spreadSheetsPivotAddon-Bx0nCKlx.js 863 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. import{s as qo}from"./spreadSheetsDesignerResourcesCn-afJmEehS.js";var Ue,Qo,Go,jo;Ue=qo,Qo={"./dist/plugins/pivot/lr.gcn.js":function(Ie,o){Object.defineProperty(o,"__esModule",{value:!0}),o.wmk2=o.wmk1=void 0,o.wmk1=["6563908988","706e0fc668"],o.wmk2=["6563908988","706e0fc668"]},"./dist/plugins/pivot/pivot-all-entry.js":function(Ie,o,ft){(Ue=Ue||{}).Pivot=ft("./node_modules_local/@spreadjs/js-pivot/dist/gc.pivot.js"),Ue.Spread=Ue.Spread||{},Ue.Spread.Pivot=ft("./dist/plugins/pivot/pivot-table-entry.js"),Ie.exports=Ue.Spread.Pivot},"./dist/plugins/pivot/pivot-core/pivot-core-entry.js":function(Ie,o,ft){var Yt=this&&this.__createBinding||(Object.create?function(S,at,X,H){H===void 0&&(H=X);var f=Object.getOwnPropertyDescriptor(at,X);f&&("get"in f?at.__esModule:!f.writable&&!f.configurable)||(f={enumerable:!0,get:function(){return at[X]}}),Object.defineProperty(S,H,f)}:function(S,at,X,H){S[H=H===void 0?X:H]=at[X]}),At=this&&this.__exportStar||function(S,at){for(var X in S)X==="default"||Object.prototype.hasOwnProperty.call(at,X)||Yt(at,S,X)};Object.defineProperty(o,"__esModule",{value:!0}),At(ft("./dist/plugins/pivot/pivot-core/pivot-fields-model.js"),o),At(ft("./dist/plugins/pivot/pivot-core/pivot-view.js"),o)},"./dist/plugins/pivot/pivot-core/pivot-core-interface.js":function(Ie,o){var ft;Object.defineProperty(o,"__esModule",{value:!0}),o.top10CompareTypeExcel=o.dateCompareTypeExcel=o.valueCompareTypeExcel=o.captionCompareTypeExcel=o.overlapCheck=o.PivotAreaReference=o.PivotPanelLayoutType=o.PivotPanelSection=o.SerializeIndex=o.DisplayFields=o.CalcItemAggregation=o.SubtotalsPosition=o.GrandTotalPosition=o.PivotAreaAxisType=o.PivotAreaType=o.PivotTableLayoutType=o.PivotPanelDirectionEnum=o.PivotChartFieldType=o.PivotTableFieldType=void 0,(ft=o.PivotTableFieldType||(o.PivotTableFieldType={}))[ft.filterField=0]="filterField",ft[ft.rowField=1]="rowField",ft[ft.columnField=2]="columnField",ft[ft.valueField=3]="valueField",(ft=o.PivotChartFieldType||(o.PivotChartFieldType={}))[ft.filterField=0]="filterField",ft[ft.axisField=1]="axisField",ft[ft.legendField=2]="legendField",ft[ft.valueField=3]="valueField",(ft=o.PivotPanelDirectionEnum||(o.PivotPanelDirectionEnum={}))[ft.fieldAndAreaStacked=0]="fieldAndAreaStacked",ft[ft.fieldAndAreaBySide=1]="fieldAndAreaBySide",ft[ft.fieldOnly=2]="fieldOnly",ft[ft.areaOnlyGrid=3]="areaOnlyGrid",ft[ft.areaOnlyTable=4]="areaOnlyTable",(ft=o.PivotTableLayoutType||(o.PivotTableLayoutType={}))[ft.compact=0]="compact",ft[ft.outline=1]="outline",ft[ft.tabular=2]="tabular",(ft=o.PivotAreaType||(o.PivotAreaType={}))[ft.all=0]="all",ft[ft.button=1]="button",ft[ft.data=2]="data",ft[ft.none=3]="none",ft[ft.normal=4]="normal",ft[ft.corner=5]="corner",ft[ft.topEnd=6]="topEnd",ft[ft.topRight=7]="topRight",(ft=o.PivotAreaAxisType||(o.PivotAreaAxisType={}))[ft.row=0]="row",ft[ft.col=1]="col",(ft=o.GrandTotalPosition||(o.GrandTotalPosition={}))[ft.none=0]="none",ft[ft.row=1]="row",ft[ft.col=2]="col",ft[ft.both=3]="both",(ft=o.SubtotalsPosition||(o.SubtotalsPosition={}))[ft.none=0]="none",ft[ft.top=1]="top",ft[ft.bottom=2]="bottom",(ft=o.CalcItemAggregation||(o.CalcItemAggregation={}))[ft.include=0]="include",ft[ft.exclude=1]="exclude",(ft=o.DisplayFields||(o.DisplayFields={}))[ft.downThenOver=0]="downThenOver",ft[ft.overThenDown=1]="overThenDown",(ft=o.SerializeIndex||(o.SerializeIndex={}))[ft.fields=1]="fields",ft[ft.options=2]="options",ft[ft.filter=4]="filter",ft[ft.sort=8]="sort",ft[ft.layout=16]="layout",ft[ft.showValueAs=32]="showValueAs",ft[ft.group=64]="group",ft[ft.styles=128]="styles",ft[ft.collapse=256]="collapse",ft[ft.theme=512]="theme",ft[ft.position=1024]="position",ft[ft.showNoData=2048]="showNoData",ft[ft.conditionalFormats=4096]="conditionalFormats",ft[ft.serverInfo=32768]="serverInfo",(ft=o.PivotPanelSection||(o.PivotPanelSection={}))[ft.fields=1]="fields",ft[ft.area=2]="area",ft[ft.viewList=4]="viewList",(ft=o.PivotPanelLayoutType||(o.PivotPanelLayoutType={}))[ft.stack=0]="stack",ft[ft.flow=1]="flow",(ft=o.PivotAreaReference||(o.PivotAreaReference={}))[ft.cellReference=0]="cellReference",ft[ft.getPivotData=1]="getPivotData",(ft=o.overlapCheck||(o.overlapCheck={}))[ft.pt=1]="pt",ft[ft.value=2]="value",ft[ft.table=4]="table",o.captionCompareTypeExcel={captionEqual:0,captionNotEqual:1,captionBeginsWith:2,captionNotBeginsWith:3,captionEndsWith:4,captionNotEndsWith:5,captionContains:6,captionNotContains:7,captionGreaterThan:8,captionGreaterThanOrEqual:9,captionLessThan:10,captionLessThanOrEqual:11,captionBetween:12,captionNotBetween:13},o.valueCompareTypeExcel={valueEqual:0,valueNotEqual:1,valueGreaterThan:2,valueGreaterThanOrEqual:3,valueLessThan:4,valueLessThanOrEqual:5,valueBetween:6,valueNotBetween:7},o.dateCompareTypeExcel={dateEqual:0,dateNotEqual:1,dateOlderThan:2,dateOlderThanOrEqual:3,dateNewerThan:4,dateNewerThanOrEqual:5,dateBetween:6,dateNotBetween:7,tomorrow:10,today:8,yesterday:9,nextWeek:17,thisWeek:15,lastWeek:16,nextMonth:14,thisMonth:12,lastMonth:13,nextQuarter:18,thisQuarter:19,lastQuarter:20,nextYear:21,thisYear:22,lastYear:23,yearToDate:40,Q1:24,Q2:25,Q3:26,Q4:27,M1:28,M2:29,M3:30,M4:31,M5:32,M6:33,M7:34,M8:35,M9:36,M10:37,M11:38,M12:39},o.top10CompareTypeExcel={count:0,percent:1,sum:2}},"./dist/plugins/pivot/pivot-core/pivot-fields-model.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt;function dt(t,r,u){var d=-1;return t=S([],t,!0),u&&t.splice(u.valuePositionIndex,0,u),(0,at.o)(t,function(m,R){if(d===-1&&m.Zc===r)return d=R,!0}),d}function xt(t,r){var u;return(0,at.o)(t,function(d,m){if(d.Zc===r)return u=d,!0}),u}function Mt(t,r){var u;return(0,at.o)(t,function(d,m){if(d.a===r)return u=d,!0}),u}function st(){this.Pq={}}function l(t,r,u){t&&t.textItem&&this.updateLabelTextItem(t.textItem,u.allowMultipleFiltersPerField),t&&t.condition&&this.updateLabelCondition(t.condition,u.allowMultipleFiltersPerField),r&&this.updateValueCondition(r),this.selectMultipleItems=u||{allowMultipleFiltersPerField:!0},this.u=!1}function T(t,r,u,d){var m=this;m.a=r,F(u)?m.Zc=r:m.Zc=u,m.l=t.p(r),m.bbt=d,m.g(t)}function D(t,r,u,d,m,R,z,ct,Tt,Ot,Pt){var Jt,$t,e,p,C;return Tt===void 0&&(Tt=!1),d&&d.valueFilter&&(Jt=d.valueFilter),$t=R===1||R===2,R=R===2,d&&d.C(Tt)?(C=p=!1,v(z.A)||F(ct)||!F(z.N)||(p=!0,C=z.T instanceof Date),{isDim:$t,isHeader:R,sourceName:r,displayName:t,items:(e=p?(C?y:s)(d,z,ct,Tt):M(d,z,Tt)).rs,filterItems:e.ds,index:u,isALL:!1,valueFilter:Jt,sortInfo:m,isShowSubtotalTop:Ot,isShowSubtotal:Pt}):{isDim:$t,isHeader:R,sourceName:r,displayName:t,items:void 0,filterItems:null,index:u,isALL:!0,valueFilter:Jt,sortInfo:m,isShowSubtotalTop:Ot,isShowSubtotal:Pt}}function M(t,r,u){var d=[],m=[],R=r.getFieldsItemList(),z=r.M(),ct=!v(z);return(0,at.o)(R,function(Tt){var Ot=ct?z[Tt]:Tt;(t.isMatchedLabelItem(Tt,u)?d:m).push(Ot)}),{rs:d,ds:m}}function s(t,r,u,d){var m,R=[],z=[],ct=(u=u.D,r.getFieldsItemList()),Tt={};for(m in(0,at.o)(u,function(Ot){var Pt=r.S(Ot);d||t.evaluateLabelCondition(Ot+"")?Tt[Pt]=!0:Tt[Pt]!==!0&&(Tt[Pt]=!1)}),(0,at.o)(ct,function(Ot){t.isInLabelFilterItem(Ot+"")&&Tt[Ot]||(Tt[Ot]=!1)}),Tt)(Tt.hasOwnProperty(m)&&Tt[m]?R:z).push(m);return{rs:R,ds:z}}function y(t,r,u,d){var m,R=[],z=[],ct=u.D,Tt=r.getFieldsItemList(),Ot=u.k,Pt=u.P,Jt={};for(m in(0,at.o)(Tt,function($t){Jt[$t]=[]}),(0,at.o)(ct,function($t){var e=r.S($t);(d||t.evaluateLabelCondition($t+""))&&(Jt[e]=(0,at.F)(Jt[e],Ot[Pt[$t]]))}),(0,at.o)(Tt,function($t){t.isInLabelFilterItem($t+"")||(Jt[$t].length=0)}),Jt)Jt.hasOwnProperty(m)&&(0<Jt[m].length?R:z).push(Jt[m]);return{rs:R,ds:z}}function G(t,r){var u,d,m,R;if(r===void 0&&(r=!1),!F(t.compareType))return u={filterType:4,filter1:{}},R=m=void 0,(d=t.compareType)===6?(m=3,R=5,u.and=!0):R=d===7?(m=5,3):m=!r||d!==4&&d!==2?d:d===4?2:4,u.filter1.operator=m,t.item1&&!F(t.item1.expected)&&(u.filter1.value=t.item1.expected),t.item2&&!F(t.item2.expected)&&(u.filter2={},u.filter2.operator=R,u.filter2.value=t.item2.expected),u}function K(t){var r,u,d,m=(d=new Date).getDay(),R=d.getDate(),z=new Date(d),ct=new Date(d);switch(t){case 11:z.setDate(R-6);break;case 9:z.setDate(R-1);break;case 8:break;case 10:z.setDate(R+1),ct.setDate(R+1);break;case 16:z.setDate(R-m-7),ct.setDate(R-m-1);break;case 15:z.setDate(R-m),ct.setDate(R-m+6);break;case 17:z.setDate(R-m+7),ct.setDate(R-m+13);break;case 13:z.setDate(1),z.setMonth(z.getMonth()-1),ct.setDate(0);break;case 12:z.setDate(1),ct.setMonth(ct.getMonth()+1),ct.setDate(0);break;case 14:z.setDate(1),z.setMonth(z.getMonth()+1),ct.setMonth(ct.getMonth()+2),ct.setDate(0);break;case 18:u=(r=z.getMonth())%3,z.setDate(1),z.setMonth(r-u+3),ct.setMonth(r-u+5),ct.getMonth()===2||ct.getMonth()===11?ct.setDate(31):ct.setDate(30);break;case 19:u=(r=z.getMonth())%3,z.setDate(1),z.setMonth(r-u),ct.setMonth(r-u+2),ct.getMonth()===2||ct.getMonth()===11?ct.setDate(31):ct.setDate(30);break;case 20:u=(r=z.getMonth())%3,z.setDate(1),z.setMonth(r-u-3),ct.setMonth(r-u-1),ct.getMonth()===2||ct.getMonth()===11?ct.setDate(31):ct.setDate(30);break;case 21:z.setDate(1),z.setMonth(1),z.setFullYear(z.getFullYear()+1),ct.setFullYear(ct.getFullYear()+2),ct.setMonth(0),ct.setDate(0);break;case 22:z.setDate(1),z.setMonth(1),ct.setFullYear(ct.getFullYear()+1),ct.setMonth(0),ct.setDate(0);break;case 23:z.setDate(1),z.setMonth(1),z.setMonth(z.getFullYear()-1),ct.setMonth(0),ct.setDate(0);break;case 40:z.setMonth(0,1),z.setHours(0,0,0,0),ct.setHours(23,59,59,999)}return d=ct.getDate(),ct.setDate(d+1),{from:tt.o0(c(z)),to:tt.o0(c(ct))}}function c(t){var r,u,d;return t&&t instanceof Date?(r=t.getFullYear(),u=t.getMonth(),d=t.getDate(),new Date(r,u,d)):t}function N(t,r){var u=t.conType;return u===3?function(d){var m;return(m={filterType:1}).isBottom=d.type===-1?1:0,m.percent=d.compareType===1?1:0,d=d.expected,F(d)||(m.value=d,m.filterValue=d),m}(t):u===2?G(t):u===0?function(d){var m,R,z;if(F(d.value1)?F(d.item1)||(m=d.item1.expected):m=d.value1,F(d.value2)?F(d.item2)||(R=d.item2.expected):R=d.value2,R)return d.compareType===12?{filterType:4,and:!0,filter1:{operator:3,value:m},filter2:{operator:5,value:R}}:d.compareType===13?{filterType:4,filter1:{operator:4,value:m},filter2:{operator:2,value:R}}:void 0;switch(z=-1,d.compareType){case 0:return{filterType:3,filter:[m]};case 1:case 3:case 5:case 7:z=1;break;case 8:z=2;break;case 9:z=3;break;case 10:z=4;break;case 11:z=5}return{filterType:4,filter1:{operator:z,value:m}}}(t):u===1?function(d,m){var R,z,ct;if(8<=(ct=F(d.compareType)?d.operator:d.compareType)&&ct<=23||ct===40)R={filterType:2,type:m},(z=K(ct)).from&&z.to&&(R.value=z.from,R.maxValue=z.to);else if(24<=ct&&ct<=39)R={filterType:2,type:m};else if(0<=ct&&ct<=7)return G(d,!0);return R}(t,r):void 0}function V(t,r){var u,d={n_:"autoFilter",ref:"A1"},m=[];return t&&(t.forEach(function(R){var z,ct;R&&(z={},R=N(R.conditions[0],r),F(R)||((ct=R.filterType)===1?z.top10=R:ct===2?z.dynamicFilter=R:ct===4?z.customFilters=R:ct===3&&(z.filters=R)),m.push(z))}),u=[],m.forEach(function(R){var z,ct,Tt,Ot,Pt,Jt,$t={n_:"filterColumn",colId:0};F(R.hiddenButton)||($t.hiddenButton=R.hiddenButton?1:0),(R.colorFilter||R.top10||R.filters||R.dynamicFilter||R.customFilters)&&($t.c_=[],z=void 0,F(R.top10)?F(R.dynamicFilter)?F(R.customFilters)?F(R.filters)||(z={n_:"filters"},(Pt=R.filters).blank&&(z.blank=1),F(Pt.dateGroupItem)&&F(Pt.filter)||(Jt=z.c_=[]),Pt.filter&&Pt.filter.forEach(function(e){H.StringEx.Xi(e)||Jt.push({n_:"filter",val:bt(e)})}),Pt.dateGroupItem&&Pt.dateGroupItem.forEach(function(e){var p={n_:"dateGroupItem"};0<e.year&&(p.year=e.year),0<=e.month&&e.month<12&&(p.month=e.month),0<e.day&&e.day<32&&(p.day=e.day),e.hour<24&&(p.hour=e.hour),e.minute<60&&(p.minute=e.minute),e.second<60&&(p.second=e.second),p.dateTimeGrouping=e.day,Jt.push(p)}),$t.c_.push(z)):(Pt=R.customFilters,F(Pt.filter1)&&F(Pt.filter2)||(z={n_:"customFilters"},Pt.and&&(z.and=1),ct=void 0,F(Pt.filter1)&&F(Pt.filter2)||(ct=z.c_=[]),F(Pt.filter1)||(Tt={n_:"customFilter"},(Ot=vt.PivotComparisonOperators[Pt.filter1.operator])!=="none"&&(Tt.operator=Ot),Tt.val=Pt.filter1.value+"",ct.push(Tt)),F(Pt.filter2)||(Tt={n_:"customFilter"},(Ot=vt.PivotComparisonOperators[Pt.filter2.operator])!=="none"&&(Tt.operator=Ot),Tt.val=Pt.filter2.value+"",ct.push(Tt)),$t.c_.push(z))):(Ot=R.dynamicFilter,F(Ot.type)||(z={n_:"dynamicFilter"},(Pt=Ot.type)&&(z.type=Pt),F(Ot.value)||(z.val=Ot.value),F(Ot.maxValue)||(z.maxVal=Ot.maxValue),$t.c_.push(z))):(z={n_:"top10"},(ct=R.top10).isBottom&&(z.top="0"),ct.percent&&(z.percent="1"),isNaN(ct.value)||(z.val=ct.value+""),isNaN(ct.filterVal)||(z.filterVal=ct.filterVal+""),$t.c_.push(z))),u.push($t)}),d.c_=u),d}function O(t,r,u,d){var m;(m=this).Zc=t,m.L=r,m.Ti=u,m.Qy=d,m.B=[],m.R=[],m.G=[],m.Q=[],m.z=[],m.Z={},m.nrt={},m.Y=[],m.H={allowMultipleFiltersPerField:!0},m.K=new ie,m.X={},t=m.Ti&&m.Ti.getPivotCacheByName(r),m.si=t&&t.getAllFieldsNames(),O.et(m,"init")}function pt(t){switch(t){case"average":return at.SubtotalType.average;case"count":return at.SubtotalType.count;case"countNums":return at.SubtotalType.countNums;case"max":return at.SubtotalType.max;case"min":return at.SubtotalType.min;case"product":return at.SubtotalType.product;case"stdDev":return at.SubtotalType.stdDev;case"stdDevp":return at.SubtotalType.stdDevp;case"var":return at.SubtotalType.varr;case"varp":return at.SubtotalType.varp;default:return at.SubtotalType.sum}}function wt(t){switch(t){case at.SubtotalType.average:return"average";case at.SubtotalType.count:return"count";case at.SubtotalType.countNums:return"countNums";case at.SubtotalType.max:return"max";case at.SubtotalType.min:return"min";case at.SubtotalType.product:return"product";case at.SubtotalType.stdDev:return"stdDev";case at.SubtotalType.stdDevp:return"stdDevp";case at.SubtotalType.varr:return"var";case at.SubtotalType.varp:return"varp";default:return"sum"}}function et(t){return-1<t.indexOf("caption")&&!F(X.captionCompareTypeExcel[t])?{conType:0,compareType:X.captionCompareTypeExcel[t]}:-1<t.indexOf("value")&&!F(X.valueCompareTypeExcel[t])?{conType:2,compareType:X.valueCompareTypeExcel[t]}:F(X.dateCompareTypeExcel[t])?F(X.top10CompareTypeExcel[t])?void 0:{conType:3,compareType:X.top10CompareTypeExcel[t]}:{conType:1,compareType:X.dateCompareTypeExcel[t]}}function ht(t){return!t||t===" "}function St(t,r){return!F(r.Z[t])&&r.Z[t]!==3}function $(t,r){var u,d;return(d={filter:[]}).blank=t.blank,(u=t.c_)[0]?(u=P(u[0].val),h(r.conType,0,u,d.blank)):(d.dateGroupItem=[],(u=[].concat(t.dateGroupItem))[0]?(t=u[0],(u={}).day=Y(t.day,1),u.hour=Y(t.hour,0),u.minute=Y(t.minute,0),u.month=Y(t.month,0),u.second=Y(t.second,0),u.year=Y(t.year,0),t=new Date(u.year,0<u.month?u.month-1:u.month,u.day,u.hour,u.minute,u.second),h(r.conType,0,t,!d.blank)):void 0)}function n(t,r){var u,d={};return ht(u=t.and)||(d.and=u==="1"),0<(u=t.c_).length&&((t=d.filter1={}).operator=u[0].operator,t.value=u[0].val),1<u.length&&((t=d.filter2={}).operator=u[1].operator,t.value=u[1].val),function(m,R){function z(Tt){var Ot;return F(R)?Ot:h(R.conType,R.compareType,Tt.value)}var ct;return m.filter1&&(ct=z(m.filter1)),m.filter2?h(R.conType,R.compareType,_,_,_,_,ct,z(m.filter2)):h(R.conType,R.compareType,_,_,_,_,ct,_)}(d,r)}function a(t,r){var u,d;return(d={}).type=ut[t.type],u=t.val,t=t.maxVal,ht(u)||(d.value=u),ht(t)||(d.maxValue=t),function(m,R){var z;return R.conType===1?h(1,R.compareType,_):z}(0,r)}function i(t,r){var u={};return u.value=L(t.val,NaN),u.percent=A(t.percent,!1),u.top=A(t.top,!0),function(d,m){var R=d.top?1:-1;return h(3,m.compareType,d.value,_,R,d.percent)}(u,r)}function h(t,r,u,d,m,R,z,ct,Tt,Ot){var Pt={};return Pt.conType=t,F(r)||(Pt.compareType=r),F(u)||(Pt.expected=u),F(d)||(Pt.ignoreBlank=d),F(m)||(Pt.type=m),F(R)||(Pt.isPercent=R),F(z)||(Pt.item1=z),F(ct)||(Pt.item2=ct),F(Tt)||(Pt.ranges=Tt),F(Ot)||(Pt.expectTypeId=Ot),t===2&&(Pt.ignoreCase=!0),Pt}function b(t,r,u){for(var d,m,R=0;R<r.length;R++)(m=(d=r[R]).nrt)&&u(m)&&t.setSortInfo(d.Zc,E)}function Q(t,r,u,d){for(var m,R=function(ct){var Tt,Ot,Pt,Jt,$t;return(ct=t[ct]).rpi&&(Pt=(Jt=ct.rpi).sortType,Jt=Jt.pivotArea,Jt=d?u.excelPivotAreaSJSToSheetPivotArea(Jt):u.excelPivotAreaToSheetPivotArea(Jt),Tt=r.getFieldInfoByName((m=(m=(m=Jt.references)==null?void 0:m[0])==null?void 0:m.items)==null?void 0:m[0]))?(Ot=r.Z[ct.Zc]===2,Pt={sortType:Pt,sortValueFieldName:Tt.Zc},1<Jt.references.length&&(Jt=Jt.references.slice(1),$t=(Ot?r.B:r.R).map(function(e){return e.Zc}),Jt.sort(function(e,p){return $t.indexOf(e.fieldName)-$t.indexOf(p.fieldName)}),Pt.sortByPivotReferences=Jt.map(function(e){return{fieldName:r.X[e.fieldName],items:e.items}})),Pt.sortByHeader=Ot,Pt.cacheName=Tt.a,Pt.sortValueSubtotalText=at.SubtotalType[Tt.Ar],ct.setSortInfo(Pt),void(r.nrt[ct.Zc]=Pt)):"continue"},z=0;z<t.length;z++)R(z)}function it(t,r){var u={references:[{fieldName:Ft().Values,items:[t.sortValueFieldName]}]};return t.sortByPivotReferences&&0<t.sortByPivotReferences.length&&(t=t.sortByPivotReferences.map(function(d){return{fieldName:r.getFieldNameBySourceName(d.fieldName),items:d.items}}),u.references=u.references.concat(t)),u}function It(t){return t&&(t.sumSubtotal=E,t.avgSubtotal=E,t.maxSubtotal=E,t.minSubtotal=E,t.varSubtotal=E,t.varPSubtotal=E,t.countSubtotal=E,t.countASubtotal=E,t.stdDevSubtotal=E,t.stdDevPSubtotal=E,t.productSubtotal=E),t}Yt=this&&this.__assign||function(){return(Yt=Object.assign||function(t){for(var r,u,d=1,m=arguments.length;d<m;d++)for(u in r=arguments[d])Object.prototype.hasOwnProperty.call(r,u)&&(t[u]=r[u]);return t}).apply(this,arguments)},At=this&&this.__rest||function(t,r){var u,d,m={};for(u in t)Object.prototype.hasOwnProperty.call(t,u)&&r.indexOf(u)<0&&(m[u]=t[u]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(d=0,u=Object.getOwnPropertySymbols(t);d<u.length;d++)r.indexOf(u[d])<0&&Object.prototype.propertyIsEnumerable.call(t,u[d])&&(m[u[d]]=t[u[d]]);return m},S=this&&this.__spreadArray||function(t,r,u){if(u||arguments.length===2)for(var d,m=0,R=r.length;m<R;m++)!d&&m in r||((d=d||Array.prototype.slice.call(r,0,m))[m]=r[m]);return t.concat(d||Array.prototype.slice.call(r))},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotFieldsModel=o.getPivotDateExConditionRange=o.getCellValuePivotFilter=o.toPivotViewQueryField=o.PivotViewField=o.PivotViewFilter=o.PivotViewFilterManager=o.in=o.Caption_Compare_Type_Excel=o.throwError=void 0,at=ft("Pivot"),X=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),H=ft("Core"),f=ft("@spreadjs/js-sheets-common"),B=ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),w=ft("./dist/plugins/pivot/pivot.ns.js"),vt=ft("./dist/plugins/pivot/pivot-util.js"),mt=f.Common.kh,tt=f.Common.ct,_=null,v=H.GC$.isEmptyObject,ft=new f.Common.ResourceManager(w.SR,"PivotTables"),Ft=ft.getResource.bind(ft),w=f.Common.ct,I=w.o0,U=w.Y0,g=null,F=f.Common.lt.ht,ot=Math.min,j=Math.max,E=void 0,A=H.NodeHelper.ur,Y=H.NodeHelper.sr,L=H.NodeHelper.ar,q=H.Util.io,J=H.Util.pr,P=H.mt.n1,bt=H.mt.vo,k=H.mt.xr,nt=H.mt.f1,gt=H.mt.xr,Z=H.mt.go,o.throwError=function(t){throw new Error(t)},ut={null:-1,aboveAverage:100,belowAverage:101,tomorrow:2,today:0,yesterday:1,nextWeek:9,thisWeek:7,lastWeek:8,nextMonth:6,thisMonth:4,lastMonth:5,nextQuarter:10,thisQuarter:11,lastQuarter:12,nextYear:13,thisYear:14,lastYear:15,yearToDate:16,Q1:17,Q2:18,Q3:19,Q4:20,M1:21,M2:22,M3:23,M4:24,M5:25,M6:26,M7:27,M8:28,M9:29,M10:30,M11:31,M12:32},Rt=function(t){var r,u,d,m,R=g;if(m=t.autoFilter&&t.autoFilter.filterItemMap&&t.autoFilter.filterItemMap[0]&&t.autoFilter.filterItemMap[0].conditions&&t.autoFilter.filterItemMap[0].conditions[0]){switch(m.conType){case 0:m.item1||m.item2?(u=(d=[m.item1&&m.item1.expected,m.item2&&m.item2.expected])[0],d=d[1]):u=m.expected,R={conType:at.PivotConditionType.caption,operator:m.compareType,val:[u,d]};break;case 1:d=(r=[m.item1&&m.item1.expected,m.item2&&m.item2.expected])[1],!(u=r[0])||u instanceof Date||(u=U(u)),!d||d instanceof Date||(d=U(d)),R={conType:at.PivotConditionType.date,val:[u,d],operator:m.compareType,isWholeDay:!!m.isWholeDay},m.compareType===at.PivotDateFilterOperator.dateToDate&&(R.isParallel=m.isParallel,R.isDynamicEndDate=m.isDynamicEndDate,R.by=m.by);break;case 3:R={conType:at.PivotConditionType.top10,val:m.expected,type:m.compareType,operator:m.type};break;case 2:u=(r=[m.item1&&m.item1.expected,m.item2&&m.item2.expected])[0],d=r[1],R={conType:at.PivotConditionType.value,val:m.expected?[m.expected]:[u,d],operator:m.compareType}}return R}},Ct=function(t,r){var u,d,m,R,z,ct,Tt,Ot=k(t,"autoFilter"),Pt=(t=(t=gt(t,"extLst"))&&gt(t,"ext"))&&gt(t,"pivotFilter")||gt(t,"x15:pivotFilter");if(Ot){switch(d=void 0,(t=Z(Ot,"filterColumn")[0])&&(Ot=gt(t,"filters"),m=gt(t,"customFilters"),R=gt(t,"dynamicFilter"),t=gt(t,"top10"),Ot?d=$(Ot,r):m?d=n(m,r):R?d=a(R,r):t&&(d=i(t,r))),z=g,Tt=ct=void 0,r.conType){case 0:d.item1||d.item2?(ct=(u=[d.item1&&d.item1.expected,d.item2&&d.item2.expected])[0],Tt=u[1]):ct=d.expected,z={conType:at.PivotConditionType.caption,operator:d.compareType,val:[ct,Tt]};break;case 1:Tt=(u=[d.item1&&d.item1.expected,d.item2&&d.item2.expected])[1],!(ct=u[0])||ct instanceof Date||(ct=U(ct)),!Tt||Tt instanceof Date||(Tt=U(Tt)),z={conType:at.PivotConditionType.date,val:[ct,Tt],operator:d.compareType,isWholeDay:d.isWholeDay||Pt&&!!Pt.useWholeDay},d.compareType===at.PivotDateFilterOperator.dateToDate&&(z.isParallel=d.isParallel,z.isDynamicEndDate=d.isDynamicEndDate,z.by=d.by);break;case 3:z={conType:at.PivotConditionType.top10,val:d.expected,type:d.compareType,operator:d.type};break;case 2:ct=(u=[d.item1&&d.item1.expected,d.item2&&d.item2.expected])[0],Tt=u[1],z={conType:at.PivotConditionType.value,val:d.expected?[d.expected]:[ct,Tt],operator:d.compareType}}return z}},Bt=function(t){var r,u,d=g;switch(t.conType){case at.PivotConditionType.caption:r=(u=t.val)[0],u=u[1],d=new at.PivotFilterCaptionCondition(t.operator,r,u);break;case at.PivotConditionType.date:u=(r=t.val)[0],r=r[1],d=t.operator===at.PivotDateFilterOperator.dateToDate?new at.PivotFilterDateCondition(t.operator,t.isWholeDay,u,r,t.isDynamicEndDate,t.isParallel,t.by):new at.PivotFilterDateCondition(t.operator,t.isWholeDay,u,r);break;case at.PivotConditionType.top10:d=new at.PivotFilterTop10Condition(t.operator,t.type,t.val);break;case at.PivotConditionType.value:r=(u=t.val)[0],u=u[1],d=new at.PivotFilterValueCondition(t.operator,r,u)}return d},kt=["difference","index","normal","percent","percentDiff","percentOfCol","percentOfRow","percentOfTotal","runTotal"],o.Caption_Compare_Type_Excel=[["captionEqual","captionNotEqual","captionBeginsWith","captionNotBeginsWith","captionEndsWith","captionNotEndsWith","captionContains","captionNotContains","captionGreaterThan","captionGreaterThanOrEqual","captionLessThan","captionLessThanOrEqual","captionBetween","captionNotBetween"],["dateEqual","dateNotEqual","dateOlderThan","dateOlderThanOrEqual","dateNewerThan","dateNewerThanOrEqual","dateBetween","dateNotBetween","today","yesterday","tomorrow",E,"thisMonth","lastMonth","nextMonth","thisWeek","lastWeek","nextWeek","nextQuarter","thisQuarter","lastQuarter","nextYear","thisYear","lastYear","Q1","Q2","Q3","Q4","M1","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12","yearToDate"],["valueEqual","valueNotEqual","valueGreaterThan","valueGreaterThanOrEqual","valueLessThan","valueLessThanOrEqual","valueBetween","valueNotBetween"],["count","percent","sum"]],o.in=dt,st.prototype.add=function(t,r){!this.get(t)&&r&&(this.Pq[t]=r)},st.prototype.get=function(t){return this.Pq[t]},st.prototype.set=function(t,r,u){var d=this.get(t);!F(u)&&F(r)?(F(d)&&(d={}),u===1?d.labelFilter=g:u===2?d.valueFilter=g:this.remove(t)):d=r,d&&F(d.labelFilter)&&F(d.valueFilter)&&this.remove(t)},st.prototype.isFilter=function(t){return!!(t=this.get(t))&&(t.C()||t.on())},st.prototype.remove=function(t){this.get(t)&&delete this.Pq[t]},st.prototype.dispose=function(){for(var t,r=0,u=Object.keys(this.Pq);r<u.length;r++)t=u[r],this.Pq[t].L0()},ie=st,o.PivotViewFilterManager=ie,l.prototype.C=function(t){var r=this.labelFilter;return!!(r&&(r.textItem&&!r.textItem.isAll||!t&&r.condition))},l.prototype.getSlicerItemInfo=function(){var t,r,u=this.selectMultipleItems,d=!1,m="";return(r=this.labelFilter)&&r.textItem&&r.textItem.list&&((t=r.textItem.list.length)===1?m=r.textItem.list[0]:1<t&&(d=!0)),{selectMultipleItems:u.allowMultipleFiltersPerField,hasMoreThanOneSelect:d,text:m}},l.prototype.on=function(){return!!this.valueFilter},l.prototype.evaluateLabelCondition=function(t){var r,u;return!(u=this).labelFilter||!u.labelFilter.condition||(r=t,!(u.labelFilter.condition.sn===at.PivotConditionType.date&&!(r=(0,at.parseStringToDate)(t)))&&u.labelFilter.condition.evaluate(r))},l.prototype.isInLabelFilterItem=function(t){var r=this;return!r.labelFilter||!r.labelFilter.textItem||-1<r.labelFilter.textItem.list.indexOf(t)},l.prototype.updateLabelCondition=function(t,r){var u=this;F(u.labelFilter)&&(u.labelFilter={}),F(t)?u.labelFilter.condition=g:u.labelFilter.condition=Bt(t),r||(u.labelFilter.textItem=g),u.u=!0},l.prototype.updateLabelTextItem=function(t,r){var u=this;F(u.labelFilter)&&(u.labelFilter={}),F(t)||(u.labelFilter.textItem=t),r||(u.labelFilter.condition=g),u.u=!0},l.prototype.updateValueCondition=function(t){var r=this;F(r.valueFilter)&&(r.valueFilter={}),r.valueFilter.condition=Bt(t.condition),r.valueFilter.conditionByName=t.conditionByName},l.prototype.isMatchedLabelItem=function(t,r){return(r||this.evaluateLabelCondition(t+""))&&this.isInLabelFilterItem(t)},l.prototype.L0=function(){var t=this;t.labelFilter=g,t.valueFilter=g,t.selectMultipleItems=g},Xt=l,o.PivotViewFilter=Xt,T.prototype.ln=function(t){this.g(t)},T.prototype.g=function(t){var r,u=(r=this).a,d=t.fn(u);r._startValue=d.startValue,r._endValue=d.endValue,r.lp=t.kn(u),r.ie=t.Le(u),d=t.tr(u),r.W5=t.hr(u),r._items=r.br(t.yr(u),d)},T.prototype.br=function(t,r){for(var u,d,m=[],R=this.ie,z=0;z<t.length;z++)d=z,u=!1,R&&0<R.length&&(d=R[t[z]]),r&&r[t[z]]&&(u=!0),m.push({indexValue:d,value:t[z],calculatedMember:u});return m},T.prototype.getSubTotalType=function(){return this.Ar},T.prototype.setSubTotalType=function(t){this.Ar!==t&&(this.Ar=t)},T.prototype.getSortInfo=function(){return this.nrt},T.prototype.setSortInfo=function(t){this.nrt=t,this.kr=t&&t.sortType},T.prototype.toPivotViewSubTotalFields=function(){var t,r,u=g;return this.Or&&(t=this.a,r=At(this.Or,[]),u=Yt({subtotalType:this.Ar,cacheName:t,fieldName:this.Zc},r)),{subTotalType:this.Ar,cacheName:this.a,valueFieldName:this.Zc,index:this.lp,showDataAs:u,cacheFieldType:this.W5}},T.prototype.toPivotViewQueryField=function(t,r,u,d,m){return D(this.Zc,this.a,this.lp,t,this.nrt,r,u,d,m,this.Spi,this.Nwr)},T.prototype.Br=function(t){},T.prototype.do=function(t){switch(t){case X.PivotTableFieldType.rowField:return"axisRow";case X.PivotTableFieldType.columnField:return"axisCol";case X.PivotTableFieldType.filterField:return"axisPage";case X.PivotTableFieldType.valueField:return"axisValues"}},T.prototype.ea=function(t){for(var r,u=this._items,d=0;d<u.length;d++)if((r=u[d])&&r.indexValue===t)return r},T.prototype.VUr=function(){var t,r,u,d,m={};if((d=this._items)&&d.length)for(t=0,r=d;t<r.length;t++)m[(u=r[t]).indexValue]=u;return m},T.prototype.es=function(t){for(var r,u=this._items,d=0;d<u.length;d++)if((r=u[d])&&r.value===t)return r},T.prototype.cs=function(t,r){for(var u,d=r||this._items,m=0;m<d.length;m++)if((u=d[m])&&u.value===t)return m},T.prototype.gs=function(t,r,u,d){for(var m,R,z,ct=this,Tt=[],Ot=!1,Pt=t.length,Jt=[],$t=0;$t<Pt;$t++)R=(m=t[$t]).indexValue,F(R)||(R=ct.ea(R),F(R))||(F(m.childItems)||(R.childItems=m.childItems),F(m.expanded)||(R.expanded=m.expanded),F(m.drillAcross)||(R.drillAcross=m.drillAcross),F(m.calculatedMember)||(R.calculatedMember=m.calculatedMember),m.hidden===!0?Ot=!0:Tt.push(R.value),F(m.missing)||(R.missing=m.missing),F(m.caption)||(R.caption=m.caption),F(m.character)||(R.character=m.character),m.collapse===!0&&u.setCollapse(r,R.value,!0),F(m.type)||(R.type=m.type),Jt.push(R));ct._items=Jt,Ot&&(z=u.getFilterInfo(ct.a),F(z)&&(z=new Xt(g,g,u.H),u.K.add(ct.a,z)),z.updateLabelTextItem({isAll:!1,list:Tt},u.H.allowMultipleFiltersPerField),u.K.set(ct.a,z))},T.prototype.Bs=function(t,r,u,d){for(var m,R,z,ct=this,Tt=[],Ot=!1,Pt=+t.count,Jt=[],$t=ct.VUr(),e=0;e<Pt;e++)m=t.c_[e],R=Y(m.x),F(R)||(R=$t[R],F(R))||(F(m.c)||(R.childItems=A(m.c)),F(m.d)||(R.expanded=A(m.d)),F(m.e)||(R.drillAcross=A(m.e)),F(m.f)||(R.calculatedMember=A(m.f)),A(m.h)===!0?Ot=!0:Tt.push(R.value),F(m.m)||(R.missing=A(m.m)),F(m.n)||(R.caption=m.n),F(m.s)||(R.character=A(m.s)),A(m.sd)===!1&&u.setCollapse(r,R.value,!0),F(m.t)||(R.type=m.t),Jt.push(R));ct._items=Jt,Ot&&(z=u.getFilterInfo(ct.a),F(z)&&(z=new Xt(g,g,u.H),u.K.add(ct.a,z)),z.updateLabelTextItem({isAll:!1,list:Tt},u.H.allowMultipleFiltersPerField),u.K.set(ct.a,z))},T.prototype.fromJson=function(t,r){var u,d,m,R,z,ct;(ct=this).cft=It(t),F(t.name)||(ct.Zc=t.name),u=r.Ti.getPivotCacheByName(r.L).getField(ct.a),F(t.items)||(d=u&&u.W5===2&&!F(u._by),ct.gs(t.items,ct.Zc,r,d)),F(t.sortType)||(d=t.sortType,m={},R=t.autoSortScope,z=void 0,d==="ascending"?z=at.SortType.asc:d==="descending"&&(z=at.SortType.desc),R?ct.rpi={sortType:z,pivotArea:R}:(m.sortType=z,ct.nrt=m,ct.kr=m.sortType)),F(t.fld)||(ct.lp=t.fld),F(t.baseField)||(ct.baseField=t.baseField),F(t.measureFilter)||(ct.nc=t.measureFilter),F(t.numberFormat)||(ct.bbt=t.numberFormat),F(t.showAll)||(ct.rc=t.showAll,r.ac[u.Zc]=ct.rc)},T.prototype.yh=function(t,r,u){var d,m,R,z,ct,Tt;(Tt=this).sc=It(r),F(r.name)||(Tt.Zc=q(P(r.name))),R=gt(r,"items")||[],ct=(d=u.Ti.getPivotCacheByName(u.L).getField(Tt.a))&&d.W5===2&&!F(d._by),Tt.Bs(R,Tt.Zc,u,ct),F(r.sortType)||(R=r.sortType,ct={},m=k(r,"autoSortScope"),z=void 0,R==="ascending"?z=at.SortType.asc:R==="descending"&&(z=at.SortType.desc),m?(R=Z(m,"pivotArea"))&&0<R.length&&(Tt.rpi={sortType:z,pivotArea:R[0]}):(ct.sortType=z,Tt.nrt=ct,Tt.kr=ct.sortType)),F(r.fld)||(Tt.lp=+r.fld),F(r.baseField)||(Tt.baseField=Y(r.baseField)),F(r.measureFilter)||(Tt.nc=A(r.measureFilter)),m=A(r.showAll,!0),Tt.rc=u.ac[d.Zc]=m,(ct=(z=(R=gt(r,"extLst"))&&gt(R,"ext"))&&gt(z,"pivotField"))&&ct.fillDownLabels&&(t.options.fillDownLabels=A(ct.fillDownLabels))},T.prototype.cc=function(t,r,u,d,m,R,z){var ct,Tt,Ot,Pt=z||this._items,Jt=[],$t=0;for(d&&m&&Pt&&Pt[0]&&Pt[0].value!=="<"+(0,vt.formatDateToString)(m)&&(Jt.push({indexValue:0}),$t=1),ct=0;ct<Pt.length;ct++)Tt=Pt[ct],Ot={},F(Tt)||(F(Tt.childItems)||(Ot.childItems=Tt.childItems),F(Tt.expanded)||(Ot.expanded=Tt.expanded),F(Tt.drillAcross)||(Ot.drillAcross=Tt.drillAcross),F(Tt.calculatedMember)||(Ot.calculatedMember=Tt.calculatedMember),u[Tt.value]===!0&&(Ot.hidden=!0),F(Tt.missing)||(Ot.missing=Tt.missing),F(Tt.caption)||(Ot.caption=Tt.caption),F(Tt.character)||(Ot.character=Tt.character),r&&r[Tt.value]===!0&&(Ot.collapse=!0),F(Tt.type)||(Ot.type=Tt.type),F(Tt.indexValue)||(Ot.indexValue=d?Tt.indexValue+$t:Tt.indexValue),Jt.push(Ot));return d&&R&&Pt&&Pt[Pt.length-1]&&Pt[Pt.length-1].value!==">"+(0,vt.formatDateToString)(R)&&Jt.push({indexValue:Jt.length}),t&&Jt.push({type:"default"}),Jt},T.prototype.mc=function(t,r,u,d,m,R,z){var ct,Tt,Ot,Pt=z||this._items,Jt=[],$t=0;for(d&&m&&Pt&&Pt[0]&&Pt[0].value!=="<"+(0,vt.formatDateToString)(m)&&(Jt.push({n_:"item",x:0}),$t=1),ct=0;ct<Pt.length;ct++)Tt=Pt[ct],Ot={n_:"item"},F(Tt)||(Tt.childItems&&(Ot.c="1"),Tt.expanded===!1&&(Ot.d="0"),Tt.drillAcross===!1&&(Ot.e="0"),Tt.calculatedMember&&(Ot.f="1"),u[Tt.value]===!0&&(Ot.h="1"),Tt.missing&&(Ot.m="1"),F(Tt.caption)||(Ot.n=Tt.caption),Tt.character&&(Ot.s="1"),r&&r[Tt.value]===!0&&(Ot.sd="0"),F(Tt.type)||(Ot.t=Tt.type),F(Tt.indexValue)||(Ot.x=d?Tt.indexValue+$t:Tt.indexValue),Jt.push(Ot));return d&&R&&Pt&&Pt[Pt.length-1]&&Pt[Pt.length-1].value!==">"+(0,vt.formatDateToString)(R)&&Jt.push({n_:"item",x:Jt.length}),t&&Jt.push({n_:"item",t:"default"}),Jt},T.prototype.tl=function(t){var r,u,d,m,R,z;if(z=(t=t.bl(this.a))&&t.sf())for(R in r=[],u=t.sh,d=t.getFieldsItemList(),m=0,z)z.hasOwnProperty(R)&&(r[z[R]]={indexValue:m,value:d[R],calculatedMember:!!u[d[R]]},m+=1);return r},T.prototype.toJson=function(t){var r,u,d,m,R,z=(R=this).cft||{},ct=t.layoutType(),Tt=t.dh;switch(ct){case X.PivotTableLayoutType.outline:z.compact=!1,delete z.outline;break;case X.PivotTableLayoutType.tabular:z.compact=!1,z.outline=!1;break;case X.PivotTableLayoutType.compact:delete z.outline,delete z.compact}if(ct=t.dh,z.axis=R.do(ct.Z[R.Zc]),z.insertBlankRow=t.options.insertBlankLineAfterEachItem,F(R.nc)||(z.measureFilter=R.nc),0<=ct.Q.indexOf(R)?z.name=R.a:F(R.Zc)||(z.name=R.Zc),F(R.kr)||(ct=void 0,R.kr===at.SortType.asc?ct="ascending":R.kr===at.SortType.desc&&(ct="descending"),z.sortType=ct),(ct=R.nrt)&&ct.sortValueFieldName&&(ct=it(ct,Tt),z.autoSortScope=t.sheetPivotAreaToExcelPivotArea(ct)),z.subtotalTop=R.Spi!==!1&&E,R.Nwr===!1||!R.Nwr&&t.options.subTotalsPosition===X.SubtotalsPosition.none?z.defaultSubtotal=!1:z.defaultSubtotal=E,F(R.lp)||(z.fld=R.lp),F(R.bbt)||(z.numberFormat=R.bbt),z.showAll=t.showNoData(R.a),r=(ct=Tt.getLabelFilterInfo(R.a))&&ct.textItem&&ct.textItem.list,!F(R._items)&&(St(R.Zc,Tt)||r)&&0<R._items.length){if(t=Tt.dv&&Tt.dv[R.Zc],u={},r&&0<r.length){for(d=0;d<R._items.length;d++)u[R._items[d].value]=!0;for(d=0;d<r.length;d++)u[r[d]]=!1}(ct=Tt.bl(R.a))&&(m=ct.W5===2&&!F(ct._by),Tt=R.tl(Tt),z.items=R.cc(F(z.defaultSubtotal),t,u,m,ct.T,ct.gd,Tt))}return z},T.prototype.wh=function(t){var r,u,d,m,R,z,ct,Tt=(ct=this).sc||{n_:"pivotField"},Ot=t.layoutType(),Pt=t.dh;switch(Ot){case X.PivotTableLayoutType.outline:Tt.compact="0",delete Tt.outline;break;case X.PivotTableLayoutType.tabular:Tt.compact="0",Tt.outline="0";break;case X.PivotTableLayoutType.compact:delete Tt.outline,delete Tt.compact}if(0<=Pt.Q.indexOf(ct)?Tt.name=bt(J(ct.a)):F(ct.Zc)||(Tt.name=bt(J(ct.Zc))),Ot=t.dh,Tt.axis=ct.do(Ot.Z[ct.Zc]),t.options.insertBlankLineAfterEachItem&&(Tt.insertBlankRow="1"),ct.nc&&(Tt.measureFilter="1"),ct.Spi===!1?Tt.subtotalTop="0":delete Tt.subtotalTop,ct.Nwr===!1||!ct.Nwr&&t.options.subTotalsPosition===X.SubtotalsPosition.none?Tt.defaultSubtotal="0":delete Tt.defaultSubtotal,F(ct.bbt)||(m=(Ot=H.ExtendedNumberFormatHelper.getFormatId(ct.bbt)).id,Ot.isBuiltIn?Tt.numFmtId=m:((Ot={}).numberFormat=new H.ExcelNumerFormat(m,ct.bbt),Tt.numFmtId=Ot.numberFormat.numberFormatId)),t.showNoData(ct.a)===!1&&(Tt.showAll="0"),r=(m=Pt.getLabelFilterInfo(ct.a))&&m.textItem&&m.textItem.list,!F(ct._items)&&(St(ct.Zc,Pt)||r)&&0<ct._items.length){if(Ot=Pt.dv&&Pt.dv[ct.Zc],u={},r&&0<r.length){for(d=0;d<ct._items.length;d++)u[ct._items[d].value]=!0;for(d=0;d<r.length;d++)u[r[d]]=!1}(m=Pt.bl(ct.a))&&(R=m.W5===2&&!F(m._by),z=ct.tl(Pt),Ot=ct.mc(F(Tt.defaultSubtotal),Ot,u,R,m.T,m.gd,z),Tt.c_=[{n_:"items",count:Ot.length+"",c_:Ot}])}return F(ct.nrt)||(R=void 0,(m=ct.nrt).sortType===at.SortType.asc?R="ascending":m.sortType===at.SortType.desc&&(R="descending"),Tt.sortType=R,m.sortValueFieldName&&(z=it(m,Pt),Ot={n_:"autoSortScope",c_:[t.sheetPivotAreaToSJSPivotArea(z)]},Tt.c_.push(Ot))),t.options.fillDownLabels===!0&&(Tt.c_=Tt.c_||[],Tt.c_.push({n_:"extLst",c_:[{n_:"ext",r_:[63,1],c_:[{n_:"pivotField",fillDownLabels:"1"}]}]})),Tt},T.prototype.eG=function(){var t=this;t.nrt=g,t._items=g,t.ie=g,t.bbt=g,t.Or=g,t.cft=g,t.sc=g,t.rc=g},Qt=T,o.PivotViewField=Qt,o.toPivotViewQueryField=D,o.getCellValuePivotFilter=G,o.getPivotDateExConditionRange=K,O.prototype.QIr=function(t,r){this.L=t,r||(this.ok(),this.LS())},O.prototype.a1=function(t,r){var u,d,m=(d=this).ac;return F(m)&&(d.ac={},m=d.ac),u=(u=d.bl(t))&&(u.y1||u.Zc),F(r)?m[u]||!1:!r!=!m[u]?(m[u]=!!r,d.tFr("showNoData",{cacheFieldName:t,name:u,isShow:r}),!0):void 0},O.prototype.x1=function(t,r,u,d){var m,R=this,z=R.L,ct=this.Ti;try{m=ct.getPivotCacheByName(z).updateCalcItem(t,r,u,d,R.P1()),R.iFr("updateCalcItem",{sourceName:t,calcItemName:r,formula:u,priority:d})}catch{(0,o.throwError)(Ft().PivotTableErrorFormula)}return m&&(R.q1=!0),m},O.prototype.up=function(t){var r=this.L;return this.Ti.getPivotCacheByName(r).getCalcItems(t)},O.prototype.Rp=function(t,r){var u,d=(u=this).L;return d=this.Ti.getPivotCacheByName(d).removeCalcItem(t,r),u.iFr("removeCalcItem",{sourceName:t,calcItemName:r}),(r=u.Up(t)[0])&&d&&(u.sm(t,!0),r.ln(u),u.q1=!0),d},O.prototype.Db=function(t,r,u){for(var d,m,R,z,ct,Tt=0,Ot=(ct=this).Up(t);Tt<Ot.length;Tt++)if(m=Ot[Tt],ct.Z[m.Zc]!==X.PivotTableFieldType.valueField){d=m;break}if(F(d)||!ct.lg(d.Zc,r))return!1;R=ct.L,R=this.Ti.getPivotCacheByName(R);try{z=R.addCalcItem(t,r,u,ct.P1()),ct.iFr("addCalcItem",{sourceName:t,calcItemName:r,formula:u})}catch{(0,o.throwError)(Ft().PivotTableErrorFormula)}return z!==!1&&(ct.q1=!0,ct.sm(t),d)&&d.ln(ct),z},O.prototype.P1=function(){for(var t,r,u=[],d=0,m=(r=this).nw(X.PivotTableFieldType.rowField).concat(r.nw(X.PivotTableFieldType.columnField));d<m.length;d++)t=m[d],u.push(t.a);return u},O.prototype.lw=function(t){var r=this.L;if(r=this.Ti.getPivotCacheByName(r),!F(r))return F(t)?r.aggregateCalcItem():r.aggregateCalcItem(t===X.CalcItemAggregation.include)},O.prototype.tr=function(t){for(var r=this.L,u={},d=0,m=this.Ti.getPivotCacheByName(r).getField(t).ty;d<m.length;d++)u[m[d]]=!0;return u},O.prototype.sm=function(t,r){var u,d;(t=(d=this).sy(t))&&(u=t.textGroup&&t.textGroup.fieldName,d.cy(u,null,!0),r&&d.modifyGroupInfoByCalcItem(t),d.dy(t))},O.prototype.modifyGroupInfoByCalcItem=function(t){var r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t=t.originFieldName,e=this.L;if((e=this.Ti.getPivotCacheByName(e).getField($t))&&(r=e.M()||{},$t=(u=t.textGroup&&t.textGroup.groupItems)&&Object.keys(u),!(F($t)||$t.length<1))){for(m=0,R=$t;m<R.length;m++){for(d=u[z=R[m]],ct=0;ct<d.length;)F(r[d[ct]])?d.splice(ct,1):ct++;d.length===0&&delete u[z]}if(Object.keys(u).length===0){for(Tt={},Ot=0,Pt=Object.keys(r);Ot<Pt.length;Ot++)Tt[Jt=Pt[Ot]]=Jt;t.textGroup.groupItems=Tt}}},O.prototype.lg=function(t,r){var u=this;return u.checkGroup(t)&&u.checkSubTotal()&&u.checkField(t)&&u.checkFieldItem(t,r)},O.prototype.checkField=function(t){var r,u,d,m,R,z;if(this.Z[t]===X.PivotTableFieldType.filterField)return!1;if(r={},(t=this.nw(X.PivotTableFieldType.valueField))&&1<t.length)for(u=0,d=t;u<d.length;u++)r[(m=d[u]).a]?(0,o.throwError)(Ft().PivotTableCalcItemHasMultipleDataField):r[m.a]=!0;for(R=0,z=t;R<z.length;R++)m=z[R],1<this.Up(m.a).length&&(0,o.throwError)(Ft().PivotTableCalcItemHasTowCacheField);return!0},O.prototype.checkSubTotal=function(t){var r,u;if((u=(r=this).nw(X.PivotTableFieldType.valueField))&&u.length)switch(u=u[0],t=F(t)?r.xy(u.Zc):t){case at.SubtotalType.average:case at.SubtotalType.stdDev:case at.SubtotalType.stdDevp:case at.SubtotalType.varr:case at.SubtotalType.varp:(0,o.throwError)(Ft().PivotTableSubtotalType)}return!0},O.prototype.checkFieldItem=function(t,r){var u;return t=(u=this).getFieldInfoByName(t),!F(t)&&(u=u.L,t=(u=this.Ti.getPivotCacheByName(u).getField(t.a)).getFieldsItemList().indexOf(r),u=u.up(),0<=t&&u.indexOf(r)<0&&(0,o.throwError)(Ft().PivotTableHasSameItemName),!0)},O.prototype.checkGroup=function(t){for(var r,u,d=0,m=(u=this).ky();d<m.length;d++)r=m[d],r=u.rC(r.name),F(r)||F(r.dateGroups)&&F(r.numberGroup)||(0,o.throwError)(Ft().PivotTableHasNumberOrDateGroup);return u.FC(t).cC()&&(0,o.throwError)(Ft().PivotTableHasNumberOrDateGroup),!0},O.prototype.cC=function(t){if(t=this.bl(t))return!!t.y1},O.prototype.NA=function(t){var r=this.L;return this.Ti.getPivotCacheByName(r).getField(t).hasCalcItem()},O.prototype.DA=function(){var t,r,u,d=this.L;if((d=this.Ti.getPivotCacheByName(d).getHeaderList())&&d.length){for(t=0,r=d;t<r.length;t++)if(u=r[t],this.NA(u.name))return!0}return!1},O.prototype.Up=function(t){for(var r,u=[],d=0,m=this.nw();d<m.length;d++)(r=m[d]).a===t&&u.push(r);return u},O.prototype.LN=function(){return this.Ti.getPivotCacheByName(this.L).getDataRefer()},O.prototype.ky=function(){var t;return(t=(t=this).Ti.getPivotCacheByName(t.L))?t.getHeaderList():[]},O.prototype.y2=function(t,r,u){var d,m;-1<(m=(d=this.Y).indexOf(t))&&d.splice(m,1),r&&(F(u)?d.push(t):d.splice(u,0,t))},O.prototype.setSigmaValuePosition=function(t,r){var u,d=(m=(u=this).getSigmaValuePosition()).positionType,m=m.positionIndex;F(t)||t!==at.DataPosition.row&&t!==at.DataPosition.col||(u.x2=t),!F(r)&&0<=r&&(u.P2=r),u.tFr("updateValuePosition",{newPositionType:t,newPositionIndex:r}),u.DT({position:d,valuesIndex:m,type:"updateValuePosition"})},O.prototype.getSigmaValuePosition=function(){var t=1<this.Q.length,r=this.P2;return{positionType:this.x2,positionIndex:r,display:t}},O.prototype.xy=function(t,r){var u,d,m,R,z;if(z=(R=this).getFieldInfoByName(t)){if(u=z.getSubTotalType(),arguments.length===1)return u;if(u!==r){for(d in R.DA()&&!F(r)&&R.checkSubTotal(r),z.setSubTotalType(r),R.nrt)!R.nrt.hasOwnProperty(d)||F(R.nrt[d])||(m=R.nrt[d]).cacheName!==z.a&&m.sortValueFieldName!==z.Zc||(m.sortValueSubtotalText=at.SubtotalType[r]);R.q1=!0,R.tFr("subtotalType",{sourceName:z.a,subtotalType:u}),this.DT({fieldName:t,subtotalType:u,type:"subTotalType"})}}},O.prototype.VT=function(t){var r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e=this;if(!F(t)){for(r=t.fieldsInfo,u=0;u<=3;u++)e.RM(u);for(e.setSigmaValuePosition(t.valueInfo.positionType,t.valueInfo.positionIndex),d=0;d<4;d++)for(m=r[d],R=0;R<m.length;R++)ct=(z=m[R]).sourceName,Tt=z.displayName,Ot=z.subtotal,e.addFieldByName(ct,Tt,d,Ot);for(u=0;u<4;u++)for(m=r[u],R=0;R<m.length;R++)ct=(z=m[R]).sourceName,Pt=z.valueFilter,Jt=z.labelFilter,$t=z.sortInfo,!Jt||F(Jt.condition)&&F(Jt.textItem)||e.setLabelFilterInfo(ct,Jt),Pt&&!F(Pt.condition)&&e.setValueFilterInfo(ct,Pt),F($t)||e.setSortInfo(ct,$t)}},O.prototype.UM=function(){for(var t,r,u,d,m,R,z=[],ct=(R=this).getSigmaValuePosition(),Tt=0;Tt<4;Tt++){for(t=R.nw(Tt),r=[],u=0;u<t.length;u++)(m={sourceName:(d=t[u]).a,displayName:d.Zc}).subtotal=d.Ar,m.labelFilter=R.getLabelFilterInfo(d.Zc),m.valueFilter=R.getValueFilterInfo(d.Zc),m.sortInfo=d.nrt,r.push(m);z[Tt]=r}return{fieldsInfo:z,valueInfo:ct}},O.prototype.KM=function(t){var r,u,d,m,R,z,ct,Tt,Ot,Pt=(Ot=(Tt=this).tx).sx,Jt={},$t=[],e=!0,p={},C={},W=Tt.Ti.getPivotCacheByName(Tt.L);if(!F(Ot)){if((0,at.o)(t,function(x){r=Tt.FC(x.fieldName),F(r)||(C[x.fieldName]=r.W5,p[x.fieldName]=F(r.y1)?r.D:r.cx,Jt[x.fieldName]=x.fieldItem)}),F(Jt))u=!0;else{for(m=0,R=Ot.tx;m<R.length;m++){for(ct in e=!0,d=(z=R[m]).path,Jt)if(mt(Jt,ct)&&p[ct][d[Pt[ct]]]!==Jt[ct]){e=!1;break}e&&($t=$t.concat(z.indexes))}u=!1}return W.dx($t,u)}},O.prototype.FC=function(t){if(t=this.getFieldInfoByName(t),!F(t))return this.bl(t.a)},O.prototype.kx=function(t,r,u){var d,m=(d=this).L,R=d.Ti.getPivotCacheByName(m),z=d.Zc;r=r?{cmd:"pivotChangeDataSourceInternal",sheetName:t.name(),cmdOption:{pivotCacheName:m,pivotCache:R,ptName:z,source:r,cacheInfo:u}}:{cmd:"updatePivotCache",sheetName:t.name(),cmdOption:{pivotCacheName:m,pivotCache:R,ptName:z}},d.Qy.execute(r),d.Pq=E,O.et(d,"updatePivotCache")},O.prototype.LS=function(){var t=this;t.q1=!0,t.WIr(),t.q3()},O.prototype.WIr=function(){var t,r,u,d,m,R,z,ct,Tt,Ot,Pt=(Ot=this).K,Jt=Ot.getAllFieldNameList(),$t=Ot.H;if(Jt&&Jt.length){for(t=0,r=Jt;t<r.length;t++)if(u=r[t],m=(Tt=(Tt=(d=Pt.get(u))==null?void 0:d.labelFilter)==null?void 0:Tt.textItem)==null?void 0:Tt.list){for(R=Ot.bl(u).DH(),z=m.length-1;0<=z;z--)ct=m[z],R.indexOf(ct)===-1&&m.splice(z,1);m.length&&m.length!==R.length||($t&&d.labelFilter.condition?(Tt={condition:d.labelFilter.condition.toJSON(),conditionByName:d.labelFilter.conditionByName},Ot.clearFilterInfo(u,1),Ot.setLabelFilterInfo(u,Tt)):Ot.clearFilterInfo(u,1))}}},O.prototype.ok=function(){for(var t,r,u,d,m,R=(m=(d=this).nw()).length,z=d.L,ct=d.Ti.getPivotCacheByName(z),Tt=0;Tt<R;Tt++)ct.zRt(m[Tt].a)?m[Tt].ln(d):(t=m[Tt].Zc,r=d.Z[t],u=dt(r=d.nw(r),t),delete d.Z[t],d.q1=!0,r.splice(u,1),d.IF(m[Tt].Zc))},O.prototype.IF=function(t){var r,u;if((u=this.Pq)&&0<u.length)for(r=u.length-1;0<=r;r--)u[r].Zc===t&&u.splice(r,1)},O.prototype.getName=function(){return this.Zc},O.prototype.getAllFieldNameList=function(){var t=this.Ti.getPivotCacheByName(this.L);return t?t.getAllFieldsNames():[]},O.prototype.getAllFieldNameListWithoutCalcField=function(t){var r,u,d,m,R=[];if(m=this.Ti.getPivotCacheByName(this.L))for(u in r=m.Pq)r.hasOwnProperty(u)&&(d=r[u],!F(d.D5)||t&&(d.W5!==2||!F(d.y1)&&d.y1!==d.Zc)||R.push(u));return R},O.prototype.clone=function(){var t,r=new O((t=this).Zc,t.L,t.Ti,t.Qy),u=(0,H.RF)(t.B),d=(0,H.RF)(t.R),m=(0,H.RF)(t.G),R=(0,H.RF)(t.Q),z=(0,H.RF)(t.Z);return r.B=u||[],r.R=d||[],r.G=m||[],r.Q=R||[],r.Z=z||[],r.z=[].concat(t.z),r.x2=t.x2,r.P2=t.P2,r},O.prototype.getAllFieldInfo=function(){var t,r=(t=this).getAllFieldNameList(),u=[],d=t.getDimFieldsMap();return(0,at.o)(r,function(m){var R=t.v_(m);u.push(R?{fieldName:R.Zc,sourceName:m,isFilter:t.K.isFilter(R.a),isDim:d[m],isPivotField:!0}:{fieldName:m,sourceName:m,isFilter:t.K.isFilter(m),isDim:d[m],isPivotField:!1})}),u},O.prototype.getDimFieldsMap=function(){var t,r,u,d=this,m={};for((u=[]).push.apply(u,d.G),u.push.apply(u,d.B),u.push.apply(u,d.R),t=0,r=u;t<r.length;t++)m[r[t].a]=!0;return m},O.prototype.getFieldInfoByName=function(t){var r,u=(r=this).Z[t];return(r=r.nw(u))?xt(r,t):g},O.prototype.DB=function(t){var r,u,d;if(d=this.Pq){for(r=d.length,u=0;u<r;u++)if(t===d[u].Zc)return d[u]}},O.prototype.v_=function(t){var r=this.nw();return r?Mt(r,t):g},O.prototype.addPivotView=function(t,r){this.z.push(t),r||this.q3()},O.prototype.removePivotView=function(t){for(var r=0;r<this.z.length;r++)if(this.z[r]===t)return void this.z.splice(r,1);this.z.length===0&&this.dispose()},O.prototype.q3=function(t,r,u,d){for(var m,R,z=0;z<this.z.length;z++)R=(m=this.z[z])instanceof B.PivotTable,t&&R||R&&0<m.Xst||m.paint(t,r,u,d)},O.prototype.sR=function(){for(var t,r=0;r<this.z.length;r++)(t=this.z[r])instanceof B.PivotTable&&t.adjustRange()},O.prototype.OR=function(t,r){return t=this.Ti.getPivotCacheByName(this.L).zRt(t),F(t)?r:t.Zc},O.prototype.FG=function(t,r,u){return t=this.Ti.getPivotCacheByName(this.L).zRt(t),F(u)&&(u=t.W5===at.PivotDataType.number?at.SubtotalType.sum:at.SubtotalType.count),F(t)||(r=t.Zc),Ft()["SubtotalType_Prefix_"+u]+r},O.prototype.PV=function(t){return this.Ti.getPivotCacheByName(this.L).zRt(t).W5===at.PivotDataType.number?at.SubtotalType.sum:at.SubtotalType.count},O.prototype.getSortInfo=function(t){return this.nrt[t]},O.prototype.setSortInfo=function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C=this,W=(0,H.RF)(C.nrt[t]),x=C.getFieldInfoByName(t);if(r&&r.sortValueFieldName&&(u=C.getFieldInfoByName(r.sortValueFieldName),!F(u))){if(r.sortByPivotReferences){if(d=r.sortByPivotReferences,(R=(m=C.Z[t])===2)||m===1){if(z=R?C.B.map(function(yt){return yt.Zc}):C.R.map(function(yt){return yt.Zc}),ct=R?C.B.map(function(yt){return yt.a}):C.R.map(function(yt){return yt.a}),d.length>z.length)return;for(Tt=0;Tt<z.length&&Tt<d.length;Tt++){if(Ot=(Pt=d[Tt]).fieldName,!Pt||F(Pt)||F(Pt.items)||Pt.items.length===0||z[Tt]!==Ot&&ct.indexOf(Ot)===-1||(Ot=C.FC(Ot)||C.bl(Ot),Pt=Pt.items,Jt=Ot.DH(),Pt.length!==1))return;for($t=0,e=Pt;$t<e.length;$t++)if(p=e[$t],Jt.indexOf(p)===-1)return}}r.sortByPivotReferences=d.map(function(yt){var _t,Lt=yt.fieldName;return{fieldName:_t=(_t=C.X[Lt])||C.si.indexOf(Lt)===-1?_t:Lt,items:yt.items}}),r.sortByHeader=R}r.cacheName=u&&u.a,r.sortValueSubtotalText=at.SubtotalType[u.Ar]}F(x)||(C.nrt[t]=r,x.setSortInfo(r),this.Ti.getPivotCacheByName(this.L).setSortInfo(x.a,!0),this.q1=!0,C.tFr("setSortInfo",{fieldName:t,sourceName:x.a,sortInfo:r}),C.DT({type:"setSortInfo",fieldName:t,sortInfo:W}))},O.prototype.clearSortInfo=function(t){var r,u,d=(u=this).getFieldInfoByName(t);F(d)||(r=(0,H.RF)(u.nrt[t]),delete u.nrt[t],d.setSortInfo(g),this.Ti.getPivotCacheByName(this.L).setSortInfo(d.a,!1),this.q1=!0,u.DT({type:"setSortInfo",fieldName:t,sortInfo:r}))},O.prototype.setCollapse=function(t,r,u){var d,m;(m=(m=this.dv)||(this.dv={}))[t]||(m[t]={}),d=m[t][r],m[t][r]=u,this.tFr("setCollapse",{sourceName:this.getSourceNameByFieldName(t),item:r,isCollapse:u}),this.DT({fieldName:t,item:r,isCollapse:d,type:"setCollapse"})},O.prototype.getCollapse=function(t,r){var u=this.dv;return u&&u[t]?u[t][r]:g},O.prototype.addField=function(t,r,u){var d,m,R,z;(3<r||r<0)&&(0,o.throwError)("wrong area code"),m=(d=this).nw(r),d.FV(t.Zc)&&r!==X.PivotTableFieldType.valueField||(F(u)?u=m.length:(R=this.getSigmaValuePosition(),z={1:at.DataPosition.row,2:at.DataPosition.col},R.display&&z[r]===R.positionType&&(u<=R.positionIndex?d.setSigmaValuePosition(R.positionType,R.positionIndex+1):u--)),d.sz(m,t,r,u),d.Z[t.Zc]=r,d.X[t.Zc]=t.a,r!==0&&(d.q1=!0),d.nFr("addPivotField",{area:r,index:u}))},O.prototype.dz=function(t){var r,u,d,m=2;if(!F(t)){for(r=t.substr(t.length-1,1),u="_",isNaN(+r)&&(u=""),d=t;this.Z[t]&&!(100<m);)t=d+u+m,m++;return t}},O.prototype.getFilterInfo=function(t){return this.K.get(t)},O.prototype.isFilter=function(t){return this.K.isFilter(t)},O.prototype.IGr=function(t,r){for(var u,d,m,R,z,ct,Tt=(ct=this).Ti.getPivotCacheByName(ct.L).yii(),Ot={},Pt=0,Jt=ct.nw();Pt<Jt.length;Pt++)(u=Jt[Pt])!==t&&(Ot[u.Zc]=!0);for(d=0,m=Tt;d<m.length;d++)R=m[d],(z=ct.getFieldNameBySourceName(R.Zc))&&(ct.Z[z]!==X.PivotTableFieldType.valueField||t.a===R.Zc)||(Ot[R.Zc]=!0);return Ot[r]},O.prototype.changeFieldName=function(t,r){var u,d=this,m=t.Zc,R=d.Z[t.Zc];if(F(r)||r===""||!r)return!1;if(d.IGr(t,r)){if(u=d.CVt().sheet)return u.jT(10,Ft().PivotTableErrorMessage_EmptyFieldName),!1;(0,o.throwError)(Ft().PivotTableErrorMessage_DuplicatedFieldName)}return d.Z[m]===X.PivotTableFieldType.valueField&&(d.changeValueFilterName(m,r),d.changeFieldsValueSortInfo(m,r)),d.changeValueArray(m,r),m&&r&&0<r.length&&(d.nrt[m]&&(d.nrt[r]=d.nrt[m],delete d.nrt[m]),t.Zc=r,delete d.Z[m],d.Z[t.Zc]=R,u=d.X[m],delete d.X[m],d.X[r]=u),d.tFr("changeFieldName",{sourceName:t.a,newFieldName:r}),d.DT({fieldName:r,oldFieldName:m,type:"changeFieldName"}),!0},O.prototype.changeValueArray=function(t,r){var u=this.Y;(0,at.o)(u,function(d,m){d===t&&(u[m]=r)})},O.prototype.changeValueFilterName=function(t,r){for(var u=this,d=0;d<4;d++)u.nw(d).forEach(function(m){(m=u.K.get(m.a))&&m.valueFilter&&m.valueFilter.conditionByName===t&&(m.valueFilter.conditionByName=r)})},O.prototype.changeFieldsValueSortInfo=function(t,r){for(var u=1;u<3;u++)this.nw(u).forEach(function(d){d.nrt&&d.nrt.sortValueFieldName&&d.nrt.sortValueFieldName===t&&(d.nrt.sortValueFieldName=r)})},O.prototype.isFieldExist=function(t){return!F(this.Z[t])},O.prototype.isFieldActualExist=function(t){var r,u=(r=this).getAllFieldNameList();return r.si||(r.si=u),-1<r.si.indexOf(t)||-1<u.indexOf(t)&&(r.si=u,!0)},O.prototype.rBt=function(t){var r=this.getFieldInfoByName(t);return this.hr(r?r.a:t)},O.prototype.hr=function(t){return(t=this.bl(t))&&t.W5},O.prototype.Kz=function(t){return t=this.getFieldInfoByName(t),this.bl(t.a).DH()},O.prototype.refreshShowDataAs=function(t,r,u){for(var d,m=0,R=this.z;m<R.length;m++)(d=R[m])instanceof B.PivotTable&&d.sq(t,r,u)},O.prototype.changeFieldArea=function(t,r,u){var d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e=($t=this).Z[t],p=$t.getFieldInfoByName(t);if(F(p))return!1;(d=$t.FC(t))&&!F(d.D5)&&r!==X.PivotTableFieldType.valueField||e<0||F(e)||$t.FV(t)&&r!==X.PivotTableFieldType.valueField||(d.hasCalcItem()&&r===X.PivotTableFieldType.filterField&&(0,o.throwError)(Ft().PivotTableMoveCalcItemFieldToReport),d=r!==e,r in X.PivotTableFieldType&&d&&(Ot=(ct=[X.PivotTableFieldType.rowField,X.PivotTableFieldType.columnField]).indexOf(r)!==-1,ct=ct.indexOf(e)!==-1,Ot)&&ct&&(d=!1),Ot=dt($t.nw(e),t),(ct=$t.getSigmaValuePosition()).display&&ct.positionType===r-1&&ct.positionIndex===Ot&&Ot===u&&e===r?$t.setSigmaValuePosition(ct.positionType,ct.positionIndex+1):(p&&$t.refreshShowDataAs(t,!1,r),r===X.PivotTableFieldType.valueField&&e!==X.PivotTableFieldType.valueField&&(m=$t.dz($t.FG(p.a,t)),$t.changeFieldName(p,m),t=m,$t.xy(p.Zc,$t.PV(p.a))),r!==X.PivotTableFieldType.valueField&&e===X.PivotTableFieldType.valueField&&($t.clearValueFilterOfValueField(p.Zc),$t.xy(p.Zc,g)),m=$t.Z[t],R=p.nrt,p=$t.CF(t),Pt=(ct=$t.getSigmaValuePosition()).display,z=ct.positionType,ct=ct.positionIndex,r===e&&Ot<u&&(Tt=ot(Ot,u),Ot=j(Ot,u),Pt)&&z===r-1&&ct<=Tt&&Ot<ct&&u--,r!==X.PivotTableFieldType.valueField&&e===X.PivotTableFieldType.valueField&&(p.Zc=p.a),$t.addField(p,r,u),R&&m!==r&&R.sortByPivotReferences&&$t.setSortInfo(t,E),m!==X.PivotTableFieldType.rowField&&m!==X.PivotTableFieldType.columnField||(Pt=m===X.PivotTableFieldType.columnField?$t.B:$t.R,Jt=(m===X.PivotTableFieldType.rowField?$t.B:$t.R).map(function(C){return $t.X[C.Zc]}),b($t,Pt,function(C){var W,x;if(C.sortByPivotReferences){for(W=C.sortByPivotReferences,x=0;x<W.length;x++)if(W[x].fieldName!==Jt[x])return 1}})),$t.q1=d,r===X.PivotTableFieldType.filterField&&$t.sR()))},O.prototype.removeFieldOrSigmaByName=function(t){var r,u,d,m,R=this;return t===Ft().sigmaValue?(u=R.B.concat(R.R),b(R,u,function(z){return!F(z.sortValueFieldName)}),R.RM(X.PivotTableFieldType.valueField),Ft().sigmaValue):((r=R.getFieldInfoByName(t))&&(R.refreshShowDataAs(t,!0),d=r.a,(m=R.Z[t])===3?(u=R.B.concat(R.R),b(R,u,function(z){return z.cacheName===d||z.sortValueFieldName===t||z.sortValueFieldName===d})):m!==1&&m!==2||(r.getSortInfo()&&delete R.nrt[r.Zc],b(R,u=m===1?R.R:R.B,function(z){return(z=z.sortByPivotReferences)!=null&&z.some(function(ct){return ct.fieldName===d})}))),R.CF(t))},O.prototype.CF=function(t){var r,u,d,m=(d=this).Z[t],R=dt(d.nw(m),t);if(!(F(m)||R<0))return r=d.getSigmaValuePosition(),u={1:at.DataPosition.row,2:at.DataPosition.col},r.display&&r.positionType===u[m]&&r.positionIndex>R&&d.setSigmaValuePosition(r.positionType,r.positionIndex-1),d.MK(t)},O.prototype.MK=function(t){var r=this,u=r.Z[t],d=dt(r.nw(u),t);return delete r.Z[t],r.q1=!0,r.OK(u,d)},O.prototype.C$=function(t){var r=this,u=r.nw(X.PivotTableFieldType.valueField);(0,at.o)(u,function(d){d.Or&&d.Or.baseFieldName===t&&((0,at.o)(r.z,function(m){m.T$===0&&(0,vt.R$)(m,d.Zc,d.Or.showDataAs)}),delete d.Or)})},O.prototype.clearValueFilterOfValueField=function(t){for(var r,u,d=this,m=X.PivotTableFieldType.rowField;m<=X.PivotTableFieldType.columnField;m++)for(u=(r=d.nw(m)).length-1;0<=u;u--)F(r[u]._filterInfo)||F(r[u]._filterInfo.valueFilter)||r[u]._filterInfo.valueFilter.conditionByName!==t||d.clearFilterInfo(r[u].Zc,2);d.q1=!0},O.prototype.RM=function(t){var r,u,d=(u=this).nw(t);if(!F(d)&&0<d.length){for(r=d.length-1;0<=r;r--)u.refreshShowDataAs(d[r].Zc,!0),u.CF(d[r].Zc);u.q1=!0}},O.prototype.sz=function(t,r,u,d){this.eFr(t,r,u,d),this.DT({fieldName:r.Zc,area:u,index:d,type:"removeField"})},O.prototype.eFr=function(t,r,u,d){var m,R=this;F(d)?t.push(r):(m=t.length,d=ot(m,d),d=j(0,d),t.splice(d,0,r)),u===X.PivotTableFieldType.valueField&&(F(R.x2)&&(R.x2=at.DataPosition.col),F(R.P2))&&(R.P2=0)},O.prototype.OK=function(t,r){var u,d,m,R,z=(R=this).nw(t);if(!(F(r)||r<0||r>=z.length))return z=z.splice(r,1)[0],F(z)||(d=u=void 0,(m=z._filterInfo)&&(m.labelFilter&&(u=m.labelFilter.condition?m.labelFilter.condition.toJSON():{textItem:Yt({},m.labelFilter.textItem)}),d=m.valueFilter?{conditionByName:m.valueFilter.conditionByName,condition:m.valueFilter.condition.toJSON()}:g),R.nFr("removePivotField",{field:z,area:t}),R.DT({fieldName:z.Zc,sourceName:z.a,labelFilter:u,valueFilter:d,sortInfo:(0,H.RF)(z.nrt),subtotalType:z.Ar,valueFilterIndex:this.Y.indexOf(z.Zc),area:t,index:r,isShowSubtotal:z.Nwr,type:"addField"})),z},O.prototype.fit=function(t){var r,u,d,m=(d=this).Ti.getPivotCacheByName(d.L),R=d.Pq;if(m.removeCalcField(t),delete d.X[t],R&&R.length&&-1<(r=R.findIndex(function(z){return z.a===t})))for(R.splice(r,1);r<R.length;r++)(u=d.v_(R[r].a))&&(u.lp=r,u.l=r),R[r].lp=r,R[r].l=r;d.q1=!0,d.iFr("removeCalcField",{fieldName:t})},O.prototype.nw=function(t){var r=this;switch(t){case 0:return r.G;case 1:return r.B;case 2:return r.R;case 3:return r.Q;default:return[].concat(this.B,this.R,this.G,this.Q)}},O.prototype.getLabelQueryField=function(){var t,r=(t=this).bit(),u=t.getAllFieldNameList(),d=[],m=t.Ti.getPivotCacheByName(t.L);return(0,at.o)(r,function(R){var z,ct,Tt=m.zRt(R.a),Ot=F(Tt.y1)?void 0:m.zRt(Tt.y1);(ct=t.getFilterInfo(R.a))&&ct.u&&(t.q1=!0,ct.u=!1),(z=u.indexOf(R.a))!==-1&&u.splice(z,1),d.push(R.toPivotViewQueryField(ct,t.Z[R.Zc],Tt,Ot))}),(0,at.o)(u,function(R){var z,ct,Tt;(Tt=t.getFilterInfo(R))&&Tt.labelFilter&&(z=m.zRt(R),ct=F(z.y1)?void 0:m.zRt(z.y1),d.push(D(R,R,-1,Tt,E,-1,z,ct)))}),d},O.prototype.Get=function(){var t={};return(0,at.o)(this.B,function(r){r=r.Zc,t[r]=1}),(0,at.o)(this.R,function(r){r=r.Zc,t[r]=2}),t},O.prototype.getSubtotalQueryField=function(){var t=this.rot(),r=[],u={};return(0,at.o)(t,function(d){r.push(d.toPivotViewSubTotalFields()),u[d.Zc]=d.getSubTotalType()}),{valueFieldsSubtotalMap:u,queryFields:r}},O.prototype.getSortMap=function(t){var r=this,u={},d={};return(0,at.o)(t,function(m){var R,z,ct,Tt,Ot,Pt,Jt,$t,e=m.sourceName,p=(m=m.sortInfo,{});if(!F(m))if(R=m.customSortCallback||m.customSortInfo){if(ct=(z=r.bl(e)).W5,Tt=z.DH(),Ot=z.M(),(Pt=R(Tt.concat(),{sortType:at.SortType.custom,isDate:ct===at.PivotDataType.date}))&&0<Pt.length){for(Jt=0,$t=Pt.length;Jt<$t;Jt++)p[Ot[Pt[Jt]]]=Jt;u[e]=p}}else d[e]=m.sortType}),{customSortMap:u,normalSortMap:d}},O.prototype.bit=function(){return[].concat(this.B,this.R,this.G)},O.prototype.rot=function(){return this.Q},O.prototype.kn=function(t){return this.Ti.getPivotCacheByName(this.L).zRt(t).lp},O.prototype.p=function(t){return(t=this.Ti.getPivotCacheByName(this.L).zRt(t)).l||t.lp},O.prototype.fn=function(t){return t=this.Ti.getPivotCacheByName(this.L).zRt(t),F(t)?{}:{startValue:t.T,endValue:t.gd}},O.prototype.yr=function(t){return this.Ti.getPivotCacheByName(this.L).zRt(t).getFieldsItemList()},O.prototype.Le=function(t){var r,u=(r=this.bl(t)).P;return!F(u)&&Object.keys(u).length!==0||this.Ti.getPivotCacheByName(this.L).dot([t]),r.P},O.prototype.bl=function(t){var r=this.Ti.getPivotCacheByName(this.L);return r&&r.zRt(t)},O.prototype.sat=function(t){var r,u,d,m,R,z=this.ac,ct={};if(!F(t)&&t.length!==0&&!F(z))for(r=this.Ti.getPivotCacheByName(this.L),u=0,d=t;u<d.length;u++)(z[R=(m=d[u]).sourceName]||(R=r.getField(R).y1,!F(R)&&z[R]))&&(ct[m.displayName]=!0);return ct},O.prototype.xpi=function(t){var r,u,d,m={};if(!F(t)&&t.length!==0)for(r=0,u=t;r<u.length;r++)m[(d=u[r]).displayName]=!!d.isShowSubtotalTop;return m},O.prototype.Awr=function(t){var r,u,d,m={};if(!F(t)&&t.length!==0)for(r=0,u=t;r<u.length;r++)m[(d=u[r]).displayName]=F(d.isShowSubtotal)?this.Dpi!==X.SubtotalsPosition.none:d.isShowSubtotal;return m},O.prototype.queryItem=function(){var t,r,u,d=(u=this).getLabelQueryField(),m=(R=u.getSubtotalQueryField()).valueFieldsSubtotalMap,R=R.queryFields,z=u.sat(d),ct=u.xpi(d),Tt=u.Awr(d),Ot=(Pt=u.getSortMap(d)).customSortMap,Pt=Pt.normalSortMap,Jt=u.L,$t=u.Ti,e=u.getSigmaValuePosition();return(u.q1||F(u.tx))&&(u.tx=$t.queryItem(Jt,d,R,e),u.q1=!1,O.et(u,"rebuild",{})),t=($t=u.lat(d)).list,r=$t.header,$t=$t.rowHeader,e={valuePositionInfo:e,subTotalsPosition:u.Dpi,valueFieldLength:R.length},u.tx&&u.tx.out(u.Ti.cut[Jt],t,r,$t,d,e,u.alt(),m,u.Y,this.toShowDataAsContextList(R),Ot,Pt,z,ct,Tt)},O.prototype.getLabelSortMap=function(){return this.getSortMap(this.getLabelQueryField())},O.prototype.toShowDataAsContextList=function(t){var r=this,u=[],d=this.Ti.getPivotCacheByName(this.L);return(0,at.o)(t,function(m){var R,z,ct,Tt,Ot,Pt,Jt,$t;if(m.showDataAs){if(R=(m=m.showDataAs).showDataAs,z=m.cacheName,ct=m.baseFieldItemType,Tt=m.baseFieldName,Ot=m.baseFieldItem,Pt=m.fieldName,m=m.subtotalType,Jt=void 0,Tt&&Ot){if($t=r.getFieldInfoByName(Tt),F($t))return;Jt=($t=d.zRt($t.a).M())?$t[Ot]:Ot}u.push({showDataAs:R,cacheName:z,fieldName:Pt,baseFieldName:Tt,baseFieldItemType:ct,baseFieldItem:Ot,subtotalType:m,baseFieldItemShared:Jt})}}),u},O.prototype.alt=function(){var t,r,u,d,m,R,z,ct=this,Tt={};for(t in ct.dv)if(ct.dv.hasOwnProperty(t)&&(u=ct.Ti.getPivotCacheByName(ct.L),!F(u))&&(r=ct.getFieldInfoByName(t),!F(r))&&(u=u.zRt(r.a),!F(u)))if(d=u.M(),m=ct.dv[t],R=void 0,F(d))Tt[t]=Yt({},m);else{for(z in m)m.hasOwnProperty(z)&&((R=R||{})[d[z]]=m[z]);Tt[t]=R}return Tt},O.prototype.lat=function(t){var r=[],u=[],d=[];return(0,at.o)(t,function(m){var R=m.displayName,z=m.isDim;m=m.isHeader,z&&(r.push(R),m||d.push(R)),m&&u.push(R)}),{list:r,header:u,rowHeader:d}},O.prototype.wVt=function(t){var r=t.cmdOption.pivotName;if(r=this.yVt(r),F(r)||F(r.Ti))return!1;t.sheetName=r.Ti.name(),this.Qy.execute(t)},O.prototype.yVt=function(t){for(var r,u=0,d=this.z;u<d.length;u++)if((r=d[u]).Zc===t&&r instanceof B.PivotTable)return r;return g},O.prototype.CVt=function(){for(var t=this.z,r=0;r<t.length;r++)if(t[r]instanceof B.PivotTable)return{sheet:t[r].Ti,ptName:t[r].Zc}},O.prototype.IVt=function(){var t,r=(t=this).getAllFieldInfo().slice(0),u=t.nw(0).slice(0);return{allField:r,rowField:t.nw(1).slice(0),colField:t.nw(2).slice(0),valueField:t.nw(3).slice(0),filterField:u,valuePosition:t.getSigmaValuePosition()}},O.prototype.adjustHasCalcItem=function(t,r,u){var d,m,R,z,ct=(z=this).L;if(ct=this.Ti.getPivotCacheByName(ct).getField(t),z.DA()){if(r===X.PivotTableFieldType.filterField)ct.hasCalcItem()&&(0,o.throwError)(Ft().PivotTableMoveCalcItemFieldToReport);else for(d=0,m=z.nw();d<m.length;d++)(R=m[d]).a===t&&(z.Z[R.Zc]===X.PivotTableFieldType.valueField&&(0,o.throwError)(Ft().PivotTableCalcItemHasMultipleDataField),(0,o.throwError)(Ft().PivotTableCalcItemHasTowCacheField));if(r===X.PivotTableFieldType.valueField)return z.checkSubTotal(u)}return!0},O.prototype.addFieldByName=function(t,r,u,d,m,R){var z,ct,Tt,Ot=this;for((3<u||u<0)&&(0,o.throwError)("wrong area code"),Tt=Ot.bl(t),z=X.PivotTableFieldType.columnField;z>=X.PivotTableFieldType.filterField;z--)if(ct=Mt(Ot.nw(z),t),!F(ct)&&u!==X.PivotTableFieldType.valueField)return void Ot.changeFieldArea(ct.Zc,u,m);if(Ot.adjustHasCalcItem(t,u,d),!F(Tt)&&r!==Ft().sigmaValue)return Tt=new Qt(Ot,t,r,R),u!==X.PivotTableFieldType.valueField&&(Ot.Dpi===X.SubtotalsPosition.top?Tt.Spi=!0:Ot.Dpi===X.SubtotalsPosition.bottom?Tt.Spi=!1:delete Tt.Spi),u===X.PivotTableFieldType.valueField&&(!F(r)&&F(Ot.Z[r])||(R=Ot.FG(t,r,d),r=Ot.dz(R),Ot.changeFieldName(Tt,r)),F(d)?Tt.setSubTotalType(Ot.PV(t)):Tt.setSubTotalType(d)),m<Ot.nw(u).length&&(u===X.PivotTableFieldType.rowField||u===X.PivotTableFieldType.columnField)&&b(Ot,u===X.PivotTableFieldType.columnField?Ot.B:Ot.R,function(Pt){return!F(Pt.sortByPivotReferences)&&0<Pt.sortByPivotReferences.length}),Ot.addField(Tt,u,m),u===X.PivotTableFieldType.filterField&&Ot.sR(),Tt},O.prototype.AVt=function(t,r,u,d,m,R){var z,ct=(z=this).bl(t);F(ct)||r===Ft().sigmaValue||(ct=new Qt(z,t,r,R),u!==X.PivotTableFieldType.valueField&&(z.Dpi===X.SubtotalsPosition.top?ct.Spi=!0:z.Dpi===X.SubtotalsPosition.bottom?ct.Spi=!1:delete ct.Spi),!F(r)&&F(z.Z[r])||(R=z.FG(t,r,d),r=z.dz(R),z.changeFieldName(ct,r)),F(d)?ct.setSubTotalType(z.PV(t)):ct.setSubTotalType(d),z.addField(ct,u,m))},O.prototype.AP=function(t){var r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt;switch(F(this.copyFieldsModel)||(this.copyFieldsModel=this.clone()),t.type){case"updateValuePosition":Ot=t.position,r=t.valuesIndex,this.setSigmaValuePosition(Ot,r);break;case"subTotalType":this.xy(t.fieldName,t.subtotalType);break;case"setSortInfo":F(t.sortInfo)?this.clearSortInfo(t.fieldName):this.setSortInfo(t.fieldName,t.sortInfo);break;case"setCollapse":this.setCollapse(t.fieldName,t.item,t.isCollapse);break;case"changeFieldName":(Ot=this.getFieldInfoByName(t.fieldName))&&(this.changeFieldName(Ot,t.oldFieldName),this.q1=!0);break;case"removeField":this.OK(t.area,t.index)&&(delete this.Z[t.fieldName],this.q1=!0);break;case"addField":r=t.fieldName,Ot=t.sourceName,u=t.labelFilter,d=t.valueFilter,m=t.sortInfo,R=t.subtotalType,z=t.area,Jt=t.index,ct=t.valueFilterIndex,Tt=t.isShowSubtotal,Ot=new Qt(this,Ot,r),Pt=this.nw(z),this.sz(Pt,Ot,z,Jt),this.Z[r]=z,this.xy(r,R),this.Z[Ot.Zc]=z,Ot.Nwr=Tt,F(u)||this.setLabelFilterInfo(r,u),F(d)||this.setValueFilterInfo(r,d,ct),F(m)||this.setSortInfo(t.fieldName,t.sortInfo),z!==0&&(this.q1=!0);break;case"setLabelFilter":F(t.filterInfo)?this.clearFilterInfo(t.sourceName,1):this.setLabelFilterInfo(t.sourceName,t.filterInfo);break;case"setValueFilter":F(t.filterInfo)?this.clearFilterInfo(t.sourceName,2):this.setValueFilterInfo(t.sourceName,t.filterInfo,t.index);break;case"group":Pt=t.oldGroupInfo,Jt=t.groupSourceFieldName,Pt?this.dy(Pt):this.cy(Jt);break;case"ungroup":this.dy(t.groupInfo)}},O.prototype.DT=function(t){var r,u,d;(d=(d=this.CVt())&&d.sheet)&&(r=d.getParent(),(0,at.o)(this.z,function(m){if(m instanceof B.PivotTable)return u=m,!0}),F(r.NVt)&&u&&u.getRange&&(r.NVt={range:u&&u.getRange()}),d.Ut.TVt(this,t))},O.prototype.getLabelFilterInfo=function(t){var r,u;if(t=this.K.get(t),!F(t)&&(t=t.labelFilter,!F(t)))return{condition:r=t&&t.condition?t.condition.toJSON():r,textItem:u=t&&t.textItem?t.textItem:u}},O.prototype.setLabelFilterInfo=function(t,r){var u,d,m,R=(m=this).K;!F(r)&&Object.keys(r).length<1||((u=m.getFilterInfo(t))&&u.labelFilter&&(d={},u.labelFilter.condition&&(d.condition=u.labelFilter.condition.toJSON()),u.labelFilter.textItem)&&(d.textItem=Yt({},u.labelFilter.textItem)),F(r)?(u&&u.labelFilter&&u.labelFilter.condition&&u.labelFilter.condition.sn===1&&m.MVt(t,g),R.set(t,g,1)):(u||(u=new Xt(r,g,m.H),m.K.add(t,u)),r.condition?(r.condition.conType===1&&m.MVt(t,r),u.updateLabelCondition(r.condition,m.H.allowMultipleFiltersPerField)):u.labelFilter&&(u.labelFilter.condition&&u.labelFilter.condition.sn===1&&m.MVt(t,g),delete u.labelFilter.condition),r.textItem?u.updateLabelTextItem(r.textItem,m.H.allowMultipleFiltersPerField):u.labelFilter&&delete u.labelFilter.textItem,m.K.get(t).on()&&!m.H.allowMultipleFiltersPerField&&R.set(t,g,2)),m.q1=!0,m.tFr("setLabelFilterInfo",{sourceName:t,filterInfo:r}),this.DT({type:"setLabelFilter",sourceName:t,filterInfo:d}),O.et(m,"setSlicerFilter",{sourceName:t,textItem:r&&r.textItem,condition:r&&r.condition,oldTextItem:d&&d.textItem,oldCondition:d&&d.condition}))},O.prototype.MVt=function(t,r){var u,d,m,R,z,ct,Tt=(ct=this).Ti.getPivotCacheByName(ct.L);if(!F(Tt)&&(u=Tt.xVt(t),!F(u))&&0<u.length)for(d=0,m=u.length;d<m;d++)R=ct.getFieldInfoByName(u[d].Zc),F(R)||((z=ct.K.get(R.a))||(z=new Xt(r,g,ct.H),ct.K.add(R.a,z)),z.updateLabelCondition(r&&r.condition,ct.H.allowMultipleFiltersPerField))},O.prototype.getValueFilterInfo=function(t){if((t=this.K.get(t))&&t.valueFilter&&t.valueFilter.condition)return{condition:t.valueFilter.condition.toJSON(),conditionByName:t.valueFilter.conditionByName}},O.prototype.getSourceNameByFieldName=function(t){if(t)return this.X[t]},O.prototype.getFieldNameBySourceName=function(t){if(t)return(t=this.v_(t))&&t.Zc},O.prototype.setValueFilterInfo=function(t,r,u){var d,m,R,z=(R=(m=this).K).get(t);!F(r)&&Object.keys(r).length<1||(F(u)&&(u=this.Y.indexOf(t)===-1?g:this.Y.indexOf(t)),z&&z.valueFilter&&(d={conditionByName:z.valueFilter.conditionByName,condition:z.valueFilter.condition.toJSON()}),F(r)?(R.set(t,g,2),m.y2(t,!1)):(z?z.updateValueCondition(r):(z=new Xt(g,r,m.H),R.add(t,z)),z.valueFilter.conditionBySourceName=this.getFieldInfoByName(r.conditionByName).a,m.y2(t,!0,u),z.C()&&!m.H.allowMultipleFiltersPerField&&R.set(t,g,1)),(z=xt(this.Pq||this.nw(),t))&&(z.nc=!0),this.q1=!0,m.tFr("setValueFilterInfo",{sourceName:t,filterInfo:r,index:u}),this.DT({type:"setValueFilter",sourceName:t,index:u,filterInfo:d}))},O.prototype.clearFilterInfo=function(t,r){var u=this,d=u.v_(t);u.getFilterInfo(t)&&(r===1?u.setLabelFilterInfo(t,g):r===2?u.setValueFilterInfo(t,g,g):(u.setValueFilterInfo(t,g,g),u.setLabelFilterInfo(t,g)),d&&(d.nc=!1),u.q1=!0)},O.prototype.DVt=function(t){this.H.allowMultipleFiltersPerField=t},O.prototype.refresh=function(t){this.q3(t)},O.prototype.fromJson=function(t,r){var u,d,m,R,z=(R=this).Ti,ct=(R.cft=t).fields;for(R.Pq=[],u=null,(z=z.getPivotCacheByCacheId(+t.cacheId))&&(R.L=z.Zc,u=z.getAllFieldsNames()),u||(u=[],ct.forEach(function(Tt){u.push(Tt.name)})),R.ac={},!t.multipleFieldFilters&&t.multipleFieldFilters!==E||(R.H.allowMultipleFiltersPerField=!0),R.Z={},R.X={},R.B=[],R.R=[],R.G=[],R.Q=[],d=0;d<u.length;d++)ct[d]&&!F(u[d])&&((m=new Qt(R,u[d],ct[d]&&ct[d].name)).fromJson(ct[d],R),F(ct[d].subtotalTop)?m.Spi=!0:m.Spi=ct[d].subtotalTop,ct[d].defaultSubtotal===!1?r.options.subTotalsPosition!==X.SubtotalsPosition.none&&(m.Nwr=!1):r.options.subTotalsPosition===X.SubtotalsPosition.none&&(m.Nwr=!0),ct[d].name=m.Zc,R.X[m.Zc]=m.a,R.Pq.push(m),m=m.getSortInfo())&&(R.nrt[ct[d].name]=m);R.SVt(t,r),Q(R.Pq,R,r,!1),F(t.pivotFilters)||R.kVt(t.pivotFilters)},O.prototype.yh=function(t,r,u){var d,m,R,z,ct,Tt,Ot=(Tt=this).Ti;for(Tt.sc=t,Tt.ac={},d=(ct=gt(t,"pivotFields"))&&ct.c_,Tt.Pq=[],ct=Ot.getPivotCacheByCacheId(+t.cacheId),Tt.L=ct.Zc,m=ct.getAllFieldsNames(),Ot=u.styleManager,A(t.multipleFieldFilters,!0)&&(Tt.H.allowMultipleFiltersPerField=!0),R=0;R<m.length;R++)(z=new Qt(Tt,m[R],d[R]&&d[R].name)).yh(r,d[R],Tt),F(d[R].subtotalTop)?z.Spi=!0:z.Spi=A(d[R].subtotalTop),A(d[R].defaultSubtotal)===!1?r.options.subTotalsPosition!==X.SubtotalsPosition.none&&(z.Nwr=!1):r.options.subTotalsPosition===X.SubtotalsPosition.none&&(z.Nwr=!0),d[R].name=q(P(z.Zc)),Tt.X[z.Zc]=z.a,Tt.Pq.push(z),(z=z.getSortInfo())&&(Tt.nrt[d[R].name]=z);Tt.jVt(t,r,Ot),Q(Tt.Pq,Tt,r,!0),(ct=t.lossless&&t.lossless.losslessPivotFilters)&&Tt.kVt(ct),u=gt(t,"filters"),F(u)||Tt.OVt(u)},O.prototype.kVt=function(t){for(var r,u,d,m,R,z=this,ct=0;ct<t.length;ct++)m=t[ct],(r=z.Pq&&z.Pq[m.fld])&&(u=m.iMeasureFld||0,u=z.Q&&z.Q[u],d=m.conType,m=Rt(m),R=u&&u.Zc,F(m)&&F(R)||(R={condition:m,conditionByName:u&&u.Zc},d===0||d===1?z.setLabelFilterInfo(r.a,R):d!==2&&d!==3||z.setValueFilterInfo(r.a,R)))},O.prototype.OVt=function(t){var r,u,d,m,R,z,ct,Tt=this;if(!F(t))for(r=t.c_,u=0;u<r.length;u++)ct=r[u],(d=Tt.Pq&&Tt.Pq[Y(ct.fld)])&&(m=Y(ct.iMeasureFld)||0,m=Tt.Q&&Tt.Q[m],R=void 0,F(ct.type)||(R=et(ct.type)),ct=Ct(ct,R),z=m&&m.Zc,F(ct)&&F(z)||(z={condition:ct,conditionByName:m&&m.Zc},(ct=R.conType)===0||ct===1?Tt.setLabelFilterInfo(d.a,z):ct!==2&&ct!==3||Tt.setValueFilterInfo(d.a,z)))},O.prototype.SVt=function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p=this,C={columnFields:X.PivotTableFieldType.columnField,rowFields:X.PivotTableFieldType.rowField};for(u in C)if(C.hasOwnProperty(u))for(d=t[u],m=0;m<d.length;m++)d[m]!==-2?(R=p.Pq[d[m]])&&p.addField(R,C[u]):(p.x2=u==="columnFields"?at.DataPosition.col:at.DataPosition.row,p.P2=m);for(z=t.pageFields,m=0;m<z.length;m++)ct=z[m],(ct=p.Pq[ct.fld])&&p.addField(ct,X.PivotTableFieldType.filterField);for(Tt=t.dataFields,Ot=p.Ti.getPivotCacheByName(p.L).getAllFieldsNames(),m=0;m<Tt.length;m++)Pt=Tt[m],p.AVt(Ot[Pt.fld],Pt.name,X.PivotTableFieldType.valueField,pt(Pt.subtotal),E,Pt.numberFormat),Pt.showDataAs&&(e={showDataAs:$t=at.PivotShowDataAs[Pt.showDataAs]},(Jt=void 0,vt.applyShowDataAsStyle)(r,Pt.name,$t),F(Pt.baseField)||(Jt=p.v_(Ot[Pt.baseField]),F(Jt))||(e.baseFieldName=Jt.Zc),F(Pt.baseItem)||(Pt.baseItem===1048828?e.baseFieldItemType=at.PivotShowDataAsBaseItemType.previous:Pt.baseItem===1048829?e.baseFieldItemType=at.PivotShowDataAsBaseItemType.next:!F(Pt.baseItem)&&Jt&&Jt._items&&(e.baseFieldItemType=at.PivotShowDataAsBaseItemType.item,e.baseFieldItem=Jt._items[Pt.baseItem]&&Jt._items[Pt.baseItem].value)),p.getFieldInfoByName(Pt.name).Or=e)},O.prototype.jVt=function(t,r,u){var d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C=this,W={colFields:X.PivotTableFieldType.columnField,rowFields:X.PivotTableFieldType.rowField};for(d in W)if(W.hasOwnProperty(d)&&(m=gt(t,d)))for(R=m.c_,z=0;z<R.length;z++)(ct=Y(R[z].x))!==-2?(ct=C.Pq[ct])&&C.addField(ct,W[d]):(C.x2=d==="colFields"?at.DataPosition.col:at.DataPosition.row,C.P2=z);if(Pt=gt(t,"pageFields"))for(Tt=Pt.c_,z=0;z<Tt.length;z++)Ot=Tt[z],(Ot=C.Pq[Y(Ot.fld)])&&C.addField(Ot,X.PivotTableFieldType.filterField);if(Pt=gt(t,"dataFields"))for(Jt=C.Ti.getPivotCacheByName(C.L).getAllFieldsNames(),$t=function(x){var yt,_t,Lt,Et,Wt=q(P(x.name));C.AVt(Jt[Y(x.fld)],Wt,X.PivotTableFieldType.valueField,pt(x.subtotal),E,x.numberFormat),yt=x.showDataAs,(Lt=gt(x,"extLst"))&&Lt.c_.forEach(function(Ut){(Ut=gt(Ut,"dataField"))&&(yt=Ut.pivotShowAs)}),F(yt)||(_t={showDataAs:Lt=at.PivotShowDataAs[yt]},(Et=void 0,vt.applyShowDataAsStyle)(r,Wt,Lt),Et=Y(x.baseField),F(Et)||(Et=C.v_(Jt[Et]),F(Et))||(_t.baseFieldName=Et.Zc),Lt=Y(x.baseItem),F(Lt)||(Lt===1048828?_t.baseFieldItemType=at.PivotShowDataAsBaseItemType.previous:Lt===1048829?_t.baseFieldItemType=at.PivotShowDataAsBaseItemType.next:!F(Lt)&&Et&&Et._items&&(_t.baseFieldItemType=at.PivotShowDataAsBaseItemType.item,_t.baseFieldItem=Et._items[Lt]&&Et._items[Lt].value)),C.getFieldInfoByName(Wt).Or=_t),F(x.numFmtId)||(Et=Y(x.numFmtId),C.getFieldInfoByName(Wt).bbt=u.Dd&&u.Dd.uv(Et))},e=0,p=Pt.c_;e<p.length;e++)$t(p[e])},O.prototype.PVt=function(){var t,r,u=(r=this).Pq,d=r.getAllFieldNameList();F(u)&&(u=r.Pq=[]),t={},(0,at.o)(u,function(m){t[m.Zc]=m}),(0,at.o)(d,function(m){var R=r.v_(m);F(R)&&(R=new Qt(r,m,m,t[m]&&t[m].bbt)),u[R.lp]=R})},O.prototype.toJson=function(t,r){var u,d,m,R;if(F((R=this).L)||(u=R.Ti.getPivotCacheByName(R.L))&&(r.cacheId=u.FVt+""),d=R.Pq,r.fields=[],d)for(m=0;m<d.length;m++)r.fields.push(d[m].toJson(t));R.toPivotFiltersOOModel(t,r),R._Vt(t,r)},O.prototype.toPivotLabelFiltersOOModel=function(t,r,u,d){var m,R,z,ct=[];(z={}).fld=u,z.id=++d,z.evalOrder=-1,u=r.condition,F(u)||(d=u.LVt,r=u.getConditionType(),z.operator=d,m=u.eX,R=u.iX,(z.conType=r)===1&&(m=m&&I(m),R=R&&I(R),u.LVt===at.PivotDateFilterOperator.dateToDate)&&(z.isParallel=u.EVt,z.isDynamicEndDate=u.BVt,z.by=u._by),d={compareType:d,conType:r,item1:{expected:z.stringValue1=m},item2:{expected:z.stringValue2=R},ignoreCase:!(z.iMeasureFld=0),isWholeDay:u.xQt},u.LVt!==at.PivotDateFilterOperator.dateToDate&&u.LVt!==at.PivotDateFilterOperator.last7Days||(d.isParallel=u.EVt,d.isDynamicEndDate=u.BVt,d.by=u._by),m={conditions:[d]}),F(m)||(ct.push(m),z.autoFilter={filterItemMap:ct},t.push(z))},O.prototype.toPivotValueFiltersOOModel=function(t,r,u,d){var m,R=this,z=[];(m={}).fld=u,m.id=++d,m.evalOrder=-1,u=r.condition,d=r.conditionByName,m.iMeasureFld=R.RVt(d)||0,r=u.getConditionType(),R=u.LVt,m.operator=R,d=(m.conType=r)===3?(m.operator=u._type,{conditions:[{conType:r,expected:u.GVt,type:u.LVt,compareType:u._type}]}):{conditions:[{compareType:R,conType:r,item1:{expected:u.eX},item2:{expected:u.iX}}]},F(d)||(z.push(d),m.autoFilter={filterItemMap:z},t.push(m))},O.prototype.toPivotFiltersOOModel=function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt,Jt=(Ot=this).Y,$t=[],e={};if(Pt=Ot.Pq){for(u=0;u<Pt.length;u++)d=Pt[u],R=(m=Ot.K.get(d.a))&&m.labelFilter,z=m&&m.valueFilter,F(R)&&F(z)||(F(R)||Ot.toPivotLabelFiltersOOModel($t,R,u,1),F(z))||(e[d.Zc]={valueFilter:z,i:u,id:1});if(Jt&&Jt.length)for(ct=0,Tt=Jt;ct<Tt.length;ct++)(m=e[Tt[ct]])&&Ot.toPivotValueFiltersOOModel($t,m.valueFilter,m.i,m.id)}0<$t.length?r.pivotFilters=$t:delete r.pivotFilters},O.prototype._Vt=function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt=this,_t={R:"columnFields",B:"rowFields"};for(u in _t)if(_t.hasOwnProperty(u))for(d=yt[u],r[_t[u]]=[],m=0;m<d.length;m++)r[_t[u]].push(d[m].lp);for(yt.Q&&1<yt.Q.length&&(yt.x2===at.DataPosition.row?r.rowFields.splice(yt.P2,0,-2):yt.x2===at.DataPosition.col&&r.columnFields.splice(yt.P2,0,-2)),R=yt.G,z=r.pageFields=[],m=0;m<R.length;m++)ct=R[m].toJson(t),z.push(ct);for(Tt=yt.Q,Ot=r.dataFields=[],m=0;m<Tt.length;m++)if(Pt=Tt[m],(Jt={}).name=Pt.Zc,Jt.subtotal=wt(Pt.Ar),Jt.numberFormat=Pt.bbt,Ot.push(Jt),$t=Tt[m].lp,r.fields&&r.fields[$t]&&(r.fields[Jt.fld=$t].dataField=!0),(e=Pt.Or)&&(e.showDataAs&&(Jt.showDataAs=at.PivotShowDataAs[e.showDataAs]),e.baseFieldName)&&(p=yt.getFieldInfoByName(e.baseFieldName),Jt.baseField=p.lp,C=e.baseFieldItemType,!F(C))){if(C===at.PivotShowDataAsBaseItemType.previous)Jt.baseItem=1048828;else if(C===at.PivotShowDataAsBaseItemType.next)Jt.baseItem=1048829;else if(C===at.PivotShowDataAsBaseItemType.item){for(W=p.tl(yt)||p._items,x=0;x<W.length;x++)if(e.baseFieldItem===W[x].value){Jt.baseItem=x;break}}}},O.prototype.wh=function(t,r){var u,d,m,R,z;if(F((z=this).L)||(u=z.Ti.getPivotCacheByName(z.L))&&(r.cacheId=u.FVt+""),m=[],d=z.Pq)for(R=0;R<d.length;R++)m.push(d[R].wh(t));r.c_.push({n_:"pivotFields",count:m.length+"",c_:m}),z.VVt(t,r),z.UVt(t,r)},O.prototype.VVt=function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt=(W=this).Y,_t=[],Lt={},Et=[],Wt=1;if(x=W.Pq){for(u=0;u<x.length;u++)d=x[u],e=(m=W.K.get(d.a))&&m.labelFilter,R=m&&m.valueFilter,ct=z=void 0,F(e)&&F(R)||(F(e)||(Ot=void 0,(Tt={n_:"filter",fld:u+"",evalOrder:"-1"}).id=""+ ++Wt,Pt=e.condition,F(Pt)||(Jt=Pt.getConditionType(),z=Pt.LVt,Jt===1&&z===at.PivotDateFilterOperator.dateToDate||Jt===1&&z===at.PivotDateFilterOperator.last7Days?W.toPivotLabelFiltersOOModel(Et,e,u,Wt):((ct=o.Caption_Compare_Type_Excel[Jt]&&o.Caption_Compare_Type_Excel[Jt][z])!==E&&(Tt.type=ct),e=Pt.eX,$t=Pt.iX,Jt===1&&(e=e&&I(e),$t=$t&&I($t)),Tt.stringValue1=e,Tt.stringValue2=$t,Tt.iMeasureFld="0",Ot={conditions:[{compareType:z,conType:Jt,item1:{expected:e},item2:{expected:$t},ignoreCase:!0,isWholeDay:Pt.xQt}]})),F(Ot))||(Tt.c_=[V([Ot],ct)],Ot.conditions[0].isWholeDay===!0&&Tt.c_.push({n_:"extLst",c_:[{n_:"ext",r_:[32,70],c_:[{n_:"x15:pivotFilter",useWholeDay:"1"}]}]}),_t.push(Tt)),F(R))||(Ot=void 0,(Tt={n_:"filter",fld:u+"",evalOrder:"-1"}).id=""+ ++Wt,Pt=R.condition,e=R.conditionByName,Tt.iMeasureFld=""+(W.RVt(e)||0),Jt=Pt.getConditionType(),z=Pt.LVt,Ot=Jt===3?(z=Pt._type,{conditions:[{conType:Jt,expected:Pt.GVt,type:Pt.LVt,compareType:Pt._type}]}):{conditions:[{compareType:z,conType:Jt,item1:{expected:Pt.eX},item2:{expected:Pt.iX}}]},(ct=o.Caption_Compare_Type_Excel[Jt]&&o.Caption_Compare_Type_Excel[Jt][z])!==E&&(Tt.type=ct),F(Ot))||z===41||z===42||(Tt.c_||(Tt.c_=[]),Tt.c_.push(V([Ot],ct)),Lt[d.Zc]=Tt);if(yt&&yt.length)for(p=0,C=yt;p<C.length;p++)(m=Lt[C[p]])&&_t.push(m)}0<_t.length?r.c_.push({n_:"filters",count:_t.length+"",c_:_t}):nt(r.c_,{},"filters"),0<Et.length&&(r.lossless||(r.lossless={}),r.lossless.losslessPivotFilters=Et)},O.prototype.UVt=function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut=this,Kt={R:"columnFields",B:"rowFields"},oe={};for(u in Kt)if(Kt.hasOwnProperty(u))for(d=Ut[u],oe[Kt[u]]=[],m=0;m<d.length;m++)oe[Kt[u]].push(d[m].lp);for($t=oe.rowFields,R=oe.columnFields,Ut.Q&&1<Ut.Q.length&&(Ut.x2===at.DataPosition.row?$t.splice(Ut.P2,0,-2):Ut.x2===at.DataPosition.col&&R.splice(Ut.P2,0,-2)),0<$t.length&&(z=[],$t.forEach(function(ae){z.push({n_:"field",x:ae})}),r.c_.push({n_:"rowFields",count:z.length+"",c_:z})),0<R.length&&(ct=[],R.forEach(function(ae){ct.push({n_:"field",x:ae})}),r.c_.push({n_:"colFields",count:ct.length+"",c_:ct})),Tt=Ut.G,Ot=[],m=0;m<Tt.length;m++)Ot.push({n_:"pageField",fld:Tt[m].lp});for(0<Ot.length&&r.c_.push({n_:"pageFields",count:Ot.length+"",c_:Ot}),Pt=Ut.Q,Jt=[],e=($t=k(r,"pivotFields"))&&$t.c_,m=0;m<Pt.length;m++)if(p=Pt[m],(C={n_:"dataField"}).name=p.Zc,C.subtotal=wt(p.Ar),F(p.bbt)||(W=(yt=H.ExtendedNumberFormatHelper.getFormatId(p.bbt)).id,yt.isBuiltIn?C.numFmtId=W:((yt={}).numberFormat=new H.ExcelNumerFormat(W,p.bbt),C.numFmtId=yt.numberFormat.numberFormatId)),Jt.push(C),W=Pt[m].lp,e&&e[W]&&(C.fld=""+W,e[W].dataField="1"),(x=p.Or)&&(yt=void 0,x.showDataAs&&(yt=at.PivotShowDataAs[x.showDataAs]),kt.indexOf(yt)===-1?C.c_=[{n_:"extLst",c_:[{n_:"ext",r_:[28,1],c_:[{n_:"dataField",pivotShowAs:yt}]}]}]:C.showDataAs=yt,x.baseFieldName)&&(_t=Ut.getFieldInfoByName(x.baseFieldName),C.baseField=_t.lp,Lt=x.baseFieldItemType,!F(Lt))){if(Lt===at.PivotShowDataAsBaseItemType.previous)C.baseItem="1048828";else if(Lt===at.PivotShowDataAsBaseItemType.next)C.baseItem="1048829";else if(Lt===at.PivotShowDataAsBaseItemType.item){for(Et=_t.tl(Ut)||_t._items,Wt=0;Wt<Et.length;Wt++)if(x.baseFieldItem===Et[Wt].value){C.baseItem=""+Wt;break}}}0<Jt.length&&r.c_.push({n_:"dataFields",count:Jt.length+"",c_:Jt})},O.prototype.RVt=function(t){for(var r=this.Q,u=0;u<r.length;u++)if(t===r[u].Zc)return u},O.prototype.dy=function(t){var r,u,d,m,R=(d=this).L,z=(m=this.Ti).cut[d.L].Pq;return d.DA()&&(t.dateGroups||t.numberGroup)&&(0,o.throwError)(Ft().PivotTableHasNumberOrDateGroup),d.p_e(t),z=t.textGroup?(r=t.textGroup.fieldName,(0,at.o)(Object.keys(z),function(ct){if(ct===r)return Ft().PivotTableErrorMessage_DuplicatedFieldName}),r):t.originFieldName,(u=this.sy(t.originFieldName))&&this.cy(t.originFieldName,!0),m.addGroup(R,t)?(d.iFr("addGroup",{groupInfo:t}),this.DT({oldGroupInfo:u,groupSourceFieldName:z,type:"group"}),this.q1=!0):Ft().PivotTableErrorMessage_InvalidGroup},O.prototype.p_e=function(t){var r,u,d;if(t&&t.dateGroups)for(r=0,u=t.dateGroups;r<u.length;r++)(d=u[r]).start&&(isNaN(Date.parse(d.start))||d.start.getDate&&isNaN(d.start.getDate()))&&(0,o.throwError)(Ft().VALUE_MUST_NUMBER),d.end&&(isNaN(Date.parse(d.end))||d.end.getDate&&isNaN(d.end.getDate()))&&(0,o.throwError)(Ft().VALUE_MUST_NUMBER);t&&t.numberGroup&&(t=t.numberGroup,(isNaN(+t.by)||isNaN(+t.start)||isNaN(+t.end))&&(0,o.throwError)(Ft().ENTRY_NUMBER),+t.by<=0)&&(0,o.throwError)(Ft().POSITIVE_INTEGER)},O.prototype.QVt=function(t,r){var u=this.L,d=this.Ti;try{d.getPivotCacheByName(u).addCalcField(t,r,!0),this.iFr("addCalcField",{fieldName:t,formula:r})}catch{(0,o.throwError)(Ft().PivotTableErrorFormula)}},O.prototype.WVt=function(){for(var t,r=this.L,u=this.Ti.getCalcFields(r),d=[],m=0;m<u.length;m++)t=this.v_(u[m].Zc),d.push(t?{fieldName:t.Zc,formula:u[m].D5}:{fieldName:u[m].Zc,formula:u[m].D5});return d},O.prototype.FV=function(t){var r,u=this.L,d=this.Ti,m=this.getFieldInfoByName(t)&&this.getFieldInfoByName(t).a||t,R=d.getCalcFields(u);if(!F(m)){for(r=0;r<R.length;r++)if(R[r].Zc===m)return!0}return!1},O.prototype.cy=function(t,r,u){var d,m,R,z,ct,Tt,Ot,Pt=(Ot=this).Ti.getPivotCacheByName(Ot.L),Jt=Ot.v_(t),$t=Pt.getField(t),e=Pt.ZVt;for(m in e)if(mt(e,m)&&(R=e[m],Pt.zVt(t,m,R))){d=(0,H.RF)(R);break}if(!F($t)&&((Tt=(Tt=Ot.getFilterInfo(t))&&Tt.labelFilter)&&Tt.textItem&&(F(Tt.condition)&&F(Tt.conditionByName)?Tt=E:Tt.textItem=E,Ot.setLabelFilterInfo(t,Tt)),z=Pt.YVt($t.Zc),!u)&&z&&0<z.length)for(ct=0;ct<z.length;ct++)Ot.HVt(z[ct]);Jt&&(Jt.nrt&&delete Ot.nrt[Jt.Zc],(Tt=Ot.Z[Jt.Zc])!==1&&Tt!==2||b(Ot,Tt===1?Ot.R:Ot.B,function(p){return(p=p.sortByPivotReferences)!=null&&p.some(function(C){return C.fieldName===t})})),Ot.q1=!0,u||O.et(Ot,"updatePivotCache"),Ot.iFr("removeGroup",{sourceName:t,notNeedBackUp:r,notRemoveField:u}),r||this.DT({groupInfo:d,type:"ungroup",pivotTable:Ot})},O.prototype.JVt=function(){for(var t,r,u=(r=this).nw(),d=r.Ti.getPivotCacheByName(r.L),m=0,R=u;m<R.length;m++)t=R[m],F(d.getField(t.a))&&r.removeFieldOrSigmaByName(t.Zc);r.q1=!0},O.prototype.rC=function(t){var r,u,d,m,R,z=(R=(m=this).Ti.getPivotCacheByName(m.L)).ZVt;for(u in z)if(mt(z,u)&&(d=z[u],R.zVt(t,u,d))){delete(r=(0,H.RF)(d)).groupSourceField;break}return r},O.prototype.NGr=function(){var t,r,u={};return(r=(t=this).Ti.getPivotCacheByName(t.L))&&(r.ZVt&&(u.groupInfos=(0,H.RF)(r.ZVt)),u.calcFields=t.WVt(),u.calcItems=r.getCalcItems()),u},O.prototype.HVt=function(t){for(var r,u,d=this,m=X.PivotTableFieldType.valueField;m>=X.PivotTableFieldType.filterField;m--)for(u=(r=d.nw(m)).length-1;0<=u;u--)r[u].a===t&&(m===X.PivotTableFieldType.valueField&&d.clearValueFilterOfValueField(r[u].Zc),d.removeFieldOrSigmaByName(r[u].Zc))},O.prototype.qVt=function(t){var r=this;return this.Ti.getPivotCacheByName(this.L).Pq[t].W5===at.PivotDataType.number?(r=r.FG(t),this.addFieldByName(t,r,X.PivotTableFieldType.valueField,at.SubtotalType.sum)):this.addFieldByName(t,t,X.PivotTableFieldType.rowField,g)},O.prototype.sy=function(t){var r,u,d,m,R=(m=this).Ti.getPivotCacheByName(m.L).ZVt;for(u in R)if(mt(R,u)&&((d=R[u]).textGroup&&d.originFieldName===t||F(d.textGroup)&&d.originFieldName===t)){r=(0,H.RF)(d);break}return r},O.prototype.XVt=function(t,r){var u,d;return t=(d=(u=this).Ti.getPivotCacheByName(u.L)).$Vt(t,r),u.iFr("setOverwriteList",{overwriteList:d.eQt()}),t},O.prototype.tQt=function(t){var r;return(r=this).Ti.getPivotCacheByName(r.L).tQt(t)},O.prototype.iQt=function(t){var r,u;return t=(u=(r=this).Ti.getPivotCacheByName(r.L)).nQt(t),r.iFr("setOverwriteList",{overwriteList:u.eQt()}),t},O.prototype.eQt=function(){var t;return(t=this).Ti.getPivotCacheByName(t.L).eQt()},O.prototype.rQt=function(){var t,r,u=(r=(t=this).Ti.getPivotCacheByName(t.L)).rQt();return t.iFr("setOverwriteList",{overwriteList:r.eQt()}),u},O.prototype.dispose=function(){var t,r,u,d,m;if((m=this).nrt=g,m.dv=g,m.Pq=g,m.cft=g,m.sc=g,m.Y=g,m.H=g,m.Z=g,m.Ti=g,m.Qy=g,!F(m.z)){for(t=0,r=m.z;t<r.length;t++)(u=r[t])&&u.dispose();m.z=g}for(F(m.tx)||m.tx.L0(),F(m.copyFieldsModel)||m.copyFieldsModel.dispose(),d=0;d<m.B.length;d++)m.B[d].eG();for(d=0;d<m.R.length;d++)m.R[d].eG();for(d=0;d<m.G.length;d++)m.G[d].eG();for(d=0;d<m.Q.length;d++)m.Q[d].eG();m.K.dispose(),m.K=g,m.H=g,m.ac=g},O.prototype.iFr=function(t,r){var u,d,m=this.z.find(function(R){return R instanceof B.PivotTable});m&&(d=(u=m.Ti)==null?void 0:u.parent,u)&&d&&d.$Dr({type:"updatePivotCacheField",propertyName:t,sheetId:u.getId(),fieldsModel:this,pt:m,params:r})},O.prototype.tFr=function(t,r){var u=this.z.find(function(d){return d instanceof B.PivotTable});u&&u.$Dr({type:"updateFieldsModel",propertyName:t,fieldsModel:this,params:r})},O.prototype.nFr=function(t,r){var u=this.z.find(function(d){return d instanceof B.PivotTable});u&&u.$Dr({type:t,fieldsModel:this,params:r})},o.PivotFieldsModel=ft=O,(0,H.$e)(ft)},"./dist/plugins/pivot/pivot-core/pivot-view.js":function(Ie,o){function ft(Yt,At,S){var at=this;at.Zc=Yt,at.dh=At instanceof ft?At.dh:At,at.Ti=S}Object.defineProperty(o,"__esModule",{value:!0}),o.PivotView=void 0,ft.prototype.getName=function(){return this.Zc},ft.prototype.paint=function(){this.GY.render()},ft.prototype.dispose=function(){var Yt=this;Yt.dh=null,Yt.GY&&Yt.GY.dispose()},o.PivotView=ft},"./dist/plugins/pivot/pivot-definition.js":function(){},"./dist/plugins/pivot/pivot-filter-diagram/slicer-base/pivot-slicer-caches.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut;function Rt(s,y){var G,K,c;if((0,X.ht)(s.P))for(s.k={},s.P={},s.D=[],G=y.oQt,K=s.lp,c=0;c<G.length;c++)G[c][K]=s.aQt(G[c][K],c,!1);s.sQt||s.uQt()}function Ct(s,y){return(y=y!==void 0&&y)?+s.state.pivotCacheId:+s.data.tabular.pivotCacheId}function Bt(s,y){var G=[];return S.GC$.each(s,function(K,c){(c=c.slicerCacheDefinition||c.timelineCacheDefinition)&&c.pivotTables&&y.indexOf(c.name)!==-1&&(c=c.pivotTables.pivotTable,S.GC$.each(c,function(N,V){V=+V.tabId,G.indexOf(V)===-1&&G.push(V)}))}),G}function kt(s,y,G){var K=[];return s&&0<s.length&&S.GC$.each(s,function(c,N){N.Type===G&&(N=S.Util.vr(N.Target),N=y[N])&&S.GC$.each(N.c_||((N=N==null?void 0:N.slicers)==null?void 0:N.slicer),function(V,O){K.indexOf(O.cache)===-1&&K.push(O.cache)})}),K}function ie(s,y,G,K){var c=y.slicers,N=y.slicerCaches,V=y.timelines;if(y=y.timelineCaches,c&&c.length!==0)return function(O,pt){var wt=[];return S.GC$.each(pt,function(et,ht){O.indexOf(+ht.sheetId)!==-1&&wt.push(ht.name)}),wt}(Bt(N,s=kt(N=s&&s[G],c,S.RelationshipConstants.yc).concat(kt(N,V,S.RelationshipConstants.Nc))).concat(Bt(y,s)),K)}function Xt(s,y){var G,K,c;if(8<=(c=(0,X.ht)(s.compareType)?s.LVt:s.compareType)&&c<=23||c===40)G={filterType:2,type:y},(K=(0,H.getPivotDateExConditionRange)(c)).from&&K.to&&(G.value=K.from,G.maxValue=K.to);else if(24<=c&&c<=39)G={filterType:2,type:y};else if(0<=c&&c<=7)return K=function(N){var V=N.getConditionType(),O=N.LVt,pt=N.eX;return N=N.iX,V===1&&(pt=pt&&g(pt),N=N&&g(N)),{compareType:O,conType:V,item1:{expected:pt},item2:{expected:N},ignoreCase:!0}}(s),(0,H.getCellValuePivotFilter)(K,!0);return G}function Qt(s){this.vpt=s,this.cQt=[],this.lQt=[]}function dt(s,y,G,K){return(s=gt.call(this,s,y,G,K)||this).slicerCacheType=ot.pivotTimeline,s.selectionLevel=j.months,s.level=j.months,(y=s).bounds=y.buildBounds(),y.selection=f.keyword_undefined,s}function xt(s,y,G,K){return(s=Z.call(this,s,y,G,K)||this).slicerCacheType=ot.pivotSlicer,s.fQt=S.SortState.ascending,s.hQt=!0,s.vQt=!0,s.dQt=!0,s.fQt=S.SortState.ascending,s.items=s.initItems(),s}function Mt(s,y,G,K){return(K=ut.call(this,K,G)||this).Ti=s,K.pivotCache=y,K.pivotTables=[],K}function st(s,y){var G,K,c,N,V=S.util.xr(s.workbook,S.XFileConstants.Au);for((0,X.ht)(V)&&(V={n_:S.XFileConstants.Au,c_:[]},s.workbook.c_.push(V)),G=[],K=0,c=y;K<c.length;K++)N=c[K],G.push({n_:"x14:slicerCache","r:id":N});V.c_.unshift({n_:"ext",r_:[54,55],c_:[{n_:"x14:slicerCaches",c_:G}]})}function l(s,y){var G,K,c,N,V=S.util.xr(s.workbook,S.XFileConstants.Au);for((0,X.ht)(V)&&(V={n_:S.XFileConstants.Au,c_:[]},s.workbook.c_.push(V)),G=[],K=0,c=y;K<c.length;K++)N=c[K],G.push({n_:"x15:timelineCacheRef","r:id":N});V.c_.push({n_:"ext",r_:[56,32],c_:[{n_:"x15:timelineCacheRefs",c_:G}]})}function T(s,y,G){y=y.styles;var K=new S.SimpleSharedStrings,c=new S.SimpleSharedStrings,N=new S.SharedDxfs(K,c),V=[];G&&G.forEach(function(O){O.wh(!1,!0,f.keyword_undefined,{x15dxfsRecords:N,timelineStyleNodes:V})}),y.extLst||(y.extLst={}),S.GC$.extend(y.extLst,{x15dxfsRecords:N.iv(),timelineSharedColors:K.wh(),timelineCommonSharedStrings:c.wh(),timelineStyleNodes:V})}function D(s,y,G){var K=G.sheetRelsMap,c=s.name(),N=s.Uw();s=ie(K,G,c,y),S.GC$.each(s,function(V,O){N.addReferenceSheetName(O)})}function M(s,y,G,K,c){s.LQt(c=c!==void 0&&c),s.yh(y,G,f.keyword_undefined,K),s.updateSlicerCaches()}Yt=this&&this.__extends||(nt=function(s,y){return(nt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(G,K){G.__proto__=K}:function(G,K){for(var c in K)Object.prototype.hasOwnProperty.call(K,c)&&(G[c]=K[c])}))(s,y)},function(s,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");function G(){this.constructor=s}nt(s,y),s.prototype=y===null?Object.create(y):(G.prototype=y.prototype,new G)}),At=this&&this.__spreadArray||function(s,y,G){if(G||arguments.length===2)for(var K,c=0,N=y.length;c<N;c++)!K&&c in y||((K=K||Array.prototype.slice.call(y,0,c))[c]=y[c]);return s.concat(K||Array.prototype.slice.call(y))},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotSlicerCacheManager=o.PivotTimelineSlicerCache=o.PivotItemSlicerCache=void 0,S=ft("Core"),F=ft("@spreadjs/js-sheets-common"),at=ft("Slicers"),X=ft("Pivot"),H=ft("./dist/plugins/pivot/pivot-core/pivot-fields-model.js"),f=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),B=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-list.js"),vt=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer/pivot-item-slicer.js"),mt=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-slicer.js"),tt=ft("./dist/plugins/pivot/pivot-util.js"),ft=new F.Common.ResourceManager(X.SR,"PivotEngine"),_=ft.getResource.bind(ft),v=S.Util.wr,Ft=S.Util.Mr,w=S.Util.ho,I=S.Util.Er,U=S.mt.n1,ft=F.Common.ct,g=ft.o0,at&&(F=at.SlicerCacheBase,ot=at.SlicerCacheType,j=at.TimelineLevel,E=at.e_e,A=at.loadSheetSlicers,Y=at.encodeSlicerName,L=at.decodeSlicerName,Yt(Mt,ut=F),Mt.prototype.pQt=function(s){for(var y=-1,G=0;G<this.pivotTables.length;G++)this.pivotTables[G].name()===s.name()&&(y=G);return y},Mt.prototype.mQt=function(){return this.Ti.mQt()},Mt.prototype.beforeSetFilter=function(){ut.prototype.beforeSetFilter.call(this),this.Ti.C_e()},Mt.prototype.afterSetFilter=function(){ut.prototype.afterSetFilter.call(this),this.Ti.N_e(),this.refreshSlicers()},Mt.prototype.A_e=function(s){this.Ti.I_e(s,this.sourceName)},Mt.prototype.T_e=function(s){return this.Ti.T_e(s,this.sourceName)},Mt.prototype.S_e=function(){for(var s,y=0,G=this.pivotTables;y<G.length;y++)if(s=G[y],this.T_e(s.name()))return!1;return!0},Mt.prototype.bQt=function(s){var y,G;return s===void 0&&(s=!1),(y=this).gQt&&0<Object.keys(y.gQt).length&&(G=y.Ti.mQt(),S.GC$.each(y.gQt,function(K){if(!(K=G.wQt(K)))return!1;s=!0,y.pivotTables.push(K)})),y.gQt&&y.pivotTables.length===Object.keys(y.gQt).length&&(y.gQt=f.keyword_null),s&&y.updateCache(),!0},Mt.prototype.isConnectedPivotTable=function(s){for(var y=0;y<this.pivotTables.length;y++)if(this.pivotTables[y].name()===s)return!0;return!1},Mt.prototype.connect=function(s,y){var G,K=this;s.dh.Ti.getPivotCacheByName(s.dh.L).yQt!==K.pivotCache.yQt||K.pQt(s)!==-1||((G=K.Ti.getExistedSlicerCache(s,K.sourceName,K.slicerCacheType))?K.Ti.CQt(K,G):K.pivotTables.push(s),y)||K.setSingleFilter(s)},Mt.prototype.disconnect=function(s){s.dh.Ti.getPivotCacheByName(s.dh.L).yQt===this.pivotCache.yQt&&(s=this.pQt(s))!==-1&&this.pivotTables.splice(s,1)},Mt.prototype.onWorkSheetDisposing=function(s){var y,G,K=this;for(ut.prototype.onWorkSheetDisposing.call(this,s),y=K.pivotTables.length-1;-1<y;y--)(G=K.pivotTables[y]).Ti&&G.Ti.name()!==s||K.pivotTables.splice(y,1)},Mt.prototype.clearSelfFilter=function(){},Mt.prototype.clearFilter=function(){var s,y,G;if((G=this).canUpdate()&&!G.filterCleared()){for(G.clearSelfFilter(),G.beforeSetFilter(),s=0;s<this.pivotTables.length;s++)(y=this.pivotTables[s]).dh.wVt({cmd:"ClearCommand",sheetName:"",cmdOption:{fieldName:G.sourceName,pivotName:y.name(),commandName:"ClearFilter",clearType:1,labelType:G.slicerCacheType===ot.pivotSlicer?1:2}});G.afterSetFilter()}},Mt.prototype.setFilter=function(){},Mt.prototype.setSingleFilter=function(s){},Mt.prototype.toJSON=function(){var s,y=(s=this).Ti.mQt(),G=s.pivotTables.map(function(K){var c=K.Ti;return{tabId:y.getSheetPosition(c.name())+1,name:K.Zc}});return{name:s.name,sourceName:s.sourceName,pivotCacheId:s.pivotCache.yQt,pivotTables:G}},Mt.prototype.wh=function(){for(var s,y,G,K={r_:(G=this).slicerCacheType===ot.pivotSlicer?[42,14,30,43]:[60,32,14],name:Y(G.name),sourceName:Y(G.sourceName),pivotTables:{pivotTable:[]}},c=G.Ti.mQt(),N=K.pivotTables.pivotTable,V=G.pivotTables,O=0;O<V.length;O++)y=(s=V[O]).Ti,N.push({tabId:c.getSheetPosition(y.name())+1+"",name:Y(s.Zc)});return K},Mt.prototype.fromJSON=function(s){var y,G=this;ut.prototype.fromJSON.call(this,s),G.pivotTables=[],y=G.Ti.mQt(),(0,X.o)(s.pivotTables,function(K){var c=y.wQt(K.name);c?G.pivotTables.push(c):(G.gQt||(G.gQt={}),G.gQt[K.name]=!0)})},Mt.prototype.preFromSJSFormat=function(s){var y,G;(G=this).disposeAllSlicers(),G.IQt=[],G.pivotTables=[],G.name=L(s.name),G.sourceName=L(s.sourceName),y=G.Ti.mQt(),s=s.pivotTables&&s.pivotTables.pivotTable,s=Array.isArray(s)?s:[s],S.GC$.each(s,function(K,c){var N;c=U(c.name),(N=y.wQt(c))?G.pivotTables.push(N):(G.gQt||(G.gQt={}),G.gQt[c]=!0)})},Mt.prototype.yh=function(s,y,G){},Mt.prototype.dispose=function(){var s=this;ut.prototype.dispose.call(this),s.Ti=f.keyword_null,s.pivotCache=f.keyword_null,s.pivotTables=f.keyword_null},Yt(xt,Z=ft=Mt),xt.prototype.filterCleared=function(){for(var s=0;s<this.items.length;s++)if(this.items[s].selected===!1)return!1;return!0},xt.prototype.add=function(s,y){return y=new vt.PivotTableItemSlicer(y,s,this),this.IQt.push(y),y},xt.prototype.sortState=function(s){var y=this;if(arguments.length===0)return y.fQt;(0,X.ht)(s)||s===y.fQt||(y.fQt=s,y.refreshSlicers())},xt.prototype.showNoDataItems=function(s){var y=this;if(arguments.length===0)return y.hQt;(s=!!s)!==y.hQt&&(y.hQt=s,y.refreshSlicers())},xt.prototype.showNoDataItemsInLast=function(s){var y=this;if(arguments.length===0)return y.vQt;(s=!!s)!==y.vQt&&(y.vQt=s,y.refreshSlicers())},xt.prototype.visuallyNoDataItems=function(s){var y=this;if(arguments.length===0)return y.dQt;(s=!!s)!==y.dQt&&(y.dQt=s,y.refreshSlicers())},xt.prototype.initItems=function(){var s,y,G,K,c,N=this.pivotCache.getField(this.sourceName);for(G in Rt(N,this.pivotCache),s=[],y=N.DH(),N.sQt)N.sQt.hasOwnProperty(G)&&(K=N.sQt[G],c=y[parseInt(G,10)],N.W5!==0||isNaN(+c)||(c=+c),s[K]={text:c,selected:!0,noData:!0});return s},xt.prototype.buildItems=function(s){var y,G,K,c,N,V,O,pt,wt,et,ht,St,$,n;if((n=this).pivotTables.length===0)return this.items||this.initItems();for(et in s=(s||n.pivotTables[0]).dh,y=n.sourceName,G=(V=n.pivotCache).getField(y),K=_().blank,c=G.sf(),Rt(G,V),N=n.TQt(n.MQt()).NQt,O=(V=s.getFilterInfo(y))&&V.labelFilter&&V.labelFilter.textItem||{isAll:!0,list:f.keyword_undefined},pt=[],wt=G.DH(),c)c.hasOwnProperty(et)&&(ht=c[et],$=wt[St=parseInt(et,10)],G.W5!==0||isNaN(+$)||($=+$),pt[ht]={text:$,selected:O.isAll||!!O.list&&O.list.indexOf($)!==-1,noData:N[St]===f.keyword_undefined||$===K});return pt},xt.prototype.TQt=function(s){var y=this;return y.Ti.mQt().fMt.TQt(y.pivotCache.getName(),s,y.sourceName)},xt.prototype.MQt=function(){var s,y,G=(y=(s=this).pivotTables[0].dh).bit(),K=y.getAllFieldNameList(),c=[],N=y.Ti.getPivotCacheByName(y.L);return K.splice(K.indexOf(s.sourceName),1),(0,X.o)(G,function(V){var O,pt,wt=N.zRt(V.a),et=(0,X.ht)(wt.y1)?void 0:N.zRt(wt.y1);wt.Zc!==s.sourceName&&((pt=y.getFilterInfo(V.a))&&pt.u&&(y.q1=!0,pt.u=!1),(O=K.indexOf(V.a))!==-1&&K.splice(O,1),pt=(O=V.toPivotViewQueryField(pt,y.Z[V.Zc],wt,et,!0)).items,V=O.sourceName,wt=O.isALL,c.push({items:pt,sourceName:V,isALL:wt}))}),(0,X.o)(K,function(V){var O,pt,wt;(wt=y.getFilterInfo(V))&&wt.labelFilter&&wt.labelFilter.textItem&&wt.labelFilter.textItem.isAll===!1&&(O=N.zRt(V),pt=(0,X.ht)(O.y1)?void 0:N.zRt(O.y1),O=(wt=(0,H.toPivotViewQueryField)(V,V,-1,wt,f.keyword_undefined,-1,O,pt)).items,pt=wt.isALL,c.push({items:O,sourceName:V,isALL:pt}))}),c},xt.prototype.updateItems=function(s){this.items=this.buildItems(s)},xt.prototype.updateCache=function(s){var y,G,K,c;if((c=this).canUpdate()&&c.S_e()){if(c.updateItems(s),s)for(y=0,G=c.pivotTables;y<G.length;y++)(K=G[y])!==s&&c.setSingleFilter(K,s);c.refreshSlicers()}},xt.prototype.clearSelfFilter=function(){var s=this.items;(0,X.o)(s,function(y){y.selected=!0})},xt.prototype.setSingleFilter=function(s,y){var G,K,c,N;(N=this).canUpdate()&&(G=s.name(),N.T_e(G)||(c=N.items,K=[],(0,X.o)(c,function(V){K.push({status:V.selected,value:V.text})}),c=s.dh,N.suspendUpdate(),c.wVt({cmd:"filterFieldLabelValue",sheetName:"",cmdOption:{fieldName:N.sourceName,pivotName:G,slicerCacheName:N.name,dataOfListBox:K}}),N.A_e(G),N.resumeUpdate()))},xt.prototype.setFilter=function(s){var y,G,K,c,N;if((N=this).canUpdate()&&(s||!N.filterCleared())){for(s=s||N.items,y=[],(0,X.o)(s,function(V){y.push({status:V.selected,value:V.text})}),N.beforeSetFilter(),G=0;G<N.pivotTables.length;G++)c=(K=N.pivotTables[G]).name(),N.T_e(c)||(K.dh.wVt({cmd:"filterFieldLabelValue",sheetName:"",cmdOption:{fieldName:N.sourceName,pivotName:K.name(),slicerCacheName:N.name,dataOfListBox:y}}),N.A_e(c));N.afterSetFilter()}},xt.prototype.toJSON=function(){var s,y,G,K=this,c=Z.prototype.toJSON.call(this);return(G=K.pivotCache.getField(K.sourceName))&&(y=G.getFieldsItemList(),s=K.items.map(function(N){return{x:y.indexOf(N.text),s:N.selected,nd:N.noData}})),{name:c.name,sourceName:c.sourceName,pivotCacheId:c.pivotCacheId,pivotTables:c.pivotTables,items:s,sortOrder:K.fQt===S.SortState.descending?S.SortState.descending:S.SortState.ascending,showNoDataItems:K.hQt,showNoDataItemsInLast:K.vQt,visuallyNoDataItems:K.dQt}},xt.prototype.wh=function(s){var y,G,K,c,N,V,O,pt,wt=(O=this).items;if(s=(s==null?void 0:s.fileType)===S.OpenSaveFileType.excel,(pt=Z.prototype.wh.call(this)).data={tabular:{pivotCacheId:O.pivotCache.yQt+"",items:{count:wt.length,i:[]}}},O.fQt===S.SortState.descending&&(pt.data.tabular.sortOrder="descending"),O.dQt===!1?pt.data.tabular.crossFilter="none":O.vQt===!1&&(pt.data.tabular.crossFilter="showItemsWithNoData"),O.hQt===!1&&(s&&delete pt.data.tabular.crossFilter,pt.extLst={ext:[{r_:[33,44],slicerCacheHideItemsWithNoData:{}}]}),s=O.pivotCache.getField(O.sourceName)){for(y=s.getFieldsItemList(),O=pt.data.tabular.items.i,G=[],K=[],c=0;c<wt.length;c++)N=wt[c],V={x:y.indexOf(N.text)},N.selected&&(V.s="1"),(N.noData?(V.nd="1",K):G).push(V);O.push.apply(O,At(At([],G,!1),K,!1))}return pt},xt.prototype.fromJSON=function(s){var y,G,K=this;Z.prototype.fromJSON.call(this,s),Rt(y=this.pivotCache.getField(this.sourceName),K.pivotCache),s.items?(G=y.DH(),K.items=s.items.map(function(c){return{text:G[+c.x],selected:!!c.s,noData:!!c.nd}})):K.items=K.buildItems(),(0,X.ht)(s.sortOrder)||(K.fQt=s.sortOrder),(0,X.ht)(s.showNoDataItems)||(K.hQt=s.showNoDataItems),(0,X.ht)(s.showNoDataItemsInLast)||(K.vQt=s.showNoDataItemsInLast),(0,X.ht)(s.visuallyNoDataItems)||(K.dQt=s.visuallyNoDataItems)},xt.prototype.preFromSJSFormat=function(s){var y,G,K=this;Z.prototype.preFromSJSFormat.call(this,s),y=s.extLst&&s.extLst.ext,(0,X.ht)(y)||(G=!1,Array.isArray(y)?G=0<y.filter(function(c){return c.slicerCacheHideItemsWithNoData}).length:y.slicerCacheHideItemsWithNoData&&(G=!0),G&&(K.hQt=!1)),y=s.data.tabular,(0,X.ht)(y.sortOrder)||(K.fQt=y.sortOrder==="descending"?S.SortState.descending:S.SortState.ascending),(G=y.crossFilter)==="none"?K.dQt=!1:G==="showItemsWithNoData"&&(K.vQt=!1)},xt.prototype.yh=function(s,y,G){},xt.prototype.dispose=function(){Z.prototype.dispose.call(this),this.items=f.keyword_null},q=xt,J=[X.PivotDateFilterOperator.equalsTo,X.PivotDateFilterOperator.Between,X.PivotDateFilterOperator.tomorrow,X.PivotDateFilterOperator.today,X.PivotDateFilterOperator.yesterday,X.PivotDateFilterOperator.nextWeek,X.PivotDateFilterOperator.thisWeek,X.PivotDateFilterOperator.lastWeek,X.PivotDateFilterOperator.nextMonth,X.PivotDateFilterOperator.thisMonth,X.PivotDateFilterOperator.lastMonth,X.PivotDateFilterOperator.nextQuarter,X.PivotDateFilterOperator.thisQuarter,X.PivotDateFilterOperator.lastQuarter,X.PivotDateFilterOperator.nextYear,X.PivotDateFilterOperator.thisYear,X.PivotDateFilterOperator.lastYear,X.PivotDateFilterOperator.yearToDate,X.PivotDateFilterOperator.dateToDate],P=[X.PivotDateFilterOperator.before,X.PivotDateFilterOperator.beforeEqualsTo,X.PivotDateFilterOperator.after,X.PivotDateFilterOperator.afterEqualsTo,X.PivotDateFilterOperator.Between,X.PivotDateFilterOperator.notBetween],Yt(dt,gt=ft),Object.defineProperty(dt.prototype,"canShowRange",{get:function(){return(0,X.ht)(this.filterType)||this.isValidFilterType},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"isValidFilterType",{get:function(){var s=this.filterType,y=this.getFilterCondition();return J.indexOf(s)!==-1&&(s!==X.PivotDateFilterOperator.dateToDate||!y.EVt)},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"filterType",{get:function(){var s;return(s=this).pivotTables.length===0&&s.selection?X.PivotDateFilterOperator.Between:(s=s.getFilterCondition())&&s.LVt},enumerable:!1,configurable:!0}),dt.prototype.getFilterCondition=function(s){var y;return(y=this).pivotTables.length!==0&&(y=(s=(s||y.pivotTables[0]).dh.getFilterInfo(y.sourceName))&&s.labelFilter&&s.labelFilter.condition)&&y.sn===X.PivotConditionType.date?y:f.keyword_undefined},dt.prototype.filterCleared=function(){var s=this;return!(!(0,X.ht)(s.filterType)&&!s.isValidFilterType||s.selection&&(s.selection.startDate!==s.bounds.startDate||s.selection.endDate!==s.bounds.endDate))},dt.prototype.buildBounds=function(){var s=this.pivotCache.getField(this.sourceName);return{startDate:s.T,endDate:s.gd}},dt.prototype.buildSelections=function(s){var y,G,K,c,N,V,O;if(!(O=this).isValidFilterType)return f.keyword_undefined;if(O.pivotTables.length===0)return this.selection||this.bounds||this.buildBounds();if(!(y=O.getFilterCondition(s)))return f.keyword_undefined;switch(G=y.xQt,O=new Date,K=(0,X.DQt)(O),c=(0,X.DQt)(O),N=(0,X.SQt)(G,y.eX),V=(0,B.getQuarter)(K),y.LVt){case X.PivotDateFilterOperator.equalsTo:K=new Date(N),c=new Date(N);break;case X.PivotDateFilterOperator.dateToDate:case X.PivotDateFilterOperator.Between:K=new Date(N),c=new Date((0,X.SQt)(G,y.iX));break;case X.PivotDateFilterOperator.tomorrow:K.setDate(K.getDate()+1),c.setDate(c.getDate()+1);break;case X.PivotDateFilterOperator.today:break;case X.PivotDateFilterOperator.yesterday:K.setDate(K.getDate()-1),c.setDate(c.getDate()-1);break;case X.PivotDateFilterOperator.nextWeek:K.setDate(K.getDate()-K.getDay()+7),c.setDate(c.getDate()-c.getDay()+14);break;case X.PivotDateFilterOperator.thisWeek:K.setDate(K.getDate()-K.getDay()),c.setDate(c.getDate()-c.getDay()+6);break;case X.PivotDateFilterOperator.lastWeek:K.setDate(K.getDate()-K.getDay()-7),c.setDate(c.getDate()-c.getDay());break;case X.PivotDateFilterOperator.nextMonth:K.setDate(1),K.setMonth(K.getMonth()+1),c.setMonth(c.getMonth()+1),c.setDate((0,B.getLastDateOfMonth)(c));break;case X.PivotDateFilterOperator.thisMonth:K.setDate(1),c.setDate((0,B.getLastDateOfMonth)(c));break;case X.PivotDateFilterOperator.lastMonth:K.setDate(1),K.setMonth(K.getMonth()-1),c.setMonth(c.getMonth()-1),c.setDate((0,B.getLastDateOfMonth)(c));break;case X.PivotDateFilterOperator.nextQuarter:K.setDate(1),K.setMonth(3*V),c.setMonth(3*(V+1)-1),c.setDate((0,B.getLastDateOfMonth)(c));break;case X.PivotDateFilterOperator.thisQuarter:K.setDate(1),K.setMonth(3*(V-1)),c.setMonth(3*V-1),c.setDate((0,B.getLastDateOfMonth)(c));break;case X.PivotDateFilterOperator.lastQuarter:K.setDate(1),K.setMonth(3*(V-2)),c.setMonth(3*(V-1)-1),c.setDate((0,B.getLastDateOfMonth)(c));break;case X.PivotDateFilterOperator.nextYear:K.setDate(1),K.setMonth(0),K.setFullYear(K.getFullYear()+1),c.setFullYear(c.getFullYear()+1),c.setMonth(11),c.setDate(31);break;case X.PivotDateFilterOperator.thisYear:K.setDate(1),K.setMonth(0),c.setMonth(11),c.setDate(31);break;case X.PivotDateFilterOperator.lastYear:K.setDate(1),K.setMonth(0),K.setFullYear(K.getFullYear()-1),c.setFullYear(c.getFullYear()-1),c.setMonth(11),c.setDate(31);break;case X.PivotDateFilterOperator.yearToDate:K.setDate(1),K.setMonth(0)}return{startDate:K,endDate:c}},dt.prototype.updateCache=function(s){var y,G,K,c;if((c=this).pivotTables.length!==0&&c.canUpdate()&&c.S_e()){if(c.bounds=c.buildBounds(),c.selection=c.buildSelections(s),s)for(y=0,G=c.pivotTables;y<G.length;y++)(K=G[y])!==s&&c.setSingleFilter(K,s);c.refreshSlicers()}},dt.prototype.clearSelfFilter=function(){this.selection=f.keyword_null},dt.prototype.setSingleFilter=function(s,y){var G,K,c,N;(N=this).canUpdate()&&(G=s.name(),N.T_e(G)||(K=s.dh,y?(y=y.labelFilter(N.sourceName),(c=s.labelFilter(N.sourceName)||{}).condition=y==null?void 0:y.condition,c.condition||c.textItem||c.conditionByName||(c=f.keyword_null),N.suspendUpdate(),K.wVt({cmd:"doPivotTableFilter",sheetName:"",cmdOption:{labelFilter:c,fieldName:N.sourceName,pivotName:G,slicerCacheName:N.name}}),N.A_e(G),N.resumeUpdate()):N.filterCleared()||(c=(y=N.selection).startDate,y=y.endDate,N.suspendUpdate(),K.wVt({cmd:"dialogForDateFilter",sheetName:"",cmdOption:{fieldName:N.sourceName,pivotName:s.name(),slicerCacheName:N.name,command:"6",isWholeDay:!0,value1:c,value2:y}}),N.A_e(G),N.resumeUpdate())))},dt.prototype.setFilter=function(s){var y,G,K,c,N,V;if((V=this).canUpdate()&&(s||!V.filterCleared())){for(s&&(V.selection=s),y=(s=V.selection).startDate,G=s.endDate,V.beforeSetFilter(),K=0;K<V.pivotTables.length;K++)N=(c=V.pivotTables[K]).name(),V.T_e(N)||(c.dh.wVt({cmd:"dialogForDateFilter",sheetName:"",cmdOption:{fieldName:V.sourceName,pivotName:c.name(),slicerCacheName:V.name,command:"6",isWholeDay:!0,value1:y,value2:G}}),V.A_e(N));V.afterSetFilter()}},dt.prototype.add=function(s,y){return y=new mt.PivotTableTimelineSlicer(y,s,this),this.IQt.push(y),y},dt.prototype.toJSON=function(){var s,y=this;return{name:(s=gt.prototype.toJSON.call(this)).name,sourceName:s.sourceName,pivotCacheId:s.pivotCacheId,pivotTables:s.pivotTables,selectionStartDate:y.selection&&y.selection.startDate.toString(),selectionEndDate:y.selection&&y.selection.endDate.toString(),boundsStartDate:y.bounds.startDate.toString(),boundsEndDate:y.bounds.endDate.toString(),filterType:y.filterType,filterCondition:(s=y.getFilterCondition())==null?void 0:s.toJSON()}},dt.prototype.wh=function(s){var y=this,G=gt.prototype.wh.call(this),K=y.selection,c=y.bounds,N=y.filterType,V=(0,X.ht)(N),O=H.Caption_Compare_Type_Excel[1][N],pt=y.isValidFilterType,wt=G.state={minimalRefreshVersion:"6",lastRefreshVersion:"6",pivotCacheId:y.pivotCache.yQt+""};return V||pt||(wt.singleRangeFilterState="0"),wt.filterType=V||!O?"unknown":O,pt&&K&&(wt.selection={startDate:(0,X.kQt)(K.startDate),endDate:(0,X.kQt)(K.endDate)}),c&&(V=new Date("1900/01/01"),K=new Date("1900/01/01"),V.setFullYear(c.startDate.getFullYear()),K.setFullYear(c.endDate.getFullYear()+1),wt.bounds={startDate:(0,X.kQt)(V),endDate:(0,X.kQt)(K)}),(c=y.getFilterCondition())&&(wt=Xt(c,O),V=P.indexOf(N)!==-1,K="0",wt&&!(0,X.ht)(wt.isWholeDay)&&(K=wt.isWholeDay?"1":"0"),y={useWholeDay:K=V?"1":K,fld:"1",id:"1",autoFilter:{ref:"A1",filterColumn:{r_:[43],colId:"0"}}},pt&&wt?(wt.filterType===2&&(y.autoFilter.filterColumn.dynamicFilter=(0,tt.writePivotDynamicFilter)(wt)),G.timelinePivotFilter=y):V&&(y.autoFilter.filterColumn.customFilters=function(et,ht){var St,$,n,a,i,h;if(!(0,X.ht)(et.filter1)||!(0,X.ht)(et.filter2))return St={},et.and&&(St.and="1"),$=et.filter1,et=et.filter2,a=!(0,X.ht)($),i=!(0,X.ht)(et),a&&(h=(h=ht[$.operator])!=="none"?{operator:h,val:$.value}:{val:$.value}),i&&(n=(ht=ht[$.operator])!=="none"?{operator:ht,val:et.value}:{val:et.value}),a&&i?St.customFilter=[h,n]:a?St.customFilter=h:i&&(St.customFilter=n),St}(wt,tt.PivotComparisonOperators),G.timelinePivotFilter=y)),G},dt.prototype.fromJSON=function(s){gt.prototype.fromJSON.call(this,s),s.selectionStartDate&&s.selectionEndDate&&(this.selection={startDate:new Date(s.selectionStartDate),endDate:new Date(s.selectionEndDate)}),this.bounds={startDate:new Date(s.boundsStartDate),endDate:new Date(s.boundsEndDate)}},dt.prototype.preFromSJSFormat=function(s){var y;gt.prototype.preFromSJSFormat.call(this,s),(s=s.state)&&(y=s.selection,s=s.bounds,y&&y.startDate&&y.endDate&&(this.selection={startDate:new Date(y.startDate),endDate:new Date(y.endDate)}),s)&&s.startDate&&s.endDate&&(this.bounds={startDate:new Date(s.startDate),endDate:new Date(s.endDate)})},dt.prototype.yh=function(s,y,G){},dt.prototype.dispose=function(){gt.prototype.dispose.call(this)},bt=dt,Qt.prototype.jQt=function(s){var y,G,K=this.vpt;if(this.get(s)||K.getCustomName(s))return!1;for(y=K.sheets,G=0;G<y.length;G++)if(y[G].getCustomName(s))return!1;return!0},Qt.prototype.OQt=function(s,y){var G,K=s+function(c){return c.replace(/[^A-Za-z0-9_\.\\\?\u0080-\uFFFF]+$/g,"").replace(/[^A-Za-z0-9_\.\\\?\u0080-\uFFFF]+/g,"_")}(y);if(this.jQt(K))return K;for(G=1;!this.jQt(K+G);)G+=1;return K+G},Qt.prototype.mQt=function(){return this.vpt},Qt.prototype.PQt=function(s,y,G){var K=[];return(0,X.o)(this.cQt,function(c){c.pivotCache.getName()!==s||y&&c.slicerCacheType!==y||G&&c.sourceName!==G||K.push(c)}),K},Qt.prototype.getPTConnectedSlicers=function(s){var y=[];return(0,X.o)(this.cQt,function(G){for(var K=0;K<G.pivotTables.length;K++)G.pivotTables[K]===s&&(y=y.concat(G.IQt))}),y},Qt.prototype.getExistedSlicerCache=function(s,y,G){var K=f.keyword_null;return(0,X.o)(this.cQt,function(c){if(c.sourceName===y&&c.slicerCacheType===G){for(var N=0;N<c.pivotTables.length;N++)if(c.pivotTables[N]===s)return K=c,!0}}),K},Qt.prototype.CQt=function(s,y){s.pivotTables=s.pivotTables.concat(y.pivotTables),(0,X.o)(y.IQt,function(G){s.IQt.push(G),G.FQt=s}),y.pivotTables=[],y.IQt=[],this.remove(y.name),s.setFilter()},Qt.prototype.get=function(s){for(var y,G=0;G<this.cQt.length;G++)if((y=this.cQt[G]).name===s)return y;return f.keyword_undefined},Qt.prototype.add=function(s,y,G){var K,c;return G===void 0&&(G=ot.pivotSlicer),c=this,K=s.dh.L,(K=s.dh.Ti.getPivotCacheByName(K))&&(c=c.getExistedSlicerCache(s,y,G)||c._Qt(K.yQt,y,G))?(c.connect(s,!0),c.pivotTables.length===1&&c.updateCache(),c):f.keyword_undefined},Qt.prototype._Qt=function(s,y,G){var K;return G===void 0&&(G=ot.pivotSlicer),(s=(K=this).mQt().fMt.getPivotCacheByPivotCacheId(+s))&&s.getField(y)?(G=G===ot.pivotSlicer?new q(K,s,y,K.OQt("Slicer_",y)):new bt(K,s,y,K.OQt("NativeTimeline_",y)),K.WB(G),G):f.keyword_undefined},Qt.prototype.WB=function(s){this.cQt.push(s)},Qt.prototype.remove=function(s){for(var y,G=this,K=0;K<G.cQt.length;K++)if((y=G.cQt[K]).name===s){y.dispose(),G.cQt.splice(K,1);break}},Qt.prototype.getSlicer=function(s){var y;return(0,X.o)(this.cQt,function(G){if(G=G.get(s))return y=G,!0}),y},Qt.prototype.getAllSlicers=function(s){var y=[];return(0,X.o)(this.cQt,function(G){(0,X.o)(G.IQt,function(K){!(0,X.ht)(s)&&K.sheet().name()!==s||y.push(K)})}),y},Qt.prototype.removeSlicer=function(s){var y,G=this;return(0,X.o)(G.cQt,function(K){var c=K.get(s);if(c)return(y={}).slicerJSON=c.toJSON(),K.remove(s),K.IQt.length===0&&(y.cacheJSON=K.toJSON(),G.remove(K.name)),!0}),y},Qt.prototype.undoAddingPivotTable=function(s){for(var y,G,K=this.cQt,c=0;c<K.length;c++)(G=(y=K[c]).pivotTables.indexOf(s))!==-1&&(this.lQt.push({cacheName:y.name,ptName:s.name()}),y.pivotTables.splice(G,1))},Qt.prototype.undoRemovingPivotTable=function(s){for(var y,G=this.lQt,K=s.name(),c=G.length-1;-1<c;c--)(y=G[c]).ptName===K&&((y=this.get(y.cacheName)).pivotTables.indexOf(s)===-1&&y.pivotTables.push(s),G.splice(c,1))},Qt.prototype.onWorksheetDisposing=function(s){for(var y,G,K=(G=this.cQt).length-1;-1<K;K--)(y=G[K]).onWorkSheetDisposing(s),y.IQt.length===0&&this.remove(y.name)},Qt.prototype.updateSlicerCaches=function(s,y){for(var G,K,c=(K=this.cQt).length-1;0<=c;c--)(G=K[c]).pivotCache.getAllFieldsNames().indexOf(G.sourceName)===-1?this.remove(G.name):s&&!G.isConnectedPivotTable(s.name())||G.updateCache(y?s:f.keyword_undefined)},Qt.prototype.changeSlicerPivotCaches=function(s,y){for(var G,K=this.cQt,c=0;c<K.length;c++)(G=K[c]).pivotCache.getName()===s&&(G.pivotCache=y)},Qt.prototype.LQt=function(s){var y,G;s===void 0&&(s=!1),G=[],(0,X.o)((y=this).cQt,function(K){K.bQt(s)||G.push(K.name)}),G.forEach(function(K){y.remove(K)})},Qt.prototype.C_e=function(){this.M_e?this.x_e+=1:(this.M_e={},this.x_e=0)},Qt.prototype.N_e=function(){--this.x_e,this.x_e<=0&&delete this.M_e},Qt.prototype.I_e=function(s,y){var G=this.M_e;G&&(G[s]||(G[s]={}),G[s][y]=!0)},Qt.prototype.T_e=function(s,y){var G=this.M_e;return!(!G||!G[s]||!G[s][y])},Qt.prototype.toJSON=function(){var s=[];return(0,X.o)(this.cQt,function(y){s.push(y.toJSON())}),s},Qt.prototype.fromJSON=function(s){var y=this;0<s.length&&((0,X.o)(this.cQt,function(G){G.dispose()}),y.cQt=[],y.lQt=[],(0,X.o)(s,function(G){var K=(0,X.ht)(G.boundsStartDate)?ot.pivotSlicer:ot.pivotTimeline;(K=y._Qt(G.pivotCacheId,G.sourceName,K))&&K.fromJSON(G)}))},Qt.prototype.preFromSJSFormat=function(s,y,G){var K,c,N,V,O,pt,wt,et,ht,St,$,n,a;if((a=this).cQt.forEach(function(i){i.dispose()}),a.cQt=[],K=s.slicerCaches,S.GC$.each(K,function(i,h){var b;(h=h.slicerCacheDefinition).pivotTables&&(b=Ct(h),b=a._Qt(b,L(h.sourceName),ot.pivotSlicer))&&b.preFromSJSFormat(h)}),K=s.timelineCaches,S.GC$.each(K,function(i,h){var b=Ct(h=h.timelineCacheDefinition,!0);(b=a._Qt(b,L(h.sourceName),ot.pivotTimeline))&&b.preFromSJSFormat(h)}),!G||G.includeStyles!==!1){if(G=(K=s.styles).extLst,c=S.NodeHelper.cr(K.tableStyles&&K.tableStyles.c_),s="TimeSlicerStyleLight1",G){if(N=G.x15dxfsRecords,V=G.timelineStylesNode,n=G.timelineStyleNodes,O=G.timelineSharedColors,G=G.timelineCommonSharedStrings,!V&&!n)return;for(wt=pt=void 0,V?(pt=!0,wt=S.NodeHelper.cr(V.timelineStyle),V.kSt&&V.kSt.defaultTimelineStyle&&(s=V.kSt.defaultTimelineStyle)):(pt=!1,wt=n,O=new S.SimpleSharedStrings(O),G=new S.SimpleSharedStrings(G)),et=y.styleManager,(ht=new S.SharedDxfs(O,G)).rv(N),a.vpt.customTimelineThemes.xur=[],St=function(i){var h,b,Q;if(!(i=wt[i]))return"continue";h=pt?i.kSt&&i.kSt.name:i.name,i=pt?S.NodeHelper.cr(S.NodeHelper.lr(i,"timelineStyleElements.timelineStyleElement")):i.styleElements,b=void 0,c&&(b=(Q=c.filter(function(it){return it.name===h})[0])&&S.NodeHelper.cr(S.NodeHelper.lr(Q,"c_"))),new at.TimelineStyle().yh(h,et,ht,i,b)},$=0;$<wt.length;$++)St($);a.vpt.customTimelineThemes.xur=Object.values(et.L1i||{})}(V=K==null?void 0:K.defaultStyleNames)!=null&&V.defaultTimelineStyle&&(s=K.defaultStyleNames.defaultTimelineStyle),y.styleManager.addDefaultStyleName("defaultTimelineStyle",s),a.vpt.customTimelineThemes&&a.vpt.defaultTimelineTheme&&(n=a.vpt.customTimelineThemes.get(s)?s:s.replace(/^TimeSlicerStyle/,""),a.vpt.defaultTimelineTheme(n))}},Qt.prototype.yh=function(s,y,G,K){var c,N,V,O,pt=!!K,wt=(O=this).mQt(),et=s.slicers,ht=s.timelines,St=s.drawings,$=s.styleManager,n=E(wt,K);if(pt)A(O,n,et,K.name(),St,s,$,y,at.SlicerType.pivotTable),A(O,n,ht,K.name(),St,s,$,y,at.SlicerType.pivotTimeline);else for(c=0,N=Object.keys(n);c<N.length;c++)V=N[c],A(O,n,et,V,St,s,$,y,at.SlicerType.pivotTable),A(O,n,ht,V,St,s,$,y,at.SlicerType.pivotTimeline)},Qt.prototype.dispose=function(){(0,X.o)(this.cQt,function(s){s.dispose()}),this.lQt=f.keyword_null,this.cQt=f.keyword_null,this.vpt=f.keyword_null},k=Qt,S.Workbook.ch("SlicerCaches",{init:function(){this.EQt=new k(this)},dispose:function(){var s=this;s.EQt&&(s.EQt.dispose(),s.EQt=f.keyword_undefined)},preFromJson:function(s,y,G){var K=this;K.EQt.dispose(),K.EQt=new k(K),s.slicerCaches&&s.slicerCaches.length!==0&&(K.EQt.fromJSON(s.slicerCaches),K.slr=!0)},fromJson:function(s,y,G){s.slicerCaches&&s.slicerCaches.length!==0&&(this.EQt.LQt(!1),this.EQt.updateSlicerCaches())},preFromSJSFormat:function(s,y,G){var K=this;K.EQt.dispose(),K.EQt=new o.PivotSlicerCacheManager(K),(s.slicerCaches&&0<Object.keys(s.slicerCaches).length||s.timelineCaches&&0<Object.keys(s.timelineCaches).length)&&K.EQt.preFromSJSFormat(s,y,G)},yh:function(s,y,G){(s.slicerCaches&&0<Object.keys(s.slicerCaches).length||s.timelineCaches&&0<Object.keys(s.timelineCaches).length)&&(S.Util.wo(G,this.v2)?function(K,c,N){for(var V=0,O=K.sheets;V<O.length;V++)D(O[V],c,N)}(this,S.util.xr(s.workbook,"sheets").c_,y):M(this.EQt,y,G))},toJson:function(s,y){var G;(G=this.EQt.toJSON())&&0<G.length&&(s.slicerCaches=G)},wh:function(s,y,G){var K,c,N,V,O,pt=this;if(y=y.styleManager,(O=pt.EQt)&&(!G||G.includeStyles!==!1)&&(c=K=!1,N=O.cQt)&&0<N.length){for(V=0;V<N.length&&(N[V].slicerCacheType===ot.pivotSlicer&&(K=!0),N[V].slicerCacheType===ot.pivotTimeline&&(c=!0),!K||!c);V++);K&&at.fdi(s,N,st,G),c&&function(wt,et,ht){var St,$,n,a,i,h,b,Q,it=0;for((Q=wt.timelineCaches)?it=Object.keys(Q).length:Q=wt.timelineCaches={},St=[],$=wt.workbook.rels,n=0,a=et;n<a.length;n++)(i=a[n]).slicerCacheType===at.SlicerCacheType.pivotTimeline&&(h=it+=1,b=v($),$.c_.push({n_:"Relationship",Id:b="rId"+b,Type:S.RelationshipConstants.kc,Target:Ft("timelineCaches/timelineCache"+h)}),Q[S.XFileConstants.pu+h]={timelineCacheDefinition:i.wh(ht)},St.push(b));l(wt,St)}(s,N,G),K&&(s.slicers||(s.slicers={}),at.cdi(s,N,pt.sheets,y,"pivot",ot.pivotSlicer)),c&&(s.timelines||(s.timelines={}),function(wt,et,ht,St){for(var $,n,a,i,h,b,Q,it,It,t,r=wt.timelines,u=Object.keys(r).length,d=[],m=0,R=ht;m<R.length;m++)if(0<(n=($=R[m]).slicers.all().filter(function(z){return z.ma==="timeline"})).length)for(a=r[S.XFileConstants.gu+(u+=1)]={timelines:{r_:[60,14,30,43],timeline:[]}},wt.drawings||(wt.drawings={}),i=0,h=n;i<h.length;i++)b=h[i],Q=I(wt,w(wt,$.name())).c_,b.wh(a.timelines.timeline,Q,St),b.style()&&!b.getStyleName()&&((Q=new at.TimelineStyle).fromJSON(b.style().toJSON()),Q.name(b.efr()),d.push(Q),Q.wh(!0,!1,St));(t=ht&&0<ht.length?ht[0].getParent():void 0)&&(it=t.customTimelineThemes.all())&&it.forEach(function(z){d.push(z),z.wh(!0,!1,St)}),it="TimeSlicerStyle",It=(t.defaultTimelineTheme()||at.TimelineStyles.light1()).name()||"",t=t.customTimelineThemes.isBuildInStyle(It)&&!It.toUpperCase().startsWith(it.toUpperCase()),St.addDefaultStyleName("defaultTimelineStyle",t?"".concat(it).concat(It):It),at.adi(wt,et,at.SlicerCacheType.pivotTimeline),T(0,wt,d)}(s,N,pt.sheets,y)),(K||c)&&function(wt){S.util.xr(wt.workbook,S.XFileConstants.Au).c_.push({n_:"ext",r_:[57,58],c_:[{n_:"x14:workbookPr",c_:[{}]}]},{n_:"ext",r_:[59,32],c_:[{n_:"x15:workbookPr",chartTrackingRefBase:"1"}]})}(s)}}}),S.Worksheet.ch("SlicerCaches",{priority:1800,yh:function(s,y,G){var K=this.parent;G&&S.Util.wo(G,K.v2)&&M(K.EQt,y,G,this)},afterRefSheetLazyLoaded:function(s,y,G){G&&S.Util.wo(G,this.parent.v2)&&(0<this.pivotTables.all().length||0<this.slicers.all().length)&&M(this.parent.EQt,y,G,this)},dispose:function(s){var y=this.parent;s.clearCache!==!1&&y&&!y.slr&&y.EQt.onWorksheetDisposing(this.name())}}),S.GC$.extend(S.Workbook.prototype,{getSameSourcePivotTablesBySlicer:function(s){var y,G,K,c=this,N=(s=s.FQt,c.EQt.PQt(s.pivotCache.getName(),s.slicerCacheType,s.sourceName)),V=s.pivotCache.Zc,O={},pt=[],wt="__NO__CACHE__";for((0,X.o)(N,function(et){0<et.pivotTables.length&&(O[et.name]=et.pivotTables.map(function(ht){return{ptName:ht.name(),sheetName:ht.getHost().name()}}),pt=pt.concat(et.pivotTables.map(function(ht){return ht.dh.getName()})))}),y=0,G=Object.keys(c.BQt);y<G.length;y++)K=G[y],pt.indexOf(K)===-1&&(K=c.BQt[K]).L===V&&(O[wt]||(O[wt]=[]),K=(0,f.getPivotTableByFieldsModel)(K),O[wt].push({ptName:K.name(),sheetName:K.getHost().name()}));return O},getSameSourceSlicersByPivotTable:function(s){var y=this,G=(s=s.dh.Ti.getPivotCacheByName(s.dh.L),y=y.EQt.PQt(s.getName()),{});return(0,X.o)(y,function(K){0<K.IQt.length&&(G[K.name]=K.IQt.slice())}),G}}),o.PivotItemSlicerCache=q,o.PivotTimelineSlicerCache=bt,o.PivotSlicerCacheManager=k)},"./dist/plugins/pivot/pivot-filter-diagram/slicer-base/pivot-slicer-shape.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B;function vt(tt,_,v,Ft,w,I,U){var g;return(_=f.call(this,tt,_,void 0,Ft,w,I,U)||this).rDe="Timeline: Works in Excel 2013 or higher. Do not move or resize.",_.ma=At.SlicerType.pivotTimeline,(g=_).ytV=new o.TimelineShapeData(tt,g.ytV.Name,"pivotTimeline",Ft||0,w||0,I||200,U||160),v&&g.tnV(),_}function mt(){return B!==null&&B.apply(this,arguments)||this}X=this&&this.__extends||(H=function(tt,_){return(H=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(v,Ft){v.__proto__=Ft}:function(v,Ft){for(var w in Ft)Object.prototype.hasOwnProperty.call(Ft,w)&&(v[w]=Ft[w])}))(tt,_)},function(tt,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function v(){this.constructor=tt}H(tt,_),tt.prototype=_===null?Object.create(_):(v.prototype=_.prototype,new v)}),Object.defineProperty(o,"__esModule",{value:!0}),o.TimelineShape=o.TimelineShapeData=void 0,Yt=ft("Shapes"),At=ft("Slicers"),Yt&&At&&(ft=At.SlicerShapeDataBase,S=At.SlicerShapeBase,at=At.encodeSlicerDrawingName,X(mt,B=ft),mt.prototype.ToSJSCT_ShapeBase=function(tt){var _,v;return(v={}).nvGraphicFramePr=(_=this).ToSJSCT_GraphicFrameNonVisual(),v.xfrm=_.ToSJSCT_Transform2D(),v.graphic={graphicData:{uri:"http://schemas.microsoft.com/office/drawing/2012/timeslicer",timeslicer:{r_:[36],name:at(_.Name)}}},v.nvGraphicFramePr.cNvPr.extLst={ext:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",creationId:{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{729A7851-DBA1-4F10-BB7B-BEC1E3EEDA64}"}}},v},mt.prototype.ToCT_ShapeBase=function(){var tt=this.ToCT_GraphicFrameNonVisual(),_=this.ToCT_Transform2D();return{shapeType:Yt.CT_ShapeType.CT_SlicerShape,nvGraphicFramePr:tt,xfrm:_,graphic:{graphicData:{timeslicer:{}}}}},ft=mt,X(vt,f=S),vt.prototype.XiV=function(tt,_,v,Ft,w,I){f.prototype.XiV.call(this,tt,_,v,Ft,w),tt.AlternateContent.Choice.r_=[36,37]},vt.prototype.WiV=function(tt){return new vt(tt,At.s1i(tt.parent,this.name()))},X=vt,o.TimelineShapeData=ft,o.TimelineShape=X)},"./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U;function g(L,q){return L.EQt.getSlicer(q)}function F(L){for(var q,J=0;J<L.z.length;J++)if((q=L.z[J])instanceof B.PivotTable)return q;return o.keyword_null}function ot(L,q){(L=F(L))&&L.Ti&&L.Ti.parent&&L.Ti.parent.EQt.updateSlicerCaches(L,q)}function j(L){return L&&(L.ma===X.SlicerType.pivotTable||L.ma===X.SlicerType.pivotTimeline)}function E(L){return L&&L.graphic.graphicData.timeslicer}function A(L,q){return(q=q.BQt[L])?F(q):o.keyword_null}function Y(L,q,J){return(L=U.call(this,L,q,J)||this).captionName(L.sourceName(),!1),L}Yt=this&&this.__extends||(I=function(L,q){return(I=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(J,P){J.__proto__=P}:function(J,P){for(var bt in P)Object.prototype.hasOwnProperty.call(P,bt)&&(J[bt]=P[bt])}))(L,q)},function(L,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");function J(){this.constructor=L}I(L,q),L.prototype=q===null?Object.create(q):(J.prototype=q.prototype,new J)}),Object.defineProperty(o,"__esModule",{value:!0}),o.VQt=o.getPivotTableByPTName=o.getPivotTableByFieldsModel=o.PivotSlicer=o.NAME=o.keyword_undefined=o.keyword_null=void 0,At=ft("Core"),S=ft("Pivot"),at=ft("Shapes"),X=ft("Slicers"),H=ft("./dist/plugins/pivot/pivot-core/pivot-fields-model.js"),f=ft("./dist/plugins/pivot/pivot-table-entry.js"),B=ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),vt=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/pivot-slicer-shape.js"),o.keyword_null=null,o.keyword_undefined=void 0,o.NAME="name",o.PivotSlicer="PivotSlicer",o.getPivotTableByFieldsModel=F,o.getPivotTableByPTName=A,X&&at&&(mt=at.CT_ShapeType,tt=X.SlicerType,_=X.SlicerCacheType,v=X.ItemSlicerCacheProperties,Ft=X.s1i,w=X.decodeSlicerName,X.SlicerShapeBase.ch(o.PivotSlicer,{fireEvents:function(L){var q=L.sheet,J=L.sheetName,P=L.propertyName,bt=L.shape,k=q.slicers.all();(0,S.o)(k,function(nt){if(j(nt)){var gt=nt.GQt;if(gt&&gt.RQt===bt&&gt.RQt[P])return L.stopThisFire=!0,nt.ki({sheet:q,sheetName:J,slicer:nt,propertyName:P}),!0}})},createSlicerWhenShapePasting:function(L){var q,J,P,bt,k=L.toSheetName,nt=L.slicerJSON,gt=L.slicerCacheName,Z=L.cacheJSON,ut=L.slicerName,Rt=L.isCut;L=L.isCopy,nt.type!==tt.pivotTable&&nt.type!==tt.pivotTimeline||(k=(q=this.Mf.parent).getSheetFromName(k),!(gt=(J=q.EQt).get(gt))&&Z&&(P=nt.type===tt.pivotTable?_.pivotSlicer:_.pivotTimeline,(gt=J._Qt(Z.pivotCacheId,Z.sourceName,P)).fromJSON(Z)),bt=gt.add(k,this.name()),X.SlicerBaseProperties.forEach(function(Ct){Ct=Ct[0],nt[Ct]!==void 0&&bt[Ct](nt[Ct])}),j(bt)&&(bt.ma===tt.pivotTable?X.ItemSlicerProperties:f.PivotTimelineSlicerProperties).forEach(function(Ct){Ct=Ct[0],nt[Ct]!==o.keyword_undefined&&bt[Ct](nt[Ct])}),typeof nt.style=="string"?bt.style(nt.style):bt.style().fromJSON(nt.style),bt.oDe=this,bt.init(),Rt&&bt.name(ut),L&&bt.name(Ft(q,ut)),bt.oDe=null,k.slicers.WB(bt),k.$Dr({type:"addSlicer",slicer:bt}))},createChildShape:function(L){var q=L.shapeData;q instanceof vt.TimelineShapeData&&(L.shape=new vt.TimelineShape(L.sheet,q.Name,!1))}}),At.Worksheet.ch(o.PivotSlicer,{slicerAdding:function(L){var q,J,P,bt,k,nt,gt,Z,ut=this;if((L.type===tt.pivotTable||L.type===tt.pivotTimeline)&&(q=ut.parent&&ut.parent.EQt)){if(J=L.type===tt.pivotTable?_.pivotSlicer:_.pivotTimeline,P=L.slicerName,gt=L.targetName,bt=L.itemName,k=L.sheet,Z=L.slicerCacheName)nt=q.get(Z);else{if(!(Z=ut.parent.wQt(gt)))return;if(!(gt=(ut=Z.dh).getSourceNameByFieldName(bt))){if(ut.getAllFieldNameList().indexOf(bt)===-1)return;gt=bt}nt=q.add(Z,gt,J)}(ut=nt.add(k,P)).init(),L.slicer=ut}},slicerRemoved:function(L){var q,J;if(J=g(q=this.parent,L=L.slicer.name())){if(J.isSelected(!1),q=q.EQt.removeSlicer(L),J.GQt){if(J.GQt.UQt)return;J.GQt.UQt=!0}this.Ut.n1i(J,"undoRemove",q)}},slicerRenamed:function(L){var q=L.newName;j(L=L.slicer)&&L.name(q)},getAllSlicers:function(L){var q=L.slicers,J=L.targetName,P=L.itemName;this.slicers&&At.GC$.each(this.slicers.z1i,function(bt,k){var nt,gt,Z;if(j(k))if(J){if((nt=k.getAllConnectedPivotTables())&&0<nt.length){for(gt=0;gt<nt.length;gt++)if((Z=nt[gt]).name()===J&&(!P||Z.getField(k.sourceName()).fieldName===P)){q.push(k);break}}}else q.push(k)})},slicerFromJson:function(L){var q,J,P,bt,k,nt,gt,Z,ut,Rt=L.slicerJSON,Ct=L.cacheJSON;if((Rt.type===tt.pivotTable||Rt.type===tt.pivotTimeline)&&this.parent&&(q=Rt.pivotName,J=Rt.sourceName,P=Rt.slicerCacheName,L=L.sheetName,bt=this.parent)&&(k=bt.getSheetFromName(L))){if(L=bt.EQt,(0,S.ht)(q)){if(!P)return;Rt.cloneSheetArgs?(ut=(gt=Rt.cloneSheetArgs).newPTs,Z=gt.pivotCacheId,gt=gt.cacheType,(nt=L._Qt(Z,Rt.cloneSheetArgs.sourceName,gt)).gQt=ut,nt.bQt()):Ct?(gt=Rt.type===tt.pivotTable?_.pivotSlicer:_.pivotTimeline,(nt=L._Qt(Ct.pivotCacheId,Ct.sourceName,gt)).fromJSON(Ct)):nt=bt.EQt.get(P)}else{if(!(Z=this.parent.wQt(q))||Z.dh.getAllFieldNameList().indexOf(J)===-1)return;nt=bt.EQt.add(Z,J),v.forEach(function(Bt){(0,S.ht)(Rt[Bt])||(nt["_"+Bt]=Rt[Bt])})}nt&&((ut=(ut=nt.get(Rt.name))||nt.add(k,Rt.name)).init(),ut.fromJSON(Rt),this.slicers.WB(ut))}}}),H.PivotFieldsModel.ch(o.PivotSlicer,{setSlicerFilter:function(L){var q=L.textItem,J=L.oldTextItem,P=L.condition;L=L.oldCondition,(q||J)&&(q&&!J||!q&&J||q.list&&0<q.list.filter(function(bt){return J.list.indexOf(bt)===-1}).length||J.list&&0<J.list.filter(function(bt){return q.list.indexOf(bt)===-1}).length)&&ot(this,!0),(P||L)&&ot(this,!0)},updatePivotCache:function(L){ot(this)},changePivotCache:function(L){(function(q,J){(q=F(q))&&q.Ti&&q.Ti.parent&&q.Ti.parent.EQt.changeSlicerPivotCaches(J.oldCacheName,J.newCache)})(this,L)},rebuild:function(){ot(this)}}),at.ShapeCollection.ch(o.PivotSlicer,{createShapeWhenFromSJSFormat:function(L){var q,J,P=L.sheet;((J=L.anchorData).graphicFrame||J.AlternateContent&&(J=J.AlternateContent.Choice)&&J.graphicFrame)&&(q=J.graphicFrame),E(q)&&(J=new vt.TimelineShape(P,w(q.nvGraphicFramePr.cNvPr.name),!1),L.shape=J,L.drawingData=q)},createShapeWhenFromJSON:function(L){var q,J=L.sheet;(q=L.json)&&q.shapeType===mt.CT_SlicerShape&&q.slicerType===tt.pivotTimeline&&(J=new vt.TimelineShape(J,q.name,!1),L.shape=J)},shapeRemoving:function(L){var q,J,P,bt,k,nt,gt=L.sheet,Z=L.shape,ut=L.ignoreModel;if(!(nt=L.isGroup)&&(q=gt.parent,nt=X.getSlicerByShape(q,Z,j))){for(J=0,P=nt;J<P.length;J++)bt=(k=P[J]).slicer,k=k.sheetIndex,k=q.sheets[k],bt.GQt.UQt=!0,k.slicers.DK(bt.name(),ut);L.cancelEvent=!0}}}),at.DrawingBaseData.ch(o.PivotSlicer,{createChildShapeDataBySJSNode:function(L){var q=L.node.graphicFrame;E(q)&&(L.shapeData=new vt.TimelineShapeData(L.sheet,o.keyword_undefined,"pivotTimeline"),L.childNode=q)},createChildShapeDataBySSJSON:function(L){L.node.shapeType===mt.CT_SlicerShape&&E(L.node)&&(L.shapeData=new vt.TimelineShapeData(L.sheet,o.keyword_undefined,"pivotTimeline"))}}),At.GC$.extend(B.PivotTable.prototype,{getAllSlicers:function(){return this.Ti.parent.EQt.getPTConnectedSlicers(this)},connectSlicer:function(L){(L=g(this.Ti.parent,L))&&L.connectPivotTable(this.name())},disconnectSlicer:function(L){(L=g(this.Ti.parent,L))&&L.disconnectPivotTable(this.name())},isConnectedSlicer:function(L){if(L=g(this.Ti.parent,L))return L.getConnectedPivotTableNameList().indexOf(this.name())!==-1}}),Yt(Y,U=X.SlicerBase),Y.prototype.sheet=function(){return this.Mf},Y.prototype.connectPivotTable=function(L){var q,J,P,bt;if(!(0,S.ht)(L)&&(J=(q=this).Mf&&q.Mf.parent&&q.Mf.parent.sheets)&&0<J.length){for(P=0;P<J.length;P++)if(bt=J[P].pivotTables.get(L))return void q.FQt.connect(bt)}},Y.prototype.disconnectPivotTable=function(L){var q;(q=this).isConnectedPivotTable(L)&&(L=A(L,q.Mf.parent))&&q.FQt.disconnect(L)},Y.prototype.isConnectedPivotTable=function(L){if(L)return this.FQt.isConnectedPivotTable(L)},Y.prototype.getAllPivotTables=function(){var L,q,J,P,bt,k;if(k=(bt=this).FQt.mQt()){for(L=[],q=k.getSameSourcePivotTablesBySlicer(bt),J=0,P=Object.keys(q);J<P.length;J++)q[P[J]].forEach(function(nt){var gt=nt.ptName;nt=nt.sheetName,(nt=k.getSheetFromName(nt))&&(nt=nt.pivotTables.get(gt))&&L.push(nt)});return L}},Y.prototype.getAllConnectedPivotTables=function(){return this.FQt.pivotTables},Y.prototype.getConnectedPivotTableNameList=function(){return this.getAllConnectedPivotTables().map(function(L){return L.name()})},Y.prototype.aDe=function(L,q){for(var J,P,bt={},k=!1,nt=0,gt=(P=this.FQt).pivotTables;nt<gt.length;nt++)J=gt[nt],(0,S.ht)(J.Eqt)||(bt[J.Eqt]=k=!0);k&&(P={newPTs:bt,pivotCacheId:P.pivotCache.yQt,sourceName:P.sourceName,cacheType:P.slicerCacheType},L.cloneSheetArgs=P)},o.VQt=Y)},"./dist/plugins/pivot/pivot-filter-diagram/slicer/pivot-item-slicer.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I;function U(g,F,ot){var j=this;return(j=I.call(this,g,F,ot)||this).ma=vt.pivotTable,g=j,ot=(F=(ot=F&&F.getParent()&&F.getParent().defaultSlicerTheme())&&ot.name())!=null?F:"light1",g.style(ot),j}Yt=this&&this.__extends||(w=function(g,F){return(w=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(ot,j){ot.__proto__=j}:function(ot,j){for(var E in j)Object.prototype.hasOwnProperty.call(j,E)&&(ot[E]=j[E])}))(g,F)},function(g,F){if(typeof F!="function"&&F!==null)throw new TypeError("Class extends value "+String(F)+" is not a constructor or null");function ot(){this.constructor=g}w(g,F),g.prototype=F===null?Object.create(F):(ot.prototype=F.prototype,new ot)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableItemSlicer=void 0,At=ft("Core"),S=ft("Slicers"),at=ft("Shapes"),X=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),H=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer/pivot-slicer-view-model.js"),f=At.mt.vo,S&&at&&(B=S.SlicerStyles,vt=S.SlicerType,mt=S.defSlicerProperty,tt=S.ItemSlicerProperties,S.SlicerChangeType,_=S.afterPropertyChanged,v=S.encodeSlicerName,Yt(U,I=X.VQt),U.prototype.style=function(g){var F,ot,j;return arguments.length===0?(ot=this.RN)==null?void 0:ot.Gf():(typeof g=="string"?(ot=g.toLowerCase().replace("slicerstyle",""),(j=(F=!(F=(j=this.Mf&&this.Mf.getParent())?j.customSlicerThemes.get(g):F)&&ot in B?B[ot]():F)&&F.name())&&j!==this.getStyleName()&&(this.Fur=j)):g&&g instanceof S.SlicerStyle&&((F=new S.SlicerStyle).fromJSON(g.toJSON()),this.getStyleName())&&(this.Fur=void 0),this.yqt(F),this)},U.prototype.getItems=function(){return this.FQt.items},U.prototype.getOptionsSet=function(){var g,F;return{nameInFormula:(F=this).nameInFormula(),sourceName:F.sourceName(),name:(g=F.name())!=null?g:F.t_e,captionName:F.captionName(),showNoDataItems:F.showNoDataItems(),showNoDataItemsInLast:F.showNoDataItemsInLast(),visuallyNoDataItems:F.visuallyNoDataItems(),showHeader:F.showHeader(),sortState:F.sortState(),columnCount:F.columnCount(),multiSelect:F.multiSelect(),itemHeight:F.itemHeight(),filterCleared:F.filterCleared(),isLocked:F.isLocked(),oDe:F.oDe}},U.prototype.QQt=function(){this.FQt.updateItems()},U.prototype.setFilterWithItems=function(g){this.FQt.setFilter(g)},U.prototype.sortState=function(g){var F,ot=this;if(arguments.length===0)return ot.FQt.sortState();g!==(F=ot.FQt.sortState())&&(ot.FQt.sortState(g),_.call(ot,"sortState",F))},U.prototype.showNoDataItems=function(g){var F,ot=this;if(arguments.length===0)return ot.FQt.showNoDataItems();(g=!!g)!==(F=ot.FQt.showNoDataItems())&&(ot.FQt.showNoDataItems(g),_.call(ot,"showNoDataItems",F))},U.prototype.showNoDataItemsInLast=function(g){var F,ot=this;if(arguments.length===0)return ot.FQt.showNoDataItemsInLast();(g=!!g)!==(F=ot.FQt.showNoDataItemsInLast())&&(ot.FQt.showNoDataItemsInLast(g),_.call(ot,"showNoDataItemsInLast",F))},U.prototype.visuallyNoDataItems=function(g){var F,ot=this;if(arguments.length===0)return ot.FQt.visuallyNoDataItems();(g=!!g)!==(F=ot.FQt.visuallyNoDataItems())&&(ot.FQt.visuallyNoDataItems(g),_.call(ot,"visuallyNoDataItems",F))},U.prototype.initSlicerUI=function(){var g=this;g.GQt=new H.PivotTableItemSlicerViewModel(g.Mf,g.getOptionsSet.bind(g),g.getItems.bind(g)),g.GQt.setStyle(g.RN),g.GQt.bind("valueChanged",function(F){g.setFilterWithItems(F)}),g.GQt.bind("clearFilter",function(){g.clearFilter()}),g.GQt.bind("propertyChanged",function(F){var ot=F.propName;F=F.value,g[ot]&&g[ot](F)})},U.prototype.fromJSON=function(g){var F,ot;g&&(I.prototype.fromJSON.call(this,g),F=this,tt.forEach(function(j){j=j[0],g[j]!==X.keyword_undefined&&F[j](g[j])}),typeof g.style=="string"?F.style(g.style):(ot=g.style)!=null&&ot.name&&Object.keys(g.style).length===1?F.style(g.style.name):g.style&&((ot=new S.SlicerStyle).fromJSON(g.style),F.style(ot)))},U.prototype.yh=function(g,F,ot,j){g&&(I.prototype.yh.call(this,g,F,ot,j),F=this,g.rowHeight!==X.keyword_undefined&&F.itemHeight(At.ExcelHelper.emuToPixles(+g.rowHeight)-4),g.lossless&&g.lossless.multiSelect!==X.keyword_undefined&&F.multiSelect(g.lossless.multiSelect),g.columnCount!==X.keyword_undefined)&&F.columnCount(+g.columnCount)},U.prototype.toJSON=function(g){var F,ot=this,j=I.prototype.toJSON.call(this,g);return tt.forEach(function(E){E=E[0],j[E]=ot[E]()}),(g=ot.style())&&(F=ot.getStyleName(),j.style=F||g.toJSON()),j},U.prototype.wh=function(g,F,ot){var j,E;E=(E=(j=this).getStyleName())||j.efr(),E={name:v(j.name()),cache:v(j.FQt.name),caption:v(j.captionName()),columnCount:j.columnCount(),style:f(E),rowHeight:At.ExcelHelper.pixelToEMU(j.itemHeight()+4),lossless:{multiSelect:j.multiSelect()}},j.showHeader()||(E.showCaption=at.SJS_False),j.disableResizingAndMoving()&&(E.lockedPosition=at.SJS_True),g.push(E)},Ft=U,tt.forEach(function(g){Ft.prototype[g[0]]=mt(g[0],g[1],g[2],g[3])}),o.PivotTableItemSlicer=Ft)},"./dist/plugins/pivot/pivot-filter-diagram/slicer/pivot-slicer-view-model.js":function(Ie,o,ft){var Yt,At,S,at,X,H;function f(B,vt,mt){return H.call(this,B,vt,mt)||this}Yt=this&&this.__extends||(X=function(B,vt){return(X=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(mt,tt){mt.__proto__=tt}:function(mt,tt){for(var _ in tt)Object.prototype.hasOwnProperty.call(tt,_)&&(mt[_]=tt[_])}))(B,vt)},function(B,vt){if(typeof vt!="function"&&vt!==null)throw new TypeError("Class extends value "+String(vt)+" is not a constructor or null");function mt(){this.constructor=B}X(B,vt),B.prototype=vt===null?Object.create(vt):(mt.prototype=vt.prototype,new mt)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableItemSlicerViewModel=void 0,at=ft("Shapes"),ft=ft("Slicers"),at&&ft&&ft.SlicerViewModelBase&&(At=ft.getSlicerSizePosInfo,S=ft.ItemSlicerShape,ft.SlicerChangeType,at=ft.SlicerViewModelBase,Yt(f,H=at),f.prototype.WQt=function(){var B,vt,mt,tt,_,v,Ft,w,I=this;(w=(Ft=this).Mf).shapes&&(B=Ft.updateOptionsCallback(),vt=(_=At(w,!0)).left,mt=_.top,tt=_.width,_=_.height,(v=(v=B.oDe)!=null?v:w.shapes.get(B.name))||(v=new S(w,B.name,!0,vt,mt,tt,_),w.shapes.ZP(v),v.allowResize(!0),v.allowMove(!0),v.dynamicSize(!1),v.dynamicMove(!0)),v.drawingType="Slicer",Ft.zQt=v.GtV,Ft.RQt=v,Ft.zQt.xT&&Ft.resetFormControl(v),Ft.refreshFormControl(),Ft.zQt.addEventListener("valueChanged",function(U,g){var F=I.updateValuesCallback();F.forEach(function(ot){return ot.selected=g.indexOf(ot.text)!==-1}),I.ki("valueChanged",F)}),Ft.zQt.addEventListener("clearFilter",function(U,g){I.ki("clearFilter",{})}),Ft.zQt.addEventListener("propertyChanged",function(U,g){I.ki("propertyChanged",g)}))},f.prototype.refreshFormControl=function(){var B;H.prototype.refreshFormControl.call(this),(B=this).zQt.setItems(B.updateValuesCallback())},o.PivotTableItemSlicerViewModel=f)},"./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-dropdown.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt;function _(v,Ft,w){return(v=tt.call(this,v,Ft)||this).onChange=w,v}Yt=this&&this.__extends||(mt=function(v,Ft){return(mt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(w,I){w.__proto__=I}:function(w,I){for(var U in I)Object.prototype.hasOwnProperty.call(I,U)&&(w[U]=I[U])}))(v,Ft)},function(v,Ft){if(typeof Ft!="function"&&Ft!==null)throw new TypeError("Class extends value "+String(Ft)+" is not a constructor or null");function w(){this.constructor=v}mt(v,Ft),v.prototype=Ft===null?Object.create(Ft):(w.prototype=Ft.prototype,new w)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTimelineDropdown=void 0,at=ft("@spreadjs/js-sheets-common"),At=ft("Core"),S=ft("Slicers"),ft=ft("./dist/plugins/pivot/pivot.ns.js"),at=new at.Common.ResourceManager(ft.SR,"PivotTables"),X=at.getResource.bind(at),H="gc-timeline-level-dropdown",f="gc-timeline-level-block",B="gc-timeline-level-text",vt="gc-timeline-selected-level",S&&(Yt(_,tt=At.zc),_.prototype.init=function(v,Ft,w){tt.prototype.Hc.call(this),v=this.initHTMLStr(v),this.open(Ft,w,v)},_.prototype.initHTMLStr=function(v){for(var Ft="",w=["",X().TIME_LEVEL_YEARS,X().TIME_LEVEL_QUARTERS,X().TIME_LEVEL_MONTHS,X().TIME_LEVEL_DAYS],I=1;I<=4;I++)Ft+=this.ZQt(w[I],v===I,I);return Ft},_.prototype.ZQt=function(v,Ft,w){return Ft=Ft?"\u221A":"",' <div class="'.concat(f,'" level="').concat(w,`">
  2. <div class="`).concat(vt,`">
  3. `).concat(Ft,`
  4. </div>
  5. <div class="`).concat(B,`">
  6. `).concat(v,`
  7. </div>
  8. </div>`)},_.prototype.WX=function(v,Ft){var w,I=this.Xc();return(w=(w=(0,At.GC$)(".".concat(H))).length===0?(0,At.GC$)(At.mt.En("div")):w).css(["left","top"],[v,Ft]),w.addClass(H),w.appendTo(I),w},_.prototype.open=function(v,Ft,w){this.WX(v,Ft).html(w),this.$c()},_.prototype.aY=function(){var v=this;(0,At.GC$)("."+f).bind("click",function(Ft){(Ft=Ft.target).className!==vt&&Ft.className!==B||(Ft=Ft.parentElement),(Ft=parseInt(Ft.getAttribute("level"),10))&&(v.onChange(Ft),v.close())})},_.prototype.$c=function(){tt.prototype.$c.call(this),this.aY()},_.prototype.KX=function(){(0,At.GC$)("."+f).unbind("click")},_.prototype.close=function(){this.KX(),tt.prototype.close.call(this)},o.PivotTimelineDropdown=_)},"./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-list.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E;function A(){var k=B.Fe(B.culture()).DateTimeFormat;return k&&k.abbreviatedMonthNames||[]}function Y(){this.YQt=10.25,this.HQt=30.75,this.JQt=0,this.qQt=!1,this.KQt=-1,this.ywt=-1,this.lit=-1,this.pki=-1,this.XQt=!1,this.$Qt=!1,this.needDrawDragRect=!1,this.mki=!1,this.tWt={containerSize:{w:300,h:100},selection:X.keyword_null,bounds:X.keyword_null,scrollPosition:X.keyword_null,offset:{top:0,left:0},level:X.keyword_null,selectionLevel:X.keyword_null,canShowRange:!0,filterCleared:!0,showScrollbar:!0,showHeader:!0,showSelectionLabel:!0,showLevel:!0,onSelectionChanged:function(){},onItemClick:function(){},getStyle:function(k){return X.keyword_null},getThemeColor:function(){return""},refresh:function(){},setCursor:function(){},onScrollPositionChanged:function(){},getPointerRelativeControl:function(k){return{x:0,y:0}}},this.initScrollbar()}function L(k){return Math.floor((k.getMonth()+3)/3)}function q(k){return J(k.getFullYear(),k.getMonth())}function J(k,nt){return(k=new Date(k,nt)).setMonth(k.getMonth()+1),k.setDate(1),k.setDate(k.getDate()-1),k.getDate()}function P(k,nt,gt){var Z,ut,Rt,Ct;nt&&(k.save(),k.fillStyle=_,Z=nt.x,ut=nt.y,Rt=nt.width,Ct=nt.height,k.beginPath(),k.moveTo(Z+5,ut),k.lineTo(Z+Rt-(gt?0:5),ut),k.quadraticCurveTo(Z+Rt,ut,Z+Rt,ut+(gt?0:5)),k.lineTo(Z+Rt,ut+Ct-(gt?0:5)),k.quadraticCurveTo(Z+Rt,ut+Ct,Z+Rt-(gt?0:5),ut+Ct),k.lineTo(Z+(gt?5:0),ut+Ct),k.quadraticCurveTo(Z,ut+Ct,Z,ut+Ct-(gt?5:0)),k.lineTo(Z,ut+(gt?5:0)),k.quadraticCurveTo(Z,ut,Z+(gt?5:0),ut),k.closePath(),k.fill(),k.fillStyle=v,k.fillRect(nt.x+2,nt.y+4.5,2,2),k.fillRect(nt.x+2,nt.y+8,2,2),k.fillRect(nt.x+2,nt.y+11.5,2,2),k.restore())}function bt(k,nt,gt){return k=new Date(k.toDateString()),nt&&(gt?(k.setMonth(0),k.setDate(1)):(k.setMonth(11),k.setDate(31))),k.getTime()}Object.defineProperty(o,"__esModule",{value:!0}),o.getMonthLength=o.getLastDateOfMonth=o.getQuarter=o.PivotTimelineList=o.getMonthMap=void 0,Yt=ft("Core"),vt=ft("@spreadjs/js-sheets-common"),At=ft("Pivot"),S=ft("Slicers"),at=ft("Shapes"),X=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),H=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-view.js"),ft=ft("./dist/plugins/pivot/pivot.ns.js"),f=vt.Common.ft,B=vt.Common.CultureManager,vt=new vt.Common.ResourceManager(ft.SR,"PivotTables"),mt=vt.getResource.bind(vt),o.getMonthMap=A,tt=Yt.mt.yt,_="#9c9c9c",v="#dddddd",(ft=Ft=Ft||{})[ft.item=0]="item",ft[ft.scrollBar=1]="scrollBar",ft[ft.leftScrollButton=2]="leftScrollButton",ft[ft.rightScrollButton=3]="rightScrollButton",ft[ft.leftDragButton=4]="leftDragButton",ft[ft.rightDragButton=5]="rightDragButton",S&&at&&(w=at.drawRoundedRect,I=S.TimelineLevel,U=S.appendBackColorStyle,g=S.Border_Names,F=S.fillText,ot=S.getEllipsisText,j=S.paintBorder,E=S.SlicerScrollBar,Object.defineProperty(Y.prototype,"props",{get:function(){return this.tWt},set:function(k){this.tWt=k},enumerable:!1,configurable:!0}),Y.prototype.initScrollbar=function(){var k,nt,gt=this;(nt=(k=new E).props).direction="horizontal",nt.showButton=!1,nt.sliderColor=H.WHITE,nt.renderTrack=!1,nt.syncSliderHeightWithPageStep=!0,nt.refresh=this.refresh.bind(this),nt.getPointerRelativeControl=function(Z){return{x:(Z=gt.getPointerRelativeControl(Z)).x-19,y:Z.y-75}},nt.setCursor=this.setCursor.bind(this),nt.onScroll=this.onScrollBarChange.bind(this),nt.finishScroll=this.onScrollBarChanged.bind(this),this.iWt=k},Y.prototype.onScrollBarChange=function(){var k=this.iWt.props.value;this.JQt=k},Y.prototype.onScrollBarChanged=function(){var k=this,nt=this._items[0],gt=this.iWt.props.value,Z=new Date(nt.toString());if(gt!==0)switch(k.level){case I.years:Z.setFullYear(Z.getFullYear()+gt);break;case I.quarters:Z.setMonth(Z.getMonth()+3*gt);break;case I.months:Z.setMonth(Z.getMonth()+gt);break;case I.days:Z.setDate(Z.getDate()+gt)}k.tWt.onScrollPositionChanged(Z),k.setCursor("default")},Y.prototype.update=function(){try{this.buildItems()}catch{return}this.setStartPosition()},Y.prototype.setStartPosition=function(){var k,nt,gt;if(gt=this.scrollPosition){if(!this._items)try{this.buildItems()}catch{return}for(k=this._items,nt=0;k[nt]<gt&&nt<k.length;)nt++;this.JQt=Math.min(nt,this.maxScrollCount)}else this.JQt=0;this.refresh()},Y.prototype.onLevelChanged=function(){this.updateScrollPosition()},Y.prototype.updateScrollPosition=function(k){var nt,gt,Z,ut=this;if(k=k||ut.selection,!(0,At.ht)(k)){for(nt=k.startDate,gt=this._items,Z=0;gt[Z]<nt&&Z<gt.length;)Z++;k=Math.round(Z-ut.onePageCanDisplayItemsCount/2),ut.tWt.onScrollPositionChanged(gt[k]||gt[0])}},Y.prototype.nCi=function(k){return k.isRight?this.eWt:this.nWt},Y.prototype.B1i=function(k){var nt,gt=(nt=this).itemWidth+1,Z=nt.itemHeight;return{rect:new Yt.Rect((k-nt.JQt)*gt,50+(nt.showHeader?0:15),gt,Z),index:k,displayIndex:k-nt.JQt}},Y.prototype.F1i=function(k){var nt,gt,Z=(gt=(nt=this).iWt).scrollBtnLen,ut=gt.height,Rt=nt.SCROLLBAR_Y_VALUE,Ct=nt.SCROLLBAR_WIDTH,Bt=gt.scrollSliderOffset,kt=gt.scrollSliderLen;switch(k.type){case 1:return new Yt.Rect(0,Rt,Ct+2*nt.SCROLLBAR_X_VALUE,ut);case 2:return new Yt.Rect(0,Rt,Z,ut);case 3:return new Yt.Rect(Z+Ct,Rt,Z,ut);case 4:return new Yt.Rect(Z,Rt,Ct,ut);case 5:return new Yt.Rect(Z+Bt,Rt,kt,ut);case 6:return new Yt.Rect(Z,Rt,Bt,ut);case 7:return new Yt.Rect(Z+Bt+kt,Rt,kt,ut)}},Y.prototype.render=function(k){var nt=this;k.save(),nt.nWt=X.keyword_null,nt.eWt=X.keyword_null,nt.renderItems(k),nt.renderLeftScrollButton(k),nt.renderRightScrollButton(k),nt.updateScrollbarProps(),nt.renderScrollbar(k),nt.needDrawDragRect&&(P(k,nt.nWt,!0),P(k,nt.eWt,!1)),k.restore()},Y.prototype.updateScrollbarProps=function(){var k,nt=this.SCROLLBAR_WIDTH;(k=this.iWt.props).containerSize={w:nt,h:19},k.max=this.maxScrollCount,k.value=this.JQt,k.pageStep=this.onePageCanDisplayItemsCount,this.iWt.props=k},Y.prototype.renderScrollbar=function(k){var nt,gt=(nt=this).SCROLLBAR_X_VALUE;k.save(),k.translate(gt,nt.SCROLLBAR_Y_VALUE),nt.showScrollBar&&nt.tWt.canShowRange&&nt.renderScrollbarTrack(k,nt.width-40),nt.needShowScrollbar&&nt.iWt.render(k),k.restore()},Y.prototype.renderLeftScrollButton=function(k){this.renderScrollBtn(k,this.rWt===Ft.leftScrollButton,!0)},Y.prototype.renderRightScrollButton=function(k){this.renderScrollBtn(k,this.rWt===Ft.rightScrollButton,!1)},Y.prototype.renderScrollBtn=function(k,nt,gt){var Z=this,ut=gt?Z.leftBtnRect:Z.rightBtnRect,Rt=(Z=nt?"rgb(243, 243, 243)":H.WHITE,nt=nt?"rgb(135, 135, 135)":"rgb(196, 196, 196)","rgb(120, 119, 117)");k.save(),k.beginPath(),k.rect(ut.x,ut.y,ut.w,ut.h),k.fillStyle=Z,k.fill(),k.strokeStyle=nt,k.stroke(),function(){k.save(),k.translate(ut.x,ut.y),k.translate((ut.w-6)/2,(ut.h-3)/2),k.beginPath();var Ct=gt?-90:90;Ct&&(k.translate(3,1.5),k.rotate(Ct/180*Math.PI),k.translate(-3,-1.5)),k.moveTo(0,3),k.lineTo(3,0),k.lineTo(6,3),k.strokeStyle=Rt,k.lineWidth=2,k.stroke(),k.restore()}(),k.restore()},Y.prototype.renderScrollbarTrack=function(k,nt){var gt,Z,ut="E6E6E6",Rt=(Z=this).getStyle("selectedTimeBlockStyle"),Ct=bt(Z.bounds.startDate,!0,!0),Bt=bt(Z.bounds.endDate,!0,!1)-Ct;(Rt=Rt&&Rt.backColor())&&!function(kt){if(kt&&typeof kt=="string"&&((kt=kt.toUpperCase())===H.WHITE||kt==="#FFF"||kt==="#FFFFFF"||kt==="RGB(255, 255, 255)"))return 1}(Rt)&&(typeof Rt=="string"?ut=f.YGt(Z.getThemeColor(Rt),.5):typeof Rt=="object"&&Rt.stops&&0<Rt.stops.length&&Rt.stops[0].color&&(ut=f.YGt(Z.getThemeColor(Rt.stops[0].color),.5))),Ct=Z.selection?(gt=nt*(((Rt=bt(Z.selection.startDate))-Ct)/Bt),nt*((bt(Z.selection.endDate)-Rt)/Bt)):(gt=0,nt),k.save(),k.fillStyle=ut,k.fillRect(gt,5,Ct,9),k.restore()},Y.prototype.renderItems=function(k){var nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt;for((Qt=this).level!==Qt.oWt&&(Qt.buildItems(),Qt.JQt=0,Qt.iWt.value=0),Qt.buildItemWidth(k),nt=Qt.JQt,gt=Qt._items,Rt=ut=Z=!1,Ct=0;Ct+nt<gt.length&&(Bt=gt[Ct+nt],k.beginPath(),kt=(Xt=Qt.isSelectedItem(Bt,ut,Rt)).selected,ut=!(!(ie=Xt.isLeft)||ut)||ut,Rt=!(!(Xt=Xt.isRight)||Rt)||Rt,!Qt.renderItem(k,Bt,Ct,Qt.aWt(Bt,Ct===0),kt,Z&&kt,ie,Xt));Ct++)Z=kt},Y.prototype.buildItemWidth=function(k){var nt=this,gt=new Date("2000-11-11"),Z=(gt=nt.sWt(gt),nt.getWholeStyle()),ut=nt.getStyle("periodLabel1Style");k.save(),ut=ut&&ut.font()||Z&&Z.font()||H.TIMELINE_DEFAULT_FONT,k.font=tt(ut),nt.YQt=k.measureText("M").width,ut=(ut=nt.getStyle("periodLabel2Style"))&&ut.font()||Z&&Z.font()||H.TIMELINE_DEFAULT_FONT,k.font=tt(ut),nt.HQt=k.measureText(gt).width,k.restore()},Y.prototype.buildItems=function(){var k,nt=(gt=(k=this).bounds).startDate,gt=gt.endDate,Z=k.level,ut=nt.getFullYear(),Rt=gt.getFullYear();switch(Z){case I.years:k.buildYearsItems(ut,Rt);break;case I.quarters:k.buildQuartersItems(ut,Rt);break;case I.months:k.buildMonthsItems(ut,Rt);break;case I.days:k.buildDaysItems(ut,Rt)}k.oWt=k.level},Y.prototype.buildYearsItems=function(k,nt){for(var gt=[],Z=k;Z<=nt;Z++)gt.push(new Date(Z,0));this._items=gt},Y.prototype.buildQuartersItems=function(k,nt){for(var gt,Z=[],ut=k;ut<=nt;ut++)for(gt=0;gt<4;gt++)Z.push(new Date(ut,3*gt));this._items=Z},Y.prototype.buildMonthsItems=function(k,nt){for(var gt,Z=[],ut=k;ut<=nt;ut++)for(gt=0;gt<12;gt++)Z.push(new Date(ut,gt));this._items=Z},Y.prototype.buildDaysItems=function(k,nt){for(var gt,Z,ut,Rt=[],Ct=k;Ct<=nt;Ct++)for(gt=0;gt<12;gt++)for(Z=J(Ct,gt),ut=1;ut<=Z;ut++)Rt.push(new Date(Ct,gt,ut));this._items=Rt},Y.prototype.aWt=function(k,nt){switch(this.level){case I.years:return X.keyword_null;case I.quarters:case I.months:return k.getMonth()===0||nt?k.getFullYear()+"":X.keyword_null;case I.days:return k.getDate()===1||nt?"".concat(A()[k.getMonth()].toUpperCase()," ").concat(k.getFullYear()):X.keyword_null;default:return X.keyword_null}},Y.prototype.sWt=function(k){var nt="";switch(this.level){case I.years:nt=k.getFullYear()+"";break;case I.quarters:nt=mt().QUARTER_MAP[L(k)];break;case I.months:nt=A()[k.getMonth()].toUpperCase();break;case I.days:nt=k.getDate()+""}return nt},Y.prototype.isSelectedItem=function(k,nt,gt){var Z,ut,Rt,Ct=(Rt=this).selection,Bt=!1,kt=!1,ie=!1;return Rt.tWt.canShowRange&&((0,At.ht)(Ct)?Bt=!0:(Z=Ct.startDate,Ct=Ct.endDate,ut=Rt.uWt(k),Rt.selectionLevel<=Rt.level?k<=Ct&&Z<=k&&(Bt=!0,kt=!nt&&k<=Z,ie=!gt&&Ct<=ut):ut<Z||Ct<k||(Bt=!0,kt=!nt&&k<=Z,ie=!gt&&Ct<=ut))),{selected:Bt,isLeft:kt,isRight:ie}},Y.prototype.isHoveredItem=function(k){return this.KQt===k},Y.prototype.renderItem=function(k,nt,gt,Z,ut,Rt,Ct,Bt){var kt,ie,Xt,Qt,dt,xt,Mt,st,l,T,D,M=(T=this).itemWidth-1,s=T.itemHeight,y=gt*(M+1)+((D=T.showScrollBar)?0:22),G=50+(T.showHeader?0:15);if(y>T.width+19)return!0;if(!D){if((D=T.width+19-3)<y)return!0;D<y+M&&(M=D-y)}for(D=T.getStyle("selectedTimeBlockStyle"),Mt=T.getStyle("unselectedTimeBlockStyle"),kt=ut?D:Mt,ut=T.getWholeStyle(),ie=new Yt.Rect(y,G,M,s),Xt=0,Qt=M,T.selectionLevel&&T.selectionLevel>T.level&&(Ct||Bt)?(xt=(dt=T.cWt(nt,Ct,Bt)).leftPoint,dt=dt.rightPoint,dt=new Yt.Rect(y+(Xt=M*xt),G,Qt=M*(dt-xt)||2,s),U(k,y,G,M,s,Mt,ut,T.getThemeColor.bind(T)),w(ie,0,k),U(k,dt.x,dt.y,dt.width,dt.height,D,ut,T.getThemeColor.bind(T)),w(dt,0,k)):(U(k,y,G,M,s,kt,ut,T.getThemeColor.bind(T)),w(ie,0,k)),Ct&&(T.nWt=new Yt.Rect(y+Xt-6,G,6,s)),Bt&&(T.eWt=new Yt.Rect(y+Xt+Qt,G,6,s)),T.isHoveredItem(gt+T.JQt)&&(k.save(),k.fillStyle="rgba(0, 0, 0, 0.15)",w(ie,0,k),k.restore()),xt=T.getStyle("selectedTimeBlockSpaceStyle"),Rt&&xt&&xt.backColor()&&(Mt=new Yt.Rect(y-1,G,1,s),k.save(),U(k,Mt.x,Mt.y,Mt.width,Mt.height,xt,X.keyword_null,T.getThemeColor.bind(T)),w(Mt,0,k),k.restore()),Z&&T.paintLabelText1(k,Z,y,G-35),T.paintLabelText2(k,nt,y,G-20,M,s),ie.x===0&&(ie.x+=.5,ie.width-=.1),ie.y===0&&(ie.y+=.5,ie.height-=.1),st=0;st<4;st++)l=g[st],(l=kt&&kt[l]())&&j(k,st,ie,l,T.getThemeColor.bind(T),0)},Y.prototype.uWt=function(k){var nt=new Date(k.toString());switch(k=864e5,this.level){case I.years:nt.setFullYear(nt.getFullYear()+1);break;case I.quarters:nt.setMonth(nt.getMonth()+3);break;case I.months:nt.setMonth(nt.getMonth()+1);break;case I.days:nt.setDate(nt.getDate()+1)}return new Date(nt.getTime()-k)},Y.prototype.cWt=function(k,nt,gt){var Z,ut,Rt,Ct=0,Bt=1;return(Rt=(ut=this).selection)&&(ut=ut.uWt(k),Z=Rt.startDate,Rt=Rt.endDate,Ct=nt?+((Z.getTime()-k.getTime())/(ut.getTime()-k.getTime())).toPrecision(3):0,Bt=gt?+((Rt.getTime()-k.getTime())/(ut.getTime()-k.getTime())).toPrecision(3):1),{leftPoint:Ct,rightPoint:Bt}},Y.prototype.paintLabelText1=function(k,nt,gt,Z){var ut,Rt,Ct,Bt,kt=(Bt=this).itemWidth-1;k.save(),Ct=Bt.getStyle("periodLabel1Style"),ut=Bt.getWholeStyle(),Rt=Bt.getThemeColor(Ct&&Ct.foreColor()||ut&&ut.foreColor()||H.BLACK),Ct=Ct&&Ct.font()||ut&&ut.font()||H.TIMELINE_DEFAULT_FONT,F(k,ot(k,nt,2*kt),gt,Z,Rt,tt(Ct),Bt.YQt,kt),k.restore()},Y.prototype.paintLabelText2=function(k,nt,gt,Z,ut,Rt){var Ct,Bt=(Ct=this).getStyle("periodLabel2Style"),kt=Ct.getWholeStyle(),ie=Bt&&Bt.foreColor()||kt&&kt.foreColor()||H.BLACK;Bt=tt(Bt&&Bt.font()||kt&&kt.font()||H.TIMELINE_DEFAULT_FONT),k.save(),kt=Ct.sWt(nt),F(k,ot(k,kt,ut),gt,Z,Ct.getThemeColor(ie),Bt,Rt,ut),k.restore()},Y.prototype.hitTest=function(k,nt){var gt,Z,ut=this,Rt=this.width,Ct=ut.showScrollBar,Bt=ut.showHeader,kt=ut.leftBtnRect,ie=ut.rightBtnRect,Xt=Ct?k:k+19+3,Qt=Bt?nt:nt+15,dt=(Bt=function(){return 0<=k&&k<=Rt-(Ct?0:7)&&50<=nt&&nt<50+ut.itemHeight},function(){return Xt>=kt.x&&Xt<=kt.x+kt.w&&Qt>=kt.y&&Qt<=kt.y+kt.h}),xt=ut.getClickItemIndex(k,nt);return function(){var Mt=ut.nWt;return Mt&&Xt>=Mt.x&&Xt<=Mt.x+Mt.width&&Qt>=Mt.y&&Qt<=Mt.y+Mt.height}()?(gt=Ft.leftDragButton,Z=xt):function(){var Mt=ut.eWt;return Mt&&Xt>=Mt.x&&Xt<=Mt.x+Mt.width&&Qt>=Mt.y&&Qt<=Mt.y+Mt.height}()?(gt=Ft.rightDragButton,Z=xt):Bt()?xt!==-1&&(gt=Ft.item,Z=xt):ut.needShowScrollbar&&k>=ut.scrollButtonSize&&k<=ut.width-ut.scrollButtonSize&&Qt>=kt.y&&Qt<=kt.y+kt.h?gt=Ft.scrollBar:dt()?gt=Ft.leftScrollButton:Xt>=ie.x&&Xt<=ie.x+ie.w&&Qt>=ie.y&&Qt<=ie.y+ie.h&&(gt=Ft.rightScrollButton),{target:gt,data:Z}},Y.prototype.onMouseDown=function(k){var nt,gt=(nt=this).getPointerRelativeControl(k),Z=(gt=nt.hitTest(gt.x,gt.y)).target;return gt=gt.data,Z===Ft.leftDragButton||Z===Ft.rightDragButton?(nt.lWt=Z,nt.mki=!0,nt.qQt=!0):Z===Ft.item?(k.shiftKey?(nt.ywt=Math.max(nt.lit,nt.ywt,gt),nt.lit=Math.min(nt.lit,nt.ywt,gt),nt.pki=gt):(nt.pki=-1,nt.lit=gt,nt.ywt=gt),nt.mki=!0,nt.$Qt=!0,nt.qQt=!0,nt.changeSelection(),!0):Z===Ft.scrollBar?(nt.iWt.onMouseDown(k),nt.qQt=!0):Z===Ft.leftScrollButton||Z===Ft.rightScrollButton?(gt=(nt.rWt=Z)===Ft.leftScrollButton?-1:1,nt.scroll(gt),nt.startScrollInterval(gt),!0):void 0},Y.prototype.isInBounding=function(k,nt){var gt=this.width,Z=this.height;return 0<=k&&k<=gt&&0<=nt&&nt<=Z},Y.prototype.onMouseMove=function(k){var nt,gt,Z,ut;return(ut=this).iWt.onMouseMove(k),k=ut.getPointerRelativeControl(k),nt=(gt=ut.hitTest(k.x,k.y)).target,gt=gt.data,(Z=ut.lWt)?ut.onDragButtonChanging(Z,gt,k.x):nt===Ft.item?(ut.$Qt?ut.ywt!==gt&&(ut.pki===-1||ut.pki!==-1&&ut.pki!==gt)&&(ut.XQt=!0,ut.ywt=gt,ut.pki=-1,ut.changeSelection()):ut.KQt=gt,ut.setCursor("default")):(nt===Ft.leftScrollButton||nt===Ft.rightScrollButton?ut.setCursor("default"):nt!==Ft.leftDragButton&&nt!==Ft.rightDragButton||ut.setCursor("ew-resize"),ut.KQt=-1),ut.refresh(),!0},Y.prototype.onDragButtonChanging=function(k,nt,gt){var Z,ut,Rt,Ct,Bt;(0,At.ht)(nt)||nt===-1||(ut=((ut=(Z=this).fWt(nt)).from+ut.to)/2,k===Ft.leftDragButton?(Rt=ut+Z.itemWidth,k=nt+1,gt<=ut?k=nt:Rt<=gt&&(k=nt+2),Z._items[k]&&Z._items[k].toLocaleDateString()!==Z.selection.startDate.toLocaleDateString()&&Z._items[k]<=Z.selection.endDate&&(Ct=new Date(Z._items[k].toString()),Bt=Z.selection.endDate,Z.selection={startDate:Ct,endDate:Bt})):(Rt=ut-Z.itemWidth,k=nt-1,ut<=gt?k=nt:gt<=Rt&&(k=nt-2),Z._items[k]&&Z._items[k]>=Z.selection.startDate&&(Ct=Z.selection.startDate,Bt=new Date(Z._items[k].toString()),Z.selection=Z.hWt(Ct,Bt))))},Y.prototype.fWt=function(k){var nt=this;return{from:(k-=nt.JQt)*nt.itemWidth,to:(k+1)*nt.itemWidth}},Y.prototype.onWindowMouseMove=function(k){k=(nt=this).getPointerRelativeControl(k);var nt,gt=nt.itemsAreaWidth-1+nt.props.offset.left;if(gt=nt.hitTest(gt,k.y).target,nt.mki){if(gt===Ft.item)nt.stopScrollInterval();else{if(nt.vWt!==void 0)return;k.x<0?nt.startScrollInterval(-1):k.x>nt.width&&nt.startScrollInterval(1)}nt.refresh()}gt=nt.isInBounding(k.x,k.y),nt.needDrawDragRect!==gt&&(nt.needDrawDragRect=gt,nt.mki||nt.refresh())},Y.prototype.startScrollInterval=function(k){var nt=this,gt=function(){nt.scroll(k),nt.refresh(),nt.vWt=window.setTimeout(gt,100)};this.vWt=window.setTimeout(gt,600)},Y.prototype.stopScrollInterval=function(){return this.vWt!==void 0&&(window.clearTimeout(this.vWt),!(this.vWt=void 0))},Y.prototype.scroll=function(k){this.scrollTo(this.JQt+k)},Y.prototype.scrollTo=function(k){var nt=this.maxScrollCount;k=Math.min(k,nt),k=Math.max(k,0),this.JQt=k},Y.prototype.onMouseUp=function(k){var nt;return(nt=this).iWt.onMouseUp(k),k=nt.getPointerRelativeControl(k),nt.hitTest(k.x,k.y).target!==Ft.item&&(this.KQt=-1,this.refresh()),!!nt.qQt&&!(nt.qQt=!1)},Y.prototype.onWindowMouseUp=function(k){var nt,gt,Z,ut;(ut=this).iWt.onWindowMouseUp(k),k=ut.getPointerRelativeControl(k),nt=(k=ut.hitTest(k.x,k.y)).target,k=k.data,ut.lWt?(gt=(Z=ut.selection).startDate,Z=Z.endDate,ut.props.onSelectionChanged({startDate:gt,endDate:Z})):ut.mki&&(nt===Ft.item&&ut.XQt&&(ut.XQt=!1,ut.ywt=k),ut.endSelectOperation()),this.stopScrollInterval()&&this.onScrollBarChanged(),this.clearState()},Y.prototype.hWt=function(k,nt){var gt;if(k&&nt){switch(nt<k&&(k=(gt=[nt,k])[0],nt=gt[1]),this.level){case S.TimelineLevel.years:nt.setMonth(11);break;case S.TimelineLevel.quarters:nt.setMonth(nt.getMonth()+2)}this.level!==S.TimelineLevel.days&&nt.setDate(q(nt))}return{startDate:k,endDate:nt}},Y.prototype.changeSelection=function(){var k=this,nt=new Date(k._items[k.lit].toString()),gt=new Date(k._items[k.ywt].toString());k.selection=k.hWt(nt,gt)},Y.prototype.endSelectOperation=function(){var k=this,nt=new Date(k._items[k.lit].toString()),gt=new Date(k._items[k.ywt].toString());k.props.onSelectionChanged(k.hWt(nt,gt))},Y.prototype.onWindowKeyUp=function(k){},Y.prototype.onWindowMouseWheel=function(k){this.iWt.onWindowMouseWheel(k)},Y.prototype.clearState=function(){var k,nt=!1;(k=this).qQt&&(nt=!(k.qQt=!1)),k.mki&&(k.KQt=-1,k.$Qt=!1,k.pki===-1&&(k.ywt=-1),nt=!(k.mki=!1)),k.lWt=X.keyword_null,k.rWt=X.keyword_null,k.stopScrollInterval(),nt&&k.refresh()},Object.defineProperty(Y.prototype,"width",{get:function(){return this.tWt.containerSize.w-(this.showScrollBar?0:44)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"height",{get:function(){return this.tWt.containerSize.h},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"scrollPosition",{get:function(){return this.tWt.scrollPosition},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"showScrollBar",{get:function(){return this.tWt.showScrollbar},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"showHeader",{get:function(){return this.tWt.showHeader},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"level",{get:function(){return this.tWt.level},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"bounds",{get:function(){return this.tWt.bounds},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"selection",{get:function(){return this.tWt.selection},set:function(k){this.tWt.selection=k},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"selectionLevel",{get:function(){return this.tWt.selectionLevel},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"itemWidth",{get:function(){return Math.max(2*this.HQt,40)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"itemHeight",{get:function(){return 18},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"needShowScrollbar",{get:function(){return this.showScrollBar&&this.itemLength>this.onePageCanEntirelyDisplayItemsCount},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"scrollButtonSize",{get:function(){return 25},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"canShowItemsLength",{get:function(){return 10},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"itemsAreaWidth",{get:function(){return Math.min(this.itemLength,this.canShowItemsLength)*this.itemWidth},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"itemLength",{get:function(){if(this._items)return this._items.length;try{return this.buildItems(),this._items.length}catch{return 0}},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"maxScrollCount",{get:function(){return Math.max(0,this.itemLength-this.onePageCanEntirelyDisplayItemsCount)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"onePageCanDisplayItemsCount",{get:function(){return Math.ceil(this.width/this.itemWidth)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"onePageCanEntirelyDisplayItemsCount",{get:function(){return Math.floor(this.width/this.itemWidth)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"leftBtnRect",{get:function(){return{x:0,y:76-(this.showScrollBar?0:25)+(this.showHeader?0:15),w:19,h:17}},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rightBtnRect",{get:function(){return{x:this.width-19+(this.showScrollBar?0:38),y:76-(this.showScrollBar?0:25)+(this.showHeader?0:15),w:19,h:17}},enumerable:!1,configurable:!0}),Y.prototype.setCursor=function(k){this.props.setCursor(k)},Y.prototype.getStyle=function(k){return this.props.getStyle(k)},Y.prototype.getWholeStyle=function(){return this.props.getStyle("wholeSlicerStyle")},Y.prototype.getThemeColor=function(k){return this.props.getThemeColor(k)},Y.prototype.getPointerRelativeControl=function(k){return(k=this.props.getPointerRelativeControl(k)).x+=this.props.offset.left,k.y+=this.props.offset.top,k},Y.prototype.getClickItemIndex=function(k,nt){var gt=this.itemWidth;return(k=Math.floor(k/gt)+this.JQt)>=this.itemLength?-1:k},Y.prototype.refresh=function(){this.props.refresh()},Y.prototype.dispose=function(){this.iWt.dispose(),this._items=X.keyword_null,this.tWt=X.keyword_null},Object.defineProperty(Y.prototype,"SCROLLBAR_X_VALUE",{get:function(){return 20},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"SCROLLBAR_Y_VALUE",{get:function(){return 75+(this.showScrollBar?0:15)+(this.showHeader?0:15)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"SCROLLBAR_WIDTH",{get:function(){return this.width-2*this.SCROLLBAR_X_VALUE},enumerable:!1,configurable:!0}),o.PivotTimelineList=Y),o.getQuarter=L,o.getLastDateOfMonth=q,o.getMonthLength=J},"./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-slicer.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w;function I(g){return g instanceof Date&&!isNaN(g.getTime())}function U(g,F,ot){var j=this;return(j=w.call(this,g,F,ot)||this).ma=B.pivotTimeline,g=j,ot=(F=(ot=F&&F.getParent()&&F.getParent().defaultTimelineTheme())&&ot.name())!=null?F:"light1",g.style(ot),g.mwr={},j}Yt=this&&this.__extends||(Ft=function(g,F){return(Ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(ot,j){ot.__proto__=j}:function(ot,j){for(var E in j)Object.prototype.hasOwnProperty.call(j,E)&&(ot[E]=j[E])}))(g,F)},function(g,F){if(typeof F!="function"&&F!==null)throw new TypeError("Class extends value "+String(F)+" is not a constructor or null");function ot(){this.constructor=g}Ft(g,F),g.prototype=F===null?Object.create(F):(ot.prototype=F.prototype,new ot)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTimelineSlicerProperties=o.PivotTableTimelineSlicer=void 0,At=ft("Pivot"),S=ft("Slicers"),at=ft("Shapes"),X=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),H=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-view-model.js"),ft=ft("Core"),f=ft.mt.vo,S&&at&&(B=S.SlicerType,vt=S.TimelineStyles,mt=S.defSlicerProperty,ft=S.onPropertyChanged,S.SlicerChangeType,tt=S.encodeSlicerName,_=[["level",S.TimelineLevel.months,ft,function(g){return 1<=g&&g<=4}],["showHorizontalScrollbar",!0,ft],["showSelectionLabel",!0,ft],["showTimeLevel",!0,ft],["scrollPosition",X.keyword_undefined,function(g,F,ot){var j,E;if((E=this)[g]){if(j=void 0,I(F)?j=F:typeof F=="string"&&I(new Date(F))&&(j=new Date(F)),(0,At.ht)(j))return;E[g](j),E.refresh()}(F=E.sheet())&&(F.Ut.n1i(E,g,ot),E.ki({sheet:F,sheetName:F.name(),slicer:E,propertyName:g}))}]],Yt(U,w=X.VQt),U.prototype.style=function(g){var F,ot;return arguments.length===0?(ot=this.RN)==null?void 0:ot.Gf():(typeof g=="string"?(ot=g.toLowerCase().replace("timeslicerstyle",""),(ot=(F=!(F=(F=(F=this.sheet())==null?void 0:F.getParent())==null?void 0:F.customTimelineThemes.get(g))&&ot in vt?vt[ot]():F)&&F.name())&&ot!==this.getStyleName()&&(this.Fur=ot)):g&&g instanceof S.TimelineStyle&&((F=new S.TimelineStyle).fromJSON(g.toJSON()),this.getStyleName())&&(this.Fur=void 0),this.yqt(F),this)},U.prototype.filterType=function(){return this.FQt.filterType},U.prototype.condition=function(){return this.FQt.getFilterCondition()},U.prototype.canShowRange=function(){return this.FQt.canShowRange},U.prototype.selection=function(){return this.FQt.selection},U.prototype.bounds=function(){var g;return(g=this.FQt.bounds)!=null&&g.startDate&&g!=null&&g.endDate?(g={startDate:new Date(g.startDate.toString()),endDate:new Date(g.endDate.toString())},this.mwr=g):this.mwr},U.prototype.selectionLevel=function(){return this.FQt.selectionLevel},U.prototype.getOptionsSet=function(){var g,F;return{nameInFormula:(F=this).nameInFormula(),sourceName:F.sourceName(),name:(g=F.name())!=null?g:F.t_e,captionName:F.captionName(),showHeader:F.showHeader(),showHorizontalScrollbar:F.showHorizontalScrollbar(),showTimeLevel:F.showTimeLevel(),showSelectionLabel:F.showSelectionLabel(),isLocked:F.isLocked(),oDe:F.oDe}},U.prototype.getValuesSet=function(){var g=this;return{filterCleared:g.filterCleared(),canShowRange:g.canShowRange(),selection:g.selection(),bounds:g.bounds(),level:g.level(),selectionLevel:g.selectionLevel(),scrollPosition:g.scrollPosition(),filterType:g.filterType(),condition:g.condition()}},U.prototype.initSlicerUI=function(){var g=this;g.GQt=new H.PivotTableTimelineSlicerViewModel(g.Mf,g.getOptionsSet.bind(g),g.getValuesSet.bind(g)),g.GQt.setStyle(g.RN),g.GQt.bind("valueChanged",function(F){g.FQt.selectionLevel=g.level(),g.setFilterWithSelection(F)}),g.GQt.bind("clearFilter",function(){g.clearFilter()}),g.GQt.bind("propertyChanged",function(F){var ot=F.propName;F=F.value,g[ot]&&g[ot](F)})},U.prototype.setFilterWithSelection=function(g){this.FQt.setFilter(g)},U.prototype.fromJSON=function(g){var F,ot;g&&(w.prototype.fromJSON.call(this,g),F=this,_.forEach(function(j){j=j[0],g[j]!==X.keyword_undefined&&(j==="scrollPosition"?F.scrollPosition(new Date(g[j])):F[j](g[j]))}),typeof g.style=="string"?F.style(g.style):(ot=g.style)!=null&&ot.name&&Object.keys(g.style).length===1?F.style(g.style.name):g.style&&((ot=new S.TimelineStyle).fromJSON(g.style),F.style(ot)))},U.prototype.yh=function(g,F,ot,j){g&&(w.prototype.yh.call(this,g,F,ot,j),F=this,g.showHeader!==X.keyword_undefined&&F.showHeader(g.showCaption==="1"),g.level!==X.keyword_undefined&&F.level(+g.level+1),g.showHorizontalScrollbar!==X.keyword_undefined&&F.showHorizontalScrollbar(g.showHorizontalScrollbar==="1"),g.showSelectionLabel!==X.keyword_undefined&&F.showSelectionLabel(g.showSelectionLabel==="1"),g.showTimeLevel!==X.keyword_undefined&&F.showTimeLevel(g.showTimeLevel==="1"),g.scrollPosition!==X.keyword_undefined&&F.scrollPosition(new Date(g.scrollPosition)),j=g.style||ot.getDefaultStyleName("defaultTimelineStyle"))&&(S.isBuildInTimelineStyle(j)?F.style(j.substring(15).toLowerCase()):(g=ot.getTimelineStyle(j))&&F.style(g.name()))},U.prototype.toJSON=function(g){var F,ot=this,j=w.prototype.toJSON.call(this,g);return _.forEach(function(E){E=E[0],j[E]=ot[E]()}),j.selectionLevel=ot.selectionLevel(),(g=ot.style())&&(F=ot.getStyleName(),j.style=F||g.toJSON()),j},U.prototype.wh=function(g,F,ot){var j,E;E=(E=(j=this).getStyleName())||j.efr(),E={name:tt(j.name()),cache:tt(j.FQt.name),caption:tt(j.captionName()),style:f(E),level:j.level()-1,selectionLevel:j.selectionLevel()-1,scrollPosition:(0,At.kQt)(j.scrollPosition())},j.showHeader()||(E.showHeader=at.SJS_False),j.disableResizingAndMoving()&&(E.lockedPosition=at.SJS_True),j.showSelectionLabel()||(E.showSelectionLabel=at.SJS_False),j.showTimeLevel()||(E.showTimeLevel=at.SJS_False),j.showHorizontalScrollbar()||(E.showHorizontalScrollbar=at.SJS_False),g.push(E)},U.prototype.L0=function(){w.prototype.L0.call(this),this.mwr={}},v=U,_.forEach(function(g){v.prototype[g[0]]=mt(g[0],g[1],g[2],g[3])}),o.PivotTableTimelineSlicer=v,o.PivotTimelineSlicerProperties=_)},"./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-view-model.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt;function mt(tt,_,v){return vt.call(this,tt,_,v)||this}Yt=this&&this.__extends||(B=function(tt,_){return(B=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(v,Ft){v.__proto__=Ft}:function(v,Ft){for(var w in Ft)Object.prototype.hasOwnProperty.call(Ft,w)&&(v[w]=Ft[w])}))(tt,_)},function(tt,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function v(){this.constructor=tt}B(tt,_),tt.prototype=_===null?Object.create(_):(v.prototype=_.prototype,new v)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableTimelineSlicerViewModel=void 0,At=ft("Shapes"),S=ft("Slicers"),at=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/pivot-slicer-shape.js"),X=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),H=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-view.js"),At&&S&&(At.registerCustomFormControl("pivotTimeline",H.PivotTableTimelineView),f=S.getSlicerSizePosInfo,S.SlicerChangeType,ft=S.SlicerViewModelBase,Yt(mt,vt=ft),mt.prototype.scrollPosition=function(tt){return X.keyword_null},mt.prototype.WQt=function(){var tt,_,v,Ft,w,I,U,g,F=this;(g=(U=this).Mf).shapes&&(this.zQt=new H.PivotTableTimelineView,tt=U.updateOptionsCallback(),_=(w=f(g,!1)).left,v=w.top,Ft=w.width,w=w.height,(I=(I=tt.oDe)!=null?I:g.shapes.get(tt.name))||(I=new at.TimelineShape(g,tt.name,!0,_,v,Ft,w),g.shapes.ZP(I),I.allowResize(!0),I.allowMove(!0),I.dynamicSize(!1),I.dynamicMove(!0)),I.drawingType="Timeline",U.zQt=I.GtV,U.RQt=I,U.zQt.xT&&U.resetFormControl(I),U.refreshFormControl(),U.zQt.addEventListener("valueChanged",function(ot,j){F.ki("valueChanged",j)}),U.zQt.addEventListener("clearFilter",function(ot,j){F.ki("clearFilter",{})}),U.zQt.addEventListener("propertyChanged",function(ot,j){F.ki("propertyChanged",j)}))},mt.prototype.refreshFormControl=function(){var tt;vt.prototype.refreshFormControl.call(this),(tt=this.zQt).setValue(this.updateValuesCallback()),tt.update()},o.PivotTableTimelineSlicerViewModel=mt)},"./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-view.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F;function ot(){return F!==null&&F.apply(this,arguments)||this}function j(A,Y){var L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt;if(!(0,X.ht)(A))return Ct=(0,B.getMonthMap)(),(0,X.ht)(Y)?"".concat(Ct[A.getMonth()]," ").concat(A.getDate(),", ").concat(A.getFullYear()):(ut=(kt=vt.Fe(vt.culture())).TimelineDateOrder,kt=kt.TimelineDateSuffix,gt=ut.indexOf(1),Z=ut.indexOf(2),ut=ut.indexOf(3),L=A.getFullYear(),ie=Y.getFullYear(),q=A.getMonth(),J=Y.getMonth(),Rt=Ct[q],Ct=Ct[J],P=(0,B.getQuarter)(A),bt=(0,B.getQuarter)(Y),P=mt().QUARTER_MAP[P],bt=mt().QUARTER_MAP[bt],k=A.getDate(),nt=Y.getDate(),A=A.getDate()===1&&Y.getDate()===(0,B.getLastDateOfMonth)(Y),Y=gt<Z,gt=Z<ut,Z=L+kt.year,ut=ie+kt.year,Rt+=kt.month,Ct+=kt.month,Bt=k+kt.date,kt=nt+kt.date,L===ie?A?q===0&&J===11?L:I.indexOf(q)!==-1&&U.indexOf(J)!==-1?J-q==2?Y?"".concat(Z," ").concat(P):"".concat(P," ").concat(Z):Y?"".concat(Z," ").concat(P," - ").concat(bt):"".concat(P," - ").concat(bt," ").concat(Z):q===J?Y?"".concat(Z," ").concat(Ct):"".concat(Ct," ").concat(Z):Y?"".concat(Z," ").concat(Rt," - ").concat(Ct):"".concat(Rt," - ").concat(Ct," ").concat(ut):q===J?(ie=void 0,ie=k===nt?gt?"".concat(Rt," ").concat(Bt):"".concat(Bt," ").concat(Rt," "):gt?"".concat(Rt," ").concat(Bt," - ").concat(kt):"".concat(Bt," - ").concat(kt," ").concat(Rt," "),Y?"".concat(Z," ").concat(ie):"".concat(ie," ").concat(Z)):(Xt=gt?"".concat(Rt," ").concat(Bt):"".concat(Bt," ").concat(Rt," "),Qt=gt?"".concat(Ct," ").concat(kt):"".concat(kt," ").concat(Ct," "),Y?"".concat(Z," ").concat(Xt," - ").concat(Qt):"".concat(Xt," - ").concat(Qt,", ").concat(ut)):A?q===0&&J===11?"".concat(Z," - ").concat(ut):I.indexOf(q)!==-1&&U.indexOf(J)!==-1?Y?"".concat(Z," ").concat(P," - ").concat(ut," ").concat(bt):"".concat(P," ").concat(Z," - ").concat(bt," ").concat(ut):Y?"".concat(Z," ").concat(Rt," - ").concat(ut," ").concat(Ct):"".concat(Rt," ").concat(Z," - ").concat(Ct," ").concat(ut):(Xt=gt?"".concat(Rt," ").concat(Bt):"".concat(Bt," ").concat(Rt," "),Qt=gt?"".concat(Ct," ").concat(kt):"".concat(kt," ").concat(Ct," "),Y?"".concat(Z," ").concat(Xt," - ").concat(ut," ").concat(Qt):"".concat(Xt,", ").concat(Z," - ").concat(Qt,", ").concat(ut)))}function E(A,Y,L){if((0,X.ht)(A)&&Y===X.PivotDateFilterOperator.Between||(0,X.ht)(Y))return mt().ALL_PERIODS;if(A&&A.startDate&&A.endDate&&A.endDate<A.startDate)return mt().INVALID_DATE_SELECTION;switch(Y){case X.PivotDateFilterOperator.equalsTo:case X.PivotDateFilterOperator.today:case X.PivotDateFilterOperator.yesterday:case X.PivotDateFilterOperator.tomorrow:return j(A.startDate);case X.PivotDateFilterOperator.Between:case X.PivotDateFilterOperator.nextWeek:case X.PivotDateFilterOperator.thisWeek:case X.PivotDateFilterOperator.lastWeek:case X.PivotDateFilterOperator.nextMonth:case X.PivotDateFilterOperator.thisMonth:case X.PivotDateFilterOperator.lastMonth:case X.PivotDateFilterOperator.nextQuarter:case X.PivotDateFilterOperator.thisQuarter:case X.PivotDateFilterOperator.lastQuarter:case X.PivotDateFilterOperator.nextYear:case X.PivotDateFilterOperator.thisYear:case X.PivotDateFilterOperator.lastYear:case X.PivotDateFilterOperator.yearToDate:return j(A.startDate,A.endDate)}var q=mt().TIMELINE_PLACE_HOLDER;switch(Y){case X.PivotDateFilterOperator.notEqualsTo:return mt().DateNotEqual.replace(q,j(L.eX));case X.PivotDateFilterOperator.before:return mt().DateOlderThan.replace(q,j(L.eX));case X.PivotDateFilterOperator.beforeEqualsTo:return mt().DateOlderThanOrEqual.replace(q,j(L.eX));case X.PivotDateFilterOperator.after:return mt().DateNewerThan.replace(q,j(L.eX));case X.PivotDateFilterOperator.afterEqualsTo:return mt().DateNewerThanOrEqual.replace(q,j(L.eX));case X.PivotDateFilterOperator.notBetween:return mt().DateNotEqual.replace(q,j(L.eX,L.value2));case X.PivotDateFilterOperator.Q1:return mt().AllDatesIn_Quarter1;case X.PivotDateFilterOperator.Q2:return mt().AllDatesIn_Quarter2;case X.PivotDateFilterOperator.Q3:return mt().AllDatesIn_Quarter3;case X.PivotDateFilterOperator.Q4:return mt().AllDatesIn_Quarter4;case X.PivotDateFilterOperator.M1:return mt().AllDatesIn_January;case X.PivotDateFilterOperator.M2:return mt().AllDatesIn_February;case X.PivotDateFilterOperator.M3:return mt().AllDatesIn_March;case X.PivotDateFilterOperator.M4:return mt().AllDatesIn_April;case X.PivotDateFilterOperator.M5:return mt().AllDatesIn_May;case X.PivotDateFilterOperator.M6:return mt().AllDatesIn_June;case X.PivotDateFilterOperator.M7:return mt().AllDatesIn_July;case X.PivotDateFilterOperator.M8:return mt().AllDatesIn_August;case X.PivotDateFilterOperator.M9:return mt().AllDatesIn_September;case X.PivotDateFilterOperator.M10:return mt().AllDatesIn_October;case X.PivotDateFilterOperator.M11:return mt().AllDatesIn_November;case X.PivotDateFilterOperator.M12:return mt().AllDatesIn_December;case X.PivotDateFilterOperator.dateToDate:if(!L.EVt)return j(A.startDate,A.endDate);if(L._by===X.PivotAdvancedDateFilterBy.year)return mt().PivotPanel_ValueFilterOrLabel_ParallelYearToDate;if(L._by===X.PivotAdvancedDateFilterBy.quarter)return mt().PivotPanel_ValueFilterOrLabel_ParallelQuarterToDate;if(L._by===X.PivotAdvancedDateFilterBy.month)return mt().PivotPanel_ValueFilterOrLabel_ParallelMonthToDate}return H.keyword_null}Yt=this&&this.__extends||(g=function(A,Y){return(g=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(L,q){L.__proto__=q}:function(L,q){for(var J in q)Object.prototype.hasOwnProperty.call(q,J)&&(L[J]=q[J])}))(A,Y)},function(A,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Class extends value "+String(Y)+" is not a constructor or null");function L(){this.constructor=A}g(A,Y),A.prototype=Y===null?Object.create(Y):(L.prototype=Y.prototype,new L)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableTimelineView=o.WHITE=o.BLACK=o.TIMELINE_DEFAULT_FONT=o.SELECTION_LABEL_FONT=void 0,At=ft("Core"),tt=ft("@spreadjs/js-sheets-common"),S=ft("Shapes"),at=ft("Slicers"),X=ft("Pivot"),H=ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),f=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-dropdown.js"),B=ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-list.js"),ft=ft("./dist/plugins/pivot/pivot.ns.js"),ft=new tt.Common.ResourceManager(ft.SR,"PivotTables"),vt=tt.Common.CultureManager,mt=ft.getResource.bind(ft),o.SELECTION_LABEL_FONT="normal 10pt calibri",o.TIMELINE_DEFAULT_FONT="normal 9pt calibri",o.BLACK="black",o.WHITE="white",at&&S&&(tt=at.SlicerViewBase,at.SlicerChangeType,_=at.SlicerUIType,v=at.paintBorder,Ft=at.fillText,w=at.getEllipsisText,Yt(ot,F=tt),ot.prototype.init=function(A){F.prototype.init.call(this,A),this.y4={canShowRange:H.keyword_null,selection:H.keyword_null,bounds:H.keyword_null,level:H.keyword_null,selectionLevel:H.keyword_null,filterCleared:H.keyword_null,scrollPosition:H.keyword_null,filterType:H.keyword_null,condition:H.keyword_null},this.LEt={},this.initList(),this.initClearFilterButton()},ot.prototype.initList=function(){var A,Y,L=this;(Y=(A=new B.PivotTimelineList).props).offset={top:-45,left:-10},Y.bounds=L.y4.bounds,A.props=Y,A.props.onSelectionChanged=L.onSelectionChanged.bind(L),A.props.getPointerRelativeControl=L.getPointerRelativeControl.bind(L),A.props.refresh=L.refresh.bind(L),A.props.getStyle=L.getStyle.bind(L),A.props.getThemeColor=L.getThemeColor.bind(L),A.props.setCursor=L.setCursor.bind(L),A.props.onScrollPositionChanged=L.onScrollPositionChanged.bind(L),L.wY=A,this.onWindowMouseMove=this.onWindowMouseMove.bind(this),this.onWindowMouseUp=this.onWindowMouseUp.bind(this),this.onWindowKeyUp=this.onWindowKeyUp.bind(this),this.onWindowMouseWheel=this.onWindowMouseWheel.bind(this),window.addEventListener("mousemove",this.onWindowMouseMove),window.addEventListener("mouseup",this.onWindowMouseUp),window.addEventListener("keyup",this.onWindowKeyUp),window.addEventListener("mousewheel",this.onWindowMouseWheel)},ot.prototype.initDropDown=function(){var A,Y=(A=this).sheet,L=A.onLevelChanged.bind(A),q=(L=new f.PivotTimelineDropdown(Y.parent&&Y.parent.j2(),At.mt.gi(Y.parent.Ti),L),A.dWt),J=(k=A.shape).startRow(),P=k.startColumn(),bt=k.startRowOffset(),k=k.startColumnOffset();J=Y.getCellRect(J,P),P=Y.zoom(),L.init(A.y4.level,J.x+(k+q.x)*P,J.y+(bt+q.y+20)*P)},ot.prototype.filterCleared=function(){return this.y4.filterCleared},ot.prototype.triggerEvent=function(A,Y){this.fireEvent(A,Y)},ot.prototype.onSelectionChanged=function(A){this.triggerEvent("valueChanged",A)},ot.prototype.onLevelChanged=function(A){this.triggerEvent("propertyChanged",{propName:"level",value:A}),this.wY.onLevelChanged()},ot.prototype.onScrollPositionChanged=function(A){this.triggerEvent("propertyChanged",{propName:"scrollPosition",value:A})},ot.prototype.setStyle=function(A){this.RN=A},ot.prototype.getStyle=function(A){return this.RN[A]()},ot.prototype.update=function(){var A,Y=(A=this).wY.props,L=(nt=A.y4).bounds,q=nt.selection,J=nt.selectionLevel,P=nt.level,bt=nt.scrollPosition,k=nt.canShowRange,nt=nt.filterCleared,gt=(Z=A.options).showHeader,Z=Z.showHorizontalScrollbar;Y.bounds=L,Y.selection=q,Y.level=P,Y.selectionLevel=J,Y.showHeader=gt,Y.showScrollbar=Z,Y.scrollPosition=bt,Y.canShowRange=k,Y.filterCleared=nt,A.wY.update()},ot.prototype.render=function(A,Y){var L,q,J,P,bt;if((Y=F.prototype.render.call(this,A,Y))&&(L=Y.left,q=Y.top,J=Y.w,Y=Y.h,!(J<0)))return bt=(P=this).LEt.showHeader,A.save(),A.rect(L+8,q+(bt?37:5),J+4,Y),A.clip(),P.LEt.showSelectionLabel&&P.paintSelectionLabel(A,L+10,q+(bt?30:5),J-70,30),P.LEt.showTimeLevel&&P.paintLevel(A,L,q-(bt?0:25),J,Y),P.paintList(A,L,q,J,Y),A.restore(),{left:L,top:q,w:J,h:Y}},ot.prototype.paintHeader=function(A,Y,L,q,J){var P=this;F.prototype.paintHeader.call(this,A,Y,L,q,J),P.width<=20||(J=(q=P.getWholeStyle())&&q.borderTop(),q=new At.Rect(Y+10,L,P.width-20,Math.min(P.height,25)),v(A,2,q,J,this.getThemeColor.bind(this)))},ot.prototype.paintSelectionLabel=function(A,Y,L,q,J){var P,bt=(k=(gt=this).y4).filterType,k=(bt=E(k.selection,bt,k.condition),gt.getWholeStyle()),nt=(P=gt.getStyle("selectionLabelStyle"))&&P.font()||k&&k.font()||o.SELECTION_LABEL_FONT,gt=gt.getThemeColor(P&&P.foreColor()||k&&k.foreColor()||o.BLACK);A.save(),Ft(A,w(A,bt,q),Y,L,gt,nt,J,q),A.restore()},ot.prototype.eCi=function(){var A,Y=0,L=(A=this.LEt).showHeader,q=A.showSelectionLabel,J=A.showTimeLevel,P=-10,bt=-45;return L?Y+=25:bt+=25,A.showHorizontalScrollbar||(P-=23),q||J||(Y-=20,bt+=20),{x:0,y:Y,listLeft:P,listTop:bt}},ot.prototype.paintList=function(A,Y,L,q,J){var P,bt,k,nt=this;A.save(),bt=-q/2+(P=nt.eCi()).x,k=-J/2+P.y,nt.wY.props.offset.left=P.listLeft,nt.wY.props.offset.top=P.listTop,A.rect(bt,k,q,J),A.clip(),A.beginPath(),A.translate(bt,k),nt.pWt(q,J),nt.wY.render(A),A.restore()},ot.prototype.paintLevel=function(A,Y,L,q,J){var P,bt,k,nt,gt,Z;if(Z=(gt=this).y4.level){switch(q=Y+(q<70?10:q-60),L+=30,k=gt.getWholeStyle(),P=(nt=gt.getStyle("timeLevelStyle"))&&nt.font()||k&&k.font()||o.TIMELINE_DEFAULT_FONT,nt=gt.getThemeColor(nt&&nt.foreColor()||k&&k.foreColor()||o.BLACK),bt="",Z){case at.TimelineLevel.years:bt=mt().TIME_LEVEL_YEARS;break;case at.TimelineLevel.quarters:bt=mt().TIME_LEVEL_QUARTERS;break;case at.TimelineLevel.months:bt=mt().TIME_LEVEL_MONTHS;break;case at.TimelineLevel.days:bt=mt().TIME_LEVEL_DAYS}A.save(),P=At.mt.yt(P),A.font=P,k=w(A,bt,60),Z=Math.ceil(A.measureText(k).width)+5,Ft(A,k,(q+=60-Z)-5,L,nt,P,30,Z),A.restore(),A.save(),k=q+Z,nt=L+10,A.beginPath(),A.fillStyle="#b2b2b2",A.moveTo(k,nt),A.lineTo(k+10,nt),A.lineTo(k+5,nt+10),A.lineTo(k,nt),A.closePath(),A.fill(),A.restore(),gt.dWt=new At.Rect(q-Y,gt.LEt.showHeader?30:5,Z+10,30)}},ot.prototype.pWt=function(A,Y){this.wY.props.containerSize={w:A,h:Y}},ot.prototype.setValue=function(A){this.y4=A,this.refresh()},ot.prototype.onWindowMouseMove=function(A){F.prototype.onWindowMouseMove.call(this,A),this.wY.onWindowMouseMove(A)},ot.prototype.onWindowMouseUp=function(A){this.wY.onWindowMouseUp(A)},ot.prototype.onWindowKeyUp=function(A){this.wY.onWindowKeyUp(A)},ot.prototype.onLevelDropDownClicked=function(A,Y){return!!this.mWt(A,Y)&&(this.initDropDown(),!0)},ot.prototype.doMouseDown=function(A){var Y,L=(Y=this).getPointerRelativeControl(A);return!(!Y.LEt.showTimeLevel||!Y.onLevelDropDownClicked(L.x,L.y))||this.wY.onMouseDown(A)},ot.prototype.doMouseMove=function(A){var Y;(Y=this).wY.onMouseMove(A),F.prototype.doMouseMove.call(this,A),A=Y.getPointerRelativeControl(A),Y.mWt(A.x,A.y)&&Y.setCursor("default")},ot.prototype.doMouseUp=function(A){this.wY.onMouseUp(A),F.prototype.doMouseUp.call(this,A)},ot.prototype.onWindowMouseWheel=function(A){this.wY.onWindowMouseWheel(A)},ot.prototype.mWt=function(A,Y){var L=this.dWt;return!!L&&A>=L.x&&A<=L.x+L.width&&Y>=L.y&&Y<=L.y+L.height-10},ot.prototype.bWt=function(){return{top:-5,left:31-this.width}},ot.prototype.gWt=function(A,Y){var L,q,J,P,bt,k,nt=this;if((k=F.prototype.gWt.call(this,A,Y)).rect)return k.rect;switch(L=nt.options,J=(k=nt.eCi()).listLeft,k=k.listTop,A){case _.scrollBar:q={rect:nt.wY.F1i(Y)};break;case _.item:bt=Y.index,P=Y.displayIndex,(0,X.ht)(P)||(bt=P+nt.wY.JQt),q=nt.wY.B1i(bt);break;case _.timeLevel:q={rect:nt.dWt};break;case _.dragBar:q={rect:nt.wY.nCi(Y)},L.showHorizontalScrollbar||(q.rect.x-=19)}return L.showHeader||(A===_.timeLevel&&L.showTimeLevel?q.rect.y+=5:q.rect.y-=15),q&&A!==_.timeLevel&&(q.rect.x-=J,q.rect.y-=k),q},ot.prototype.dispose=function(){this.wY.dispose(),this.wY=H.keyword_null,this.wWt=H.keyword_null,this.RN=H.keyword_null,this.dWt=H.keyword_null,window.removeEventListener("mousemove",this.onWindowMouseMove),window.removeEventListener("mouseup",this.onWindowMouseUp),window.removeEventListener("keyup",this.onWindowKeyUp),window.removeEventListener("mousewheel",this.onWindowMouseWheel),F.prototype.dispose.call(this)},o.PivotTableTimelineView=ot),I=[0,3,6,9],U=[2,5,8,11]},"./dist/plugins/pivot/pivot-panel/pivot-panel.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt;function xt(st,l,T){T===void 0&&(T=S.PivotPanelLayoutType.stack);var D=this;D.yWt=l.Zc,D.Ti=st,D._type=0,D.CWt=T,D.Qy=l.Qy,D.IWt=l,D.AWt=!1,D.NWt=[],D.TWt=0,D.Hc()}function Mt(st,l,T){return(st=dt.call(this,st,l)||this)._type=0,st.T$=1,st.MWt(T),st.GY=new ie(T,st),st.xWt={showFields:!0,showArea:!0,showViewList:!0},st.dh&&(st.Qy=st.dh.Qy,st.z=l,st.dh.addPivotView(st,!0)),st.paint(),st}Yt=this&&this.__extends||(Xt=function(st,l){return(Xt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(T,D){T.__proto__=D}:function(T,D){for(var M in D)Object.prototype.hasOwnProperty.call(D,M)&&(T[M]=D[M])}))(st,l)},function(st,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function T(){this.constructor=st}Xt(st,l),st.prototype=l===null?Object.create(l):(T.prototype=l.prototype,new T)}),At=this&&this.__assign||function(){return(At=Object.assign||function(st){for(var l,T,D=1,M=arguments.length;D<M;D++)for(T in l=arguments[D])Object.prototype.hasOwnProperty.call(l,T)&&(st[T]=l[T]);return st}).apply(this,arguments)},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotPanel=o.PivotPanelLayout=o.panelOperation=void 0,S=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),at=ft("./dist/plugins/pivot/pivot-core/pivot-view.js"),X=ft("Pivot"),Qt=ft("@spreadjs/js-sheets-common"),H=ft("./dist/plugins/pivot/pivot.ns.js"),f=ft("Core"),B=ft("./dist/plugins/pivot/pivot-ui/dropdown-list.js"),vt=ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),mt=ft("./dist/plugins/pivot/pivot-util.js"),tt=Qt.Common.zf.j0,ft=window,_=document,v=ft.jQuery,Ft="pivotPanel",w=null,I=Qt.Common.lt.ht,ft=new Qt.Common.ResourceManager(H.SR,"PivotTables"),U=ft.getResource.bind(ft),g=".pivot-panel",ot="gc-panel-all-field-item",j=(F="gc-panel-area-item")+"-content",E="gc-panel-defer-layout-right-button",A="gc-panel-bottomBorderStyle",Y="gc-panel-topBorderStyle",L="gc-panel-defer-layout-input",q="gc-panel-area-item-icon",J="gc-panel-area-item-label",P="data-index",bt="Pivot-Field-Filter",k="gc-panel-all-field-checkbox",nt="gc-panel-all-field",gt="gc-panel-collapse",Z="gc-panel-selected-view",ut="gc-panel-add",Rt="gc-panel-apply",Ct="gc-panel-withoutViewList",Bt="gc-panel-views",(Qt=kt=o.panelOperation||(o.panelOperation={}))[Qt.addField=0]="addField",Qt[Qt.removeField=1]="removeField",Qt[Qt.updateFieldArea=2]="updateFieldArea",Qt[Qt.updateValuePosition=3]="updateValuePosition",xt.prototype.Hc=function(){this.Fz()},xt.prototype.resetLayout=function(){var st=this;st.AWt=!1,st.NWt=[],st.TWt=0},xt.prototype.dispose=function(){var st=this;st.IWt=w,st.Qy=w,st.NWt=w,st.DWt=w,st.Ti.innerHTML="",st.Ti=void 0,st.SWt()},xt.prototype.Fz=function(){var st,l,T,D,M="."+(D=this).yWt,s=D.Ti;this.IWt.dh&&((0,f.GC$)(D.Ti,s).bind("dragover"+g+M,function(y){y.preventDefault()}).bind("dragleave"+g+M,function(){st&&(l=st)}),(0,f.GC$)("."+F,s).bind("dragstart"+g+M,function(){var y={r:null};xt.et(D,"beforeDrag",y),y.r||(st=st||(0,f.GC$)(this),(0,f.GC$)(document).bind("dragover"+g+M,function(G){G.preventDefault()}).bind("drop"+g+M,function(G){var K;G.preventDefault(),K=G.clientX,G=G.clientY,!st||K>D.Ti.offsetLeft&&K<D.Ti.offsetLeft+D.Ti.offsetWidth&&G>D.Ti.offsetTop&&G<D.Ti.offsetTop+D.Ti.offsetHeight||I(l)||(K=D.IWt.z.Zc,(D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh).wVt({cmd:"removeField",sheetName:"",cmdOption:{fieldName:l.attr("data-name"),pivotName:K,isSusPaint:D.AWt}})),(0,f.GC$)(document).unbind("dragover"+g+M),(0,f.GC$)(document).unbind("drop"+g+M),st=null}))}),(0,f.GC$)("."+j,s).bind("dragover"+g+M,function(y){var G,K;(K=y.target).classList.contains(F)?(y=y.offsetY,G=K.parentElement,(0,f.GC$)(G.children).removeClass(A),(0,f.GC$)(G.children).removeClass(Y),y<K.offsetHeight&&K.classList.add(Y)):K.classList.contains(j)&&K.lastElementChild&&K.lastElementChild.classList.add(A)}).bind("dragleave"+g+M,function(){(0,f.GC$)("."+F).removeClass(A).removeClass(Y)}).bind("drop"+g+M,function(y){var G,K,c,N,V;y.stopPropagation(),((y=y.toElement||y.relatedTarget||y.target).classList.contains(J)||y.classList.contains(q))&&(y=y.parentElement),st&&(c=st.attr("data-sourceName")||st.attr("data-name"),V=(0,f.GC$)(st).attr("data-area"),K=y&&parseInt((0,f.GC$)(y).attr("data-area"),10),G=parseInt((0,f.GC$)(y).attr(P),10),y.childElementCount===0?G=0:y.classList.contains("gc-panel-area-item-content")&&(y=y.lastElementChild,G=parseInt((0,f.GC$)(y).attr(P),10),G++),I(V)?(D.AWt&&(y=kt.addField,D.NWt.push({name:c,toArea:K,index:G,type:y})),T=D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh,N=D.IWt.z.Zc,T.wVt({cmd:"AddField",sheetName:"",cmdOption:{fieldName:c,targetArea:K,targetIndex:G,pivotName:N,isSusPaint:D.AWt}})):I(K)||(V=D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh,N=D.IWt.z.Zc,V.wVt({cmd:"moveField",sheetName:"",cmdOption:{fieldName:c,targetArea:K,targetIndex:G,pivotName:N,isSusPaint:D.AWt}})),l=st=null)}),(0,f.GC$)("."+ot,s).bind("dragstart"+g+M,function(){st=st||(0,f.GC$)(this)}),(0,f.GC$)("."+nt,s).bind("dragenter"+g+M,function(y){y.stopPropagation(),st&&(l=st)}).bind("drop"+g+M,function(){var y,G;I(l)||(D.AWt&&D.NWt.push({name:l.attr("data-name"),type:kt.removeField}),y=D.IWt.z.Zc,(G=D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh).wVt({cmd:"removeField",sheetName:"",cmdOption:{fieldName:l.attr("data-name"),pivotName:y,fieldsModel:G,isSusPaint:D.AWt}})),l=st=null}),(0,f.GC$)("."+L,s).bind("click"+g+M,function(y){D.AWt=y.target.checked,y=(0,f.GC$)("."+E),D.AWt?D.IWt.dh&&(D.IWt.dh.copyFieldsModel=D.IWt.dh.clone()):(D.IWt.dh.copyFieldsModel=void 0,D.IWt.refresh(D.AWt)),y&&y.prop("disabled",!D.AWt)}),(0,f.GC$)("."+E,s).bind("click"+g+M,function(){var y,G;D.AWt&&(y=D.IWt.dh.copyFieldsModel.UM(),G=D.IWt.z.Zc,D.IWt.dh.wVt({cmd:"updatePivotDefer",sheetName:"",cmdOption:{pivotName:G,fieldsInfo:y}})),D.IWt.refresh(!1)}),(0,f.GC$)("."+q,s).bind("click"+M,function(y){var G,K,c,N,V,O;(0,f.GC$)(this).hasClass(bt)||(G=(c=(0,f.GC$)(y.target).parent()).attr("data-name"),K=+c.attr("data-area"),c=+c.attr(P),N=D.updateOptionForDropDown(G,K,c),y={x:y.clientX,y:y.clientY},V=D.IWt.z.Zc,O=D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh,new B.PivotDropDown(document.body,O,V,G,K,c,D.AWt).rQ(y,N))}),(0,f.GC$)("."+ot,s).bind("contextmenu"+M,function(y){var G=(0,f.GC$)(this).attr("data-name"),K=(y={x:y.clientX,y:y.clientY},D.IWt.z.Zc),c=D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh;return new B.PivotCacheFieldsDropdownDialog(document.body,c,K,G,null,null,D.AWt).rQ(y),!1}),(0,f.GC$)("."+k,s).bind("click"+M,function(y){y=(0,f.GC$)(y.target).parent().attr("data-sourceName");var G=this.checked,K=D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh;y={fieldName:y,checked:G,pivotName:D.IWt.z.Zc,isSusPaint:D.AWt},K.wVt({cmd:"changePanelFieldStatus",sheetName:D.IWt.Zc,cmdOption:y})}),(0,f.GC$)("."+bt,s).bind("click"+M,function(y){var G,K=(0,f.GC$)(y.target).parent().attr("data-name"),c=(y={x:y.pageX,y:y.pageY},D.AWt?D.IWt.dh.copyFieldsModel:D.IWt.dh),N=D.IWt.z.Zc;(G=D.IWt.z)instanceof vt.PivotTable&&(G=G.layoutType()===S.PivotTableLayoutType.compact,c.wVt({cmd:"CreatePivotFilterDialog",sheetName:D.IWt.Zc,cmdOption:{position:y,fieldName:K,fieldsModel:c,isCompact:G,pivotName:N}}))}),(0,f.GC$)("."+gt,s).bind("click"+M,function(y){var G,K=D.IWt.dh,c=(y={x:y.pageX,y:y.pageY},D.IWt.z),N=D.IWt.z.Zc,V=100;(G=(0,f.GC$)("."+Bt))&&0<G.length&&200<G.width()&&300<(V=G.width()-100)&&(V=300),c&&(G={position:y,pivotName:N,views:c.views,width:V},K.wVt({cmd:"CreatePivotViewsListDialog",cmdOption:G}))}),(0,f.GC$)("."+ut,s).bind("click"+M,function(y){var G,K,c,N=(0,f.GC$)("#"+Z).val();(0,mt.kWt)(N)&&(N=U().DefaultPivotTableViewName),G=D.IWt.z,K=D.IWt.dh,c=D.IWt.z.Zc,G&&(N={name:N,pivotName:c,views:G.views},K.wVt({cmd:"AddPivotView",cmdOption:N}),(0,f.GC$)("#"+Z).val(""))}),(0,f.GC$)("."+Rt,s).bind("click"+M,function(y){var G=(0,f.GC$)("#"+Z).val(),K=D.IWt.dh,c=D.IWt.z,N=D.IWt.z.Zc;c&&(G={name:G,pivotName:N,views:c.views},K.wVt({cmd:"ApplyPivotView",cmdOption:G}))}),(0,f.GC$)("."+nt,s).bind("scroll.pivotPanel"+g+M,function(){D.TWt=this.scrollTop}))},xt.prototype.updateOptionForDropDown=function(st,l,T){var D=this.AWt?this.IWt.dh.copyFieldsModel:this.IWt.dh,M={1:X.DataPosition.row,2:X.DataPosition.col},s={isSigma:!1,isAlone:!1,location:1,area:l},y=D.getSigmaValuePosition(),G=(D=D.nw(l),0);return y.display&&y.positionType===M[l]&&(G=1),st===U().sigmaValue&&(s.isSigma=!0),(y=D.length+G)===1&&(s.isAlone=!0),T===0?s.location=1:T<y-1?s.location=2:T===y-1&&(s.location=3),s},xt.prototype.SWt=function(){var st="."+this.yWt,l=this.Ti;(0,f.GC$)(document).unbind("dragover"+g+st),(0,f.GC$)(document).unbind("drop"+g+st),(0,f.GC$)("."+F,l).unbind("dragstart"+g+st),(0,f.GC$)("."+ot,l).unbind("dragstart"+g+st),(0,f.GC$)(this.Ti,l).unbind("dragover"+g+st),(0,f.GC$)(this.Ti,l).unbind("dragleave"+g+st),(0,f.GC$)("."+j,l).unbind("dragleave"+g+st),(0,f.GC$)("."+j,l).unbind("dragover"+g+st),(0,f.GC$)("."+j,l).unbind("drop"+g+st),(0,f.GC$)("."+ot,l).unbind("dragstart"+g+st),(0,f.GC$)("."+nt,l).unbind("drop"+g+st),(0,f.GC$)("."+nt,l).unbind("dragenter"+g+st),(0,f.GC$)("."+L,l).unbind("click"+g+st),(0,f.GC$)("."+E,l).unbind("click"+g+st),(0,f.GC$)("."+q,l).unbind("click."+st),(0,f.GC$)("."+ot,l).unbind("contextmenu."+st),(0,f.GC$)("."+k,l).unbind("click."+st),(0,f.GC$)("."+bt,l).unbind("click."+st),(0,f.GC$)("."+gt,l).unbind("click."+st),(0,f.GC$)("."+ut,l).unbind("click."+st),(0,f.GC$)("."+Rt,l).unbind("click."+st),(0,f.GC$)("."+nt,l).unbind("scroll"+g+st)},xt.prototype.Mrt=function(st){var l,T,D=st.allField,M=st.rowField,s=st.colField,y=st.valueField,G=st.filterField;st=st.valuePosition,y&&1<y.length&&st.positionType===X.DataPosition.row&&M.splice(st.positionIndex,0,{Zc:U().sigmaValue,lp:st.positionIndex}),y&&1<y.length&&st.positionType===X.DataPosition.col&&s.splice(st.positionIndex,0,{Zc:U().sigmaValue,lp:st.positionIndex}),l=S.PivotPanelLayoutType[(st=this).CWt].toLocaleLowerCase(),T=st.jWt(),D=st.OWt(D),G=st.PWt([G,M,s,y]),M=st.FWt(),s=st.IWt.xWt.showViewList?st._Wt():"",y=st.IWt.xWt.showFields?`
  9. <div class="gc-panel-fields-section" `.concat("containArea",'="').concat(st.IWt.xWt.showArea,`">
  10. `).concat(T,`
  11. `).concat(D,`
  12. </div>`):"",T=st.IWt.xWt.showArea?`
  13. <div class="gc-panel-areas-section" `.concat("containFields",'="').concat(st.IWt.xWt.showFields,`">
  14. <span>`).concat(U().PivotPanel_FieldAreaText,`</span>
  15. <div class = "gc-panel-field-area">
  16. `).concat(G,`
  17. </div>
  18. `).concat(M,`
  19. </div>
  20. `):"",st.Ti.innerHTML=`
  21. <div class="gc-panel gc-panel-`.concat(l,` gc-no-user-select">
  22. <div class=`).concat(Ct," ").concat("containViewList",'="').concat(st.IWt.xWt.showViewList,`">
  23. <div class="gc-panel-header">
  24. <h2>`).concat(U().PivotPanel_Title,`</h2>
  25. </div>
  26. `).concat(y,`
  27. `).concat(T,`
  28. </div>
  29. `).concat(s,`
  30. </div>
  31. `),(D=(0,f.GC$)("#"+nt)[0])&&D.scrollTo({top:st.TWt})},xt.prototype._Wt=function(){return`
  32. <div class="`.concat(Bt,`">
  33. <span style="width: 45px;display: inline-block;text-align: center; font-size: 14px">`).concat(U().Views,`</span>
  34. <div style="width: calc(100% - 50px); display: inline-block; border: 1px solid #CBCBCB; white-space: nowrap">
  35. <span class="`).concat(gt,`"></span>
  36. <input style="border: none; width: calc(100% - 91px); outline:none; vertical-align: text-bottom;" id="`).concat(Z,`"/>
  37. <input type="button" class="gc-panel-button `).concat(ut,`" value="\u271A"/>
  38. <input type="button" class="gc-panel-button `).concat(Rt,`" value="\u2714"/>
  39. </div>
  40. </div>
  41. `)},xt.prototype.jWt=function(){return`
  42. <span>`.concat(U().PivotPanel_ReportText,`</span>
  43. `)},xt.prototype.OWt=function(st){var l,T,D,M,s,y,G,K="";if(st)for(l=0,T=st;l<T.length;l++)D=(G=T[l]).fieldName,M=G.sourceName,s=G.isFilter,y=G.isPivotField,G=G.isDim,K+=this.LWt(D,M,s,y,G);return`
  44. <div class="`.concat(nt,'" id="').concat(nt,`">
  45. <ul>
  46. `).concat(K,`
  47. </ul>
  48. </div>
  49. `)},xt.prototype.LWt=function(st,l,T,D,M){return l=tt(l),st=tt(st),`
  50. <li class="`.concat(ot+(T?" gc-panel-all-field-item-filtered":""),'" title="').concat(st,'" data-name="').concat(st,'" data-sourceName="').concat(l,`" draggable="true">
  51. <input type="checkbox" `).concat(D?"checked":"",' class = "').concat(k,` gc-panel-checkbox"/>
  52. <span class="`).concat(D?"gc-panel-all-field-checked":"gc-panel-all-field-unchecked",'">').concat((0,mt.NUr)(M?st:l),`</span>
  53. <span class="`).concat(q+" "+bt,`"></span>
  54. <span class="`).concat(T?"gc-panel-all-field-filter":"",`"></span>
  55. </li>`)},xt.prototype.render=function(st){this.SWt(),this.Mrt(st),this.Fz()},xt.prototype.d5=function(){this.SWt(),this.Ti.innerHTML=""},xt.prototype.PWt=function(st){for(var l,T="",D=0,M=this.CWt===S.PivotPanelLayoutType.stack?[0,2,1,3]:[0,1,2,3];D<M.length;D++)l=M[D],T+=this.EWt(l,st?st[l]:null);return T},xt.prototype.BWt=function(st){return st=["Filters","Rows","Columns","Values"][st],{title:U()["PivotPanel_"+st+"ItemsTitle"],rowItemClass:st}},xt.prototype.EWt=function(st,l){var T=(D=this.BWt(st)).title,D=D.rowItemClass,M="";return l&&(M=this.RWt(l,st)),`
  56. <section class="gc-panel-area-section gc-panel-area-section-`.concat(D,`">
  57. <div class="gc-panel-area-item-title">
  58. <label class="`).concat(q," gc-panel-area-item-").concat(D,`"></label>
  59. <span>`).concat(T,`</span>
  60. </div>
  61. <ul class="gc-panel-area-item-content" data-area="`).concat(st,`">
  62. `).concat(M,`
  63. </ul>
  64. </section>`)},xt.prototype.RWt=function(st,l){var T=this,D="";return st.forEach(function(M,s){D+=T.GWt(M.Zc,l,s)}),D},xt.prototype.GWt=function(st,l,T){return`
  65. <li class="`.concat(F,'" data-name="').concat(tt(st),'" data-area="').concat(l,'" data-index="').concat(T,`" draggable="true">
  66. <span class="`).concat(J,'">').concat((0,mt.NUr)(tt(st)),`</span>
  67. <span class="`).concat(q,`"></span>
  68. </li>
  69. `)},xt.prototype.FWt=function(){return`<div class = "gc-panel-defer-layout-update">
  70. <div class = "gc-panel-defer-layout-left-div">
  71. <input type="checkbox" class = "gc-panel-checkbox gc-panel-defer-layout-input" `.concat(this.AWt?"checked":"",`>
  72. <label>`).concat(U().PivotPanel_DeferUpdateText,`</label >
  73. </div>
  74. <button class="gc-panel-defer-layout-right-button" `).concat(this.AWt?"":"disabled",">").concat(U().PivotPanel_Update,`</button>
  75. </div>
  76. `)},xt.prototype.VWt=function(st){if(I(st))return this.CWt;this.CWt=st},ie=xt,o.PivotPanelLayout=ie,(0,f.$e)(ie),Yt(Mt,dt=at.PivotView),Mt.prototype.MWt=function(st){st&&(v&&v(st).data(Ft,this),(0,f.GC$)(st).data(Ft,this))},Mt.prototype.UWt=function(){var st;(st=(st=this).GY&&st.GY.Ti)&&(v&&v(st).data(Ft,w),(0,f.GC$)(st).data(Ft,w))},Mt.prototype.isPivotViewAttached=function(st){return this.z&&this.z===st},Mt.prototype.attach=function(st){this.detach(),st&&(this.dh=st.dh,this.Qy=this.dh.Qy,this.dh.addPivotView(this,!0),this.z=st),this.GY.resetLayout(),this.paint()},Mt.prototype.detach=function(){this.dh&&(this.dh.removePivotView(this),this.dh=null,this.z=null,this.GY.resetLayout(),this.paint())},Mt.prototype.sectionVisibility=function(st){var l;if(I(st))return l=0,this.xWt.showFields&&(l+=S.PivotPanelSection.fields),this.xWt.showArea&&(l+=S.PivotPanelSection.area),this.xWt.showViewList&&(l+=S.PivotPanelSection.viewList),l;l={showFields:!1,showArea:!1,showViewList:!1},st&S.PivotPanelSection.fields&&(l.showFields=!0),st&S.PivotPanelSection.area&&(l.showArea=!0),st&S.PivotPanelSection.viewList?((0,f.GC$)("."+Ct).attr("containViewList","true"),l.showViewList=!0):(0,f.GC$)("."+Ct).attr("containViewList","false"),this.xWt=l,this.refresh(!1)},Mt.prototype.panelLayout=function(st){var l=this.GY.VWt();if(I(st))return l;st===S.PivotPanelLayoutType.stack&&l===S.PivotPanelLayoutType.flow?(this.GY.VWt(S.PivotPanelLayoutType.stack),this.refresh(!1)):st===S.PivotPanelLayoutType.flow&&l===S.PivotPanelLayoutType.stack&&(this.GY.VWt(S.PivotPanelLayoutType.flow),this.refresh(!1))},Mt.prototype.type=function(st){if(arguments.length===0)return this._type;this._type=st},Mt.prototype.paint=function(st){var l=this,T=(st=st?this.dh.copyFieldsModel:this.dh,l.z&&l.z.views.all());l.GY.render(st?At(At({},st.IVt()),{views:T}):{allField:null,rowField:null,colField:null,valueField:null,filterField:null,valuePosition:null,views:T})},Mt.prototype.refresh=function(st){var l=st?this.dh.copyFieldsModel:this.dh;l&&l.q3(st)},Mt.prototype.destroy=function(){var st=this;st.Qy=w,st.dh&&(st.dh.removePivotView(st),st.dh=w),st.UWt(),st.Ti=w,st.GY&&(st.GY.dispose(),st.GY=w)},Mt.prototype.dispose=function(){this.destroy(),this.z=w},Mt.findControl=function(st){return typeof st=="string"&&(st=_.getElementById(st)),(0,f.GC$)(st).data(Ft)},o.PivotPanel=Mt},"./dist/plugins/pivot/pivot-panel/pivot-widget.js":function(Ie,o,ft){var Yt;function At(S){return S===0?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMThweCIgaGVpZ2h0PSIxOHB4IiB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c29ydDE8L3RpdGxlPgogICAgPGcgaWQ9InNvcnQxIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTcsMCBMMTcsMTcgTDAsMTcgTDAsMCBMMTcsMCBaIE0xNiwxIEwxLDEgTDEsMTYgTDE2LDE2IEwxNiwxIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiNBQkFCQUIiPjwvcGF0aD4KICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjRjdGOUZCIiB4PSIxIiB5PSIxIiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiPjwvcmVjdD4KICAgICAgICA8cG9seWdvbiBpZD0i6Lev5b6ELTQiIGZpbGw9IiM2NjY2NjYiIHBvaW50cz0iNSA3IDEzIDcgOSAxMSI+PC9wb2x5Z29uPgogICAgPC9nPgo8L3N2Zz4=":S===1?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMThweCIgaGVpZ2h0PSIxOHB4IiB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c29ydDQ8L3RpdGxlPgogICAgPGcgaWQ9InNvcnQ0IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTcsMCBMMTcsMTcgTDAsMTcgTDAsMCBMMTcsMCBaIE0xNiwxIEwxLDEgTDEsMTYgTDE2LDE2IEwxNiwxIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiNBQkFCQUIiPjwvcGF0aD4KICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjRjdGOUZCIiB4PSIxIiB5PSIxIiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiPjwvcmVjdD4KICAgICAgICA8cGF0aCBkPSJNMTEsMyBMMTIsMyBMMTIsOSBMMTQsOSBMMTEuNSwxMiBMOSw5IEwxMSw5IEwxMSwzIFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzY2NjY2NiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTEuNTAwMDAwLCA3LjUwMDAwMCkgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTExLjUwMDAwMCwgLTcuNTAwMDAwKSAiPjwvcGF0aD4KICAgICAgICA8cG9seWdvbiBpZD0i6Lev5b6ELTQiIGZpbGw9IiM2NjY2NjYiIHBvaW50cz0iMyAxMCA4IDEwIDUuNSAxMyI+PC9wb2x5Z29uPgogICAgPC9nPgo8L3N2Zz4=":S===2?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMThweCIgaGVpZ2h0PSIxOHB4IiB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c29ydDM8L3RpdGxlPgogICAgPGcgaWQ9InNvcnQzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTcsMCBMMTcsMTcgTDAsMTcgTDAsMCBMMTcsMCBaIE0xNiwxIEwxLDEgTDEsMTYgTDE2LDE2IEwxNiwxIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiNBQkFCQUIiPjwvcGF0aD4KICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjRjdGOUZCIiB4PSIxIiB5PSIxIiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiPjwvcmVjdD4KICAgICAgICA8cGF0aCBkPSJNMTEsMyBMMTIsMyBMMTIsOSBMMTQsOSBMMTEuNSwxMiBMOSw5IEwxMSw5IEwxMSwzIFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzY2NjY2NiI+PC9wYXRoPgogICAgICAgIDxwb2x5Z29uIGlkPSLot6/lvoQtNCIgZmlsbD0iIzY2NjY2NiIgcG9pbnRzPSIzIDEwIDggMTAgNS41IDEzIj48L3BvbHlnb24+CiAgICA8L2c+Cjwvc3ZnPg==":S===3?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMThweCIgaGVpZ2h0PSIxOHB4IiB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c29ydDI8L3RpdGxlPgogICAgPGcgaWQ9InNvcnQyIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTcsMCBMMTcsMTcgTDAsMTcgTDAsMCBMMTcsMCBaIE0xNiwxIEwxLDEgTDEsMTYgTDE2LDE2IEwxNiwxIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiNBQkFCQUIiPjwvcGF0aD4KICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjRjdGOUZCIiB4PSIxIiB5PSIxIiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiPjwvcmVjdD4KICAgICAgICA8cG9seWdvbiBpZD0i6Lev5b6ELTQiIGZpbGw9IiM2NjY2NjYiIHBvaW50cz0iMyAxMCA4IDEwIDUuNSAxMyI+PC9wb2x5Z29uPgogICAgICAgIDxwYXRoIGQ9Ik0xNC4zNTk0ODc1LDQgQzE0LjUyNTE3MjksNCAxNC42NTk0ODc1LDQuMTM0MzE0NTggMTQuNjU5NDg3NSw0LjMgQzE0LjY1OTQ4NzUsNC4zNzAxODA5NSAxNC42MzQ4ODI3LDQuNDM4MTQwODIgMTQuNTg5OTUzOSw0LjQ5MjA1NTMyIEwxMS4zOTk1MDUsOC4zMiBMMTEuNCwxMS42MzIyNTgxIEw5LjYsMTIuNiBMOS41OTk1MDQ5Niw4LjMyIEw2LjQxMDA0NjEsNC40OTIwNTUzMiBDNi4zMDM5NzY4OCw0LjM2NDc3MjI1IDYuMzIxMTc0MDksNC4xNzU2MDI4NCA2LjQ0ODQ1NzE2LDQuMDY5NTMzNjIgQzYuNTAyMzcxNjYsNC4wMjQ2MDQ4NyA2LjU3MDMzMTUzLDQgNi42NDA1MTI0OCw0IEwxNC4zNTk0ODc1LDQgWiIgaWQ9IkNvbWJpbmVkLVNoYXBlIiBmaWxsPSIjNjY2NjY2Ij48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==":S===4?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMThweCIgaGVpZ2h0PSIxOHB4IiB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c29ydDU8L3RpdGxlPgogICAgPGcgaWQ9InNvcnQ1IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTcsMCBMMTcsMTcgTDAsMTcgTDAsMCBMMTcsMCBaIE0xNiwxIEwxLDEgTDEsMTYgTDE2LDE2IEwxNiwxIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiNBQkFCQUIiPjwvcGF0aD4KICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjRjdGOUZCIiB4PSIxIiB5PSIxIiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiPjwvcmVjdD4KICAgICAgICA8cGF0aCBkPSJNNCw1IEw1LDUgTDUsMTEgTDcsMTEgTDQuNSwxNCBMMiwxMSBMNCwxMSBMNCw1IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzY2NjY2NiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNC41MDAwMDAsIDkuNTAwMDAwKSByb3RhdGUoLTE4MC4wMDAwMDApIHRyYW5zbGF0ZSgtNC41MDAwMDAsIC05LjUwMDAwMCkgIj48L3BhdGg+CiAgICAgICAgPHBhdGggZD0iTTE0LjM1OTQ4NzUsNCBDMTQuNTI1MTcyOSw0IDE0LjY1OTQ4NzUsNC4xMzQzMTQ1OCAxNC42NTk0ODc1LDQuMyBDMTQuNjU5NDg3NSw0LjM3MDE4MDk1IDE0LjYzNDg4MjcsNC40MzgxNDA4MiAxNC41ODk5NTM5LDQuNDkyMDU1MzIgTDExLjM5OTUwNSw4LjMyIEwxMS40LDExLjYzMjI1ODEgTDkuNiwxMi42IEw5LjU5OTUwNDk2LDguMzIgTDYuNDEwMDQ2MSw0LjQ5MjA1NTMyIEM2LjMwMzk3Njg4LDQuMzY0NzcyMjUgNi4zMjExNzQwOSw0LjE3NTYwMjg0IDYuNDQ4NDU3MTYsNC4wNjk1MzM2MiBDNi41MDIzNzE2Niw0LjAyNDYwNDg3IDYuNTcwMzMxNTMsNCA2LjY0MDUxMjQ4LDQgTDE0LjM1OTQ4NzUsNCBaIiBpZD0iQ29tYmluZWQtU2hhcGUiIGZpbGw9IiM2NjY2NjYiPjwvcGF0aD4KICAgIDwvZz4KPC9zdmc+":S===5?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMThweCIgaGVpZ2h0PSIxOHB4IiB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c29ydDY8L3RpdGxlPgogICAgPGcgaWQ9InNvcnQ2IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTcsMCBMMTcsMTcgTDAsMTcgTDAsMCBMMTcsMCBaIE0xNiwxIEwxLDEgTDEsMTYgTDE2LDE2IEwxNiwxIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiNBQkFCQUIiPjwvcGF0aD4KICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjRjdGOUZCIiB4PSIxIiB5PSIxIiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiPjwvcmVjdD4KICAgICAgICA8cGF0aCBkPSJNNCw1IEw1LDUgTDUsMTEgTDcsMTEgTDQuNSwxNCBMMiwxMSBMNCwxMSBMNCw1IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzY2NjY2NiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNC41MDAwMDAsIDkuNTAwMDAwKSBzY2FsZSgxLCAtMSkgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTQuNTAwMDAwLCAtOS41MDAwMDApICI+PC9wYXRoPgogICAgICAgIDxwYXRoIGQ9Ik0xNC4zNTk0ODc1LDQgQzE0LjUyNTE3MjksNCAxNC42NTk0ODc1LDQuMTM0MzE0NTggMTQuNjU5NDg3NSw0LjMgQzE0LjY1OTQ4NzUsNC4zNzAxODA5NSAxNC42MzQ4ODI3LDQuNDM4MTQwODIgMTQuNTg5OTUzOSw0LjQ5MjA1NTMyIEwxMS4zOTk1MDUsOC4zMiBMMTEuNCwxMS42MzIyNTgxIEw5LjYsMTIuNiBMOS41OTk1MDQ5Niw4LjMyIEw2LjQxMDA0NjEsNC40OTIwNTUzMiBDNi4zMDM5NzY4OCw0LjM2NDc3MjI1IDYuMzIxMTc0MDksNC4xNzU2MDI4NCA2LjQ0ODQ1NzE2LDQuMDY5NTMzNjIgQzYuNTAyMzcxNjYsNC4wMjQ2MDQ4NyA2LjU3MDMzMTUzLDQgNi42NDA1MTI0OCw0IEwxNC4zNTk0ODc1LDQgWiIgaWQ9IkNvbWJpbmVkLVNoYXBlIiBmaWxsPSIjNjY2NjY2Ij48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==":S===6?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAeBJREFUOBGtkj1oU1EUx8+5fSC00VZoCwpOtUOcBMHFdhA0g5ODg0HSDg0EuoibOrTRodBdhWIMlCAFFTMphCqVakgGcS2InSoiQQ22SUxe373H+7+ax2uJkz3w7rnn6/fOvecSHaQsfqjNLLyvCXQvbrValUqlItGYihrNts50ds0b6Ki/uw+CgLTWXdPpEHC7/Pl0xzenuE8lfd/EYe/JtAaK/wlotnSm7QdPs2dHv/7yg2ew9wN6dcBIml2rxYLG9hdi3mShLWE6QSJjXuzI8QfnRxtdUKlUEmamRCLh6uD3sLTq9aSQqnl96jr+4nkeBYHO+9Zvww+RAzHGWO6eO/wL8E1GickvJ8fX/6QSXV3ZyBsmHCMEAP5fUiwWBV8U4o7QWb0Q175+7gK2RVE8SEaOseKJ/ktr5W7B/gnA7wCHLr7asPs4HPJycqTR0utM6snAlXdhMWIA9LwDBCHyeOLozvf2KrF6G7tWvkEUXraL9wKEGfLo3OGfuvnajvDjUPryFHPWuCq7FAqFeTuBLGyMEV0opbKpVOqOe4mydKa/3vjxQrc6W0OD49PRYhQhEQB0gElgD58DYvm2ePKWpS64h2Ro13WOu2a6N3zz033kQHK53Bx0Op2+C30g8htq3/HPc2QfaQAAAABJRU5ErkJggg==":S===7?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAdVJREFUOBFjYKAQMIL0/9ztovn31991YLP+/2f4z8TIz/DvvyQjE6MNl9f+ozA7Tpw48R8IGCwtLcH6QOIsIILddc91IKUJYv/fZiv65dvfQ4wMTKu4Q47ANYPk/vz5A6JQANgAmMj/pTaCn9/+2M3AyHSYJ/poIQMD3CKwkr9//8KUwmm4Af/nWvN+/Ppl539GhisCKQEZjIyM/+GqoAyQC4DiKMJgA/7PNOZ6/+XdVqD3HgtJ6cQzMjb8Q1FFyIC3Hz7mAwPHFmj83bd3z19506ECDAygLkaGKSIVd6bCDPv37x8DKBCRAdgFIuV32oGCIIwXYAtEJmQdnedeJbedefUfRCOLw9ggA9ANQTHg64+/6T9//zsAomGakGlQLKDHBNyAqqNPDH7++qfFyMwU+evXP00QH1kziA3SjNMFX7/9Tf/x68/qBjOxF99//VkD4mMzAN0F4EjN2v+K58+XT89AsQCM/cfAtCALDG5lFh4+qWmOYl8WL15cD4yBBpCBoHQAigkmJqaG2NjYRrAXvr1/H/nz9/9Xf/8y5v/49bcHRAO98wokDtIEUggyAOYFEBskBpIDg7AV189ELL9eBeODaBAfJI4sNmfOnDoQRhajmA0AtPr0ppdKGGIAAAAASUVORK5CYII=":S===8?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAO5JREFUOBFjYBgFRIfAjRs3eI8dO7bz+PHjRsiaWJA5uNhnzpxhffny5dr///+7MjExgfQ4w9QywRggev/+/Rx79+6NRBYDamJ8//79/J8/f7r+/v373q9fv6KQ5VEM+Pbt24rv378v27ZtWwFMEZDdCdQUDdT8+u/fv+4uLi4vYXIgmhGZs3HjRr9///6tBYoxA3EqEPMAXTCBkZHxKzMzs6Ofn99pZPUgNooBIIGVK1eCvLAEqJEB6F9GIP0XSPuFhoZuB8mjAwwDQAoWL16cAtQ4G6o4MS4ubgGUTTw1b968wrlz51YRr2PkqgQA82JlH8nI1QYAAAAASUVORK5CYII=":S===9?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAPlJREFUOBHtULkNg0AQPJBBogVyKICE1CSkxIgCqMkFUAApiQlISCiAAlwABIjfM2dZOnwteKXTfjNzuyvE34zfE7Rt65/n+bBtOwuC4MV+13XuPM+FaZp5GIa9yrmpCeNpmh5wdxCeTdNErI3jWEPUgwB7ssY6TRNYliUzDOMJgk9PEMmIe/iMuWraCmxWVeWu6ypFmJNsWVYUx7FcibWvaROwgTXEvu8Sg18FRhfbtn05F69NUJalC4EaKA9PHgwiXKd3HCdKkuQyhTbBMAwFCJLMsfkd14HzcZ8C/nJEkwDVjuPIAaxBitI0ffExZg3CuYr9x58LvAEtbX2YkfGdBQAAAABJRU5ErkJggg==":S===11?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAO5JREFUOBFjYBgFRIfAjRs3eI8dO7bz+PHjRsiaWJA5uNhnzpxhffny5dr///+7MjExgfQ4w9QywRggev/+/Rx79+6NRBYDamJ8//79/J8/f7r+/v373q9fv6KQ5VEM+Pbt24rv378v27ZtWwFMEZDdCdQUDdT8+u/fv+4uLi4vYXIgmhGZs3HjRr9///6tBYoxA3EqEPMAXTCBkZHxKzMzs6Ofn99pZPUgNooBIIGVK1eCvLAEqJEB6F9GIP0XSPuFhoZuB8mjAwwDQAoWL16cAtQ4G6o4MS4ubgGUTTw1b968wrlz51YRr2PkqgQA82JlH8nI1QYAAAAASUVORK5CYII=":S===12?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAgRJREFUOBFjYKAQMIL0nzx5cs6/f/+SCZnFyMh4kpeX105bW/sXTC0TiCEmJpbz58+fc0DMgAe/YWJiCkXWDNILNkBRUfEHUGPw379/3/3+/RtsCIhGwv+A8pFmZmaPQZqQAdgAkICjo+MDoAExQPwPpBFIgzHIRUDv1QLl9yBrhLHBYQDjgOjt27fXAzU0AP0LFgbSmzw8PAKA9H9kdTA2hgH///9n2gIEQEO+mpzfvp2FmfWgeO3kuzAN6DTcCzAJoE0g/zZoXj+8h+Pti7lMLx5deJHpmwKTB9H/09JY74XamoHYGAaABIFh8PemhAb//3//1wBN4/r769fsRwmu0x8luUrdjXRov/v++sM/f/5a4DOA4RMrZ+dOq7C1QC8Z/P/7/8K/P38z/nz/+fjfn98+QDf4qq0/NgmvAaCYAHrlpziDzI0/f//e+AuMjb9//jH9+8dQrrL6yFmQZhDA6gWQBDAaG+Pu79/+8OudjX9//4kAeqcLKLbm7+9fHf8bGuD64AyQJhj4+fPnpaTHj5se3Xm08d/fv57AGJmgsupwubqIbtSP778enNm/IhymFqsB6enpvx/fO+IL9ILbn39/L6oIaJaBNDDOmvVb8Ldg2I9vv2yAYQNOAlgNACn+zfD/+r+//+4x/mMoAGkEiYGA4oEDP1iZmCp3a4mpQEQoJAFYGTPePuR04gAAAABJRU5ErkJggg==":S===13?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NjlBNDZFRkFFMDUxMTFFOTkyRTA4QkVCNjlCMDYwMEEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NjlBNDZFRkJFMDUxMTFFOTkyRTA4QkVCNjlCMDYwMEEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2OUE0NkVGOEUwNTExMUU5OTJFMDhCRUI2OUIwNjAwQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo2OUE0NkVGOUUwNTExMUU5OTJFMDhCRUI2OUIwNjAwQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Poa+1GoAAAE5SURBVHjapJO/SgNBEIdzS6x9CR8gEIjNYSkISWNI1BCw0MLCQCqDhWC0SGIltpo3SIrY2NgI1ygoJo1WIZBW0gn+Qc9vYC8sS+5OyMB3c7v3m7mZnTvH9/3EPJaUi+d5V7idf+jvYcV13a9gQ2m/D08xwW9QMIOnCdj8wOVhEhL8C1voxvaDoAJJMsKVtdi2I57fzsqszAWiG9yJpbmGRuQhWnYKy/AOkvCOxKGjUvYGYmnhGKTkNjwzpV1Tw3oBMmEViP3AInRgHS4JSOvqKrANTXhQEWNrQRdSUgXsgUwhCzkqvZjZgmWf8KoJ9DWCH0PPwLC6PsQebMKZbqlJOyouwUCPU4LX4Jy31vAlkO9lIzIB4m/pE1ahDwfGflFuqcKJa+EFhlDVgQnjsz+EJVk78/7OfwIMAP6mWr/ROcXGAAAAAElFTkSuQmCC":S===14?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAGBJREFUGBljYCAHzJo1a8L///+ZsOlFEQQqygcqXr1q1SpOdMUoCqGSQe/fv987c+ZMEWTF2BSC5C0ZGRkXEaPwONAZccgKWZA5UPY6QUHBmLCwsO9Y5CBC+HyNUxPZEgCPEyCkHm49GwAAAABJRU5ErkJggg==":""}Object.defineProperty(o,"__esModule",{value:!0}),o.getFilterCellButtonInfo=o.getFilterButtonImageSrc=void 0,Yt=ft("Core"),o.getFilterButtonImageSrc=At,o.getFilterCellButtonInfo=function(S,at,X){return{position:X,imageSize:{width:18,height:18},options:{configurationNumber:at},imageType:Yt.ButtonImageType.custom,visibility:Yt.ButtonVisibility.always,useButtonStyle:!1,enable:!0,buttonBackColor:"transparent",imageSrc:At(S),command:"OpenPivotFilterDialogCmd",hasOverLay:!0}}},"./dist/plugins/pivot/pivot-table-entry.js":function(Ie,o,ft){var Yt,At=this&&this.__createBinding||(Object.create?function(at,X,H,f){f===void 0&&(f=H);var B=Object.getOwnPropertyDescriptor(X,H);B&&("get"in B?X.__esModule:!B.writable&&!B.configurable)||(B={enumerable:!0,get:function(){return X[H]}}),Object.defineProperty(at,f,B)}:function(at,X,H,f){at[f=f===void 0?H:f]=X[H]}),S=this&&this.__exportStar||function(at,X){for(var H in at)H==="default"||Object.prototype.hasOwnProperty.call(X,H)||At(X,at,H)};Object.defineProperty(o,"__esModule",{value:!0}),o.SortType=void 0,S(ft("./dist/plugins/pivot/pivot.ns.js"),o),S(ft("./dist/plugins/pivot/pivot-table/pivot-table-spread.js"),o),ft("./dist/plugins/pivot/pivot-table/pivot-table-command.js"),S(ft("./dist/plugins/pivot/pivot-table/pivot-table-theme.js"),o),S(ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),o),S(ft("./dist/plugins/pivot/pivot-core/pivot-view.js"),o),S(ft("./dist/plugins/pivot/pivot-core/pivot-fields-model.js"),o),S(ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),o),S(ft("./dist/plugins/pivot/pivot-panel/pivot-panel.js"),o),S(ft("./dist/plugins/pivot/pivot-ui/dropdown-list.js"),o),S(ft("./dist/plugins/pivot/pivot-ui/pivot-filter-dialogs.js"),o),S(ft("./dist/plugins/pivot/pivot-ui/filter-dialog.js"),o),S(ft("./dist/plugins/pivot/pivot-ui/pivot-view-list-dialog.js"),o),S(ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/pivot-slicer-caches.js"),o),S(ft("./dist/plugins/pivot/pivot-filter-diagram/slicer-base/slicer-base.js"),o),S(ft("./dist/plugins/pivot/pivot-filter-diagram/slicer/pivot-item-slicer.js"),o),S(ft("./dist/plugins/pivot/pivot-filter-diagram/timeline/pivot-timeline-slicer.js"),o),S(ft("./dist/plugins/pivot/pivot-table/customPivotTableTheme.js"),o),Yt=ft("Pivot"),Object.defineProperty(o,"SortType",{enumerable:!0,get:function(){return Yt.SortType}}),ft("./dist/plugins/pivot/pivot-definition.js")},"./dist/plugins/pivot/pivot-table/customPivotTableTheme.js":function(Ie,o,ft){var Yt,At,S,at;function X(){return at!==null&&at.apply(this,arguments)||this}Yt=this&&this.__extends||(S=function(H,f){return(S=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(B,vt){B.__proto__=vt}:function(B,vt){for(var mt in vt)Object.prototype.hasOwnProperty.call(vt,mt)&&(B[mt]=vt[mt])}))(H,f)},function(H,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");function B(){this.constructor=H}S(H,f),H.prototype=f===null?Object.create(f):(B.prototype=f.prototype,new B)}),Object.defineProperty(o,"__esModule",{value:!0}),o.CustomPivotTableThemeManager=void 0,At=ft("Core"),Yt(X,at=At.CustomThemeManagerBase),X.prototype.Oh=function(){return At.CustomThemeType.pivot},X.prototype.remove=function(H){var f,B,vt=this;(B=(f=this.Vv).defaultPivotTableTheme())&&this.M0r(B.name(),H)&&f.defaultPivotTableTheme(void 0),f.suspendPaint(),(B=f.sheets)&&0<B.length&&B.forEach(function(mt){(mt=mt.pivotTables.all())&&0<mt.length&&mt.forEach(function(tt){vt.M0r(tt.getThemeName(),H)&&tt.theme((tt=f.defaultPivotTableTheme()&&f.defaultPivotTableTheme().name())!=null?tt:"light16")})}),f.resumePaint(),at.prototype.remove.call(this,H)},X.prototype.S0r=function(H,f){var B=this,vt=this.Vv;this.M0r(vt.isr,H)&&vt.defaultPivotTableTheme(f.name()),vt.suspendPaint(),vt.sheets.forEach(function(mt){(mt=mt.pivotTables.all())&&0<mt.length&&mt.forEach(function(tt){B.M0r(tt.getThemeName(),H)&&tt.theme(f.name())})}),vt.resumePaint()},o.CustomPivotTableThemeManager=X},"./dist/plugins/pivot/pivot-table/pivot-data-model.js":function(Ie,o,ft){var Yt,At,S,at,X;function H(B){this.dataTable=[],this.colValueTable=[],this.QWt=B,this.WWt=[],this.zWt=[],this.ZWt=[],this.YWt={}}function f(){this.HWt=[new X(0),new X(1),new X(2),new X(3),new X(4)]}Object.defineProperty(o,"__esModule",{value:!0}),o.PivotDataModel=void 0,Yt=ft("@spreadjs/js-sheets-common"),At=ft("Core"),S=ft("Pivot"),at=Yt.Common.lt.ht,H.prototype.JWt=function(B,vt){this.ZWt[B]=vt},H.prototype.setStartInfo=function(B,vt){this.DQ=B,this.jN=vt},H.prototype.Kbt=function(B,vt,mt){this.J_(B,vt,!0).value=mt},H.prototype.Twr=function(B,vt,mt){this.xwr(B,vt,!0).value=mt},H.prototype.kwr=function(B,vt,mt){this.J_(B,vt,!0).value=mt},H.prototype.setColCount=function(B){this.Tx=B},H.prototype.setRowCount=function(B){this.Sx=B},H.prototype.getColInfoMap=function(){for(var B,vt,mt={},tt=(vt=this.WWt).length,_=0;_<tt;_++)vt[_]&&(B=vt[_].path,vt[_].valueFieldName&&(B===""?B=vt[_].valueFieldName||"":B+=S.Separator+vt[_].valueFieldName||""),mt[B]=_);return mt},H.prototype.getRange=function(){return new At.Range(this.DQ,this.jN,this.Sx,this.Tx)},H.prototype.Sl=function(B,vt){return(B=this.J_(B,vt))&&B.value},H.prototype.qWt=function(B,vt,mt){this.J_(B,vt,!0).style=mt},H.prototype.ML=function(B,vt){return(B=this.J_(B,vt))&&B.style},H.prototype.KWt=function(B,vt,mt){this.J_(B,vt,!0).fieldName=mt},H.prototype.XWt=function(B,vt){return(B=this.J_(B,vt))&&B.fieldName||B&&B.value},H.prototype.$Wt=function(B,vt){return(B=this.J_(B,vt))&&B.nodeRefer},H.prototype.J_=function(B,vt,mt){var tt;if(!(tt=this.dataTable[B])){if(!mt)return null;tt=this.dataTable[B]=[]}if(!(B=tt[vt])){if(!mt)return null;B=tt[vt]={}}return B},H.prototype.xwr=function(B,vt,mt){var tt;if(!(tt=this.colValueTable[B])){if(!mt)return null;tt=this.colValueTable[B]=[]}if(!(B=tt[vt])){if(!mt)return null;B=tt[vt]={}}return B},H.prototype.c5=function(){this.dataTable=[],this.colValueTable=[],this.WWt=[],this.zWt=[],this.ZWt=[],this.YWt={},delete this.Sx,delete this.Tx},H.prototype.kn=function(B){for(var vt=this.ZWt,mt=0;mt<vt.length;mt++)if(this.ZWt[mt]&&this.ZWt[mt].fieldName===B)return mt},H.prototype.tZt=function(B,vt,mt,tt){var _,v=this.YWt;at(v[vt])&&(v[vt]={}),at(v[vt][mt])&&(v[vt][mt]={},v[vt][mt].ranges=[]),(_=v[vt][mt]).level===tt&&_.ranges.includes(B)||(v[vt][mt].level=tt,v[vt][mt].ranges.push(B))},X=H,f.prototype.getAllModel=function(){var B=this.HWt;return{pageModel:B[0],cornerModel:B[1],columnModel:B[2],rowModel:B[3],contentModel:B[4]}},f.prototype.getModel=function(B){return this.HWt[B]},f.prototype.c5=function(){var B=(_=this.HWt)[0],vt=_[1],mt=_[2],tt=_[3],_=_[4];B.c5(),vt.c5(),mt.c5(),tt.c5(),_.c5()},f.prototype.getWholeRange=function(){},f.prototype.iZt=function(){},o.PivotDataModel=f},"./dist/plugins/pivot/pivot-table/pivot-table-command.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l,T,D,M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe,ye,De,Ve,Le,fe,Re,Ke,lo,ao,po,Xe,xe,yo,to,fo,mo;function vo(rt,lt,Dt,Nt,Vt,Zt){var Ht,qt,zt,ne,pe,ue,be,Te,we,Se=!1;return lt?(Te=lt.a,ue=rt.getFilterInfo(Te),zt=lt.nrt):(ue=rt.getFilterInfo(Dt),Te=Dt),Ht=lt=!1,ue&&ue.labelFilter&&(ue.labelFilter.condition&&(lt=!0),ue.labelFilter.textItem)&&!ue.labelFilter.textItem.isAll&&(Ht=!0),qt=!!ue&&ue.on(),zt=zt?zt.sortType:it,rt.rBt(Dt)===0&&(Se=!0),ne=it,pe=!1,ue&&ue.labelFilter&&ue.labelFilter.textItem&&(ne=ue.labelFilter.textItem.list,pe=ue.labelFilter.textItem.isAll),ue=rt.bl(Te).DH(),be=rt.hr(Te),we=(Te=rt.bl(Te)).sf(),{fieldIsNumber:Se,sortInfo:zt,hasLabelCondition:lt,hasValueCondition:qt,fields:co(Te,ue,ne,pe,we,zt,be,(rt.z||[]).filter(function(_e){return _e.Zc===Vt})[0],Dt,Zt),isColOrRow:Nt,hasLabelManual:Ht}}function co(rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne){var pe,ue,be,Te=[],we=[];if(Vt){for(ue=0;ue<lt.length;ue++)we[Vt[ue]]=lt[ue];Zt===H.SortType.desc&&we.reverse()}return Zt=we.length===0?lt:we,be=function(Se){var _e,Be;if(!(rt.nZt&&0<rt.nZt.length)&&(0,H.ht)(rt.y1)&&(_e=ne===3?{dataOnly:!0,references:[{fieldName:F().Values,items:[zt]}]}:{labelOnly:!0,references:[{fieldName:zt}]},_e=(_e=qt.getStyle(_e))&&_e.formatter,Ht===H.PivotDataType.date&&(Se=(0,H.parseStringToDate)(Se),Be=A.Fe().DateTimeFormat,_e=_e||Be.shortDatePattern),_e)){if(typeof _e=="string")return new g(_e).format(Se);if(_e instanceof _.Formatter.FormatterBase)return _e.format(Se)}return Se+""},!Dt||Dt.length===0||Nt?Zt.forEach(function(Se){pe={status:!0,value:Se,text:be(Se)},Te.push(pe)}):Zt.forEach(function(Se){pe={status:!0,value:Se,text:be(Se)},Dt.indexOf(Se)<0&&(pe.status=!1),Te.push(pe)}),Te}function So(rt,lt){var Dt=0;return rt.forEach(function(Nt,Vt){Nt.Zc===lt&&(Dt=Vt)}),Dt}function Ge(rt,lt){var Dt,Nt,Vt=rt.colHeadFieldInfo,Zt=rt.cornerFieldInfo,Ht=rt.pageFieldInfo,qt=rt.rowInfos,zt=rt.colInfos,ne=rt.activeRowFieldInfo,pe=rt.activeColFieldInfo,ue=rt.area,be=rt.value,Te=rt.menuArea,we=rt.valueFieldName;switch(ue){case 0:Dt=Ht&&Ht.fieldName;break;case 1:Te===1?Dt=be:Te===2&&Zt&&(Dt=Zt.fieldName)===F().sigmaValueTemp&&(Dt=F().sigmaValue);break;case 2:if(Te===2&&Vt)(Dt=Vt.fieldName)===F().sigmaValueTemp&&(Dt=F().sigmaValue);else if(Te===5)Dt=we||lt&&lt.Q[0].Zc;else if(Dt=pe&&pe.name||be,(0,H.ht)(Dt)){for(Nt=pe;0<=Nt&&zt[Nt]&&(0,H.ht)(zt[Nt].itemName);)Nt-=1;Dt=zt[Nt].fieldName}break;case 3:if(Te===5)Dt=we||lt&&lt.Q[0].Zc;else if(Dt=ne&&ne.name||be,(0,H.ht)(Dt)){for(Nt=ne.index;0<=Nt&&qt[Nt]&&(0,H.ht)(qt[Nt].itemName);)Nt-=1;Dt=qt[Nt].fieldName}break;case 4:Dt=we}return Dt}function We(rt,lt){return jt.call(this,rt,lt)||this}function Ye(rt,lt){return de.call(this,rt,lt)||this}function qe(rt,lt){return le.call(this,rt,lt)||this}function ge(rt,lt){return se.call(this,rt,lt)||this}function go(rt,lt){return ce.call(this,rt,lt)||this}function $e(rt,lt){return he.call(this,rt,lt)||this}function eo(rt,lt){return ve.call(this,rt,lt)||this}function To(rt,lt){return me.call(this,rt,lt)||this}function Qe(rt,lt){return Ce.call(this,rt,lt)||this}function ro(rt,lt){return Pe.call(this,rt,lt)||this}function Fo(rt,lt){return Ne.call(this,rt,lt)||this}function No(rt,lt){return Fe.call(this,rt,lt)||this}function _o(rt,lt){return ye.call(this,rt,lt)||this}function Do(rt,lt){return De.call(this,rt,lt)||this}function Io(rt){return(0,H.ht)(rt)?it:rt instanceof Date?rt:E.yU(rt)}function wo(rt,lt){return Ve.call(this,rt,lt)||this}function oo(rt,lt){return Le.call(this,rt,lt)||this}function He(rt,lt){return fe.call(this,rt,lt)||this}function io(rt,lt){return Re.call(this,rt,lt)||this}function Eo(rt,lt){return Ke.call(this,rt,lt)||this}function Co(rt,lt,Dt){var Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee=(Be=lt.tT).commandOptions.pivotTableCellInfo,ke=(lt=lt.Mf,Be.selections[0]),Me=(Oe=lt.pivotTables.get(Be.commandOptions.pivotTableName)).eZt,Ae=!1,Ze=Oe.rZt.HWt[3],je=Oe.rZt.HWt[2],no=[],Je=Oe.dh,Po=Ze.zWt,ho=je.WWt,ze=[];switch(1<Je.Q.length&&(Zt=Je.x2,Ht=Je.P2),Oe.suspendLayout(),Ee.area){case 3:if(qt=Je.B.length,Zt===0&&Ee.activeRowFieldInfo&&Ht<Ee.activeRowFieldInfo.index&&(qt+=1),Ae=Ee.activeRowFieldInfo&&Ee.activeRowFieldInfo.index===qt-1,(Nt=Dt?{row:Ze.DQ+Me.row,col:ke.col,rowCount:Ze.Sx,colCount:1}:ke).row<Ze.DQ+Me.row||Nt.row+Nt.rowCount>Ze.DQ+Me.row+Ze.Sx||Nt.col<Me.col||Nt.col+Nt.colCount>Me.col+Ze.Tx)return;for(zt=Nt.row;zt<Nt.row+Nt.rowCount;zt++)for(ne=Nt.col;ne<Nt.col+Nt.colCount&&(ue=(pe=Oe.getPivotInfoImp(zt,ne,!1,!1,!0)).rowInfos&&pe.rowInfos[Ee.activeRowFieldInfo.index-(Ae?1:0)])&&((be=Po[zt-Ze.DQ-Me.row]).collapseIndex!==It||!(ue.isSubtotal&&Oe.options.subtotalsPosition!==at.SubtotalsPosition.top||ue.isGrandTotal||ue.isBlankRow))&&(ue=pe.rowInfos&&pe.rowInfos[Ee.activeRowFieldInfo.index-(Ae?1:0)]).itemName;ne++)if((Te=Oe.collapse(ue.fieldName,ue.itemName))&&!rt||!Te&&rt){we=ue.fieldName+ue.itemName,ze.indexOf(we)<0&&(ze.push(we),no.push({fieldName:ue.fieldName,itemName:ue.itemName,collapse:rt}));break}break;case 2:if(Ee.colHeadFieldInfo){for(qt=Je.R.length,Zt===1&&(Ee.relativeRow===0&&Ht<Ee.relativeColumn||Ee.activeColFieldInfo&&Ht<Ee.activeColFieldInfo.index)&&(qt+=1),Ae=Ee.relativeColumn===qt-1,ne=(Vt={row:Ee.relativeColumn+Me.row+1,col:je.jN+Me.col,rowCount:1,colCount:je.Tx}).col;ne<Vt.col+Vt.colCount;ne++)for(zt=Vt.row;zt<Vt.row+Vt.rowCount&&(Se=Oe.getPivotInfoImp(zt,ne,!1,!1,!0),be=ho[ne-je.jN-Me.col],_e=Se.colInfos&&Se.colInfos[Se.relativeRow-1-(Ae?1:0)])&&(be.collapseIndex!==It||!_e.isSubtotal&&!_e.isGrandTotal)&&(_e=Se.colInfos&&Se.colInfos[Se.relativeRow-1-(Ae?1:0)]).itemName;zt++)if((Te=Oe.collapse(_e.fieldName,_e.itemName))&&!rt||!Te&&rt){we=_e.fieldName+_e.itemName,ze.indexOf(we)<0&&(ze.push(we),no.push({fieldName:_e.fieldName,itemName:_e.itemName,collapse:rt}));break}}else{if(qt=Je.R.length,Zt===1&&Ee.activeColFieldInfo&&Ht<Ee.activeColFieldInfo.index&&(qt+=1),Ae=Ee.activeColFieldInfo&&Ee.activeColFieldInfo.index===qt-1,(Vt=Dt?{row:ke.row,col:je.jN+Me.col,rowCount:1,colCount:je.Tx}:ke).col<je.jN+Me.col||Vt.col+Vt.colCount>je.jN+Me.col+je.Tx||Vt.row<=Me.row||Vt.row+Vt.rowCount>Me.row+je.Sx)return;for(ne=Vt.col;ne<Vt.col+Vt.colCount;ne++)for(zt=Vt.row;zt<Vt.row+Vt.rowCount&&(Se=Oe.getPivotInfoImp(zt,ne,!1,!1,!0),be=ho[ne-je.jN-Me.col],_e=Se.colInfos[Ee.activeColFieldInfo&&Ee.activeColFieldInfo.index-(Ae?1:0)])&&(be.collapseIndex!==It||!_e.isSubtotal&&!_e.isGrandTotal)&&(_e=Se.colInfos[Ee.activeColFieldInfo.index-(Ae?1:0)]).itemName;zt++)if((Te=Oe.collapse(_e.fieldName,_e.itemName))&&!rt||!Te&&rt){we=_e.fieldName+_e.itemName,ze.indexOf(we)<0&&(ze.push(we),no.push({fieldName:_e.fieldName,itemName:_e.itemName,collapse:rt}));break}}break;case 1:if(1<ke.colCount*ke.rowCount)return;if(Ee.cornerFieldInfo){for(qt=Ze.Tx,Zt===2&&Ht<Ee.relativeColumn&&(qt+=1),Ae=Ee.relativeColumn===qt-1,zt=(Nt={row:Ze.DQ+Me.row,col:ke.col,rowCount:Ze.Sx,colCount:1}).row;zt<Nt.row+Nt.rowCount;zt++)for(ne=Nt.col;ne<Nt.col+Nt.colCount&&(pe=Oe.getPivotInfoImp(zt,ne,!1,!1,!0),be=Po[zt-Ze.DQ-Me.row],ue=pe.rowInfos[Ee.relativeColumn-(Ae?1:0)])&&(be.collapseIndex!==It||!(ue.isSubtotal&&Oe.options.subtotalsPosition!==at.SubtotalsPosition.top||ue.isGrandTotal||ue.isBlankRow))&&(ue=pe.rowInfos[Ee.relativeColumn-(Ae?1:0)]).itemName;ne++)if((Te=Oe.collapse(ue.fieldName,ue.itemName))&&!rt||!Te&&rt){we=ue.fieldName+ue.itemName,ze.indexOf(we)<0&&(ze.push(we),no.push({fieldName:ue.fieldName,itemName:ue.itemName,collapse:rt}));break}}}return Oe.resumeLayout(),no}function Oo(rt,lt){return lo.call(this,rt,lt)||this}function Ao(rt,lt){return ao.call(this,rt,lt)||this}function Lo(rt,lt){return po.call(this,rt,lt)||this}function Mo(rt,lt){return Xe.call(this,rt,lt)||this}function Zo(rt,lt){return xe.call(this,rt,lt)||this}function Ho(rt){return!isNaN(parseFloat(rt))&&isFinite(rt)}function Ro(rt,lt){return yo.call(this,rt,lt)||this}function Vo(rt,lt){return to.call(this,rt,lt)||this}function ko(rt,lt){return fo.call(this,rt,lt)||this}function Bo(rt,lt){return mo.call(this,rt,lt)||this}function Wo(rt,lt){var Dt,Nt=rt.split(w.nameSeparator);isNaN(parseInt(Nt[Nt.length-1],10))?rt+=w.nameSeparator+"1":(Dt=Nt[Nt.length-1],Nt.splice(Nt.length-1,1,w.nameSeparator+(parseInt(Dt,10)+1)),rt=Nt.join("")),lt.save(rt)||Wo(rt,lt)}Yt=this&&this.__extends||(ee=function(rt,lt){return(ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(Dt,Nt){Dt.__proto__=Nt}:function(Dt,Nt){for(var Vt in Nt)Object.prototype.hasOwnProperty.call(Nt,Vt)&&(Dt[Vt]=Nt[Vt])}))(rt,lt)},function(rt,lt){if(typeof lt!="function"&&lt!==null)throw new TypeError("Class extends value "+String(lt)+" is not a constructor or null");function Dt(){this.constructor=rt}ee(rt,lt),rt.prototype=lt===null?Object.create(lt):(Dt.prototype=lt.prototype,new Dt)}),At=this&&this.__spreadArray||function(rt,lt,Dt){if(Dt||arguments.length===2)for(var Nt,Vt=0,Zt=lt.length;Vt<Zt;Vt++)!Nt&&Vt in lt||((Nt=Nt||Array.prototype.slice.call(lt,0,Vt))[Vt]=lt[Vt]);return rt.concat(Nt||Array.prototype.slice.call(lt))},Object.defineProperty(o,"__esModule",{value:!0}),S=ft("Core"),at=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),X=ft("./dist/plugins/pivot/pivot-table-entry.js"),H=ft("Pivot"),f=ft("./dist/plugins/pivot/pivot-ui/filter-dialog.js"),B=ft("./dist/plugins/pivot/pivot-ui/pivot-field-setting-dialog.js"),vt=ft("./dist/plugins/pivot/pivot-ui/pivot-show-value-as-dialog.js"),mt=ft("./dist/plugins/pivot/pivot-ui/pivot-number-group-dialog.js"),tt=ft("./dist/plugins/pivot/pivot-ui/pivot-date-group-dialog.js"),_=ft("@spreadjs/js-sheets-common"),v=ft("SheetsCalc"),o=ft("./dist/plugins/pivot/pivot.ns.js"),Ft=ft("./dist/plugins/pivot/pivot-core/pivot-core-entry.js"),w=ft("./dist/plugins/pivot/pivot-util.js"),I=ft("@spreadjs/js-calc"),U=ft("./dist/plugins/pivot/pivot-ui/pivot-sort-dialog.js"),g=_.Formatter.GeneralFormatter,ft=new _.Common.ResourceManager(o.SR,"PivotTables"),F=ft.getResource.bind(ft),o=S.Commands.ActionBase,ot="PivotOutlineButtonToggle",j=S.Commands.zA,E=_.Common.ct,A=_.Common.CultureManager,Y="moveField",L="removeField",q="AddField",J="fieldSet",P="CreatePivotFilterDialog",bt="updateListBox",k="changePanelFieldStatus",nt="filterFieldLabelValue",gt="pivotSort",Z="ClearCommand",ut="updatePivotCache",Rt="createFilterSecondaryMenu",Ct="createDialogForLabelFilter",Bt="OpenPivotFilterDialogCmd",kt="updateCondition",ie="createDialogForValueFilter",Xt="updateValueCondition",Qt="createDialogForPivotSort",dt="sortPivotField",xt="sortPivotValueField",Mt="TopTenCondition",st="dialogForDateFilter",l="openValueFieldSettingDialogCmd",T="UpdatePivotValueFieldCmd",D="UpdatePivotFieldCmd",M="CreatePivotViewsListDialog",s="OpenPivotGroupDialog",y="OpenPivotShowValueAsDialog",G="ApplyPivotView",K="AddPivotView",c="pivotRefresh",N="pivotTableGroup",V="pivotTableUnGroup",O="pivotShowDetails",pt="pivotExpand",wt="pivotCollapse",et="pivotExpandEntireField",ht="pivotCollapseEntireField",St="removePivotGrandTotal",$="updatePivotDefer",n="doPivotTableFilter",a="selectWholePivotTable",i="pivotShowSubtotal",h="pivotChangeDataSource",b="pivotChangeDataSourceInternal",Q=["backColor","foreColor","hAlign","vAlign","font","themeFont","formatter","borderLeft","borderTop","borderRight","borderBottom","locked","textIndent","wordWrap","showEllipsis","_showTip","shrinkToFit","backgroundImage","cellType","backgroundImageLayout","tabStop","textDecoration","imeMode","name","parentName","watermark","cellPadding","labelOptions","quotePrefix","diagonalDown","diagonalUp","isVerticalText","cellButtons","dropDowns","textOrientation"],it=null,It=void 0,t=function(rt,lt,Dt){rt=rt.pivotTables.findPivotTable(lt,Dt);var Nt=it;return{pivotInfo:Nt=rt?rt.getPivotInfoImp(lt,Dt,!1,!1,!0):Nt,pt:rt}},r=function(rt,lt,Dt,Nt,Vt){for(var Zt,Ht,qt=[],zt=0;zt<Nt.length;zt++)Ht=Nt[zt],Zt=void 0,Vt===3?Zt=new S.Range(Ht.row,Ht.col,Ht.rowCount,1):Vt===2&&(Zt=new S.Range(Ht.row,Ht.col,1,Ht.colCount)),(Ht=Zt&&rt.pivotTables.getRangePivotAreas(Zt))&&Ht[lt].map(function(ne){ne.labelOnly&&ne.references.forEach(function(pe){if(pe.fieldName===Dt)for(var ue=0;ue<pe.items.length;ue++)qt.indexOf(pe.items[ue])===-1&&qt.push(pe.items[ue])})});return qt},Yt(We,jt=o),We.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be=!1;if((ue=this).canExecute()&&(rt=ue.Mf,Dt=ue.tT,lt=(Dt=t(rt,Dt.row,Dt.col)).pivotInfo,Dt=Dt.pt,lt)){Nt=lt.activeRowFieldInfo,Vt=lt.activeColFieldInfo,pe=lt.area,Zt=void 0,(Ht=rt.Ut).startTransaction(),ue.X5(rt,!0);try{switch(pe){case 2:Zt=lt.colInfos[Vt&&Vt.index];break;case 3:Zt=lt.rowInfos[Nt&&Nt.index]}qt=Zt.fieldName,zt=Zt.itemName,ne=Dt.collapse(qt,zt),Dt.collapse(qt,zt,!ne),rt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:qt,item:zt,newValue:!ne,oldValue:ne,pivotTableName:Dt.Zc}),be=!0}finally{ue.q5(rt,!0),pe=S.Commands.TI(rt.name()),ue.tT[pe]=Ht.endTransaction()}}return be},We.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt=(Vt=this).Mf,Ht=!1;if(Vt.canUndo()){Vt.X5(Zt,!0);try{rt=S.Commands.TI(Zt.name()),lt=Vt.tT[rt],Zt.Ut.undo(lt),Dt=lt.pivotTableChanges[lt.pivotTableChanges.length-1].value,Nt=t(Zt,Vt.tT.row,Vt.tT.col).pt,Zt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Dt.fieldName,newValue:Dt.isCollapse,oldValue:!Dt.isCollapse,pivotTableName:Nt.Zc,item:Dt.item}),Ht=!0}finally{Vt.q5(Zt,!0)}}return Ht},u=We,S.Commands[ot]={canUndo:!0,execute:function(rt,lt,Dt){return S.Commands.zA(rt,u,lt,Dt)}},Yt(Ye,de=o),Ye.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee,ke,Me=!1;if((ke=this).canExecute()){if(lt=(rt=ke.Mf).Ut,Dt=(Ht=ke.tT.cmdOption).fieldName,Nt=Ht.targetArea,Vt=Ht.targetIndex,Zt=Ht.isSusPaint,Ht=Ht.pivotName,qt=rt.pivotTables&&rt.pivotTables.get(Ht),zt=Zt?qt.dh.copyFieldsModel:qt.dh,Zt)Dt===F().sigmaValue?(Vt=(Vt=-1<Vt?Vt:0)<=(ne=zt.nw(Nt)).length?Vt:ne.length,zt.setSigmaValuePosition(Nt-1,Vt)):zt.changeFieldArea(Dt,Nt,Vt),zt.q3(Zt);else if(lt.startTransaction(),ke.X5(rt,!0),!(0,H.ht)(Dt))try{if(Dt===F().sigmaValue)ne=zt.nw(Nt),Vt=(Vt=-1<Vt?Vt:0)<=ne.length?Vt:ne.length,Ee=qt.dataPosition(),zt.setSigmaValuePosition(Nt-1,Vt),pe=Nt-1,ue=Vt,be=Ee.positionType,Te=Ee.positionIndex,pe===be&&ue===Te||(zt.q3(Zt,null,!1),rt.ki(S.Events.PivotTableChanged,{type:"dataPositionChanged",newArea:pe,newIndex:ue,oldArea:be,oldIndex:Te,pivotTableName:Ht}));else{if(ne=void 0,we=zt.getFieldInfoByName(Dt),(0,H.ht)(we))return!1;for(Se=at.PivotTableFieldType.columnField;Se>=at.PivotTableFieldType.filterField;Se--){for(ne=zt.nw(Se),_e=!1,Be=ne.length-1;0<=Be;Be--)if(ne[Be].a===we.a){Dt=ne[Be].Zc,_e=!0;break}if(_e)break}Oe=qt.getField(Dt),ne=zt.nw(Nt),pe=Nt,be=Oe.pivotArea,Te=Oe.pivotIndex,ue=(ue=-1<Vt?Vt:0)<=ne.length?ue:ne.length,pe===be&&Te===ue||(qt.updateField(Dt,Nt,Vt),zt.q3(Zt,null,!1),rt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Dt,newArea:pe,newIndex:ue,oldArea:be,oldIndex:Te,pivotTableName:Ht}))}Me=!0}catch(Ae){rt.jT(10,Ae.message)}finally{ke.q5(rt,!0),Ee=S.Commands.TI(rt.name()),ke.tT[Ee]=lt.endTransaction()}}return Me},Ye.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne=(zt=this).Mf,pe=!1;if(zt.canUndo()){zt.X5(ne,!0);try{for(rt=S.Commands.TI(ne.name()),lt=zt.tT[rt],Dt=ne.pivotTables&&ne.pivotTables.get(zt.tT.cmdOption.pivotName),Nt=lt.pivotTableChanges,Vt=void 0,ne.Ut.undo(lt),Zt=0;Zt<Nt.length&&(Vt=Nt[Zt].value).type!=="addField"&&Vt.type!=="updateValuePosition";Zt++);Ht=Dt.getField(Vt.fieldName),Vt.type==="updateValuePosition"?(qt=Dt.dataPosition(),ne.ki(S.Events.PivotTableChanged,{type:"fieldChanged",newArea:Vt.position,newIndex:Vt.valuesIndex,oldArea:qt.positionType,oldIndex:qt.positionIndex,pivotTableName:zt.tT.cmdOption.pivotName})):ne.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Vt.fieldName,newArea:Vt.area,newIndex:Vt.index,oldArea:Ht.pivotArea,oldIndex:Ht.pivotIndex,pivotTableName:zt.tT.cmdOption.pivotName}),pe=!0}finally{zt.q5(ne,!0)}}return pe},d=Ye,S.Commands[Y]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,d,lt,Dt)}},Yt(qe,le=o),qe.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e=!1;if((Se=this).canExecute())if(we=Se.tT,lt=(rt=Se.Mf).Ut,Dt=we.cmdOption,(qt=Ht=Zt=Vt=Nt=void 0,H.ht)(Dt)?(zt=(we=we.commandOptions).pivotTableCellInfo,Nt=(Ht=rt.pivotTables&&rt.pivotTables.get(we.pivotTableName)).dh,Vt=Ge(zt)):(Vt=Dt.fieldName,Zt=Dt.isSusPaint,Ht=rt.pivotTables&&rt.pivotTables.get(Dt.pivotName),Nt=Zt?Ht.dh.copyFieldsModel:Ht.dh),Zt){if(Vt===F().sigmaValue)for(pe=(ne=Nt.nw(at.PivotTableFieldType.valueField)).length-1;0<=pe;pe--)Nt.clearValueFilterOfValueField(ne[pe].Zc);ue=Nt.Z[Vt],(qt=Nt.removeFieldOrSigmaByName(Vt))instanceof Ft.PivotViewField&&(ue===at.PivotTableFieldType.valueField?Nt.clearValueFilterOfValueField(Vt):Nt.y2(Vt,!1)),Nt.q3(Zt)}else{lt.startTransaction(),Se.X5(rt,!0);try{if(Ht&&Ht.suspendLayout(),be=[],Vt===F().sigmaValue){for(pe=(ne=Nt.nw(at.PivotTableFieldType.valueField)).length-1;0<=pe;pe--)Nt.clearValueFilterOfValueField(ne[pe].Zc);if((Te=Nt.nw(at.PivotTableFieldType.valueField))&&0<Te.length)for(pe=0;pe<Te.length;pe++)be.push(Ht.getField(Te[pe].Zc))}else be.push(Ht.getField(Vt));for(qt=Nt.getFieldInfoByName(Vt),ue=Nt.Z[Vt],qt instanceof Ft.PivotViewField&&(ue===at.PivotTableFieldType.valueField?Nt.clearValueFilterOfValueField(Vt):Nt.y2(Vt,!1)),Nt.removeFieldOrSigmaByName(Vt),Ht&&Ht.resumeLayout(),pe=0;pe<be.length;pe++)rt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Vt,oldArea:be[pe].pivotArea,oldIndex:be[pe].pivotIndex,newArea:it,newIndex:it,pivotTableName:Ht.Zc});_e=!0}finally{Se.q5(rt,!0),we=S.Commands.TI(rt.name()),Se.tT[we]=lt.endTransaction()}}return _e},qe.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=(Zt=this).Mf,qt=!1;if(Zt.canUndo()){Zt.X5(Ht,!0);try{for(rt=S.Commands.TI(Ht.name()),lt=Zt.tT[rt],Ht.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=0;Nt<Dt.length;Nt++)Vt=Dt[Nt],Ht.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Vt.fieldName,newArea:Vt.area,newIndex:Vt.index,oldIndex:it,oldArea:it,pivotTableName:(Zt.tT.cmdOption||Zt.tT.commandOptions).pivotName});qt=!0}finally{Zt.q5(Ht,!0)}}return qt},m=qe,S.Commands[L]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,m,lt,Dt)}},Yt(ge,se=o),ge.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne=!1;if((zt=this).canExecute()){qt=zt.tT.commandOptions,(lt=(rt=zt.Mf).Ut).startTransaction(),zt.X5(rt,!0);try{Dt=qt.pivotTableCellInfo,Nt=rt.pivotTables.get(qt.pivotTableName),Vt=Dt.area,Zt=Dt.menuArea,(Ht=Nt.options.grandTotalPosition)===1||Ht===2?Nt.options.grandTotalPosition=0:Ht===3&&(Vt===3&&Zt===5?Nt.options.grandTotalPosition=1:Vt===2&&Zt===5&&(Nt.options.grandTotalPosition=2)),Ht!==Nt.options.grandTotalPosition&&rt.ki(S.Events.PivotTableChanged,{type:"grandTotal",oldValue:Ht,newValue:Nt.options.grandTotalPosition,pivotTableName:Nt.Zc}),ne=!0}finally{zt.q5(rt,!0),qt=S.Commands.TI(rt.name()),zt.tT[qt]=lt.endTransaction()}}return ne},ge.prototype.undo=function(){var rt,lt,Dt,Nt=(Dt=this).Mf,Vt=!1;if(Dt.canUndo()){Dt.X5(Nt,!0);try{rt=S.Commands.TI(Nt.name()),lt=Dt.tT[rt],Nt.Ut.undo(lt),Vt=!0}finally{Dt.q5(Nt,!0)}}return Vt},R=ge,S.Commands[St]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,R,lt,Dt)}},Yt(go,ce=o),go.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe=!1;if((ne=this).canExecute()){rt=ne.tT.commandOptions,(Dt=(lt=ne.Mf).Ut).startTransaction(),ne.X5(lt,!0);try{Nt=(zt=rt.pivotTableCellInfo).activeRowFieldInfo||zt.activeColFieldInfo,Vt=zt.colHeadFieldInfo||zt.cornerFieldInfo,(Zt=(Nt==null?void 0:Nt.name)||(Vt==null?void 0:Vt.fieldName))&&(qt=(Ht=lt.pivotTables.get(rt.pivotTableName)).subtotalVisible(Zt),Ht.subtotalVisible(Zt,!qt),lt.ki(S.Events.PivotTableChanged,{type:"subtotalVisible",oldValue:qt,newValue:Ht.subtotalVisible(Zt),pivotTableName:Ht.Zc})),pe=!0}finally{ne.q5(lt,!0),zt=S.Commands.TI(lt.name()),ne.tT[zt]=Dt.endTransaction()}}return pe},go.prototype.undo=function(){var rt,lt,Dt,Nt=(Dt=this).Mf,Vt=!1;if(Dt.canUndo()){Dt.X5(Nt,!0);try{rt=S.Commands.TI(Nt.name()),lt=Dt.tT[rt],Nt.Ut.undo(lt),Vt=!0}finally{Dt.q5(Nt,!0)}}return Vt},z=go,S.Commands[i]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,z,lt,Dt)}},Yt($e,he=o),$e.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee,ke,Me,Ae,Ze=!1;if((Ae=this).canExecute()){lt=(rt=Ae.tT).cmdOption,Dt=rt.commandOptions,(Vt=(Nt=Ae.Mf).Ut).startTransaction(),Ae.X5(Nt,!0),(ne=zt=qt=Ht=Zt=void 0,H.ht)(lt)?(Me=Dt.pivotTableCellInfo,Zt=(ne=Nt.pivotTables.get(Dt.pivotTableName)).dh,Ht=Dt.subTotalType,zt=Ge(Me,Zt)):(Ht=lt.subtotalType,zt=lt.oldFieldName,Zt=(ne=Nt.pivotTables.get(lt.pivotName)).dh),Me=Zt.getFieldInfoByName(zt),pe=Zt.xy(zt),qt=lt&&lt.fieldName||!(0,H.ht)(Ht)&&pe!==Ht&&Zt.dz(Zt.FG(Me.a,Me.Zc,Ht))||zt,ue=!0;try{(0,H.ht)(Me)||(0,H.ht)(Ht)||(Te=!(be=!0),pe!==Ht&&(Zt.xy(zt,Ht),Te=!0),(0,H.ht)(zt)||zt===qt||(we=Zt.getFieldInfoByName(zt),be=Zt.changeFieldName(we,qt)),be?ue=!1:(qt=zt,Nt.jT(10,F().PivotTableErrorMessage_EmptyFieldName)),Te&&(Zt.q3(null,null,!1),ue=!0,Nt.ki(S.Events.PivotTableChanged,{type:"SummarizedValueBy",fieldName:qt,oldValue:pe,newValue:Ht,pivotTableName:ne.Zc}))),Be=_e=Se=void 0,lt?(Se=lt.showValueAsType,_e=lt.baseField,Be=lt.baseItem):Dt&&(Se=Dt.showValueAsType),Oe=void 0,Be?Oe=Be.index===0?{showDataAs:Se,baseFieldName:_e,baseFieldItemType:2}:Be.index===1?{showDataAs:Se,baseFieldName:_e,baseFieldItemType:1}:{showDataAs:Se,baseFieldName:_e,baseFieldItemType:0,baseFieldItem:Be.value}:_e?Oe={showDataAs:Se,baseFieldName:_e}:(0,H.ht)(Se)||(Oe={showDataAs:Se}),Ee=Zt.getFieldInfoByName(qt).Or||{showDataAs:0},Oe&&!this.oZt(Oe,Ee)&&(ne.showDataAs(qt,Oe),ue=!0,Nt.ki(S.Events.PivotTableChanged,{type:"ShowValueAs",fieldName:qt,oldValue:(0,S.RF)(Ee),newValue:(0,S.RF)(Oe),pivotTableName:ne.Zc})),ke=rt.formatter,Ht===7&&(ke=ke||"0.0000000"),(0,H.ht)(ne.showDataAs(qt))||(Se=ne.showDataAs(qt).showDataAs),(0,w.applyShowDataAsStyle)(ne,qt,Se,ke),Zt.q3(null,null,ue),Ze=!0}catch(je){Nt.jT(10,je.message)}finally{Ae.q5(Nt,!0),Me=S.Commands.TI(Nt.name()),Ae.tT[Me]=Vt.endTransaction()}}return Ze},$e.prototype.oZt=function(rt,lt){var Dt=lt.showDataAs,Nt=lt.baseFieldName,Vt=lt.baseFieldItem;return lt=lt.baseFieldItemType,rt.showDataAs===Dt&&rt.baseFieldName===Nt&&rt.baseFieldItem===Vt&&rt.baseFieldItemType===lt},$e.prototype.aZt=function(rt){for(var lt=0,Dt=Q;lt<Dt.length;lt++)if(!(0,H.ht)(rt[Dt[lt]]))return!1;return!0},$e.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we=(Te=this).Mf,Se=!1;if(Te.canUndo()){Te.X5(we,!0);try{for(rt=S.Commands.TI(we.name()),Dt=(lt=Te.tT[rt]).pivotTableChanges,Vt=(Nt=Te.tT.cmdOption||Te.tT.commandOptions).pivotTableName||Nt.pivotName,Ht=(Zt=we.pivotTables&&we.pivotTables.get(Vt)).dh,zt=qt=void 0,ne=0;ne<Dt.length;ne++)(pe=Dt[ne].value).type==="showDataAs"?qt=pe:pe.type==="subTotalType"&&(zt=pe);we.Ut.undo(lt),qt&&(ue=Ht.getFieldInfoByName(qt.fieldName))&&(be=ue.Or,we.ki(S.Events.PivotTableChanged,{type:"ShowValueAs",fieldName:qt.fieldName,oldValue:(0,S.RF)(be),newValue:(0,S.RF)(qt.oldShowDataAs),pivotTableName:Zt.Zc})),zt&&we.ki(S.Events.PivotTableChanged,{type:"SummarizedValueBy",fieldName:zt.fieldName,oldValue:Ht.xy(zt.fieldName),newValue:zt.subtotalType,pivotTableName:Zt.Zc}),Se=!0}finally{Te.q5(we,!0)}}return Se},ct=$e,S.Commands[T]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,ct,lt,Dt)}},Yt(eo,ve=o),eo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se=!1;if((we=this).canExecute()){Te=(rt=we.tT).cmdOption,ne=rt.commandOptions,Nt=void 0,(Dt=(lt=we.Mf).Ut).startTransaction(),we.X5(lt,!0),Vt=((zt=qt=Zt=void 0,H.ht)(Te)?(qt=Ge(ne.pivotTableCellInfo,Zt=(zt=lt.pivotTables.get(ne.pivotTableName)).dh),Nt=ne.showNoData,ne):(qt=Te.oldFieldName,Zt=(zt=lt.pivotTables.get(Te.pivotName)).dh,Nt=Te.showNoData,Te)).showSubtotalTop,ne=Zt.getFieldInfoByName(qt),Ht=Te&&Te.fieldName||Zt.dz(Zt.OR(ne.a,ne.Zc))||qt;try{if(zt&&zt.suspendLayout(),pe=rt.formatter,be=ue=void 0,zt){if(ue=zt.showNoData(ne.a),zt.showNoData(ne.a,Nt),be=zt.subtotalPosition(ne.Zc),zt.subtotalPosition(ne.Zc,Vt?at.SubtotalsPosition.top:at.SubtotalsPosition.bottom),S.mt.St(pe))try{(0,v.evaluateFormula)(lt,pe)}catch(_e){if(!(_e instanceof I.CalcError))return}this.sZt(zt,Ht,pe),zt.resumeLayout(),ue!==zt.showNoData(ne.a)&&lt.ki(S.Events.PivotTableChanged,{type:"showNoData",oldValue:ue,newValue:zt.showNoData(ne.a),pivotTableName:zt.Zc,cacheFieldName:ne.a}),be!==zt.subtotalPosition(ne.Zc)&&lt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:ne.Zc,oldValue:be,newValue:zt.subtotalPosition(ne.Zc),pivotTableName:zt.Zc}),qt!==Ht&&(zt.updateFieldName(qt,Ht),lt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:ne.Zc,oldValue:qt,newValue:ne.Zc,pivotTableName:zt.Zc}))}Se=!0}finally{we.q5(lt,!0),Te=S.Commands.TI(lt.name()),we.tT[Te]=Dt.endTransaction()}}return Se},eo.prototype.uZt=function(rt){return-1<[H.PivotShowDataAs.percentOfTotal,H.PivotShowDataAs.percentOfRow,H.PivotShowDataAs.percentOfCol,H.PivotShowDataAs.percent,H.PivotShowDataAs.percentOfParentRow,H.PivotShowDataAs.percentOfParentCol,H.PivotShowDataAs.percentOfParent,H.PivotShowDataAs.percentDiff,H.PivotShowDataAs.percentOfRunningTotal].indexOf(rt)},eo.prototype.ML=function(rt,lt){return rt.getStyle({labelOnly:!0,references:[{fieldName:lt}]})},eo.prototype.sZt=function(rt,lt,Dt){var Nt;lt={labelOnly:!0,references:[{fieldName:lt}]},Nt=(Nt=(0,S.RF)(rt.getStyle(lt)))||new S.Style,Dt?Nt.formatter=Dt:(delete Nt.formatter,(0,w.cZt)(Nt)&&(Nt=null)),rt.setStyle(lt,Nt)},eo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we=(Te=this).Mf,Se=!1;if(Te.canUndo()){Te.X5(we,!0);try{for(rt=S.Commands.TI(we.name()),Dt=(lt=Te.tT[rt]).pivotTableChanges,Vt=(Nt=Te.tT.cmdOption||Te.tT.commandOptions).pivotTableName||Nt.pivotName,Zt=we.pivotTables&&we.pivotTables.get(Vt),ne=zt=qt=Ht=void 0,pe=0;pe<Dt.length;pe++)(ue=Dt[pe].value).type==="showNoData"?Ht=ue:ue.type==="isShowSubtotalTop"?(qt=ue,zt=Zt.subtotalPosition(qt.fieldName)):ue.type==="changeFieldName"&&(ne=ue);we.Ut.undo(lt),Ht&&(be=Zt.showNoData(Ht.cacheFieldName),we.ki(S.Events.PivotTableChanged,{type:"showNoData",cacheFieldName:Ht.cacheFieldName,oldValue:Ht.isShow,newValue:be,pivotTableName:Zt.Zc})),qt&&we.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:qt.fieldName,oldValue:zt,newValue:qt.oldShowSubtotalPosition,pivotTableName:Zt.Zc}),ne&&we.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:ne.fieldName,oldValue:ne.fieldName,newValue:ne.oldFieldName,pivotTableName:Zt.Zc}),Se=!0}finally{Te.q5(we,!0)}}return Se},Tt=eo,S.Commands[D]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Tt,lt,Dt)}},Yt(To,me=o),To.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne=!1,pe=(zt=this).tT.cmdOption;if(zt.canExecute())if(rt=pe.targetArea,lt=pe.fieldName,Dt=pe.targetIndex,Nt=pe.pivotName,pe=pe.isSusPaint,Zt=(Vt=zt.Mf).Ut,qt=Vt.pivotTables.get(Nt),qt=pe?qt.dh.copyFieldsModel:qt.dh,(0,H.ht)(Dt)&&(Dt=qt.nw(rt).length,(Ht=qt.getSigmaValuePosition()).display)&&Ht.positionType===rt-1&&Dt++,Ht=lt,rt===at.PivotTableFieldType.valueField&&(Ht=qt.dz(qt.FG(lt))),pe)qt.addFieldByName(lt,Ht,rt,it,Dt),qt.q3(pe);else{Zt.startTransaction(),zt.X5(Vt,!0);try{qt.addFieldByName(lt,Ht,rt,it,Dt),qt.q3(pe,null,!1),Vt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Ht,sourceName:lt,newArea:rt,newIndex:Dt,oldIndex:it,oldArea:it,pivotTableName:Nt}),ne=!0}catch(ue){Vt.jT(10,ue.message)}finally{zt.q5(Vt,!0),qt=S.Commands.TI(Vt.name()),zt.tT[qt]=Zt.endTransaction()}}return ne},To.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=(Zt=this).Mf,qt=!1;if(Zt.canUndo()){Zt.X5(Ht,!0);try{for(rt=S.Commands.TI(Ht.name()),lt=Zt.tT[rt],Ht.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=0;Nt<Dt.length;Nt++)(Vt=Dt[Nt].value).type==="removeField"&&Ht.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Vt.fieldName,oldArea:Vt.area,oldIndex:Vt.index,newArea:it,newIndex:it,pivotTableName:Zt.tT.cmdOption.pivotName});qt=!0}finally{Zt.q5(Ht,!0)}}return qt},Ot=To,S.Commands[q]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Ot,lt,Dt)}},Yt(Qe,Ce=o),Qe.prototype.getAllItemsList=function(rt){var lt=[];return rt._items.forEach(function(Dt){lt.push(Dt.value)}),lt},Qe.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee,ke,Me,Ae,Ze=!1;if((Ae=this).canExecute()){rt=Ae.tT.cmdOption,Vt=Nt=Dt=lt=void 0,(Ht=(Zt=Ae.Mf).Ut).startTransaction(),Ae.X5(Zt,!0);try{if((0,H.ht)(rt)){if(ue=Ae.tT.commandOptions,be=Ae.tT.selections,Te=ue.subType,Nt=Zt.pivotTables.get(ue.pivotTableName),Me=ue.pivotTableCellInfo,we=Nt.dh,Se=Me.area,lt=Ge(Me),_e=void 0,Vt=Nt.options.allowMultipleFiltersPerField&&Nt.labelFilter(lt)||{},_e=(0,H.ht)(Vt.textItem)?{isAll:!1}:Vt.textItem,Be=r(Zt,ue.pivotTableName,lt,be,Se),Te===1)_e.list=At([],Be,!0);else if(Te===2){for(Oe=(we.getLabelFilterInfo(lt)&&we.getLabelFilterInfo(lt).textItem&&we.getLabelFilterInfo(lt).textItem.list||we.Kz(lt)).slice(0),Ee=[],ke=0;ke<Oe.length;ke++)Be.indexOf(Oe[ke])===-1&&Ee.push(Oe[ke]);_e.list=Ee}Vt.textItem=_e}else lt=rt.fieldName,Dt=rt.pivotName,Nt=Zt.pivotTables.get(Dt),qt=rt.dataOfListBox,Vt=Nt.options.allowMultipleFiltersPerField&&Nt.labelFilter(lt)||{},zt={list:[],isAll:!1},ne=[],pe=!0,qt.forEach(function(je){je.status||(pe=pe&&je.status),je.status&&ne.push(je.value)}),zt.isAll=pe,zt.list=ne,Vt.textItem=zt;Nt.labelFilter(lt,Vt),Zt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:lt,filterInfo:Nt.labelFilter(lt),pivotTableName:Dt}),Ze=!0}finally{Ae.q5(Zt,!0),Me=S.Commands.TI(Zt.name()),Ae.tT[Me]=Ht.endTransaction()}}return Ze},Qe.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),Dt=(lt=Nt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.Ut.undo(lt),Vt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt.sourceName,filterInfo:(0,S.RF)(Dt.filterInfo),pivotTableName:Nt.tT.cmdOption&&Nt.tT.cmdOption.pivotName||Nt.tT.commandOptions.pivotTableName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},Pt=Qe,S.Commands[nt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Pt,lt,Dt)}},Yt(ro,Pe=o),ro.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee,ke,Me=!1;if((ke=this).canExecute()){lt=(rt=ke.tT).cmdOption,qt=Ht=Vt=Nt=Dt=void 0,(ne=(zt=ke.Mf).Ut).startTransaction(),ke.X5(zt,!0),pe=!1;try{if((0,H.ht)(lt))Nt=(be=rt.commandOptions).pivotTableName,Vt=zt.pivotTables.get(be.pivotTableName),Dt=Ge(Ee=be.pivotTableCellInfo),Zt=be.subType,be.sortValueInfo?pe=!0:(Te=function(Ae){var Ze,je,no,Je,Po,ho,ze,so,bo;if(Ae.menuArea===4){if(no=Ae.rowInfos,Je=Ae.colInfos,Po=no&&no.length,ho=Je&&Je.length,bo=Po===0||no&&no.some(function(uo){return uo.isGrandTotal}),so=ho===0||Je&&Je.some(function(uo){return uo.isGrandTotal}),Ae=Ae.valueFieldName,ze=F(),bo&&so||!Ae)throw new Error(ze.Invalid_Field_Sort_By);return(so=bo?(Ze=Je[ho-1].fieldName,no):(Ze=no[Po-1].fieldName,Je))&&0<so.length&&((bo=so.findIndex(function(uo){return uo.fieldName===ze.sigmaValue}))!==-1&&(Ae=so[bo].itemName,so.splice(bo,1)),je=so.map(function(uo){return{fieldName:uo.fieldName,items:[uo.itemName]}})),{fieldName:Ze,sortValueFieldName:Ae,sortByPivotReferences:je}}}(Ee))&&(Dt=Te.fieldName,Ht=Te.sortValueFieldName,qt=Te.sortByPivotReferences);else switch(Dt=lt.fieldName,Nt=lt.pivotName,ue=lt.commandName,Vt=zt.pivotTables.get(Nt),ue){case"asc":Zt=H.SortType.asc;break;case"desc":Zt=H.SortType.desc;break;case"custom":Zt=H.SortType.custom;break;default:return}if(we=void 0,pe){for(Se=Vt.dh,_e=(be=lt||rt.commandOptions).sortValueInfo.sortedFieldNames,Be=[].concat(_e),_e.sort(function(Ae,Ze){return Ae=Ae.localeCompare(Ze),Zt===H.SortType.desc?-1*Ae:Ae}),Oe=0;Oe<_e.length-1;Oe++)Se.changeFieldArea(_e[Oe],3,Oe);Vt.refresh(),we={type:"sort",sortType:Zt,fieldName:F().Values,oldOrder:Be,newOrder:_e,pivotTableName:Nt}}else Vt.sort(Dt,{sortType:Zt,sortValueFieldName:Ht,sortByPivotReferences:qt}),we={type:"sort",fieldName:Dt,sortType:Zt,sortInfo:Vt.sort(Dt),pivotTableName:Nt};we&&(zt.ki(S.Events.PivotTableChanged,we),Me=!0)}catch(Ae){zt.jT(10,Ae.message)}finally{ke.q5(zt,!0),Ee=S.Commands.TI(zt.name()),ke.tT[Ee]=ne.endTransaction()}}return Me},ro.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=(qt=this).Mf,ne=!1;if(qt.canUndo()){qt.X5(zt,!0);try{rt=S.Commands.TI(zt.name()),Dt=(lt=qt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,zt.Ut.undo(lt),Vt=(Nt=qt.tT.cmdOption||qt.tT.commandOptions).sortValueInfo?(Ht=(Zt=Nt.sortValueInfo).sortedFieldNames,{type:"sort",sortType:Zt.sortType,fieldName:F().Values,oldOrder:At([],Ht,!0),newOrder:At([],Ht,!0).reverse(),pivotTableName:Nt.pivotName||Nt.pivotTableName}):{type:"sort",fieldName:Dt.fieldName,sortType:Dt.sortInfo?Dt.sortInfo.sortType:it,sortInfo:Dt.sortInfo,pivotTableName:Nt.pivotName},zt.ki(S.Events.PivotTableChanged,Vt),ne=!0}finally{qt.q5(zt,!0)}}return ne},Jt=ro,S.Commands[gt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Jt,lt,Dt)}},Yt(Fo,Ne=o),Fo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue=!1;if((pe=this).canExecute()){rt=pe.tT.cmdOption,Zt=Vt=Nt=Dt=lt=void 0,(qt=(Ht=pe.Mf).Ut).startTransaction(),pe.X5(Ht,!0);try{(0,H.ht)(rt)?(ne=pe.tT.commandOptions,lt=Ht.pivotTables.get(ne.pivotTableName),Dt=Ge(ne.pivotTableCellInfo),Nt=ne.clearType):(Dt=rt.fieldName,Nt=rt.clearType,Vt=rt.labelType||3,Zt=rt.pivotName,lt=Ht.pivotTables.get(Zt)),Nt===1?((zt=lt.labelFilter(Dt))&&(Vt===1?delete zt.textItem:Vt===2?delete zt.condition:zt=it),lt.labelFilter(Dt,zt)):Nt===2?lt.valueFilter(Dt,it):Nt===0&&(lt.labelFilter(Dt,it),lt.valueFilter(Dt,it)),Ht.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt,pivotTableName:Zt,clearType:Nt}),ue=!0}finally{pe.q5(Ht,!0),ne=S.Commands.TI(Ht.name()),pe.tT[ne]=qt.endTransaction()}}return ue},Fo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=(Zt=this).Mf,qt=!1;if(Zt.canUndo()){Zt.X5(Ht,!0);try{for(rt=S.Commands.TI(Ht.name()),lt=Zt.tT[rt],Ht.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=0;Nt<Dt.length;Nt++)(Vt=Dt[Nt].value).type!=="setLabelFilter"&&Vt.type!=="setValueFilter"||Ht.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Vt.fieldName,filterInfo:(0,S.RF)(Vt.filterInfo),pivotTableName:(Zt.tT.cmdOption||Zt.tT.commandOptions).pivotName});qt=!0}finally{Zt.q5(Ht,!0)}}return qt},$t=Fo,S.Commands[Z]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,$t,lt,Dt)}},Yt(No,Fe=o),No.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be=!1;if((ue=this).canExecute()){rt=(Vt=ue.tT.cmdOption).fieldName,lt=Vt.selectValue,Dt=Vt.inputValue,Nt=Vt.inputValueEnd,Vt=Vt.pivotName,(Ht=(Zt=ue.Mf).Ut).startTransaction(),ue.X5(Zt,!0);try{pe=(qt=Zt.pivotTables.get(Vt)).dh.rBt(rt),zt=qt.options.allowMultipleFiltersPerField&&qt.labelFilter(rt)||{},pe===H.PivotDataType.number&&(Dt=(0,H.ht)(Dt)?Dt:parseInt(Dt,10),Nt=(0,H.ht)(Nt)?Nt:parseInt(Nt,10)),ne={conType:H.PivotConditionType.caption,val:[Dt,Nt],operator:lt},zt.condition=ne,qt.labelFilter(rt,zt),Zt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:rt,filterInfo:qt.labelFilter(rt),pivotTableName:Vt}),be=!0}finally{ue.q5(Zt,!0),pe=S.Commands.TI(Zt.name()),ue.tT[pe]=Ht.endTransaction()}}return be},No.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),lt=Nt.tT[rt],Vt.Ut.undo(lt),Dt=lt.pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt.fieldName,filterInfo:(0,S.RF)(Dt.filterInfo),pivotTableName:Nt.tT.cmdOption.pivotName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},e=No,S.Commands[kt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,e,lt,Dt)}},Yt(_o,ye=o),_o.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te=!1;if((be=this).canExecute()){ue=be.tT.cmdOption,(lt=(rt=be.Mf).Ut).startTransaction(),be.X5(rt,!0);try{Dt=ue.valueOfField,Nt=ue.valueOfFieldValue,Vt=ue.inputValue,Zt=ue.inputValueEnd,Ht=ue.fieldName,qt=ue.pivotName,zt=rt.pivotTables.get(qt),ne={},pe={conType:H.PivotConditionType.value,val:[Vt,Zt],operator:+Nt},ne.condition=pe,ne.conditionByName=Dt,zt.valueFilter(Ht,ne),rt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Ht,filterInfo:zt.valueFilter(Ht),pivotTableName:qt}),Te=!0}finally{be.q5(rt,!0),ue=S.Commands.TI(rt.name()),be.tT[ue]=lt.endTransaction()}}return Te},_o.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),lt=Nt.tT[rt],Vt.Ut.undo(lt),Dt=lt.pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt.fieldName,filterInfo:(0,S.RF)(Dt.filterInfo),pivotTableName:Nt.tT.cmdOption.pivotName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},p=_o,S.Commands[Xt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,p,lt,Dt)}},Yt(Do,De=o),Do.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e=!1;if((Se=this).canExecute()){we=Se.tT.cmdOption,(lt=(rt=Se.Mf).Ut).startTransaction(),Se.X5(rt,!0);try{Dt=we.fieldName,Nt=we.TopOrBottomValue,Vt=we.inputValue,Zt=we.pivotName,Ht=we.selectTypeValue,qt=we.valueFieldName,zt=rt.pivotTables.get(Zt),ne={},ue=1,be=0,Te=10,Nt==="Bottom"&&(ue=-1),Ht==="Percent"?be=1:Ht==="Sum"&&(be=2),isNaN(+Vt)||(Te=+Vt),pe={conType:H.PivotConditionType.top10,val:Te,type:be,operator:ue},ne.condition=pe,ne.conditionByName=qt,zt.valueFilter(Dt,ne),rt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt,filterInfo:zt.valueFilter(Dt),pivotTableName:Zt}),_e=!0}finally{Se.q5(rt,!0),we=S.Commands.TI(rt.name()),Se.tT[we]=lt.endTransaction()}}return _e},Do.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),Dt=(lt=Nt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.Ut.undo(lt),Vt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt.sourceName,filterInfo:(0,S.RF)(Dt.filterInfo),pivotTableName:Nt.tT.cmdOption.pivotName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},C=Do,S.Commands[Mt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,C,lt,Dt)}},Yt(wo,Ve=o),wo.prototype.canExecute=function(){for(var rt,lt=this.tT.cmdOption,Dt=this.Mf.pivotTables.get(lt.pivotName).dh,Nt=0;Nt<Dt.z.length;Nt++)Dt.z[Nt]instanceof X.PivotPanel&&(rt=Dt.z[Nt]);return!(rt&&rt.GY&&rt.GY.AWt)},wo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee=!1;if((Oe=this).canExecute()){if(rt=Oe.tT.cmdOption,Dt=(lt=Oe.Mf).Ut,Nt=rt.fieldName,Vt=rt.pivotName,we=rt.host,Zt=rt.command,Ht=rt.isWholeDay,Be=rt.dateLabel,qt=rt.value1,zt=rt.value2,pe=(ne=lt.pivotTables.get(Vt)).dh,ue=ne.options.allowMultipleFiltersPerField&&ne.labelFilter(Nt)||{},be=void 0,Te=+Zt.split("-")[0],isNaN(Te))return;if(Te<=H.PivotDateFilterOperator.notBetween&&Be)we=new f.DateFilterDialog(we,Be,pe,Nt,Vt,Te),rt.needFocus&&we.Lmr(),Ee=!0;else try{if(Dt.startTransaction(),Oe.X5(lt,!0),Se=Io(qt),_e=Io(zt),!(0,H.ht)(qt)&&(0,H.ht)(Se)||!(0,H.ht)(zt)&&(0,H.ht)(_e))throw new Error(F().DateFormatError);be=Te==41?Oe.createParallelDateFilterCondition(Zt):{conType:H.PivotConditionType.date,val:[Se,_e],isWholeDay:Ht,operator:Te},ue.condition=be,ne.labelFilter(Nt,ue),lt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Nt,filterInfo:ne.labelFilter(Nt),pivotTableName:Vt}),Ee=!0}finally{Oe.q5(lt,!0),Be=S.Commands.TI(lt.name()),Oe.tT[Be]=Dt.endTransaction()}}return Ee},wo.prototype.createParallelDateFilterCondition=function(rt){var lt,Dt,Nt,Vt,Zt;switch(+rt.split("-")[1]){case 1:Dt=new Date,Nt=new Date,Zt=(Vt=Dt.getMonth())%3,Dt.setDate(1),Dt.setHours(0,0,0,0),Dt.setMonth(Vt-Zt),Nt.setHours(23,59,59),lt={conType:H.PivotConditionType.date,val:[Dt,Nt],isWholeDay:!0,operator:H.PivotDateFilterOperator.dateToDate,isParallel:!1,by:H.PivotAdvancedDateFilterBy.quarter};break;case 2:Dt=new Date,Nt=new Date,Dt.setDate(1),Dt.setHours(0,0,0,0),Nt.setHours(23,59,59),lt={conType:H.PivotConditionType.date,val:[Dt,Nt],isWholeDay:!0,operator:H.PivotDateFilterOperator.dateToDate,isParallel:!1,by:H.PivotAdvancedDateFilterBy.month};break;case 3:Dt=new Date,Nt=new Date,Dt.setMonth(0,1),Dt.setHours(0,0,0,0),Nt.setHours(23,59,59),lt={conType:H.PivotConditionType.date,val:[Dt,Nt],isWholeDay:!0,operator:H.PivotDateFilterOperator.dateToDate,isParallel:!0,by:H.PivotAdvancedDateFilterBy.year};break;case 4:Dt=new Date,Nt=new Date,Zt=(Vt=Dt.getMonth())%3,Dt.setDate(1),Dt.setHours(0,0,0,0),Dt.setMonth(Vt-Zt),Nt.setHours(23,59,59),lt={conType:H.PivotConditionType.date,val:[Dt,Nt],isWholeDay:!0,operator:H.PivotDateFilterOperator.dateToDate,isParallel:!0,by:H.PivotAdvancedDateFilterBy.quarter};break;case 5:Dt=new Date,Nt=new Date,Dt.setDate(1),Dt.setHours(0,0,0,0),Nt.setHours(23,59,59),lt={conType:H.PivotConditionType.date,val:[Dt,Nt],isWholeDay:!0,operator:H.PivotDateFilterOperator.dateToDate,isParallel:!0,by:H.PivotAdvancedDateFilterBy.month}}return lt},wo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),Dt=(lt=Nt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.Ut.undo(lt),Vt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt.sourceName,filterInfo:(0,S.RF)(Dt.filterInfo),pivotTableName:Nt.tT.cmdOption.pivotName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},W=wo,S.Commands[st]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,W,lt,Dt)}},Yt(oo,Le=o),oo.prototype.canExecute=function(){return!0},oo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt=!1;if((Ht=this).canExecute()){Zt=Ht.tT.cmdOption,lt=(rt=Ht.Mf).Ut,Dt=Zt.fieldName,Nt=Zt.pivotName,Zt=Zt.labelFilter,Vt=rt.pivotTables.get(Nt);try{lt.startTransaction(),Ht.X5(rt,!0),Vt.labelFilter(Dt,Zt),rt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt,filterInfo:Vt.labelFilter(Dt),pivotTableName:Nt}),qt=!0}finally{Ht.q5(rt,!0),Zt=S.Commands.TI(rt.name()),Ht.tT[Zt]=lt.endTransaction()}}return qt},oo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),Dt=(lt=Nt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.Ut.undo(lt),Vt.ki(S.Events.PivotTableChanged,{type:"filter",fieldName:Dt.sourceName,filterInfo:(0,S.RF)(Dt.filterInfo),pivotTableName:Nt.tT.cmdOption.pivotName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},x=oo,S.Commands[n]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,x,lt,Dt)}},Yt(He,fe=o),He.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e,Be,Oe,Ee,ke,Me,Ae,Ze,je,no,Je,Po,ho,ze,so,bo,uo,xo,Yo=!1;if((xo=this).canExecute()){(lt=(rt=xo.Mf).Ut).startTransaction(),xo.X5(rt,!0),uo=(Dt=xo.tT).commandOptions,Nt=Dt.cmdOption;try{if(ue=((ue=pe=ne=zt=qt=Ht=Zt=Vt=void 0,H.ht)(Nt)?(Vt=(qt=rt.pivotTables.get(uo.pivotTableName)).dh,Se=(we=uo.pivotTableCellInfo).activeRowFieldInfo,_e=we.activeColFieldInfo,pe=we.area,Zt=Se&&Se.name||_e&&_e.name,Dt):(Zt=Nt.fieldName,Ht=Nt.pivotName,zt=Nt.dataType,qt=rt.pivotTables.get(Ht),Nt)).selections,Zt=(be=qt.getField(Zt)).sourceName,Te=be.fieldName,Be=qt.getGroupInfo(Zt),Ee=Oe=void 0,zt===H.PivotDataType.number)Oe=ne={originFieldName:Zt,numberGroup:{start:Nt.startingAtValue,end:Nt.endingAtValue,by:Nt.groupByValue}},qt.group(ne);else if(zt===H.PivotDataType.date){if(ne={originFieldName:Zt},0<(ke=Nt.groupByValueArray).length)for(ne.dateGroups=[],Me=0;Me<ke.length;Me++)Ae=ke[Me],ne.dateGroups.push({start:new Date(Nt.startingAtValue),end:new Date(Nt.endingAtValue),by:Ae});Oe=ne,qt.group(ne)}else if(Ze=Zt,no=je=void 0,Je={},Po=!!Vt.sy(Zt),ho=r(rt,qt.name(),Te,ue,pe),so=(ze=qt.getGroupInfo(Zt))&&ze.textGroup&&ze.textGroup.groupItems,(0,H.ht)(so))1<ho.length&&(Ze=(je=Zt)+2,Je[F().Group+1]=ho,Oe=no={originFieldName:je,textGroup:{fieldName:Ze,groupItems:Je}},qt.group(no),Po||(pe===3?qt.add(Ze,Ze,at.PivotTableFieldType.rowField,void 0,So(Vt.B,Zt)):pe===2&&qt.add(Ze,Ze,at.PivotTableFieldType.columnField,void 0,So(Vt.R,Zt)),Ee=qt.getField(Ze)));else{for(Me=0;Me<ho.length;Me++)if(-1<(bo=ho[Me]).indexOf("Group")&&so[bo]&&1<so[bo].length)return!1;so[F().Group+(Object.keys(so).length+1)]=ho,Oe=ze,qt.group(ze)}rt.ki(S.Events.PivotTableChanged,{type:"group",fieldName:Zt,oldGroupInfo:Be,newGroupInfo:Oe,pivotTableName:qt.name()}),Ee&&rt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Ee.fieldName,oldArea:it,oldIndex:it,newArea:Ee.pivotArea,newIndex:Ee.pivotIndex,pivotTableName:qt.name()}),Yo=!0}catch(Uo){rt.jT(10,Uo.message)}finally{xo.q5(rt,!0),uo=S.Commands.TI(rt.name()),xo.tT[uo]=lt.endTransaction()}}return Yo},He.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be=(ue=this).Mf,Te=!1;if(ue.canUndo()){ue.X5(be,!0);try{for(rt=S.Commands.TI(be.name()),lt=ue.tT[rt],Nt=(Dt=ue.tT.cmdOption||ue.tT.commandOptions).pivotTableName||Dt.pivotName,Vt=be.pivotTables&&be.pivotTables.get(Nt),Zt=lt.pivotTableChanges,qt=Ht=void 0,zt=0;zt<Zt.length;zt++)(ne=Zt[zt].value).type==="group"&&(Ht=ne),ne.type==="removeField"&&(qt=ne);pe=Vt.getGroupInfo(Ht&&Ht.groupSourceFieldName),be.Ut.undo(lt),qt&&be.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Ht.groupSourceFieldName,oldArea:qt.pivotArea,oldIndex:qt.pivotIndex,newArea:it,newIndex:it,pivotTableName:Nt}),Ht&&be.ki(S.Events.PivotTableChanged,{type:"group",fieldName:Ht.groupSourceFieldName,oldGroupInfo:pe,newGroupInfo:Ht.oldGroupInfo,pivotTableName:Nt}),Te=!0}finally{ue.q5(be,!0)}}return Te},yt=He,S.Commands[N]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,yt,lt,Dt)}},Yt(io,Re=o),io.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=!1;if((qt=this).canExecute()){(lt=(rt=qt.Mf).Ut).startTransaction(),qt.X5(rt,!0);try{Dt=qt.tT.commandOptions,Nt=rt.pivotTables.get(Dt.pivotTableName),Ht=Ge(Dt.pivotTableCellInfo),(Vt=Nt.getField(Ht))&&Vt.sourceName&&(Zt=Nt.getGroupInfo(Vt.sourceName),Nt.ungroup(Vt.sourceName),rt.ki(S.Events.PivotTableChanged,{type:"group",fieldName:Vt.sourceName,oldGroupInfo:Zt,newGroupInfo:null,pivotTableName:Dt.pivotTableName}),zt=!0)}finally{qt.q5(rt,!0),Ht=S.Commands.TI(rt.name()),qt.tT[Ht]=lt.endTransaction()}}return zt},io.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),Dt=(lt=Nt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.Ut.undo(lt),Vt.ki(S.Events.PivotTableChanged,{type:"group",fieldName:Dt.sourceName,oldGroupInfo:null,newGroupInfo:Dt.groupInfo,pivotTableName:Nt.tT.commandOptions.pivotTableName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},_t=io,S.Commands[V]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,_t,lt,Dt)}},Yt(Eo,Ke=o),Eo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt=!1;if((Vt=this).canExecute()){(lt=(rt=Vt.Mf).Ut).startTransaction(),Vt.X5(rt,!0);try{(Dt=Vt.Mf.pivotTables.get(Vt.tT.commandOptions.pivotTableName)).suspendLayout(),Nt=Co(!1,this,!1),(0,H.o)(Nt,function(Ht){var qt=Dt.collapse(Ht.fieldName,Ht.itemName);Dt.collapse(Ht.fieldName,Ht.itemName,Ht.collapse),Dt.updateDataModel(),rt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Ht.fieldName,item:Ht.itemName,newValue:Ht.collapse,oldValue:qt,pivotTableName:Dt.Zc})}),Dt.resumeLayout(),Zt=!0}finally{Vt.q5(rt,!0),Nt=S.Commands.TI(rt.name()),Vt.tT[Nt]=lt.endTransaction()}}return Zt},Eo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=(qt=this).Mf,ne=!1;if(qt.canUndo()){qt.X5(zt,!0);try{for(rt=S.Commands.TI(zt.name()),lt=qt.tT[rt],zt.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=qt.Mf.pivotTables.get(qt.tT.commandOptions.pivotTableName),Vt=0;Vt<Dt.length;Vt++)(Zt=Dt[Vt].value).type==="setCollapse"&&(Ht=Nt.collapse(Zt.fieldName,Zt.item),zt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Zt.fieldName,item:Zt.item,newValue:Ht,oldValue:Zt.isCollapse,pivotTableName:Nt.Zc}));ne=!0}finally{qt.q5(zt,!0)}}return ne},Lt=Eo,S.Commands[pt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Lt,lt,Dt)}},Yt(Oo,lo=o),Oo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt=!1;if((Vt=this).canExecute()){(lt=(rt=Vt.Mf).Ut).startTransaction(),Vt.X5(rt,!0);try{(Dt=Vt.Mf.pivotTables.get(Vt.tT.commandOptions.pivotTableName)).suspendLayout(),Nt=Co(!0,this,!1),(0,H.o)(Nt,function(Ht){var qt=Dt.collapse(Ht.fieldName,Ht.itemName);Dt.collapse(Ht.fieldName,Ht.itemName,Ht.collapse),Dt.updateDataModel(),rt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Ht.fieldName,item:Ht.itemName,newValue:Ht.collapse,oldValue:qt,pivotTableName:Dt.Zc})}),Dt.resumeLayout(),Zt=!0}finally{Vt.q5(rt,!0),Nt=S.Commands.TI(rt.name()),Vt.tT[Nt]=lt.endTransaction()}}return Zt},Oo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=(qt=this).Mf,ne=!1;if(qt.canUndo()){qt.X5(zt,!0);try{for(rt=S.Commands.TI(zt.name()),lt=qt.tT[rt],zt.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=qt.Mf.pivotTables.get(qt.tT.commandOptions.pivotTableName),Vt=0;Vt<Dt.length;Vt++)(Zt=Dt[Vt].value).type==="setCollapse"&&(Ht=Nt.collapse(Zt.fieldName,Zt.item),zt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Zt.fieldName,item:Zt.item,newValue:Ht,oldValue:Zt.isCollapse,pivotTableName:Nt.Zc}));ne=!0}finally{qt.q5(zt,!0)}}return ne},Et=Oo,S.Commands[wt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Et,lt,Dt)}},Yt(Ao,ao=o),Ao.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=!1;if((qt=this).canExecute()){Ht=qt.tT,(lt=(rt=qt.Mf).Ut).startTransaction(),qt.X5(rt,!0);try{(Dt=rt.pivotTables.get(Ht.commandOptions.pivotTableName)).suspendLayout(),Nt=Co(!1,this,!0),(Zt=[],H.o)(Nt,function(ne){!Dt.collapse(ne.fieldName,ne.itemName)!=!ne.collapse&&(Dt.collapse(ne.fieldName,ne.itemName,ne.collapse),Vt=ne.fieldName,Zt.push(ne.itemName))}),Dt.resumeLayout(),Zt.length&&rt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Vt,newValue:!1,oldValue:!0,pivotTableName:Dt.Zc,changedItems:Zt}),zt=!0}finally{qt.q5(rt,!0),Ht=S.Commands.TI(rt.name()),qt.tT[Ht]=lt.endTransaction()}}return zt},Ao.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne=(zt=this).Mf,pe=!1;if(zt.canUndo()){zt.X5(ne,!0);try{for(rt=S.Commands.TI(ne.name()),lt=zt.tT[rt],ne.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=zt.Mf.pivotTables.get(zt.tT.commandOptions.pivotTableName),Vt=void 0,Zt=[],Ht=0;Ht<Dt.length;Ht++)(qt=Dt[Ht].value).type==="setCollapse"&&(Zt.push(qt.item),Vt=qt.fieldName);ne.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Vt,changedItems:Zt,newValue:!0,oldValue:!1,pivotTableName:Nt.Zc}),pe=!0}finally{zt.q5(ne,!0)}}return pe},Wt=Ao,S.Commands[et]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Wt,lt,Dt)}},Yt(Lo,po=o),Lo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=!1;if((qt=this).canExecute()){Ht=qt.tT,(lt=(rt=qt.Mf).Ut).startTransaction(),qt.X5(rt,!0);try{(Dt=rt.pivotTables.get(Ht.commandOptions.pivotTableName)).suspendLayout(),Nt=Co(!0,this,!0),Zt=[],(0,H.o)(Nt,function(ne){!Dt.collapse(ne.fieldName,ne.itemName)!=!ne.collapse&&(Dt.collapse(ne.fieldName,ne.itemName,ne.collapse),Vt=ne.fieldName,Zt.push(ne.itemName))}),Dt.resumeLayout(),Zt.length&&rt.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Vt,newValue:!0,oldValue:!1,pivotTableName:Dt.Zc,changedItems:Zt}),zt=!0}finally{qt.q5(rt,!0),Ht=S.Commands.TI(rt.name()),qt.tT[Ht]=lt.endTransaction()}}return zt},Lo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne=(zt=this).Mf,pe=!1;if(zt.canUndo()){zt.X5(ne,!0);try{for(rt=S.Commands.TI(ne.name()),lt=zt.tT[rt],ne.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=zt.Mf.pivotTables.get(zt.tT.commandOptions.pivotTableName),Vt=void 0,Zt=[],Ht=0;Ht<Dt.length;Ht++)(qt=Dt[Ht].value).type==="setCollapse"&&(Zt.push(qt.item),Vt=qt.fieldName);ne.ki(S.Events.PivotTableChanged,{type:"collapse",fieldName:Vt,newValue:!1,oldValue:!0,pivotTableName:Nt.Zc,changedItems:Zt}),pe=!0}finally{zt.q5(ne,!0)}}return pe},Ut=Lo,S.Commands[ht]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Ut,lt,Dt)}},Yt(Mo,Xe=o),Mo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue,be,Te,we,Se,_e=!1;if((Se=this).canExecute())if(we=Se.tT,lt=(rt=Se.Mf).Ut,Dt=(we=we.cmdOption).isSusPaint,Nt=we.fieldName,Vt=we.checked,we=we.pivotName,Zt=rt.pivotTables&&rt.pivotTables.get(we),Ht=void 0,qt=Dt?Zt.dh.copyFieldsModel:Zt.dh,Dt)Vt?qt.qVt(Nt):qt.HVt(Nt),qt.q3(Dt);else{lt.startTransaction(),Se.X5(rt,!0);try{if(Vt)zt=qt.qVt(Nt),Ht=qt.Ti.getPivotCacheByName(qt.L).Pq[Nt].W5===H.PivotDataType.number?{pivotArea:at.PivotTableFieldType.valueField,pivotIndex:qt.nw(at.PivotTableFieldType.valueField).length-1}:Zt.getField(Nt),qt.q3(Dt,null,!1),rt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:zt&&zt.Zc,oldArea:it,oldIndex:it,newArea:Ht.pivotArea,newIndex:Ht.pivotIndex,pivotTableName:Zt.Zc});else{for(ne=void 0,pe=[],ue=at.PivotTableFieldType.valueField;ue>=at.PivotTableFieldType.filterField;ue--)for(be=(ne=qt.nw(ue)).length-1;0<=be;be--)ne[be].a===Nt&&pe.unshift(Zt.getField(ne[be].Zc));for(qt.HVt(Nt),qt.q3(Dt,null,!1),Te=0;Te<pe.length;Te++)Ht=pe[Te],rt.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Ht.fieldName,sourceName:Nt,oldArea:Ht.pivotArea,oldIndex:Ht.pivotIndex,newArea:it,newIndex:it,pivotTableName:Zt.Zc})}_e=!0}finally{Se.q5(rt,!0),we=S.Commands.TI(rt.name()),Se.tT[we]=lt.endTransaction()}}return _e},Mo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=(Zt=this).Mf,qt=!1;if(Zt.canUndo()){Zt.X5(Ht,!0);try{for(rt=S.Commands.TI(Ht.name()),lt=Zt.tT[rt],Ht.Ut.undo(lt),Dt=lt.pivotTableChanges,Nt=0;Nt<Dt.length;Nt++)(Vt=Dt[Nt].value).type==="removeField"?Ht.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Vt.fieldName,oldArea:Vt.area,oldIndex:Vt.index,newArea:it,newIndex:it,pivotTableName:Zt.tT.cmdOption.pivotName}):Ht.ki(S.Events.PivotTableChanged,{type:"fieldChanged",fieldName:Vt.fieldName,oldArea:it,oldIndex:it,newArea:Vt.area,newIndex:Vt.index,pivotTableName:Zt.tT.cmdOption.pivotName});qt=!0}finally{Zt.q5(Ht,!0)}}return qt},Kt=Mo,S.Commands[k]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Kt,lt,Dt)}},Yt(Zo,xe=o),Zo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=!1;if((Zt=this).canExecute()){Vt=Zt.tT,(lt=(rt=Zt.Mf).Ut).startTransaction(),Zt.X5(rt,!0);try{Nt=(Dt=Vt.cmdOption).fieldsInfo,(rt.pivotTables&&rt.pivotTables.get(Dt.pivotName)).dh.VT(Nt),Ht=!0}finally{Zt.q5(rt,!0),Vt=S.Commands.TI(rt.name()),Zt.tT[Vt]=lt.endTransaction()}}return Ht},oe=Zo,S.Commands[$]={canUndo:!1,execute:function(rt,lt,Dt){return j(rt,oe,lt,Dt)}},Yt(Ro,yo=o),Ro.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=!1;if((Zt=this).canExecute()){Vt=Zt.tT,(lt=(rt=Zt.Mf).Ut).startTransaction(),Zt.X5(rt,!0);try{Nt=(Dt=Vt.cmdOption).name,Dt.views.apply(Nt),rt.ki(S.Events.PivotTableChanged,{type:"viewChanged",viewName:Nt,pivotTableName:Dt.pivotName}),Ht=!0}finally{Zt.q5(rt,!0),Vt=S.Commands.TI(rt.name()),Zt.tT[Vt]=lt.endTransaction()}}return Ht},Ro.prototype.undo=function(){var rt,lt,Dt,Nt=(Dt=this).Mf,Vt=!1;if(Dt.canUndo()){Dt.X5(Nt,!0);try{rt=S.Commands.TI(Nt.name()),lt=Dt.tT[rt],Nt.Ut.undo(lt),Nt.ki(S.Events.PivotTableChanged,{type:"viewChanged",pivotTableName:Dt.tT.cmdOption.pivotName}),Vt=!0}finally{Dt.q5(Nt,!0)}}return Vt},ae=Ro,S.Commands[G]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,ae,lt,Dt)}},S.Commands[O]={canUndo:!1,execute:function(rt,lt,Dt){rt=S.Commands.Tp(rt,lt),lt=lt.commandOptions;var Nt,Vt=rt.pivotTables.get(lt.pivotTableName),Zt=(lt=lt.pivotTableCellInfo).rowInfos,Ht=(lt=lt.colInfos,Zt=Zt&&lt?Zt.concat(lt):Zt||lt||[],[]),qt=0;(0,H.o)(Zt,function(zt){zt.fieldName!==F().sigmaValue&&(Ht[qt]={fieldName:zt.fieldName,fieldItem:zt.itemName},qt++)}),lt=Vt.getPivotDetails(Ht),(Zt=rt.getParent())&&((Vt=new S.Worksheet).setRowCount(200<lt.length?lt.length:200),Vt.setColumnCount(20<lt[0].length?lt[0].length:20),Vt.setArray(0,0,lt),Nt=function(zt){for(var ne,pe,ue,be=0,Te=0;Te<zt.sheets.length;Te++)for(ne=zt.sheets[Te].tables.all(),pe=0;pe<ne.length;pe++)(ue=ne[pe].name())&&5<ue.length&&ue.substring(0,5).toLowerCase()==="table"&&Ho(ue=ue.substring(5,ue.length))&&Number(ue)>=be&&(be=Number(ue));return"Table"+(be+1).toString()}(Zt),Vt.tables.add(Nt,0,0,lt.length,lt[0].length),Zt.addSheet(Zt.getActiveSheetIndex(),Vt),Zt.ki(S.Events.ActiveSheetChanged,{oldSheet:rt,newSheet:Vt}))}},S.Commands[Rt]={canUndo:!1,execute:function(rt,lt){rt=S.Commands.Tp(rt,lt);var Dt,Nt=(lt=lt.cmdOption).fieldName,Vt=lt.pivotName,Zt=lt.commandName,Ht=lt.host,qt=lt.position,zt=lt.filterDialog,ne=(lt=[],(rt=rt.pivotTables&&rt.pivotTables.get(Vt)).dh);if(rt=rt.dh.getSourceNameByFieldName(Nt)||Nt,rt=ne.K.get(rt),Zt==="ValueFilter")Dt=new X.PivotValuesDialog(Ht,ne,Vt,Nt,it,it,zt),rt&&rt.valueFilter&&(rt.valueFilter.condition.sn===3?lt.push(8):lt.push(rt.valueFilter.condition.LVt));else{switch(ne.rBt(Nt)){case 0:Dt=new X.PivotNumberFilter(Ht,ne,Vt,Nt,it,it,zt);break;case 2:Dt=new X.PivotDateFilterDialog(Ht,ne,Vt,Nt,it,it,zt);break;default:Dt=new X.PivotStringFilterDialog(Ht,ne,Vt,Nt,it,it,zt)}rt&&rt.labelFilter&&rt.labelFilter.condition&&(Zt=rt.labelFilter.condition.sn===2?rt.labelFilter.condition.LVt+6:rt.labelFilter.condition.LVt,lt.push(Zt))}Dt.rQ(qt,{existed:lt,dataType:1})}},S.Commands[Ct]={canUndo:!1,execute:function(rt,lt,Dt){var Nt,Vt,Zt,Ht,qt,zt,ne=lt.cmdOption;rt=S.Commands.Tp(rt,lt),(0,H.ht)(ne)?(lt=lt.commandOptions,zt=rt.pivotTables.get(lt.pivotTableName),lt=lt.pivotTableCellInfo,Nt=zt.dh,Vt=Ge(lt),Zt=zt.name(),qt=(lt=zt.labelFilter(Vt))&&lt.conditionInfo&&lt.conditionInfo.LVt||0):(Vt=ne.fieldName,Zt=ne.pivotName,qt=ne.command,Nt=(zt=rt.pivotTables.get(Zt)).dh),lt=new(Nt.rBt(Vt)===H.PivotDataType.date?(Ht=F().getDateLabelFilterItemText(),f.DateFilterDialog):(Ht=F().getStringLabelFilterItemText(),X.LabelFilter))(document.body,Ht,Nt,Vt,Zt,+qt),ne.needFocus&&lt.Lmr()}},S.Commands[P]={canUndo:!1,execute:function(rt,lt,Dt){rt=S.Commands.Tp(rt,lt);var Nt,Vt,Zt,Ht=(lt=lt.cmdOption).position,qt=lt.fieldName,zt=(lt=lt.pivotName,(rt=rt.pivotTables.get(lt).dh).getFieldInfoByName(qt));return zt=vo(rt,zt,qt,Vt,lt,Zt=rt.Z[qt]),Zt===at.PivotTableFieldType.filterField?Vt=!(Nt=24):(Nt=30,Zt!==at.PivotTableFieldType.valueField&&(Vt=!0)),zt.isColOrRow=Vt,new X.PivotFilterDialog(document.body,rt,lt).init(Nt,qt,Ht,zt),!0}},S.Commands[J]={canUndo:!1,execute:function(rt,lt){var Dt,Nt,Vt,Zt,Ht=lt.cmdOption;return rt=S.Commands.Tp(rt,lt),(0,H.ht)(Ht)?(Nt=Ge((lt=lt.commandOptions).pivotTableCellInfo,Dt=(Zt=rt.pivotTables.get(lt.pivotTableName))&&Zt.dh),Vt=lt.pivotTableName):(Zt=rt.pivotTables.get(Ht.pivotName),Nt=Ht.fieldName,Vt=Ht.pivotName,Dt=Zt&&Zt.dh),lt=Zt&&Zt.lZt,rt=Dt.getFieldInfoByName(Nt),Ht=Dt.a1(rt.a),rt=!!rt.Spi,new B.PivotDimFieldSettingDialog(Dt,Nt,Vt,lt,Ht,rt,Zt.layoutType()).$c(),!0}},S.Commands[Bt]={canUndo:!1,execute:function(rt,lt,Dt){rt=S.Commands.Tp(rt,lt);var Nt,Vt,Zt,Ht,qt,zt,ne=(pe=t(rt,lt.row,lt.col)).pivotInfo,pe=pe.pt;if(ne){switch(Nt=void 0,ne.area){case 0:Nt=ne.pageFieldInfo;break;case 1:Nt=ne.cornerFieldInfo;break;case 2:Nt=ne.colHeadFieldInfo}if(!Nt)return!1;Vt=Nt.fieldName,zt=Nt.isCompactRoot,lt=rt.getCellRect(lt.row,lt.col),Zt=pe.dh,lt.y+=lt.height,Ht=vo(Zt,Zt.getFieldInfoByName(Vt),Vt,!0,pe.Zc,Zt.Z[Vt]),(qt=0)===ne.area?qt=24:(qt=30,zt&&(zt=void 0,ne.area===1&&(zt=Zt.B.length),1<(zt=ne.area===2?Zt.R.length:zt)&&(qt+=1),Ht.areaFieldName=Zt.nw(ne.area).map(function(ue){return ue.Zc}))),new X.PivotFilterDialog(rt.parent&&rt.parent.j2(),pe.dh,pe.getName(),{allowResize:!0,keepDialogSize:!0}).init(qt,Vt,lt,Ht)}return!0}},S.Commands[bt]={canUndo:!1,execute:function(rt,lt){rt=S.Commands.Tp(rt,lt);var Dt=(lt=lt.cmdOption).fieldName,Nt=lt.configurationNumber,Vt=lt.position,Zt=lt.filterDialog,Ht=(lt=lt.pivotName,(rt=rt.pivotTables.get(lt).dh).getFieldInfoByName(Dt)),qt=[],zt=rt.Z[Dt];return rt.nw(zt).forEach(function(ne){qt.push(ne.Zc)}),qt.splice(qt.indexOf(Dt),1),qt.unshift(Dt),(rt=vo(rt,Ht,Dt,!0,lt,zt)).areaFieldName=qt,Zt.init(Nt,Dt,Vt,rt),!0}},S.Commands[Qt]={canUndo:!1,execute:function(rt,lt,Dt){var Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue=lt.cmdOption,be=lt.commandOptions;if(rt=S.Commands.Tp(rt,lt),ue)return Nt=ue.fieldName,Vt=ue.pivotName,lt=ue.needFocus,qt=(Ht=(Zt=rt.pivotTables.get(Vt)).dh).nw(3),zt=[Nt],qt.forEach(function(Te){zt.push(Te.Zc)}),ue=new U.SortFieldDialog(document.body,zt,Ht,Nt,Vt,rt),lt&&ue.Lmr(),!0;if(be){if(lt=be.pivotTableCellInfo,Vt=be.pivotTableName,Ht=(Zt=rt.pivotTables.get(Vt)).dh,lt.area===4){ue=Zt.getRange().content,be=Zt.rZt.HWt[4].getRange(),ne=ue.row+lt.relativeRow+be.row,ue=ue.col+lt.relativeColumn+be.col,be=Zt.getPivotInfo(ne,ue);try{new U.SortValueDialog(document.body,rt,Zt,be)}catch(Te){return rt.jT(10,Te.message),!1}}else{if(Nt=void 0,lt.colHeadFieldInfo?Nt=lt.colHeadFieldInfo.fieldName:lt.activeColFieldInfo?Nt=lt.activeColFieldInfo.name:lt.activeRowFieldInfo?Nt=lt.activeRowFieldInfo.name:lt.cornerFieldInfo&&(Nt=lt.cornerFieldInfo.fieldName),!Nt||(qt=Ht.nw(3),ne=[Nt],pe=[],qt.forEach(function(Te){pe.push(Te.Zc)}),pe.indexOf(Nt)!==-1))return!1;Nt===F().Values?new U.SortValueDialog(document.body,rt,Zt,lt,!0):(ne=ne.concat(pe),new U.SortFieldDialog(document.body,ne,Ht,Nt,Vt,rt))}return!0}return!1}},Yt(Vo,to=o),Vo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt=!1;if((qt=this).canExecute()){Ht=qt.tT.cmdOption,(lt=(rt=qt.Mf).Ut).startTransaction(),qt.X5(rt,!0);try{Dt=Ht.pivotName,Nt=Ht.fieldName,Vt=Ht.sortInfo,(Zt=rt.pivotTables.get(Dt)).sort(Nt,Vt),rt.ki(S.Events.PivotTableChanged,{type:"sort",fieldName:Nt,sortType:Vt.sortType,sortInfo:(0,S.RF)(Zt.sort(Nt)),pivotTableName:Dt}),zt=!0}finally{qt.q5(rt,!0),Ht=S.Commands.TI(rt.name()),qt.tT[Ht]=lt.endTransaction()}}return zt},Vo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt=(Nt=this).Mf,Zt=!1;if(Nt.canUndo()){Nt.X5(Vt,!0);try{rt=S.Commands.TI(Vt.name()),Dt=(lt=Nt.tT[rt]).pivotTableChanges[lt.pivotTableChanges.length-1].value,Vt.Ut.undo(lt),Vt.ki(S.Events.PivotTableChanged,{type:"sort",fieldName:Dt.fieldName,sortType:Dt.sortInfo.sortType,sortInfo:(0,S.RF)(Dt.sortInfo),pivotTableName:Nt.tT.cmdOption.pivotName}),Zt=!0}finally{Nt.q5(Vt,!0)}}return Zt},te=Vo,S.Commands[dt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,te,lt,Dt)}},Yt(ko,fo=o),ko.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue=!1;if((pe=this).canExecute()){ne=pe.tT.cmdOption,(lt=(rt=pe.Mf).Ut).startTransaction(),pe.X5(rt,!0);try{for(Dt=ne.pivotName,Nt=ne.sortedFieldNames,Vt=ne.sortType,qt=(Ht=(Zt=rt.pivotTables.get(Dt)).dh).Q.map(function(be){return be.Zc}),zt=0;zt<Nt.length-1;zt++)Ht.changeFieldArea(Nt[zt],3,zt);Zt.refresh(),rt.ki(S.Events.PivotTableChanged,{type:"sort",fieldName:F().Values,sortType:Vt,oldOrder:qt,newOrder:Nt,pivotTableName:Dt}),ue=!0}finally{pe.q5(rt,!0),ne=S.Commands.TI(rt.name()),pe.tT[ne]=lt.endTransaction()}}return ue},ko.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt=(Ht=this).Mf,zt=!1;if(Ht.canUndo()){Ht.X5(qt,!0);try{rt=S.Commands.TI(qt.name()),lt=Ht.tT[rt],qt.Ut.undo(lt),Nt=(Dt=Ht.tT.cmdOption).sortedFieldNames,Vt=Dt.sortType,Zt=Dt.pivotName,qt.ki(S.Events.PivotTableChanged,{type:"sort",sortType:Vt,fieldName:F().Values,oldOrder:At([],Nt,!0),newOrder:At([],Nt.reverse(),!0),pivotTableName:Zt}),zt=!0}finally{Ht.q5(qt,!0)}}return zt},re=ko,S.Commands[xt]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,re,lt,Dt)}},Yt(Bo,mo=o),Bo.prototype.execute=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht=!1;if((Zt=this).canExecute()){rt=Zt.tT.commandOptions,Dt=(lt=Zt.Mf).Ut,Vt=lt.pivotTables.get(rt.pivotName),Dt.startTransaction(),Zt.X5(lt,!0);try{Nt=Vt.getSource(),Vt.updateSource(rt.source),lt.ki(S.Events.PivotTableChanged,{type:"changeDataSource",pivotTableName:rt.pivotName,oldDataSource:Nt,newDataSource:rt.source}),Ht=!0}finally{Zt.q5(lt,!0),Vt=S.Commands.TI(lt.name()),Zt.tT[Vt]=Dt.endTransaction()}}return Ht},Bo.prototype.undo=function(){var rt,lt,Dt,Nt,Vt,Zt,Ht,qt=(Ht=this).Mf,zt=!1;if(Ht.canUndo()){Ht.X5(qt,!0);try{rt=S.Commands.TI(qt.name()),lt=Ht.tT[rt],qt.Ut.undo(lt),Nt=(Dt=Ht.tT.commandOptions).pivotName,Vt=Dt.source,Zt=qt.pivotTables.get(Nt),qt.ki(S.Events.PivotTableChanged,{type:"changeDataSource",oldDataSource:Vt,newDataSource:Zt.getSource(),pivotTableName:Nt}),zt=!0}finally{Ht.q5(qt,!0)}}return zt},Gt=Bo,S.Commands[h]={canUndo:!0,execute:function(rt,lt,Dt){return j(rt,Gt,lt,Dt)}},S.Commands[b]={canUndo:!1,execute:function(rt,lt){var Dt=lt.cmdOption;lt=(rt=S.Commands.Tp(rt,lt)).parent;try{lt.ZIr(Dt.pivotCacheName,Dt.pivotCache,Dt.ptName,Dt.source,Dt.cacheInfo,rt)}catch{(0,Ft.throwError)(F().NoHaveSpread)}}},S.Commands[ie]={canUndo:!1,execute:function(rt,lt,Dt){var Nt,Vt,Zt,Ht,qt,zt,ne,pe,ue=lt.cmdOption;if(rt=S.Commands.Tp(rt,lt),(0,H.ht)(ue)){if(lt=lt.commandOptions,pe=rt.pivotTables&&rt.pivotTables.get(lt.pivotTableName),zt=lt.pivotTableCellInfo,qt=lt.isTop10,(Nt=pe.dh).nw(3).length===0)return rt.jT(10,F().EmptyValueFieldError),!1;zt=Ge(zt),Vt=pe.name(),Zt=F().getValueFilterItemText(),qt||(Ht=(lt=pe.valueFilter(zt))&&lt.conditionInfo&&lt.conditionInfo.LVt||0)}else{if(zt=ue.fieldName,Vt=ue.pivotName,Zt=ue.content,Ht=ue.command,(Nt=(pe=rt.pivotTables.get(Vt)).dh).nw(3).length===0)return rt.jT(10,F().EmptyValueFieldError),!1;Ht==="Top10"&&(qt=!0)}lt=Nt.nw(3),ne=[],lt.forEach(function(be){ne.push(be.Zc)}),pe=new f.ValueFilter(document.body,Zt,ne,Nt,zt,Vt,+Ht,qt),ue.needFocus&&pe.Lmr()}},S.Commands[l]={canUndo:!1,execute:function(rt,lt){var Dt,Nt,Vt,Zt,Ht=lt.cmdOption;return rt=S.Commands.Tp(rt,lt),(0,H.ht)(Ht)?(Nt=Ge((lt=lt.commandOptions).pivotTableCellInfo,Dt=(Zt=rt.pivotTables.get(lt.pivotTableName))&&Zt.dh),Vt=lt.pivotTableName):(Vt=Ht.pivotName,Dt=(Zt=rt.pivotTables.get(Vt)).dh,Nt=Ht.fieldName),lt=Zt.lZt,new B.PivotValuesFieldSettingDialog(Dt,Nt,Vt,lt).$c(),!0}},S.Commands[s]={canUndo:!1,execute:function(rt,lt){rt=S.Commands.Tp(rt,lt);var Dt,Nt,Vt,Zt,Ht,qt,zt,ne=lt.commandOptions;if(zt=rt.pivotTables.get(ne.pivotTableName))if(Dt=(qt=ne.pivotTableCellInfo).activeRowFieldInfo,qt=qt.activeColFieldInfo,Dt=Dt&&Dt.name||qt&&qt.name,qt=zt.getGroupInfo(Dt),Nt=zt.getField(Dt),zt=zt.dh,Ht=(Vt=ne.selections||rt.getSelections()).length===1&&Vt[0].rowCount===1&&Vt[0].colCount===1,Nt.dataType===H.PivotDataType.number&&Ht){if(Zt=function(pe,ue){return ue?(ue=ue.numberGroup,{isStartActive:(0,H.ht)(ue.start),start:((0,H.ht)(ue.start)?pe:ue).start,isEndActive:(0,H.ht)(ue.end),end:((0,H.ht)(ue.end)?pe:ue).end,by:(0,H.ht)(ue.by)?10:ue.by}):{start:pe.start,isStartActive:!0,end:pe.end,isEndActive:!0,by:10}}(Nt,qt),!(0,H.ht)(Zt))return new mt.PivotNumberGroupDialog(document.body,ne.pivotTableName,Dt,zt,Nt.start,Zt.start,Nt.end,Zt.end,Zt.by).$c(),!0}else if(Nt.dataType===H.PivotDataType.date&&Ht){if(Zt=function(pe,ue){var be,Te,we,Se;if(ue){for(be=[],Te=0,we=ue.dateGroups;Te<we.length;Te++)Se=we[Te],be.push(Se.by);return{start:pe.start,isStartActive:!0,end:pe.end,isEndActive:!0,by:be}}return{start:pe.start,isStartActive:!0,end:pe.end,isEndActive:!0,by:[H.DateGroupType.months,H.DateGroupType.quarters,H.DateGroupType.years]}}(Nt,qt),!(0,H.ht)(Zt))return Ht=lt.activeRow||rt.getActiveRowIndex(),qt=lt.activeCol||rt.getActiveColumnIndex(),lt=rt.getActualStyle(Ht,qt)&&rt.getActualStyle(Ht,qt).formatter,new tt.PivotDateGroupDialog(document.body,ne.pivotTableName,Dt,zt,Nt.start,Zt.start,Nt.end,Zt.end,Zt.by,Vt,lt).$c(),!0}else rt.Qy().execute({cmd:"pivotTableGroup",sheetName:rt.name(),commandOptions:ne,selections:Vt})}},S.Commands[y]={canUndo:!1,execute:function(rt,lt){rt=S.Commands.Tp(rt,lt),lt=lt.commandOptions,rt=rt.pivotTables.get(lt.pivotTableName);var Dt,Nt=Ge(Dt=lt.pivotTableCellInfo,rt=rt&&rt.dh),Vt=lt.pivotTableName;return lt=lt.showValueAsType,new vt.PivotShowValueAsDialog(document.body,rt,Nt,Vt,Dt,lt),!0}},S.Commands[ut]={canUndo:!1,execute:function(rt,lt){var Dt=lt.cmdOption;lt=(rt=S.Commands.Tp(rt,lt)).parent;try{lt.kx(Dt.pivotCacheName,Dt.pivotCache,Dt.ptName,rt)}catch{(0,Ft.throwError)(F().NoHaveSpread)}}},S.Commands[c]={canUndo:!1,execute:function(rt,lt){rt=S.Commands.Tp(rt,lt),lt=lt.commandOptions,lt=rt.pivotTables.get(lt.pivotTableName),(0,H.ht)(lt)||(lt.updateSource(),rt.ki(S.Events.PivotTableChanged,{type:"updateSource",pivotTableName:lt.name()}))}},S.Commands[M]={canUndo:!1,execute:function(rt,lt){var Dt=(lt=lt.cmdOption).position,Nt=lt.views;lt=lt.width,new X.PivotViewListDialog(document.body,Nt,lt).init(Dt)}},S.Commands[K]={canUndo:!1,execute:function(rt,lt){var Dt=(lt=lt.cmdOption).name;return!(lt=lt.views).save(Dt)&&(Wo(Dt,lt),!0)}},S.Commands[a]={canUndo:!1,execute:function(rt,lt,Dt){var Nt,Vt,Zt,Ht,qt,zt,ne;if((rt=(ne=function(pe,ue){return pe.sheets?(0,S._f)(pe,ue.sheetName):pe}(rt,lt)).getSelections()).length===1&&!ne.isEditing()){for(Nt=rt[0],Vt=ne.pivotTables.all(),Zt=0;Zt<Vt.length;Zt++)if(Ht=(qt=Vt[Zt].getRange()).page,qt=qt.content,zt=Ht?Ht.union(qt):qt,Ht&&Ht.containsRange(Nt)||qt&&qt.containsRange(Nt)){ne.setSelection(zt.row,zt.col,zt.rowCount,zt.colCount);break}}}},S.Commands.fZt=function(rt){var lt=!(Dt=S.mt.Qf()),Dt=Dt;rt.register(ot,S.Commands[ot]),rt.register(Y,S.Commands[Y]),rt.register(L,S.Commands[L]),rt.register(J,S.Commands[J]),rt.register(q,S.Commands[q]),rt.register(P,S.Commands[P]),rt.register(G,S.Commands[G]),rt.register(K,S.Commands[K]),rt.register(M,S.Commands[M]),rt.register(bt,S.Commands[bt]),rt.register(nt,S.Commands[nt]),rt.register(gt,S.Commands[gt]),rt.register(Qt,S.Commands[Qt]),rt.register(dt,S.Commands[dt]),rt.register(xt,S.Commands[xt]),rt.register(Z,S.Commands[Z]),rt.register(Rt,S.Commands[Rt]),rt.register(Ct,S.Commands[Ct]),rt.register(kt,S.Commands[kt]),rt.register(ie,S.Commands[ie]),rt.register(Xt,S.Commands[Xt]),rt.register(Mt,S.Commands[Mt]),rt.register(st,S.Commands[st]),rt.register(n,S.Commands[n]),rt.register(Bt,S.Commands[Bt]),rt.register(s,S.Commands[s]),rt.register(l,S.Commands[l]),rt.register(D,S.Commands[D]),rt.register(T,S.Commands[T]),rt.register(k,S.Commands[k]),rt.register(c,S.Commands[c]),rt.register(ut,S.Commands[ut]),rt.register(h,S.Commands[h]),rt.register(b,S.Commands[b]),rt.register($,S.Commands[$]),rt.register(St,S.Commands[St]),rt.register(i,S.Commands[i]),rt.register(N,S.Commands[N]),rt.register(V,S.Commands[V]),rt.register(pt,S.Commands[pt]),rt.register(wt,S.Commands[wt]),rt.register(et,S.Commands[et]),rt.register(ht,S.Commands[ht]),rt.register(O,S.Commands[O]),rt.register(y,S.Commands[y]),rt.register(a,S.Commands[a],65,lt,!1,!1,Dt)}},"./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-base-layout.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g;function F(){return B.Functions.CALC_PRECISION||14}function ot(E,A,Y,L){return E!==!0&&A!==v&&2<=Y&&L===0?1:0}function j(){}Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableLayoutBase=o.getValuesRowOffset=o.hZt=void 0,Yt=ft("Pivot"),At=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),S=ft("Core"),at=ft("./dist/plugins/pivot/pivot-panel/pivot-widget.js"),X=ft("@spreadjs/js-sheets-common"),H=ft("./dist/plugins/pivot/pivot.ns.js"),f=ft("./dist/plugins/pivot/pivot-util.js"),B=ft("@spreadjs/js-calc"),vt=ft("./dist/plugins/pivot/pivot-table/pivot-table-theme-range.js"),mt=X.Common.lt.ht,tt=null,_=Math.max,v=void 0,Ft=X.Common.zf,ft=new X.Common.ResourceManager(H.SR,"PivotTables"),w=ft.getResource.bind(ft),S.GC$,I="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+bWludXMxNjwvdGl0bGU+CiAgICA8ZyBpZD0ibWludXMxNiIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hOWkh+S7vS0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzLjAwMDAwMCwgMy4wMDAwMDApIj4KICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMCIgeT0iMCIgd2lkdGg9IjExIiBoZWlnaHQ9IjExIj48L3JlY3Q+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDAgTDExLDAgTDExLDExIEwwLDExIEwwLDAgWiBNMSwxIEwxLDEwIEwxMCwxMCBMMTAsMSBMMSwxIFoiIGlkPSLnn6nlvaIiIGZpbGw9IiNBQkFCQUIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiBmaWxsPSIjNjY2NjY2IiB4PSIzIiB5PSI1IiB3aWR0aD0iNSIgaGVpZ2h0PSIxIj48L3JlY3Q+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",U="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+cGx1czE2PC90aXRsZT4KICAgIDxnIGlkPSJwbHVzMTYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLnvJbnu4TlpIfku70tMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMy4wMDAwMDAsIDMuMDAwMDAwKSI+CiAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMSIgaGVpZ2h0PSIxMSI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMCwwIEwxMSwwIEwxMSwxMSBMMCwxMSBMMCwwIFogTTEsMSBMMSwxMCBMMTAsMTAgTDEwLDEgTDEsMSBaIiBpZD0i55+p5b2iIiBmaWxsPSIjQUJBQkFCIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPHBhdGggZD0iTTYsMyBMNiw1IEw4LDUgTDgsNiBMNS45OTksNiBMNiw4IEw1LDggTDQuOTk5LDYgTDMsNiBMMyw1IEw1LDUgTDUsMyBMNiwzIFoiIGlkPSLlvaLnirbnu5PlkIgiIGZpbGw9IiM2NjY2NjYiPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==",g=X.Common.st.E8,o.hZt=function(E,A,Y,L,q,J,P){var bt;return q&&(bt=q[P]),E.vZt(A,Y,L,bt,J,P)},o.getValuesRowOffset=ot,j.dZt=function(E,A){var Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l,T,D,M,s,y,G,K,c=!0;if(K=E.pivotTables.get(A)){for(E=K.pZt(),A=K.rZt,Y=K.Get(),L=(A=A.HWt)[0],q=A[1],J=A[2],P=A[3],A=A[4],k=(bt=K.mZt()).length,nt=K.bZt(),gt=K.dh.nrt,Z=nt.length,ut=bt.length,Ct=(Ct=(Rt=K.options).subTotalsPosition)===At.SubtotalsPosition.top||Ct===At.SubtotalsPosition.bottom,Bt=K.gZt(),kt=K.dh.getSigmaValuePosition(),ie=(Mt=K.wZt()).Nkt,Xt=Mt.yZt,Qt=Mt,dt=[],xt={},(0,Yt.o)(E,function(N){var V=(V=K.dh.bl(N.a))&&V.D5?Yt.SubtotalType.sum:N.Ar;V={name:N.Zc,subtotalText:Yt.SubtotalType[V],subtotalType:V,cacheName:N.a,hasShowDataAs:!(!Qt.CZt[N.Zc]||Qt.CZt[N.Zc].showDataAs===Yt.PivotShowDataAs.normal)},dt.push(V),xt[N.Zc]=V}),st=Mt=-1,1<dt.length&&(kt.positionType===Yt.DataPosition.col?Mt=kt.positionIndex:st=kt.positionIndex),l=[],bt.forEach(function(N){l.push(N.Zc)}),0<=Mt&&l.splice(Mt,tt,w().Values),M=ot(T=K.options.hideValuesRow,D=K.Cki,E.length,bt.length),s={},y=0;y<l.length;y++)s[l[y]]=y+M;return G={},[].concat(Bt,bt,nt).forEach(function(N){var V=K.dh.bl(N.a);(0,Yt.isEmptyObject)(V.P)&&(0,Yt.isEmptyObject)(V.AQt)||(G[N.Zc]=V.getFieldsItemList()||[])}),K.IZt=G,K.AZt=Z+(-1<st?1:0),K.NZt=ut+(-1<Mt?1:0)+M,K.options.showHeaders?c=!1:E.length===1?nt.length===0&&bt.length!==0||(c=!1):1<E.length&&bt.length===0&&-1<Mt&&(c=!1),J.isHideFirstRow=c,ut=K.options.showHeaders,{sharedMap:G,repeatValueFiledChildLength:0,rowDeep:Z,rowFields:nt,colFields:bt,hasColumnSubTotal:Ct,fieldMap:Y,pageModel:L,cornerModel:q,columnModel:J,rowModel:P,contentModel:A,options:Rt,pageFields:Bt,valuePositionInfo:kt,valueFieldsInfo:dt,columnValuePosition:Mt,rowValuePosition:st,columnDeep:k,rootNode:ie,headerNode:Xt,subtotalCollection:Qt,valueFieldsMap:xt,pt:K,sortInfo:gt,columnFieldsIndexes:l,colFieldsMap:s,isHideFirstRow:c,showHeaders:ut,hideValuesRow:T,dataCaption:D}}},j.render=function(E){var A=this.dZt(E.Ti,E.Zc);A&&(this.TZt(A),this.MZt(A),this.xZt(A),this.DZt(E,A.rowModel),this.SZt(A),this.kZt(A),E.Uct(),this.jZt(A),A=null,vt.PivotTableThemeRangeHelper.generateThemeRangeInfos(E))},j.jZt=function(E){delete E.rootNode,delete E.headerNode,E.subtotalCollection.L0(),delete E.subtotalCollection},j.OZt=function(E,A,Y){mt(Y.rowHeaderLevel)?Y.YAt=Y.grandTotalLevel:Y.YAt=Y.rowHeaderLevel,E.zWt[A]=Y},j.recalcFormula=function(E){(E=E.Ti)&&(E.suspendPaint(),E.getCalcService().recalculateAll(!1,!1),E.resumePaint())},j.PZt=function(E){var A,Y,L,q,J,P,bt,k,nt,gt,Z=E.sharedMap,ut=E.rowFieldsIndexes,Rt=(gt=(nt=E.rowModel).zWt).length,Ct=E.rowValuePosition,Bt=E.rowFieldsIndexes.length;for(nt.YWt={},A=0;A<Rt;A++)if((Y=gt[A])&&(L=Y.path,!mt(L))&&L!==""&&!Y.isBlankRow&&!Y.isSubtotal)for(q=L.split(Yt.Separator),E.valuePositionInfo.display&&E.valuePositionInfo.positionType===Yt.DataPosition.row&&!mt(Y.valueFieldName)&&q.splice(Ct,null,Y.valueFieldName),J=0,P=q.length;J<P;J++)bt=ut[J],k=q[J],nt.tZt(A,bt,bt!==w().Values?(0,f.FZt)(Z,bt,k):k,Bt-J)},j._Zt=function(E,A,Y,L){E.push({path:A,isBlankRow:!0}),Y.push([]),L.push([])},j.DZt=function(E,A){var Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt;if(E.options.mergeItem&&E.layoutType()===At.PivotTableLayoutType.tabular){for(k in Y=E.EZt.LZt,L=A.Tx,q=A.dataTable,J=A.zWt,P=A.YWt,(0,Yt.o)(q,function(ie,Xt){var Qt;(Qt=J[Xt])&&(Qt.isBlankRow||Qt.isSubtotal||Qt.isGrandTotal)&&(Qt=Qt.isBlankRow?q[Xt-1].length-1:ie.length-1,Y.push({row:Xt,col:Qt,rowCount:1,colCount:L-Qt}))}),bt=function(ie,Xt,Qt,dt){return!E.collapse(Qt,dt)||ie.valueFieldName===Xt.valueFieldName},P)if(P.hasOwnProperty(k)){for(gt in nt=P[k])if(nt.hasOwnProperty(gt)&&(ut=(Z=nt[gt]).ranges,1<(Rt=Z.level))&&-1<L-Rt&&1<ut.length){for(Bt=Ct=ut[0],kt=1;kt<ut.length;kt++)ut[kt]-ut[kt-1]==1&&bt(J[kt],J[kt-1],k,gt)?Bt+=1:(0<Bt-Ct&&Y.push({row:Ct,col:L-Rt,rowCount:Bt-Ct+1,colCount:1}),Bt=Ct=ut[kt]);0<Bt-Ct&&Y.push({row:Ct,col:L-Rt,rowCount:Bt-Ct+1,colCount:1})}}}},j.SZt=function(E){var A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt=E.pt,Qt=E.columnModel;if(E=E.isHideFirstRow,Xt.options.mergeItem){for(nt in A=Xt.EZt.BZt,Y=Qt.Sx-1,L=E?1+Y:Y,q=this.twoDimensionalArraySpin(Qt.dataTable),J=Qt.WWt,P=Qt.YWt,bt=E?0:1,(0,Yt.o)(q,function(dt,xt){var Mt=J[xt];mt(Mt)||Mt.isBlankColumn||(Mt.isSubtotal||Mt.isGrandTotal)&&(Mt=dt.length-1,A.push({row:Mt,col:xt,rowCount:Y-Mt+1,colCount:1}))}),k=function(dt,xt,Mt,st){return!Xt.collapse(Mt,st)||dt.valueFieldName===xt.valueFieldName},P)if(P.hasOwnProperty(nt)){for(Z in gt=P[nt])if(gt.hasOwnProperty(Z)&&(Rt=(ut=gt[Z]).ranges,1<(Ct=ut.level))&&-1<L-Ct&&1<Rt.length){for(kt=Bt=Rt[0],ie=1;ie<Rt.length;ie++)Rt[ie]-Rt[ie-1]==1&&k(J[ie],J[ie-1],nt,Z)?kt+=1:(0<kt-Bt&&A.push({row:L-Ct+bt,col:Bt,rowCount:1,colCount:kt-Bt+1}),kt=Bt=Rt[ie]);0<kt-Bt&&A.push({row:L-Ct+bt,col:Bt,rowCount:1,colCount:kt-Bt+1})}}}},j.twoDimensionalArraySpin=function(E){var A,Y,L,q,J;if(E&&E.length!==0){for(Y=E.length,L=A=0;L<E.length;L++)E[L]&&A<E[L].length&&(A=E[L].length);if(A!==0){for(q=new Array(A),L=0;L<A;L++)q[L]=[];for(L=0;L<A;L++)for(J=0;J<Y;J++)E[J]&&E[J][L]&&(q[L][J]=E[J][L]);return q}}},j.qcr=function(E){return(E=E.pt.Ti)&&E.options.rightToLeft?S.ButtonPosition.left:S.ButtonPosition.right},j.TZt=function(E){var A=this,Y=E.pageFields,L=E.pageModel,q=E.pt,J=0,P=0,bt=0,k=q.dh,nt=(q=E.options).displayFieldsInPageFilterArea,gt=q.reportFilterFieldsPerColumn;nt===At.DisplayFields.overThenDown?gt===0?L.setRowCount(1):L.setRowCount(Math.ceil(Y.length/gt)):gt===0?L.setRowCount(Y.length):L.setRowCount(Y.length>=gt?gt:Y.length),(0,Yt.o)(Y,function(Z,ut){var Rt=Z.Zc,Ct=(Z=Z.a,k.isFilter(Z));nt===At.DisplayFields.overThenDown?J=gt===0?(P=0,3*ut):(P=Math.floor(ut/gt),ut%gt*3):gt===0?(P=ut,J=0):(J=3*Math.floor(ut/gt),P=ut%gt),L.Kbt(P,J,Rt),Ct?(Z=(ut=k.getFilterInfo(Z))&&ut.getSlicerItemInfo(),L.Kbt(P,J+1,Z.hasMoreThanOneSelect?w().MultipleItems:Z.text)):L.Kbt(P,J+1,w().All),L.qWt(P,J+1,A.RZt(Ct,tt,8,E.options.showFilter,A.qcr(E))),L.KWt(P,J+1,Rt),bt=bt<J+1?J+1:bt}),L.setColCount(bt+1)},j.GZt=function(E,A,Y,L,q,J,P,bt){var k=this,nt=E.columnModel,gt=E.contentModel,Z=E.columnValuePosition,ut=E.rowValuePosition,Rt=E.valueFieldsMap,Ct=E.subtotalCollection,Bt=E.rowModel;E=E.rowDeep,Z!==-1?(0,Yt.o)(nt.WWt,function(kt,ie){var Xt,Qt;kt&&(Xt=kt.rowPathMap,Qt=Rt[kt.valueFieldName],Xt)&&Xt.indexList&&Xt.indexList[L]&&Qt&&(k.VZt(Ct,Ct.CZt[kt.valueFieldName],A,kt.valueFieldName,Xt,kt)?gt.Kbt(Y,ie,f.GC_EMPTY_VALUE):gt.Kbt(Y,ie,g((0,o.hZt)(Ct,Xt.indexList[L],Qt.cacheName,Qt.subtotalText,A.UZt,A.YAt,kt.valueFieldName),F())))}):(Bt.tZt(Y,w().Values,bt,E+1-ut),(0,Yt.o)(nt.WWt,function(kt,ie){var Xt=kt&&kt.rowPathMap;Xt&&Xt.indexList&&Xt.indexList[L]&&(k.VZt(Ct,Ct.CZt[bt],A,bt,Xt,kt)?gt.Kbt(Y,ie,f.GC_EMPTY_VALUE):gt.Kbt(Y,ie,g((0,o.hZt)(Ct,Xt.indexList[L],q,P,A.UZt,A.YAt,bt),F())))}))},j.VZt=function(E,A,Y,L,q,J){var P;if((P=Y.UZt)&&P[L]){if(P=P[L],mt(P.minorPath)||(P.minorPath=J.path),mt(P.colTotalIndex)||(P.colTotalIndex=q.indexList[""]),(A.showDataAs===8||A.showDataAs===9)&&(-1<A.baseRootLevel&&0<(A.showDataAsIndex&Y.QZt)||-1<A.baseHeaderLevel&&0<(A.showDataAsIndex&J.showDataAsIndex)))return!0;if(A.isDifferenceOrPercent)if(A.isHeaderOfPercentOrDiff){if(q.level<A.baseHeaderLevel+1)return!0;P.indexInfo.baseMinorPath=J.rowPathMap.baseSubtotalInfo[L].baseMajorPath}else{if(A.baseRootLevel+1>Y.YAt||Y.nodeName===A.baseFieldItemShared&&A.baseRootLevel+1===Y.YAt)return!0;P.indexInfo.baseMinorPath=J.path}if(A.needBuildRunningTotalOrRankPath){if(Y.zEt&&-1<A.baseRootLevel||-1<A.baseHeaderLevel&&q.level<A.baseHeaderLevel+1)return!0;P.indexInfo.minorPath=J.path,P.indexInfo.baseMinorPath=J.rowPathMap.baseSubtotalInfo[L].baseMajorPath}if(A.showDataAs===Yt.PivotShowDataAs.percentOfRow&&(P.indexInfo.baseIndex=E.WZt("").indexList[Y.zZt]),A.showDataAs===Yt.PivotShowDataAs.percentOfCol&&(P.indexInfo.baseIndex=q.indexList[""]),A.showDataAs===Yt.PivotShowDataAs.percentOfParent){if(-1<A.baseRootLevel&&Y.YAt<A.baseRootLevel+1)return!0;if(-1<A.baseHeaderLevel){if(A.baseHeaderLevel+1>q.level)return!0;q.level===A.baseHeaderLevel+1&&(P.indexInfo.baseIndex=q.indexList[Y.zZt]),q.level>A.baseHeaderLevel+1&&(L=J.rowPathMap.baseSubtotalInfo[L].percentOfBasePath,mt(L)||(P.indexInfo.baseIndex=E.WZt(L).indexList[Y.zZt]))}}if(A.showDataAs===Yt.PivotShowDataAs.index&&(P.indexInfo.rowTotalIndex=E.WZt("").indexList[Y.zZt],P.indexInfo.colTotalIndex=q.indexList[""]),A.showDataAs===Yt.PivotShowDataAs.percentOfParentRow&&(P.indexInfo.minorPath=J.path),A.showDataAs===Yt.PivotShowDataAs.percentOfParentCol&&(P.indexInfo.baseIndex=E.WZt(J.rowPathMap.parentPath).indexList[Y.zZt]),J.path===""&&A.needBuildPercentOfPath&&A.baseRootLevel===-1)return!0}},j.ZZt=function(E,A,Y,L,q){var J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l;if(q===void 0&&(q=""),J=E.colMap,P=E.contentModel,l=E.columnValuePosition,st=E.rowValuePosition,bt=E.rowDeep,st=st!==-1,l=l!==-1,!(Y.zEt&&0<bt&&E.options.grandTotalPosition!==At.GrandTotalPosition.both&&E.options.grandTotalPosition!==At.GrandTotalPosition.row||q===""&&Y.YAt<bt)){if(k=q,l)for(q!==""&&(q+=Yt.Separator),nt=0,gt=L;nt<gt.length;nt++)Z=(kt=gt[nt]).name,ut=kt.cacheName,Rt=kt.subtotalText,Ct=kt.hasShowDataAs,Bt=J[q+Z],kt=!1,(kt=Ct?this.YZt(E.subtotalCollection,E.subtotalCollection.CZt[Z],q,Y,Z,k,bt):kt)?P.Kbt(A,Bt,f.GC_EMPTY_VALUE):P.Kbt(A,Bt,g((0,o.hZt)(E.subtotalCollection,Y.HZt,ut,Rt,Y.UZt,Y.YAt,Z),F()));if(st&&(Bt=J[q],!mt(Bt)))for(ie=A,Xt=0,Qt=L;Xt<Qt.length;Xt++)xt=(dt=Qt[Xt]).name,ut=dt.cacheName,Rt=dt.subtotalText,Mt=!1,(Mt=(Ct=dt.hasShowDataAs)?this.YZt(E.subtotalCollection,E.subtotalCollection.CZt[xt],q,Y,xt,k,bt):Mt)?P.Kbt(ie,Bt,f.GC_EMPTY_VALUE):P.Kbt(ie,Bt,g((0,o.hZt)(E.subtotalCollection,Y.HZt,ut,Rt,Y.UZt,Y.YAt,xt),F())),ie++;st||l||L.length!==1||(l=(st=L[0]).name,ut=st.cacheName,Rt=st.subtotalText,Ct=st.hasShowDataAs,q!==""&&(q+=Yt.Separator),Bt=J[q+l],mt(Bt))||(L=!1,(L=Ct?this.YZt(E.subtotalCollection,E.subtotalCollection.CZt[l],q,Y,l,k,bt):L)?P.Kbt(A,Bt,f.GC_EMPTY_VALUE):P.Kbt(A,Bt,g((0,o.hZt)(E.subtotalCollection,Y.HZt,ut,Rt,Y.UZt,Y.YAt,l),F())))}},j.YZt=function(E,A,Y,L,q,J,P){return A.needBuildRunningTotalOrRankPath&&-1<A.baseHeaderLevel&&(L.UZt[q].indexInfo.minorPath=J),(A.showDataAs===8||A.showDataAs===9)&&0<(A.showDataAsIndex&L.QZt)||(A.showDataAs===Yt.PivotShowDataAs.percentOfRow&&L.YAt<=P&&(L.UZt[q].indexInfo.baseIndex=E.JZt(L.zZt,!1)),A.showDataAs===Yt.PivotShowDataAs.index&&L.YAt<=P&&(L.UZt[q].indexInfo.rowTotalIndex=E.JZt(L.zZt,!1)),!!(A.isDifferenceOrPercent&&-1<A.baseHeaderLevel&&L.YAt<A.actualBaseLevel))||Y===""&&A.showDataAs===Yt.PivotShowDataAs.percentOfParent&&A.baseRootLevel===-1||-1<A.baseHeaderLevel&&L.YAt<A.actualBaseLevel||!!(L.zEt&&A.needBuildRunningTotalOrRankPath&&-1<A.baseRootLevel)||!!(Y===""&&A.needBuildRunningTotalOrRankPath&&-1<A.baseHeaderLevel&&A.actualBaseLevel===L.YAt)},j.MZt=function(E){var A,Y,L,q,J,P,bt=E.columnModel,k=E.valueFieldsInfo,nt=E.headerNode,gt=E.hasColumnSubTotal,Z=E.colFields,ut=E.columnValuePosition,Rt=E.columnDeep,Ct=E.isHideFirstRow,Bt=E.showHeaders,kt=E.pt,ie=E.hideValuesRow,Xt=E.dataCaption,Qt=nt.qZt+(Ct?0:1)+ot(ie,Xt,k.length,Z.length),dt=gt?nt.KZt+nt.XZt+nt.$Zt:nt.KZt+nt.$Zt+nt.Dwr;if((P=E.options.grandTotalPosition)!==At.GrandTotalPosition.both&&P!==At.GrandTotalPosition.row?gt&&(dt-=E.columnValuePosition===-1?1:E.valueFieldsInfo.length,dt=_(dt,0)):gt||(dt+=E.columnValuePosition===-1?1:E.valueFieldsInfo.length),Z.length===0&&(dt=nt.KZt+nt.$Zt),P=k.length,(dt=Rt===0&&P===0?0:dt)<(A=E.columnFieldsIndexes.length)){for(Y=dt;Y<A;Y++)bt.WWt[Y]={path:"",isBlankColumn:!0};dt=A}ut!==-1&&0<Rt&&(Qt+=1),bt.setColCount(dt),E.contentModel.setColCount(dt),bt.setRowCount(Qt),L={},q=[],J=Rt?1:0,J+=ot(ie,Xt,P,Z.length),0<Rt&&(Bt&&this.tYt(bt,Z,ut,E),(0,Yt.o)(Z,function(xt){q.push({name:xt.Zc,isFilter:kt.dh.isFilter(xt.a),isDim:!0,sortInfo:xt.nrt})})),ut!==-1&&q.splice(ut,0,{name:w().Values,isFilter:!1,isDim:!1}),(0,Yt.o)(q,function(xt,Mt){xt=xt.name,L[xt]=Mt+J}),E.columnHeaderRowMap=L,gt=0,ot(ie,Xt,k.length,Z.length)===1&&(bt.Kbt(gt,0,Xt),bt.Twr(gt,0,Xt),gt++),this.iYt(E,nt,gt<Rt?gt+1:gt,0,k),Ct&&bt.dataTable.splice(gt,1),bt.colValueTable.splice(gt,1),E.colMap=bt.getColInfoMap()},j.nYt=function(E,A,Y){var L,q=E.options.grandTotalPosition,J=Y!==At.SubtotalsPosition.none?A.KZt+A.XZt+A.$Zt:A.KZt+A.$Zt;return A.zEt&&(E.colFields.length===0&&(J=A.KZt+A.$Zt),L=Y!==At.SubtotalsPosition.none,q=q!==At.GrandTotalPosition.none&&q!==At.GrandTotalPosition.col,0<E.columnDeep)&&(L&&!q?J-=E.columnValuePosition===-1?1:E.valueFieldsInfo.length:q&&!L&&(J+=E.columnValuePosition===-1?1:E.valueFieldsInfo.length)),Y===At.SubtotalsPosition.none&&(J+=A.Dwr),J},j.iYt=function(E,A,Y,L,q){var J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt=E.columnModel,ie=E.columnDeep,Xt=E.columnValuePosition,Qt=E.sharedMap,dt=E.columnHeaderRowMap,xt=E.colFields,Mt=E.columnFieldsIndexes,st=A.nodeName,l=A.YAt,T=A.zEt,D=A.eYt,M=A.rYt,s=A.oYt,y=1,G=E.options.subTotalsPosition!==At.SubtotalsPosition.none,K=E.options.grandTotalPosition!==At.GrandTotalPosition.none&&E.options.grandTotalPosition!==At.GrandTotalPosition.col;if(Xt!==-1&&l<=Xt&&(y=q.length),st=(0,f.FZt)(Qt,M,st),J=E.pt.collapse(M,st)&&l!==ie,Bt=E.pt.dh.getFieldInfoByName(M),P=E.options.subTotalsPosition,Bt&&Bt.Nwr&&!G?(G=!0,P=Bt.Spi?At.SubtotalsPosition.top:At.SubtotalsPosition.bottom):Bt&&Bt.Nwr===!1&&G&&(G=!1,P=At.SubtotalsPosition.none),kt.Kbt(Y,L,st),kt.Twr(Y,L,st),J)for(bt=A.lYt.split(Yt.Separator),0<=Xt&&Xt<=l&&(Bt=dt[w().Values]-1,bt.splice(Bt,tt,q[0].name)),k=0,nt=bt.length;k<nt;k++)kt.tZt(L,Mt[k],Mt[k]!==w().Values?(0,f.FZt)(Qt,Mt[k],bt[k]):bt[k],Mt.length-k);if(gt=L,D){for(Z=dt[w().Values],T||Xt===0||(kt.Kbt(Z-1,L,st),kt.Twr(Z-1,L,st),s&&0<s.length&&l<ie&&E.options.showDrill&&kt.qWt(Z-1,L,this.aYt(J,S.ButtonPosition.leftOfText))),ut=0,Rt=q;ut<Rt.length;ut++)Ct=Rt[ut],kt.Kbt(Z,gt,Ct.name),kt.Twr(Z,gt,Ct.name),T&&ie===0&&kt.tZt(gt,w().Values,Ct.name,xt.length-Xt+1),gt+=J?1:this.sYt(E,A,Z+1,gt,[Ct],P);if(J)return this.uYt(E,A,Z,gt-y,q,Z),l===ie&&ie!==0&&this.cYt(E,kt,gt,A,Xt,ie,q),y}else{if(Y=dt[M],mt(Y))Y=0;else if(kt.Kbt(Y,gt,st),kt.Twr(Y,gt,st),s&&0<s.length&&l<ie&&E.options.showDrill&&kt.qWt(Y,gt,this.aYt(J,S.ButtonPosition.leftOfText)),J)return this.uYt(E,A,Y,gt,q,Y),l===ie&&ie!==0&&this.cYt(E,kt,gt,A,Xt,ie,q),y;this.sYt(E,A,Y+1,gt,q,P)}return D=L+(Bt=this.nYt(E,A,P)||y)-y,l===ie&&ie!==0&&this.cYt(E,kt,D,A,Xt,ie,q),(G||T&&K||!ie&&q.length)&&this.uYt(E,A,dt[M]||1,D,q),Bt},j.cYt=function(E,A,Y,L,q,J,P){var bt,k,nt,gt=E.columnFieldsIndexes,Z=E.colFieldsMap;if(q!==-1)for(bt=0,k=P.length;bt<k;bt++)nt=P[bt],A.WWt[Y+bt]={path:L.lYt,valueFieldName:nt.name,grandTotalLevel:L.YAt,showDataAsIndex:L.QZt,rowPathMap:E.subtotalCollection.WZt(L.zZt)},this.tZt(A,Y+bt,E.sharedMap,L.lYt,L.YAt,q,gt,Z,nt.name,!1);else A.WWt[Y]={path:L.lYt,grandTotalLevel:L.YAt,showDataAsIndex:L.QZt,rowPathMap:E.subtotalCollection.WZt(L.zZt)},this.tZt(A,Y,E.sharedMap,L.lYt,L.YAt,q,gt,Z,P&&P[0]&&P[0].name,!1)},j.tZt=function(E,A,Y,L,q,J,P,bt,k,nt){var gt,Z,ut,Rt=L.split(Yt.Separator);for(0<=J&&J<=q&&(L=bt[w().Values],Rt.splice(L,tt,k)),gt=P.length,Z=0,ut=nt?Rt.length-1:Rt.length;Z<ut;Z++)E.tZt(A,P[Z],(0,f.FZt)(Y,P[Z],Rt[Z]),gt-Z)},j.uYt=function(E,A,Y,L,q,J){var P,bt,k,nt,gt,Z,ut,Rt,Ct=E.columnModel,Bt=E.columnDeep,kt=E.columnValuePosition,ie=E.sharedMap,Xt=E.columnHeaderRowMap,Qt=E.columnFieldsIndexes,dt=E.colFieldsMap,xt=E.hideValuesRow,Mt=E.dataCaption,st=E.colFields,l=q.length,T=A.zEt,D=A.YAt,M=A.nodeName,s=A.lYt,y=A.rYt,G=E.options.grandTotalPosition;if(!(T&&0<Bt&&G!==At.GrandTotalPosition.both&&G!==At.GrandTotalPosition.row||Bt-1<D&&Bt!==0))if(bt=(0,f.FZt)(ie,y,M),k=E.pt.collapse(y,bt),nt=Xt[w().Values],G=ot(xt,Mt,q.length,st.length),D<=kt)for(Y=T?Bt===0?0+G:1+G:Xt[y]+G,gt=L,Z=0;Z<l;Z++)ut=q[Z].name,P=Bt===0?k?bt:T?ut:bt+" "+ut:k?bt:T?Ft.I5(w().Total,[""," "+ut]):bt+" "+ut,(k&&Z===0||!k)&&(Ct.Kbt(Y,gt+Z,P),Ct.Twr(Y,gt+Z,P)),k&&(Ct.Kbt(nt,gt+Z,ut),Ct.Twr(nt,gt+Z,ut)),Rt={path:s,valueFieldName:ut,grandTotalLevel:D,showDataAsIndex:A.QZt,rowPathMap:E.subtotalCollection.WZt(A.zZt)},s&&D<Bt&&Ct.tZt(gt+Z,w().Values,ut,Bt+1-D),mt(J)||(Rt.collapseIndex=J-1),T?kt===0&&Bt===0||(Rt.isGrandTotal=!0):Rt.isSubtotal=!0,Ct.WWt[gt+Z]=Rt;else ie=L,Bt===0&&kt===-1?(P=q[0]&&q[0].name||"",Y=0):P=k?bt:T?w().GrandTotal:Ft.I5(w().Total,[bt,""]),E.valuePositionInfo.display&&E.valuePositionInfo.positionType===Yt.DataPosition.row&&Bt===0&&(P=""),Ct.Kbt(Y,ie,P),Ct.Twr(Y,ie,P),M=void 0,Rt={path:s,valueFieldName:M=q.length===1?q[0].name:M,grandTotalLevel:D,showDataAsIndex:A.QZt,rowPathMap:E.subtotalCollection.WZt(A.zZt)},s&&this.tZt(Ct,ie,E.sharedMap,A.lYt,A.YAt,kt,Qt,dt,q&&q[0]&&q[0].name,!0),mt(J)||(Rt.collapseIndex=J-1),T?Rt.isGrandTotal=!0:Rt.isSubtotal=!0,Ct.WWt[ie]=Rt},j.fYt=function(E,A,Y){if(!(E<A&&Y<=1||E+1<A&&1<Y))return A},j.tYt=function(E,A,Y,L){var q=this,J=[],P=L.pt.dh;(0,Yt.o)(A,function(bt){J.push({name:bt.Zc,isFilter:P.isFilter(bt.a),isDim:!0,sortInfo:bt.nrt})}),Y!==-1&&J.splice(Y,0,{name:w().Values,isFilter:!1,isDim:!1}),(0,Yt.o)(J,function(bt,k){var nt=bt.name,gt=bt.isDim,Z=bt.isFilter;bt=bt.sortInfo,E.Kbt(0,k,nt),E.Twr(0,k,nt),gt&&E.qWt(0,k,q.RZt(Z,bt,24,L.options.showFilter,q.qcr(L))),E.JWt(k,{isCompactRoot:!1,fieldName:nt})})},j.sYt=function(E,A,Y,L,q,J){var P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt=E.columnDeep,kt=E.options,ie=E.columnModel,Xt=E.columnValuePosition,Qt=L,dt=0;if(0<(Ct=A.oYt).length&&A.YAt<Bt)for(P=kt.fillDownLabels,k=J===At.SubtotalsPosition.none?0:1,ut=Z=gt=nt=bt=void 0,q.length&&A.YAt<=Xt&&(k*=q.length),ut=0;ut<Ct.length;ut++){if(bt=1,nt=Ct[ut],Z=(gt=this.iYt(E,nt,Y,Qt,q))-k,P)for(Rt=ie.Sl(Y,Qt);bt<Z;bt++)ie.Kbt(Y,bt+Qt,Rt);Qt+=gt,dt+=gt}return A.YAt>=Bt?1:dt},j.hYt=function(E,A,Y,L,q){var J,P,bt,k,nt,gt,Z,ut=E.valueFieldsInfo,Rt=E.columnModel,Ct=E.columnDeep,Bt=E.columnValuePosition,kt=E.sharedMap,ie=ut.length,Xt=L.zEt,Qt=L.YAt,dt=L.nodeName,xt=L.lYt,Mt=L.rYt;if(!(Ct-1<Qt&&Ct!==0))if(P=(0,f.FZt)(kt,Mt,dt),bt=E.pt.collapse(Mt,P),q&&Qt<=Bt)for(k=bt?Y:Y+(L.KZt+L.vYt-1)*ie,nt=0;nt<ie;nt++)gt=ut[nt].name,J=Ct===0?bt?P:Xt?gt:P+" "+gt:bt?P:Xt?Ft.I5(w().Total,[""," "+gt]):P+" "+gt,Rt.Kbt(A,k+nt,J),Rt.Twr(A,k+nt,J),Z={path:xt,valueFieldName:gt,grandTotalLevel:Qt,showDataAsIndex:L.QZt,rowPathMap:E.subtotalCollection.WZt(L.zZt)},Xt?Z.isGrandTotal=!0:Z.isSubtotal=!0,Rt.WWt[k+nt]=Z;else kt=bt?Y:Y+L.KZt+L.XZt-1,J=Ct===0?ut[0]&&ut[0].name||"":bt?P:Xt?w().GrandTotal:Ft.I5(w().Total,[P,""]),Rt.Kbt(A,kt,J),Rt.Twr(A,kt,J),dt=void 0,Z={path:xt,valueFieldName:dt=ut.length===1?ut[0].name:dt,grandTotalLevel:Qt,showDataAsIndex:L.QZt,rowPathMap:E.subtotalCollection.WZt(L.zZt)},Xt?Z.isGrandTotal=!0:Z.isSubtotal=!0,Rt.WWt[kt]=Z},j.dYt=function(E,A,Y,L){var q=new S.Style;return q.textIndent=A,q.hAlign=0,q.cellButtons=[{position:Y===void 0?S.ButtonPosition.left:Y,imageType:S.ButtonImageType.custom,command:"PivotOutlineButtonToggle",visibility:S.ButtonVisibility.always,useButtonStyle:!1,enabled:!0,buttonBackColor:"transparent",hoverBackColor:"transparent",imageSrc:E?U:I,imageSize:{width:18,height:18}}],q},j.pYt=function(E){var A=new S.Style;return A.textIndent=E,A},j.Gn=function(E,A,Y){var L=E.rowDeep,q=E.rowValuePosition,J=(E=E.options).rowLabelIndent;return E=E.showDrill,J=J*A*2,Y&&E&&(1<L||L===1&&q!==-1)&&(J+=3),J},j.aYt=function(E,A){var Y=new S.Style;return Y.cellButtons=[{position:A===void 0?S.ButtonPosition.left:A,command:"PivotOutlineButtonToggle",imageType:S.ButtonImageType.custom,visibility:S.ButtonVisibility.always,useButtonStyle:!1,enabled:!0,buttonBackColor:"transparent",hoverBackColor:"transparent",imageSrc:E?U:I,imageSize:{width:18,height:18}}],Y},j.RZt=function(E,A,Y,L,q){return L?(L=0,A&&(A.sortType===Yt.SortType.asc&&(L=1),A.sortType===Yt.SortType.desc)&&(L=2),A=E?[3,4,5][L]:L,(E=new S.Style).cellButtons=[(0,at.getFilterCellButtonInfo)(A,Y,q)],E):{}},j.mYt=function(E){var A;return E=E?"0px 0px 0px 25px":void 0,(A=new S.Style).cellPadding=E,A},o.PivotTableLayoutBase=j},"./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-compact-layout.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w;function I(){return w!==null&&w.apply(this,arguments)||this}Yt=this&&this.__extends||(Ft=function(U,g){return(Ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(F,ot){F.__proto__=ot}:function(F,ot){for(var j in ot)Object.prototype.hasOwnProperty.call(ot,j)&&(F[j]=ot[j])}))(U,g)},function(U,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function F(){this.constructor=U}Ft(U,g),U.prototype=g===null?Object.create(g):(F.prototype=g.prototype,new F)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableCompactLayout=void 0,At=ft("Pivot"),S=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),at=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-base-layout.js"),X=ft("./dist/plugins/pivot/pivot-util.js"),H=ft("@spreadjs/js-sheets-common"),f=ft("./dist/plugins/pivot/pivot.ns.js"),B=ft("Core"),vt=ft("./dist/plugins/pivot/pivot-core/pivot-fields-model.js"),mt=ft("@spreadjs/js-calc"),tt=H.Common.lt.ht,_=H.Common.zf,ft=new H.Common.ResourceManager(f.SR,"PivotTables"),v=ft.getResource.bind(ft),Yt(I,w=at.PivotTableLayoutBase),I.kZt=function(U){var g,F,ot,j=U.cornerModel,E=U.columnModel,A=U.rowModel,Y=U.valueFieldsInfo,L=U.rowFields,q=U.options,J=U.showHeaders,P=U.colFields,bt=U.rowValuePosition,k=U.pt,nt=U.hideValuesRow,gt=U.dataCaption,Z=(E=E.Sx,k.dh);j.setRowCount(E),j.setColCount(A.Tx),k=(0,at.getValuesRowOffset)(nt,gt,Y.length,P.length),0<L.length?(Y.length!==1||P.length<1&&!J||j.Kbt(0+k,0,Y[0].name),J&&(tt(q.rowHeaderCaption)?j.Kbt(E-1,0,v().RowLabels):j.Kbt(E-1,0,q.rowHeaderCaption),g=!1,ot=[],(F=null,At.o)(L,function(ut){g=g||Z.isFilter(ut.a),F=F||ut.nrt,ot.push(ut.Zc)}),j.qWt(E-1,0,this.RZt(g,F,24,U.options.showFilter,this.qcr(U))),j.JWt(0,{isCompactRoot:!0,fieldName:L[0]&&L[0].Zc||""}),A.JWt(0,{isCompactRoot:!0,compactFieldList:ot}),A.WWt)&&L[L.length-1]&&(A.WWt[0]={path:L[L.length-1].Zc})):0<=bt&&J&&j.Kbt(j.Sx-1,0,v().Values)},I.tYt=function(U,g,F,ot){var j,E=this;tt(ot.options.colHeaderCaption)?U.Kbt(0,0,0<g.length?v().ColumnLabels:v().Values):U.Kbt(0,0,ot.options.colHeaderCaption),j=ot.pt.dh,U.JWt(0,{isCompactRoot:!0,fieldName:g[0]&&g[0].Zc}),(0,At.o)(g,function(A,Y){var L=A.Zc,q=j.isFilter(A.a);A=A.nrt,U.zWt[Y+1]={path:L},Y===0&&U.qWt(0,Y,E.RZt(q,A,30,ot.options.showFilter,E.qcr(ot)))})},I.xZt=function(U){var g,F,ot,j,E,A,Y,L,q,J,P=U.rootNode,bt=U.options,k=U.valueFieldsInfo,nt=U.rowFields,gt=U.colFields,Z=U.rowValuePosition,ut=U.hideValuesRow,Rt=U.dataCaption;for((J=0<nt.length?1:0)==0&&k.length===1&&0<gt.length&&(J=1),nt.length===0&&-1<U.rowValuePosition&&(J+=1),U.rowModel.setColCount(J),g=[],F={},ot=[],j=0,E=nt;j<E.length;j++)A=E[j],ot.push(A.Zc);for(Z!==-1&&ot.splice(Z,0,v().Values),Y=(0,at.getValuesRowOffset)(ut,Rt,k.length,gt.length),L=0,q=ot.length;L<q;L++)F[ot[L]]=L+Y,g.push(ot[L]);U.rowFieldsIndexes=g,U.rowFieldsMap=F,J=bt.subTotalsPosition===S.SubtotalsPosition.bottom,nt=this.bYt(U,P,J,0,k),U.rowModel.setRowCount(nt),U.contentModel.setRowCount(nt)},I.gYt=function(U,g){var F,ot=g.KZt+g.wYt,j=(E=U.options).subTotalsPosition,E=E.grandTotalPosition;return j===S.SubtotalsPosition.top?(ot+=g.yYt,0<g.kpi&&(ot+=g.kpi)):j===S.SubtotalsPosition.bottom&&(ot+=g.vYt),g.zEt&&(F=j!==S.SubtotalsPosition.none,E=E!==S.GrandTotalPosition.none&&E!==S.GrandTotalPosition.row,F&&!E?ot-=U.rowValuePosition===-1?1:U.valueFieldsInfo.length:(!F&&E||E&&g.vYt===0)&&(ot+=U.rowValuePosition===-1?1:U.valueFieldsInfo.length),U.rowFields.length===0)&&(ot=g.KZt+g.wYt),j===S.SubtotalsPosition.none&&(ot+=g.jwr),ot},I.CYt=function(U,g,F){return U.rowValuePosition!==0&&g.YAt<=U.rowValuePosition?F===S.SubtotalsPosition.none?g.IYt:g.AYt:F===S.SubtotalsPosition.bottom?g.AYt:(U=g.IYt,0<g.jpi&&(U+=g.jpi),U)},I.bYt=function(U,g,F,ot,j){var E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt=U.rowModel,kt=U.rowValuePosition,ie=U.rowDeep,Xt=U.options,Qt=U.sharedMap,dt=U.rowFieldsIndexes,xt=U.rowFieldsMap,Mt=g.eYt,st=g.nodeName,l=g.YAt,T=g.zEt,D=g.lYt,M=g.rYt,s=1,y=0;if(kt!==-1&&(l<=kt?s=j.length:y=1),Ct=(E=U.pt.dh.getFieldInfoByName(M))&&E.Spi,Qt=(0,X.FZt)(Qt,M,st),A=ot,Y=U.pt.collapse(g.rYt,Qt)&&l!==ie,st=l<ie,Mt){if(T||U.repeatValueFiledChildLength++,!T&&kt!==0){for(L={path:D,isValueFieldDim:!1},U.valuePositionInfo&&U.valuePositionInfo.positionType===0&&U.valuePositionInfo.display?L.compactLevel=(0,vt.in)(U.rowFields,M,{valuePositionIndex:U.valuePositionInfo.positionIndex,Zc:j[0].name}):L.compactLevel=g.YAt-1,st&&(L.rowHeaderLevel=this.fYt(ie,l+y,s)),this.OZt(Bt,A,L),J=0,P=(q=g.lYt.split(At.Separator)).length;J<P;J++)Bt.tZt(A,dt[J],(0,X.FZt)(U.sharedMap,dt[J],q[J]),dt.length-J);Bt.Kbt(A,0,Qt),g.oYt&&0<g.oYt.length&&g.YAt<U.rowDeep&&U.options.showDrill?Bt.qWt(A,0,this.aYt(Y,B.ButtonPosition.leftOfText)):Bt.qWt(A,0,this.pYt(w.Gn.call(this,U,g.YAt-1,!0))),A++}for(bt=void 0,nt=!1,gt=k=0,Z=j;gt<Z.length;gt++){if(ut=Z[gt],Bt.Kbt(A,0,ut.name),Bt.qWt(A,0,this.pYt(w.Gn.call(this,U,kt,kt!==0))),bt={path:D,grandTotalLevel:l,valueFieldName:ut.name,isValueFieldDim:!(g.oYt&&0<g.oYt.length&&g.YAt<U.rowDeep),rowHeaderLevel:this.fYt(ie,l,s),isSigmaValue:!0},U.valuePositionInfo&&U.valuePositionInfo.positionType===0&&U.valuePositionInfo.display?bt.compactLevel=(0,vt.in)(U.rowFields,ut.name,{valuePositionIndex:U.valuePositionInfo.positionIndex,Zc:ut.name}):L.compactLevel=g.YAt-1,this.OZt(Bt,A,bt),g.YAt<ie)for(q=g.lYt.split(At.Separator),0<=kt&&kt<=l&&q.splice(kt,null,ut.name),J=0,P=q.length;J<P;J++)q[J]&&Bt.tZt(A,dt[J],dt[J]!==v().Values?(0,X.FZt)(U.sharedMap,dt[J],q[J]):q[J],dt.length-J);A++,Y?g.YAt<=kt&&kt<ie&&!T&&Xt.insertBlankLineAfterEachItem&&(this.NYt(U,g,Bt.zWt.length),A++,k++,nt=!0):(g.zEt&&ie===0&&kt===0&&(this.TYt(U,g,A-1,"",j),ot=j.length),A+=this.MYt(U,g,F,A,[ut]),l+1===ie&&Xt.insertBlankLineAfterEachItem&&g.oYt&&g.oYt[0].AYt===0&&(A++,this.NYt(U,g,Bt.zWt.length)))}if(l===ie&&Xt.insertBlankLineAfterEachItem&&(A++,this.NYt(U,g,Bt.zWt.length)),Y)return(s=this.xYt(U,g,A-j.length-k,j,s,void 0,0,!0,nt))+1}else{if(!T){if(Bt.Kbt(A,0,Qt),L={path:D,grandTotalLevel:l,valueFieldName:j[0]&&j[0].name},st&&(L.rowHeaderLevel=this.fYt(ie,l+y,s)),Mt=U.rowValuePosition!==-1&&g.YAt>U.rowValuePosition?g.YAt:g.YAt-1,g.oYt&&0<g.oYt.length&&g.YAt<U.rowDeep?(L.isValueFieldDim=!1,U.options.showDrill?Bt.qWt(A,0,this.dYt(U.pt.collapse(g.rYt,Qt),w.Gn.call(this,U,Mt),B.ButtonPosition.leftOfText)):Bt.qWt(A,0,this.pYt(w.Gn.call(this,U,Mt)))):(L.isValueFieldDim=!0,Bt.qWt(A,0,this.pYt(w.Gn.call(this,U,Mt,!0)))),U.valuePositionInfo&&U.valuePositionInfo.positionType===0&&U.valuePositionInfo.display?L.compactLevel=(0,vt.in)(U.rowFields,M,{valuePositionIndex:U.valuePositionInfo.positionIndex,Zc:j[0].name}):L.compactLevel=g.YAt-1,this.OZt(Bt,A,L),g.YAt<ie)for(q=g.lYt.split(At.Separator),0<=kt&&kt<l&&(st=xt[v().Values],q.splice(st,null,j[0].name)),J=0,P=q.length;J<P;J++)Bt.tZt(A,dt[J],dt[J]!==v().Values?(0,X.FZt)(U.sharedMap,dt[J],q[J]):q[J],dt.length-J);if(Y)return 1<j.length&&U.rowValuePosition>l?(s=this.xYt(U,g,++A,j,s,void 0,0,!0))+1:this.xYt(U,g,A,j,s,void 0,0);A++}this.MYt(U,g,F,A,j)}return y=(0,X.getActualSubtotalPosition)(Xt.subTotalsPosition,Ct,E&&E.Nwr),Qt=0,Mt=this.gYt(U,g),Xt.insertBlankLineAfterEachItem&&(Mt+=Qt=this.CYt(U,g,Xt.subTotalsPosition)),M=ot+Mt-s,xt=!0,(st=ie||!j.length?y:S.SubtotalsPosition.bottom)===S.SubtotalsPosition.bottom||st===S.SubtotalsPosition.top&&l<kt||y===S.SubtotalsPosition.top&&T?M=ot+Mt-s:st===S.SubtotalsPosition.top&&kt<=l?(M=ot,Rt=!0,l===kt&&(M=ot+Mt-s,Rt=!1)):y!==S.SubtotalsPosition.none||!T||Xt.grandTotalPosition!==S.GrandTotalPosition.both&&Xt.grandTotalPosition!==S.GrandTotalPosition.col?xt=!1:M=ot+Mt-s,xt?(!Rt&&Xt.insertBlankLineAfterEachItem&&g.AYt&&!T&&M--,ie===0&&T?(Ct=j[0]&&j[0].name||"",Bt.Kbt(M,0,Ct),kt===-1&&(bt={path:D,rowHeaderLevel:this.fYt(ie,l,s)},this.OZt(Bt,M,bt)),this.ZZt(U,M,g,j,"")):this.xYt(U,g,M,j,void 0,Rt)):y===S.SubtotalsPosition.none&&U.options.insertBlankLineAfterEachItem&&0<Qt&&this.NYt(U,g,M),Mt},I.xYt=function(U,g,F,ot,j,E,A,Y,L){var q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt=U.rowDeep,xt=U.rowModel,Mt=U.rowValuePosition,st=U.sharedMap,l=U.options,T=U.rowFieldsMap,D=U.rowFieldsIndexes,M=g.YAt,s=g.nodeName,y=g.zEt,G=g.lYt,K=g.rYt;if(!y||U.options.grandTotalPosition!==S.GrandTotalPosition.none&&U.options.grandTotalPosition!==S.GrandTotalPosition.row){if(k=(q=U.pt.dh.getFieldInfoByName(K))&&q.Spi,M<dt||dt===0){if(-(J=1)!==Mt&&M<=Mt&&(J=ot.length),F=P=F,st=(0,X.FZt)(st,K,s),P>=xt.Sx)return;if(s=void 0,s=y?1<ot.length&&0<=Mt?_.I5(v().Total,["",""]):v().GrandTotal:1<ot.length&&0<=Mt||(0,X.getActualSubtotalPosition)(l.subtotalsPosition,k,q==null?void 0:q.Nwr)!==S.SubtotalsPosition.bottom?st:_.I5(v().Total,[st,""]),dt===0&&(s=ot[0]&&ot[0].name||""),bt=U.pt.collapse(g.rYt,st)?Mt<=0?st:"":s,k=U.columnValuePosition!==-1,nt={path:G,rowHeaderLevel:this.fYt(dt,M,J),grandTotalLevel:M},(0,At.ht)(A)||(nt.collapseIndex=A),y?nt.isGrandTotal=!0:nt.isSubtotal=!0,U.valuePositionInfo&&U.valuePositionInfo.positionType===0&&U.valuePositionInfo.display?nt.compactLevel=(0,vt.in)(U.rowFields,K,{valuePositionIndex:U.valuePositionInfo.positionIndex,Zc:ot[0].name}):nt.compactLevel=g.YAt-1,k){for(xt.Kbt(P,0,bt),Z=0,ut=(gt=g.lYt.split(At.Separator)).length;Z<ut-1;Z++)xt.tZt(P,D[Z],D[Z]!==v().Values?(0,X.FZt)(U.sharedMap,D[Z],gt[Z]):gt[Z],D.length-Z);this.DYt(xt,P,w.Gn.call(this,U,nt.rowHeaderLevel-1)),this.OZt(xt,P,nt),this.GZt(U,g,P,G)}else{if(U.valueFieldsInfo.length===0){if(!E){for(xt.Kbt(P,0,bt),Z=0,ut=(gt=g.lYt.split(At.Separator)).length;Z<ut-1;Z++)xt.tZt(P,D[Z],D[Z]!==v().Values?(0,X.FZt)(U.sharedMap,D[Z],gt[Z]):gt[Z],D.length-Z);this.DYt(xt,P,w.Gn.call(this,U,nt.rowHeaderLevel-1))}this.OZt(xt,P,nt)}for(Rt=0,Ct=ot;Rt<Ct.length;Rt++){for(Bt=(Xt=Ct[Rt]).name,kt=Xt.cacheName,ie=Xt.subtotalType,Xt=Xt.subtotalText,nt={path:G,rowHeaderLevel:this.fYt(dt,M,J),grandTotalLevel:M,valueFieldName:Bt},(0,At.ht)(A)||(nt.collapseIndex=A),Y&&(nt.collapse=!0),L||(1<J?xt.Kbt(P,0,bt+" "+Bt):xt.Kbt(P,0,bt)),gt=g.lYt.split(At.Separator),0<=Mt&&Mt<M&&(Qt=T[v().Values],gt.splice(Qt,null,Bt)),Z=0,ut=gt.length;Z<ut-1;Z++)xt.tZt(P,D[Z],D[Z]!==v().Values?(0,X.FZt)(U.sharedMap,D[Z],gt[Z]):gt[Z],D.length-Z);Qt=U.rowValuePosition!==-1&&g.YAt>U.rowValuePosition?g.YAt:g.YAt-1,this.DYt(xt,P,w.Gn.call(this,U,Qt)),y?nt.isGrandTotal=!0:nt.isSubtotal=!0,U.valuePositionInfo&&U.valuePositionInfo.positionType===0&&U.valuePositionInfo.display?nt.compactLevel=(0,vt.in)(U.rowFields,g.eYt?Bt:K,{valuePositionIndex:U.valuePositionInfo.positionIndex,Zc:Bt}):nt.compactLevel=g.YAt-1,this.OZt(xt,P,nt),this.GZt(U,g,P,G,kt,ie,Xt,Bt),P++,L&&(P++,j++)}}this.ZZt(U,F,g,ot)}return y||!l.insertBlankLineAfterEachItem||L||(this.NYt(U,g,xt.zWt.length),tt(j))||j++,j}},I.NYt=function(U,g,F){var ot=U.rowDeep,j=(U=U.rowModel,g.YAt);g=g.lYt,(j<=ot||ot===0)&&this.OZt(U,F,{path:g,isBlankRow:!0})},I.DYt=function(U,g,F){var ot=U.ML(g,0)||new B.Style;ot.h5(this.pYt(F)),U.qWt(g,0,ot)},I.MYt=function(U,g,F,ot,j){var E,A,Y,L,q,J,P,bt,k,nt,gt,Z=U.rowDeep,ut=U.rowValuePosition,Rt=U.rowFieldsIndexes,Ct=U.rowModel,Bt=g.oYt,kt=g.YAt,ie=Bt.length;if(Z<=kt)for(E=g.lYt.split(At.Separator),0<=ut&&!tt(j)&&E.splice(ut,null,j[0].name),A=0,Y=E.length;A<Y;A++)E[A]&&Ct.tZt(ot-1,Rt[A],Rt[A]!==v().Values?(0,X.FZt)(U.sharedMap,Rt[A],E[A]):E[A],Rt.length-A);if((L=0)<ie)for(q=ot,J=0,P=Bt;J<P.length;J++)k=0,Z<(nt=(bt=P[J]).YAt)?(gt=q-1,g.zEt&&Z===0&&0<U.columnDeep&&ut===-1&&(gt=q),this.TYt(U,bt,gt,"",j)):(nt===Z&&(gt=bt.eYt?q+1:q,this.ZZt(U,gt,bt,j)),L+=k=this.bYt(U,bt,F,q,j),q+=k);return L},I.TYt=function(U,g,F,ot,j){var E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut=U.columnValuePosition,Rt=U.contentModel,Ct=U.colMap,Bt=g.oYt,kt=g.nodeName,ie=g.HZt;if(ot!==""&&(ot+=At.Separator),E=ut!==-1,Bt.length===0)for(A=0,Y=j;A<Y.length;A++)L=(J=Y[A]).name,q=J.cacheName,J=J.subtotalText,P=ot,U.columnDeep!==0&&(P+=kt),E&&(P!==""?P+=At.Separator+L:P=L),P=Ct[P],tt(P)||(bt=!1,bt=!!((k=U.subtotalCollection.CZt[L])&&(k.needBuildRunningTotalOrRankPath&&(g.UZt[L].indexInfo.minorPath=g.SYt),k.showDataAs===8||k.showDataAs===9)&&0<(k.showDataAsIndex&g.QZt))||bt)||Rt.Kbt(F,P,H.Common.st.E8((0,at.hZt)(U.subtotalCollection,ie,q,J,g.UZt,g.YAt,L),mt.Functions.CALC_PRECISION||14));else for(nt=0,gt=Bt;nt<gt.length;nt++)Z=gt[nt],this.TYt(U,Z,F,ot+kt,j);g.kYt||this.ZZt(U,F,g,j,ot+kt)},I._type=S.PivotTableLayoutType.outline,o.PivotTableCompactLayout=I},"./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-empty-layout.js":function(Ie,o){var ft,Yt;function At(tt,_,v){tt.save(),tt.strokeStyle=ft.frameColor,tt.lineWidth=ft.frameLineWidth,tt.strokeRect(0,0,_,v),tt.fillStyle=ft.tableHeadLine,tt.fillRect(0,0,_,v),tt.restore()}function S(tt,_,v,Ft){tt.save(),tt.strokeStyle=ft.frameColor,tt.lineWidth=ft.inputLineWidth,tt.strokeRect(0,0,_,v),tt.rect(1,0,_-2,v),tt.clip(),tt.translate(.5*_,0),X(tt,Ft),tt.restore()}function at(tt,_,v){for(var Ft=function(I,U,g){var F,ot,j,E,A,Y=[];if(I&&0<I.length){for(F=I.split(/\r\n|\r|\n/),(ot=mt()).save(),g&&(ot.font=g),j=0,E=F.length;j<E;j++)(A=B(ot,F[j],U))&&(A.length===0?Y.push(""):A.forEach(function(L){Y.push(L)}));ot.restore()}return Y}(v,_-10,ft.font),w=0;w<Ft.length;w++)tt.translate(0,20),X(tt,Ft[w]);return 20*Ft.length}function X(tt,_){tt.save(),tt.textBaseline=ft.nameBaseline,tt.textAlign=ft.textAlign,tt.font=ft.font,tt.fillStyle=ft.nameColor,tt.fillText(_,0,4),tt.restore()}function H(tt,_,v,Ft){(function(w,I,U){w.save(),w.fillStyle=ft.tableHeadLine,w.fillRect(.5*-I,.5*-U,I,U),w.restore()})(tt,_,v),function(w,I){w.save(),w.translate(-180*I*.5,-152*I*.5),function(U,g,F,ot){var j,E,A;for(U.save(),U.scale(ot,ot),f(U,0,0,13,8,ft.tableHeadColor,!0),f(U,3,3,7,2,ft.tableHeadLine,!0),f(U,14,0,49,8,ft.tableHeadColor,!0),E=j=0;E<4;E++)f(U,12*E+17,3,7,2,ft.tableHeadLine,!0);for(f(U,0,9,13,45,ft.tableHeadColor,!0),E=0;E<7;E++)f(U,3,j=6*E+12,7,2,ft.tableHeadLine,!0);for(f(U,14,9,49,45,ft.tableContentRim,!0),E=0;E<7;E++)for(j=6*E+8+4,A=0;A<4;A++)f(U,12*A+17,j,7,2,ft.tableContent,!0);U.restore()}(w,0,0,I),w.translate(110*I,0),function(U,g,F,ot){var j,E,A,Y;for(U.save(),U.scale(ot,ot),f(U,0,0,g,F,ft.tableContentRim,!0),f(U,8,8,41,3,ft.tableHeadColor,!0),f(U,7,19,57,55,ft.recordBookFrameColor,!1),f(U,8,20,55,53,ft.tableHeadLine,!0),E=j=0;E<9;E++)f(U,11,j=26+5*E,2,2,ft.recordColor,!0),f(U,14,j,42,2,ft.recordColor,!0);for(f(U,8,82,41,3,ft.tableHeadColor,!0),E=A=0;E<2;E++)for(A=92+30*E,Y=0;Y<2;Y++)f(U,j=7+31*Y,A,26,24,ft.recordBookFrameColor,!1),f(U,j+1,1+A,24,22,ft.tableHeadLine,!0);U.restore()}(w,70,152,I),w.translate(-2*I,64*I),function(U,g,F){U.save(),U.scale(F,F),U.beginPath(),U.save(),U.arc(0,0,g,0,2*Math.PI,!0),U.clip(),U.arc(0,0,g,0,2*Math.PI,!0),U.strokeStyle=ft.MagnifierFrameColor,U.stroke(),U.arc(0,0,g-1,0,2*Math.PI,!0),U.clip(),U.arc(0,0,g-1,0,2*Math.PI,!0),U.fillStyle=ft.tableHeadLine,U.fill();for(var ot=0,j=0;j<3;j++)f(U,-16,-(ot=24-18*j),13,13,ft.tableContent,!1),f(U,1,4-ot,35,5,ft.recordColor,!0);(function(E,A,Y,L){E.save(),E.translate(Math.round(A+L/2),Math.round(Y+L/2)),E.strokeStyle="red",E.rotate(-.25*Math.PI),E.beginPath(),E.fillStyle=ft.tickColor,E.fillRect(.375*-L,.25*-L,.2*L,.5*L),E.closePath(),E.fill(),E.beginPath(),E.fillStyle=ft.tickColor,E.fillRect(.375*-L,.05*L,.75*L,.2*L),E.closePath(),E.fill(),E.stroke(),E.restore()})(U,-15,-6,11),U.restore(),U.restore()}(w,32,I),w.restore()}(tt,Ft)}function f(tt,_,v,Ft,w,I,U){tt.save(),tt.translate(_,v),U?(tt.fillStyle=I,tt.fillRect(0,0,Ft,w)):(tt.strokeStyle=I,tt.strokeRect(0,0,Ft,w)),tt.restore()}function B(tt,_,v){var Ft,w,I,U,g,F=_.split(" "),ot=[],j="",E=0,A=tt.measureText(" ").width;if(_.length===1)return F;for(Ft=0,w=F.length;Ft<w;Ft++)I=F[Ft],v<(U=tt.measureText(I).width)?(0<j.length&&ot.push(j),vt(tt,F[Ft],v,U).forEach(function(Y){ot.push(Y)}),j="",E=0):(g=j+I,j=v<(E+=U+A)?E-A<=v?(ot.push(g),E=0,""):(ot.push(j),v<(E=U+A)?(ot.push(I),E=0,""):I+" "):g+" ");return 0<j.length&&ot.push(j),ot}function vt(tt,_,v,Ft){var w,I,U,g,F=Math.ceil(Ft/v),ot=_.length/F,j=[];for(F=0;0<v&&F<_.length;){for(w=_.substring(F,F+ot),U=(I=tt.measureText(w).width)<=v?1:-1,g=0;(I<v&&0<U||v<I&&U<0)&&!(F+ot+(g+=U)>=_.length||F+ot+g===0);)w=_.substring(F,F+ot+g),I=tt.measureText(w).width;if(!(F<F+ot+(g-=U)))break;j.push(_.substring(F,F+ot+g)),F=F+ot+g}return j}function mt(){var tt,_;return(_=Yt)||((tt=document.createElement("canvas")).hidden=!0,tt.width=1,tt.height=1,document.body.appendChild(tt),Yt=_=tt.getContext("2d")),_}Object.defineProperty(o,"__esModule",{value:!0}),o.jYt=void 0,ft={frameColor:"rgba(100,100,100,1)",nameColor:"rgba(50,50,50,1)",panelTitleColor:"rgba(50,50,50)",tableHeadColor:"rgba(77,130,184,1)",tableHeadLine:"rgba(255,255,255,1)",tableContent:"rgba(128,128,128,1)",tableContentRim:"rgba(193,211,230,1)",recordBookFrameColor:"rgba(153,183,214,1)",recordColor:"rgba(179,179,179,1)",MagnifierFrameColor:"rgba(196,213,231,1)",tickColor:"rgba(216,99,68,1)",font:"12px Regular",textAlign:"center",nameBaseline:"hanging",frameLineWidth:2,inputLineWidth:2},o.jYt=function(tt,_,v,Ft,w,I,U,g){var F,ot,j;I<3||w<3||(F=I/194,ot=w/362,j=w-2,tt.save(),tt.rect(U.x,U.y,U.width,U.height),tt.clip(),1<j&&(tt.translate(v,Ft),At(tt,I,w),j-=2),0<j&&(tt.translate(.125*(I-2),.08*(w-2)),S(tt,.75*I,20,_),j-=.08*(w-2)+20),0<j&&(tt.translate(.75*(I-2)/2,.08*(w-2)),j-=.08*(w-2)+at(tt,I,g)),0<j&&(tt.translate(0,.9*(U=.7*j)),H(tt,I-11*F,U,Math.min(F,ot))),tt.restore())}},"./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-outline-layout.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v;function Ft(){return v!==null&&v.apply(this,arguments)||this}Yt=this&&this.__extends||(_=function(w,I){return(_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(U,g){U.__proto__=g}:function(U,g){for(var F in g)Object.prototype.hasOwnProperty.call(g,F)&&(U[F]=g[F])}))(w,I)},function(w,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function U(){this.constructor=w}_(w,I),w.prototype=I===null?Object.create(I):(U.prototype=I.prototype,new U)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableOutlineLayout=void 0,At=ft("Pivot"),S=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),at=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-base-layout.js"),X=ft("./dist/plugins/pivot/pivot-util.js"),H=ft("@spreadjs/js-sheets-common"),f=ft("./dist/plugins/pivot/pivot.ns.js"),B=ft("@spreadjs/js-calc"),vt=H.Common.lt.ht,mt=H.Common.zf,ft=new H.Common.ResourceManager(f.SR,"PivotTables"),tt=ft.getResource.bind(ft),Yt(Ft,v=at.PivotTableLayoutBase),Ft.kZt=function(w){var I,U=this,g=w.cornerModel,F=w.columnModel,ot=w.rowModel,j=w.valueFieldsInfo,E=w.rowFieldsMap,A=w.pt,Y=w.rowFields,L=w.showHeaders,q=w.colFields,J=w.rowValuePosition,P=w.hideValuesRow,bt=w.dataCaption,k=(F=F.Sx,A.dh);g.setRowCount(F),g.setColCount(ot.Tx),P=(0,at.getValuesRowOffset)(P,bt,j.length,q.length),0<Y.length?(j.length!==1||q.length<1&&!L||g.Kbt(0+P,0,j[0].name),L&&(I=F-1,(0,At.o)(Object.keys(E),function(nt){var gt,Z,ut,Rt=E[nt];g.Kbt(I,Rt,nt),(gt=nt!==tt().Values)&&(ut=A.zRt(nt),Z=k.isFilter(ut.a),ut=ut.nrt,g.qWt(I,Rt,U.RZt(Z,ut,30,w.options.showFilter,U.qcr(w)))),g.JWt(Rt,{isCompactRoot:!1,fieldName:nt,isDim:gt}),ot.WWt[Rt]={path:nt}}))):0<=J&&L&&g.Kbt(g.Sx-1,0,tt().Values)},Ft.tYt=function(w,I,U,g){var F=this,ot=[];(0,At.o)(I,function(j){ot.push({name:j.Zc,isFilter:g.pt.dh.isFilter(j.a),isDim:!0,sortInfo:j.nrt})}),U!==-1&&ot.splice(U,0,{name:tt().Values,isFilter:!1,isDim:!1}),(0,At.o)(ot,function(j,E){var A=j.name,Y=j.isDim,L=j.isFilter;j=j.sortInfo,w.Kbt(0,E,A),w.zWt[E+1]={path:A},Y&&w.qWt(0,E,F.RZt(L,j,30,g.options.showFilter,F.qcr(g))),w.JWt(E,{isCompactRoot:!1,fieldName:A})})},Ft.CYt=function(w,I,U){return w.rowValuePosition!==0&&I.YAt<=w.rowValuePosition?U===S.SubtotalsPosition.none?I.IYt:I.AYt:U===S.SubtotalsPosition.bottom?I.AYt:(w=I.IYt,0<I.jpi&&(w+=I.jpi),w)},Ft.gYt=function(w,I){var U,g=I.KZt+I.wYt,F=(ot=w.options).subTotalsPosition,ot=ot.grandTotalPosition;return F===S.SubtotalsPosition.top?(g+=I.yYt,0<I.kpi&&(g+=I.kpi)):F===S.SubtotalsPosition.bottom&&(g+=I.vYt),I.zEt&&(U=F!==S.SubtotalsPosition.none,ot=ot!==S.GrandTotalPosition.none&&ot!==S.GrandTotalPosition.row,U&&!ot?g-=w.rowValuePosition===-1?1:w.valueFieldsInfo.length:(!U&&ot||ot&&I.vYt===0)&&(g+=w.rowValuePosition===-1?1:w.valueFieldsInfo.length),w.rowFields.length===0)&&(g=I.KZt+I.wYt),F===S.SubtotalsPosition.none&&(g+=I.jwr),g},Ft.xZt=function(w){var I,U;this.OYt(w),U=w.rootNode,I=w.valueFieldsInfo,U=this.bYt(w,U,0,I),w.rowModel.setRowCount(U),w.contentModel.setRowCount(U)},Ft.bYt=function(w,I,U,g){var F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut=w.rowFieldsMap,Rt=w.rowModel,Ct=w.rowValuePosition,Bt=w.options,kt=w.sharedMap,ie=w.rowDeep,Xt=w.rowFieldsIndexes,Qt=I.eYt,dt=I.rYt,xt=I.nodeName,Mt=I.YAt,st=I.zEt,l=I.lYt,T=ut[dt],D=1;if(Ct!==-1&&Mt<=Ct&&(D=g.length),ot=(F=w.pt.dh.getFieldInfoByName(dt))&&F.Spi,kt=(0,X.FZt)(kt,dt,xt),j=U,E=w.pt.collapse(I.rYt,kt)&&Mt!==ie,Qt){if(st||w.repeatValueFiledChildLength++,A=ut[tt().Values],!st&&Ct!==0){for(Rt.Kbt(j,T,kt),this.OZt(Rt,j,{path:l,isValueFieldDim:!1,rowHeaderLevel:this.fYt(ie,Mt,D)}),L=0,q=(Y=I.lYt.split(At.Separator)).length;L<q;L++)Rt.tZt(j,Xt[L],(0,X.FZt)(w.sharedMap,Xt[L],Y[L]),Xt.length-L);I.oYt&&0<I.oYt.length&&I.YAt<w.rowDeep&&w.options.showDrill&&Rt.qWt(j,T,this.aYt(E)),j++}for(J=void 0,bt=!1,k=P=0,nt=g;k<nt.length;k++){if(gt=nt[k],Rt.Kbt(j,A,gt.name),J={path:l,rowHeaderLevel:this.fYt(ie,Mt,D),isValueFieldDim:!(I.oYt&&0<I.oYt.length&&I.YAt<w.rowDeep),valueFieldName:gt.name,isSigmaValue:!0},this.OZt(Rt,j,J),I.YAt<ie)for((Y=I.lYt.split(At.Separator)).splice(A,null,gt.name),L=0,q=Y.length;L<q;L++)Y[L]&&Rt.tZt(j,Xt[L],Xt[L]!==tt().Values?(0,X.FZt)(w.sharedMap,Xt[L],Y[L]):Y[L],Xt.length-L);j++,E?I.YAt<=Ct&&Ct<ie&&!st&&Bt.insertBlankLineAfterEachItem&&(this.NYt(w,I,Rt.zWt.length),j++,P++,bt=!0):(I.zEt&&ie===0&&Ct===0&&(this.TYt(w,I,j-1,"",g),U=g.length),j+=this.MYt(w,I,j,[gt],ot,F==null?void 0:F.Nwr),Mt+1===ie&&Bt.insertBlankLineAfterEachItem&&I.oYt&&I.oYt[0].AYt===0&&(j++,this.NYt(w,I,Rt.zWt.length)))}if(Mt===ie&&Bt.insertBlankLineAfterEachItem&&(j++,this.NYt(w,I,Rt.zWt.length)),E)return(D=this.xYt(w,I,j-g.length-P,g,D,void 0,T,!0,bt))+1}else{if(!vt(T)){if(Rt.Kbt(j,T,kt),J={path:l,rowHeaderLevel:this.fYt(ie,Mt,D),valueFieldName:g[0]&&g[0].name},I.oYt&&0<I.oYt.length&&I.YAt<w.rowDeep?(J.isValueFieldDim=!1,w.options.showDrill&&Rt.qWt(j,T,this.aYt(w.pt.collapse(I.rYt,kt)))):J.isValueFieldDim=!0,this.OZt(Rt,j,J),I.YAt<ie)for(Y=I.lYt.split(At.Separator),0<=Ct&&Ct<Mt&&(A=ut[tt().Values],Y.splice(A,null,g[0].name)),L=0,q=Y.length;L<q;L++)Rt.tZt(j,Xt[L],Xt[L]!==tt().Values?(0,X.FZt)(w.sharedMap,Xt[L],Y[L]):Y[L],Xt.length-L);if(E)return Mt<Ct?(D=this.xYt(w,I,++j,g,D,!1,T,!0))+1:this.xYt(w,I,j,g,D,void 0,T);j++}this.MYt(w,I,j,g,ot,F==null?void 0:F.Nwr)}return dt=(0,X.getActualSubtotalPosition)(Bt.subTotalsPosition,ot,F==null?void 0:F.Nwr),xt=0,Qt=this.gYt(w,I),Bt.insertBlankLineAfterEachItem&&(Qt+=xt=this.CYt(w,I,Bt.subTotalsPosition)),kt=U+Qt-D,ut=!0,(T=ie||!g.length?dt:S.SubtotalsPosition.bottom)===S.SubtotalsPosition.bottom||T===S.SubtotalsPosition.top&&Mt<Ct||T===S.SubtotalsPosition.top&&st?kt=U+Qt-D:T===S.SubtotalsPosition.top&&Ct<=Mt?(kt=U,Z=!0,Mt===Ct&&(kt=U+Qt-D,Z=!1)):dt!==S.SubtotalsPosition.none||!st||Bt.grandTotalPosition!==S.GrandTotalPosition.both&&Bt.grandTotalPosition!==S.GrandTotalPosition.col?ut=!1:kt=U+Qt-D,ut?(!Z&&Bt.insertBlankLineAfterEachItem&&I.AYt&&!st&&kt--,ie===0&&st?(T=g[0]&&g[0].name||"",Rt.Kbt(kt,0,T),Ct===-1&&(J={path:l,rowHeaderLevel:this.fYt(ie,Mt,D)},this.OZt(Rt,kt,J)),this.ZZt(w,kt,I,g,"")):this.xYt(w,I,kt,g,void 0,Z)):dt===S.SubtotalsPosition.none&&w.options.insertBlankLineAfterEachItem&&0<xt&&this.NYt(w,I,kt),Qt},Ft.xYt=function(w,I,U,g,F,ot,j,E,A){var Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt=w.rowDeep,Mt=w.rowModel,st=w.rowFieldsMap,l=w.rowValuePosition,T=w.sharedMap,D=w.options,M=w.rowFieldsIndexes,s=I.YAt,y=I.nodeName,G=I.zEt,K=I.lYt,c=I.rYt;if(!I.zEt||w.options.grandTotalPosition!==S.GrandTotalPosition.none&&w.options.grandTotalPosition!==S.GrandTotalPosition.row){if(L=(Y=w.pt.dh.getFieldInfoByName(c))&&Y.Spi,s<xt||xt===0){if(q=G?0:st[I.rYt],-(J=1)!==l&&s<=l&&(J=g.length),(U=P=U)>=Mt.Sx)return;if(k=bt=void 0,xt===0?bt=g[0]&&g[0].name||"":(T=(0,X.FZt)(T,c,y),w.pt.collapse(I.rYt,T)?bt=T:G?1<g.length&&0<=l?(bt=tt().Total,k=!0):bt=tt().GrandTotal:bt=1<g.length&&0<=l||g.length<2&&(0,X.getActualSubtotalPosition)(D.subtotalsPosition,L,Y==null?void 0:Y.Nwr)===S.SubtotalsPosition.top?T:mt.I5(tt().Total,[T,""])),c=w.columnValuePosition!==-1,nt={path:K,rowHeaderLevel:this.fYt(xt,s,J),grandTotalLevel:s},(0,At.ht)(j)||(nt.collapseIndex=j),G?nt.isGrandTotal=!0:nt.isSubtotal=!0,c){if(!ot)for(Mt.Kbt(P,q,bt),Z=0,ut=(gt=I.lYt.split(At.Separator)).length;Z<ut-1;Z++)Mt.tZt(P,M[Z],M[Z]!==tt().Values?(0,X.FZt)(w.sharedMap,M[Z],gt[Z]):gt[Z],M.length-Z);this.OZt(Mt,P,nt),this.GZt(w,I,P,K)}else{if(w.valueFieldsInfo.length===0){if(!ot)for(Mt.Kbt(P,q,bt),Z=0,ut=(gt=I.lYt.split(At.Separator)).length;Z<ut-1;Z++)Mt.tZt(P,M[Z],M[Z]!==tt().Values?(0,X.FZt)(w.sharedMap,M[Z],gt[Z]):gt[Z],M.length-Z);this.OZt(Mt,P,nt)}for(Rt=0,Ct=g;Rt<Ct.length;Rt++){for(Bt=(Xt=Ct[Rt]).name,kt=Xt.subtotalType,ie=Xt.cacheName,Xt=Xt.subtotalText,nt={path:K,rowHeaderLevel:this.fYt(xt,s,J),grandTotalLevel:s,valueFieldName:Bt},(0,At.ht)(j)||(nt.collapseIndex=j),E&&(nt.collapse=!0),(dt=Qt=void 0)===ot||1<J?(Qt=l>=nt.grandTotalLevel?k?mt.I5(bt,[""," "+Bt]):bt+" "+Bt:bt,dt=q):ot?(Qt=bt,E||(dt=q)):(Qt=Bt,dt=w.valuePositionInfo.positionIndex),A||Mt.Kbt(P,dt,Qt),gt=I.lYt.split(At.Separator),0<=l&&l<s&&(dt=st[tt().Values],gt.splice(dt,null,g[0].name)),Z=0,ut=gt.length;Z<ut-1;Z++)Mt.tZt(P,M[Z],M[Z]!==tt().Values?(0,X.FZt)(w.sharedMap,M[Z],gt[Z]):gt[Z],M.length-Z);G?nt.isGrandTotal=!0:nt.isSubtotal=!0,this.OZt(Mt,P,nt),this.GZt(w,I,P,K,ie,kt,Xt,Bt),P++,A&&(P++,F++)}}this.ZZt(w,U,I,g)}return G||!D.insertBlankLineAfterEachItem||A||(this.NYt(w,I,Mt.zWt.length),vt(F))||F++,F}},Ft.NYt=function(w,I,U){var g=w.rowDeep,F=(w=w.rowModel,I.YAt);I=I.lYt,(F<=g||g===0)&&this.OZt(w,U,{path:I,isBlankRow:!0})},Ft.MYt=function(w,I,U,g,F,ot){var j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie=w.rowDeep,Xt=w.options,Qt=w.rowFieldsMap,dt=w.rowModel,xt=w.rowValuePosition,Mt=w.rowFieldsIndexes,st=I.oYt,l=I.YAt,T=st.length;if(ie<=l)for(j=I.lYt.split(At.Separator),0<=xt&&!vt(g)&&j.splice(xt,null,g[0].name),E=0,A=j.length;E<A;E++)j[E]&&dt.tZt(U-1,Mt[E],Mt[E]!==tt().Values?(0,X.FZt)(w.sharedMap,Mt[E],j[E]):j[E],Mt.length-E);if((Y=0)<T)for(L=U,q=Xt.fillDownLabels,k=(bt=P=J=void 0,X.getActualSubtotalPosition)(Xt.subTotalsPosition,F,ot)===S.SubtotalsPosition.bottom?1:0,nt=this.mYt(Xt.showDrill),gt=0,Z=st;gt<Z.length;gt++)if(ut=Z[gt],Rt=0,ie<=l)kt=L-1,I.zEt&&ie===0&&0<w.columnDeep&&xt===-1&&(kt=L),this.TYt(w,ut,kt,"",g);else{if(Rt=this.bYt(w,ut,L,g),q)for(J=Qt[ut.rYt],bt=Rt+L-k,P=dt.Sl(L,J),Ct=void 0,Bt=L+1;Bt<bt;Bt++)(Ct=dt.zWt[Bt])&&!Ct.isBlankRow&&(!Ct.isSubtotal||l<Ct.grandTotalLevel-1)&&(dt.Kbt(Bt,J,P),dt.qWt(Bt,J,nt));Y+=Rt,l+1===ie&&(kt=ut.eYt?L+1:L,this.ZZt(w,kt,ut,g)),L+=Rt}return Y},Ft.TYt=function(w,I,U,g,F){var ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt=w.columnValuePosition,Z=w.contentModel,ut=w.colMap,Rt=I.oYt,Ct=I.nodeName,Bt=I.HZt;if(g!==""&&(g+=At.Separator),ot=gt!==-1,Rt.length===0)for(j=0,E=F;j<E.length;j++)A=(L=E[j]).name,Y=L.cacheName,L=L.subtotalText,q=g,w.columnDeep!==0&&(q+=Ct),ot&&(q!==""?q+=At.Separator+A:q=A),q=ut[q],J=w.subtotalCollection.CZt[A],vt(q)||(P=!1,P=!!(J&&(J.needBuildRunningTotalOrRankPath&&(I.UZt[A].indexInfo.minorPath=I.SYt),J.showDataAs===8||J.showDataAs===9)&&0<(J.showDataAsIndex&I.QZt))||P)||Z.Kbt(U,q,H.Common.st.E8((0,at.hZt)(w.subtotalCollection,Bt,Y,L,I.UZt,I.YAt,A),B.Functions.CALC_PRECISION||14));else for(bt=0,k=Rt;bt<k.length;bt++)nt=k[bt],this.TYt(w,nt,U,g+Ct,F);I.kYt||this.ZZt(w,U,I,F,g+Ct)},Ft.OYt=function(w){var I,U,g,F,ot,j,E,A,Y,L=w.rowModel,q=w.rowFields,J=w.rowValuePosition,P=w.valueFieldsInfo,bt=w.colFields;for((Y=q.length)===0&&P.length===1&&0<bt.length&&(Y=1),I=[],U=0,g=q;U<g.length;U++)F=g[U],I.push(F.Zc);for(J!==-1&&(Y+=1,I.splice(J,0,tt().Values)),L.setColCount(Y),ot={},j=[],E=0,A=I.length;E<A;E++)ot[I[E]]=E,j.push(I[E]);w.rowFieldsMap=ot,w.rowFieldsIndexes=j},Ft._type=S.PivotTableLayoutType.outline,o.PivotTableOutlineLayout=Ft},"./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-tabular-layout.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v;function Ft(){return v!==null&&v.apply(this,arguments)||this}Yt=this&&this.__extends||(_=function(w,I){return(_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(U,g){U.__proto__=g}:function(U,g){for(var F in g)Object.prototype.hasOwnProperty.call(g,F)&&(U[F]=g[F])}))(w,I)},function(w,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function U(){this.constructor=w}_(w,I),w.prototype=I===null?Object.create(I):(U.prototype=I.prototype,new U)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableTabularLayout=void 0,At=ft("Pivot"),S=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),at=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-base-layout.js"),X=ft("@spreadjs/js-sheets-common"),H=ft("./dist/plugins/pivot/pivot.ns.js"),f=ft("./dist/plugins/pivot/pivot-util.js"),B=ft("@spreadjs/js-calc"),vt=X.Common.lt.ht,mt=X.Common.zf,ft=new X.Common.ResourceManager(H.SR,"PivotTables"),tt=ft.getResource.bind(ft),Yt(Ft,v=at.PivotTableLayoutBase),Ft.kZt=function(w){var I,U=this,g=w.cornerModel,F=w.columnModel,ot=w.rowModel,j=w.valueFieldsInfo,E=w.rowFieldsMap,A=w.pt,Y=w.rowFields,L=w.showHeaders,q=w.colFields,J=w.rowValuePosition,P=w.hideValuesRow,bt=w.dataCaption;F=F.Sx,g.setRowCount(F),g.setColCount(ot.Tx),P=(0,at.getValuesRowOffset)(P,bt,j.length,q.length),Y.length?(j.length!==1||q.length<1&&!L||g.Kbt(0+P,0,j[0].name),L&&(I=F-1,(0,At.o)(Object.keys(E),function(k,nt){var gt,Z,ut;g.Kbt(I,nt,k),(gt=k!==tt().Values)&&(ut=A.zRt(k),Z=A.dh.isFilter(ut.a),ut=ut.nrt,g.qWt(I,nt,U.RZt(Z,ut,30,w.options.showFilter,U.qcr(w)))),g.JWt(nt,{isCompactRoot:!1,fieldName:k,isDim:gt}),ot.WWt[nt]={path:k}}))):0<=J&&L&&g.Kbt(g.Sx-1,0,tt().Values)},Ft.tYt=function(w,I,U,g){var F=this,ot=[];(0,At.o)(I,function(j){ot.push({name:j.Zc,isFilter:g.pt.dh.isFilter(j.a),isDim:!0,sortInfo:j.nrt})}),U!==-1&&ot.splice(U,0,{name:tt().Values,isFilter:!1,isDim:!1}),(0,At.o)(ot,function(j,E){var A=j.name,Y=j.isDim,L=j.isFilter;j=j.sortInfo,w.Kbt(0,E,A),w.zWt[E+1]={path:A},Y&&w.qWt(0,E,F.RZt(L,j,30,g.options.showFilter,F.qcr(g))),w.JWt(E,{isCompactRoot:!1,fieldName:A})})},Ft.xZt=function(w){this.OYt(w);var I=w.rootNode,U=w.valueFieldsInfo,g=w.rowModel,F=w.contentModel;this.bYt(w,I,0,U),g.setRowCount(g.zWt.length),F.setRowCount(g.zWt.length)},Ft.bYt=function(w,I,U,g){var F,ot,j,E,A,Y,L,q,J,P,bt,k,nt=w.rowFieldsMap,gt=w.rowModel,Z=w.rowValuePosition,ut=w.rowDeep,Rt=w.sharedMap,Ct=w.rowFieldsIndexes,Bt=I.eYt,kt=I.rYt,ie=I.nodeName,Xt=I.YAt,Qt=I.zEt,dt=I.lYt,xt=nt[kt],Mt=1,st=w.options.subTotalsPosition!==S.SubtotalsPosition.none,l=w.options.grandTotalPosition!==S.GrandTotalPosition.none&&w.options.grandTotalPosition!==S.GrandTotalPosition.row,T=w.pt.dh.getFieldInfoByName(kt),D=w.options.subTotalsPosition;if(T&&T.Nwr&&!st?(st=!0,D=T.Spi?S.SubtotalsPosition.top:S.SubtotalsPosition.bottom):T&&T.Nwr===!1&&st&&(st=!1,D=S.SubtotalsPosition.none),T=D!==S.SubtotalsPosition.none,Z!==-1&&Xt<=Z&&(Mt=g.length),Rt=(0,f.FZt)(Rt,kt,ie),F=U,ot=w.pt.collapse(I.rYt,Rt)&&Xt!==ut,Bt){for(j=nt[tt().Values],Qt||Z===0||(gt.Kbt(F,xt,Rt),I.oYt&&0<I.oYt.length&&I.YAt<w.rowDeep&&w.options.showDrill&&gt.qWt(F,xt,this.aYt(ot))),E=void 0,Y=!1,L=A=0,q=g;L<q.length;L++)J=q[L],gt.Kbt(F,j,J.name),E={path:dt,rowHeaderLevel:this.fYt(ut,Xt,Mt)},1<Mt&&(E.valueFieldName=J.name,E.isValueFieldDim=!0),this.OZt(gt,F,E),ot?I.YAt<=Z&&Z<ut&&!Qt&&w.options.insertBlankLineAfterEachItem?(this.NYt(w,I,gt.zWt.length),F++,F++,A++,Y=!0):F++:(I.zEt&&ut===0&&Z===0&&(this.TYt(w,I,F,"",g),U=g.length),F+=this.MYt(w,I,F,[J],D),Xt+1===ut&&w.options.insertBlankLineAfterEachItem&&I.oYt&&I.oYt[0].AYt===0&&(F++,this.NYt(w,I,gt.zWt.length)));if(Xt===ut&&w.options.insertBlankLineAfterEachItem&&ut!==0&&(F++,this.NYt(w,I,gt.zWt.length)),ot)return Mt=this.xYt(w,I,T,F-Mt-A,g,Mt,!0,xt,!0,Y,D),T||(Mt+=A),Mt}else{if(!vt(xt)&&(gt.Kbt(F,xt,Rt),this.OZt(gt,F,{path:dt,rowHeaderLevel:this.fYt(ut,Xt,Mt),valueFieldName:g[0]&&g[0].name}),I.oYt&&0<I.oYt.length&&I.YAt<w.rowDeep&&w.options.showDrill&&gt.qWt(F,xt,this.aYt(ot)),ot)){if(I.YAt<ut)for(P=I.lYt.split(At.Separator),0<=Z&&Z<=Xt&&(kt=nt[tt().Values]-1,P.splice(kt,null,g[0].name)),bt=0,k=P.length;bt<k;bt++)P[bt]&&gt.tZt(F,Ct[bt],Ct[bt]!==tt().Values?(0,f.FZt)(w.sharedMap,Ct[bt],P[bt]):P[bt],Ct.length-bt);return ie=!0,w.valuePositionInfo.positionIndex!==0&&(ie=!1),this.xYt(w,I,!0,F,g,Mt,ie,xt,!0,void 0,D)}this.MYt(w,I,F,g,D)}return Bt=this.gYt(w,I)||Mt,Rt=0,w.options.insertBlankLineAfterEachItem&&(Bt+=Rt=this.CYt(I,w.options.subTotalsPosition)),nt=U+Bt-Mt,st||Qt&&l||!ut&&g.length?(w.options.insertBlankLineAfterEachItem&&I.AYt&&!Qt&&nt--,ut===0&&Qt?(kt=g[0]&&g[0].name||"",gt.Kbt(nt,0,kt),Z===-1?(E={path:dt,rowHeaderLevel:this.fYt(ut,Xt,Mt)},this.OZt(gt,nt,E),this.ZZt(w,0,I,g,"")):this.ZZt(w,nt,I,g,"")):Z<=0?this.xYt(w,I,T,nt,g,void 0,!0,void 0,void 0,void 0,D):this.xYt(w,I,T,nt,g,void 0,void 0,void 0,void 0,void 0,D)):D===S.SubtotalsPosition.none&&w.options.insertBlankLineAfterEachItem&&0<Rt&&this.NYt(w,I,nt),Bt},Ft.CYt=function(w,I){return I===S.SubtotalsPosition.none?w.IYt:w.AYt},Ft.gYt=function(w,I){var U,g=(F=w.options).subTotalsPosition,F=F.grandTotalPosition,ot=g!==S.SubtotalsPosition.none?I.KZt+I.XZt+I.$Zt:I.KZt+I.$Zt;return I.zEt&&(U=g!==S.SubtotalsPosition.none,F=F!==S.GrandTotalPosition.none&&F!==S.GrandTotalPosition.row,U&&!F?ot-=w.rowValuePosition===-1?1:w.valueFieldsInfo.length:(F&&!U||F&&I.vYt===0&&w.rowFields.length!==0)&&(ot+=w.rowValuePosition===-1?1:w.valueFieldsInfo.length),w.rowFields.length===0)&&(ot=I.KZt+I.$Zt),g===S.SubtotalsPosition.none&&(ot+=I.Dwr),ot},Ft.xYt=function(w,I,U,g,F,ot,j,E,A,Y,L){var q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt=w.rowDeep,Mt=w.rowModel,st=w.rowFieldsMap,l=w.sharedMap,T=w.options,D=w.rowValuePosition,M=w.rowFieldsIndexes,s=I.YAt,y=I.nodeName,G=I.zEt,K=I.lYt,c=I.rYt,N=!1;if(G){if(w.options.grandTotalPosition===S.GrandTotalPosition.none||w.options.grandTotalPosition===S.GrandTotalPosition.row)return;N=!0}if(U&&s<xt||xt===0||N){if(-(q=1)!==D&&s<=D&&(q=F.length),J=G?0:st[I.rYt],(U=P=g)>=Mt.Sx)return;if(k=bt=void 0,xt===0?bt=F[0]&&F[0].name||"":(N=(0,f.FZt)(l,c,y),w.pt.collapse(I.rYt,N)?bt=N:G?1<F.length&&0<=D?(bt=tt().Total,k=!0):bt=tt().GrandTotal:bt=1<F.length&&0<D||F.length<2&&L===S.SubtotalsPosition.none?N:mt.I5(tt().Total,[N,""])),w.columnValuePosition!==-1){for(nt={path:K,grandTotalLevel:s,valueFieldName:F[0]&&F[0].name},G?nt.isGrandTotal=!0:nt.isSubtotal=!0,(0,At.ht)(E)||(nt.collapseIndex=E),Mt.Kbt(P,J,bt),Z=0,ut=(gt=I.lYt.split(At.Separator)).length;Z<ut-1;Z++)Mt.tZt(P,M[Z],M[Z]!==tt().Values?(0,f.FZt)(w.sharedMap,M[Z],gt[Z]):gt[Z],M.length-Z);this.OZt(Mt,P,nt),this.GZt(w,I,P,K)}else{if(nt=void 0,w.valueFieldsInfo.length===0){for(Mt.Kbt(P,J,bt),Z=0,ut=(gt=I.lYt.split(At.Separator)).length;Z<ut-1;Z++)Mt.tZt(P,M[Z],M[Z]!==tt().Values?(0,f.FZt)(w.sharedMap,M[Z],gt[Z]):gt[Z],M.length-Z);nt={path:K,grandTotalLevel:s},G?nt.isGrandTotal=!0:nt.isSubtotal=!0,(0,At.ht)(E)||(nt.collapseIndex=E),this.OZt(Mt,P,nt)}for(Rt=0,Ct=F;Rt<Ct.length;Rt++){for(Bt=(Xt=Ct[Rt]).cacheName,kt=Xt.subtotalType,ie=Xt.subtotalText,nt={path:K,grandTotalLevel:s,valueFieldName:Xt=Xt.name},G?nt.isGrandTotal=!0:nt.isSubtotal=!0,dt=Qt=void 0,A&&(nt.collapse=!0),j===void 0||1<q?(Qt=k?mt.I5(bt,[""," "+Xt]):bt+" "+Xt,dt=J):j?(Qt=bt,A||(dt=J)):(Qt=Xt,dt=w.valuePositionInfo.positionIndex),nt.valueFieldName=Xt,Y||Mt.Kbt(P,dt,Qt),gt=I.lYt.split(At.Separator),0<=D&&D<s&&(dt=st[tt().Values],gt.splice(dt,null,Qt)),Z=0,ut=gt.length;Z<ut-1;Z++)Mt.tZt(P,M[Z],M[Z]!==tt().Values?(0,f.FZt)(w.sharedMap,M[Z],gt[Z]):gt[Z],M.length-Z);(0,At.ht)(E)||(nt.collapseIndex=E),this.OZt(Mt,P,nt),this.GZt(w,I,P,K,Bt,kt,ie,Xt),P++,Y&&(P++,ot++)}}this.ZZt(w,U,I,F)}return G||!T.insertBlankLineAfterEachItem||Y||(this.NYt(w,I,Mt.zWt.length),vt(ot))||ot++,ot},Ft.NYt=function(w,I,U){var g=w.rowDeep,F=(w=w.rowModel,I.YAt);I=I.lYt,(F<=g||g===0)&&this.OZt(w,U,{path:I,isBlankRow:!0})},Ft.MYt=function(w,I,U,g,F){var ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct=w.rowDeep,Bt=w.rowModel,kt=w.options,ie=w.rowFieldsMap,Xt=w.rowValuePosition,Qt=w.rowFieldsIndexes,dt=I.oYt,xt=I.YAt,Mt=dt.length;if(Ct<=xt)for(ot=I.lYt.split(At.Separator),0<=Xt&&!vt(g)&&ot.splice(Xt,null,g[0].name),j=0,E=ot.length;j<E;j++)ot[j]&&Bt.tZt(U,Qt[j],Qt[j]!==tt().Values?(0,f.FZt)(w.sharedMap,Qt[j],ot[j]):ot[j],Qt.length-j);if((A=0)<Mt)for(Y=U,L=kt.fillDownLabels,P=J=q=void 0,bt=F===S.SubtotalsPosition.bottom?1:0,k=this.mYt(kt.showDrill),nt=0,gt=dt;nt<gt.length;nt++)if(Z=gt[nt],Ct<=xt)this.TYt(w,Z,Y,"",g);else{if(xt+1===Ct&&this.ZZt(w,Y,Z,g),ut=this.bYt(w,Z,Y,g),L)for(q=ie[Z.rYt],P=ut+Y-bt,J=Bt.Sl(Y,q),Rt=Y+1;Rt<P;Rt++)Bt.zWt[Rt]&&!Bt.zWt[Rt].isBlankRow&&(Bt.Kbt(Rt,q,J),Bt.qWt(Rt,q,k));Y+=ut,A+=ut}return Ct<=xt?1:A},Ft.TYt=function(w,I,U,g,F){var ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt=w.columnValuePosition,Z=w.contentModel,ut=w.colMap,Rt=I.oYt,Ct=I.nodeName,Bt=I.HZt;if(g!==""&&(g+=At.Separator),ot=gt!==-1,Rt.length===0)for(j=0,E=F;j<E.length;j++)A=(L=E[j]).name,Y=L.cacheName,L=L.subtotalText,q=g,w.columnDeep!==0&&(q+=Ct),ot&&(q!==""?q+=At.Separator+A:q=A),q=ut[q],vt(q)||(J=!1,J=!!((P=w.subtotalCollection.CZt[A])&&(P.needBuildRunningTotalOrRankPath&&(I.UZt[A].indexInfo.minorPath=I.SYt),P.showDataAs===8||P.showDataAs===9)&&0<(P.showDataAsIndex&I.QZt))||J)||Z.Kbt(U,q,X.Common.st.E8((0,at.hZt)(w.subtotalCollection,Bt,Y,L,I.UZt,I.YAt,A),B.Functions.CALC_PRECISION||14));else for(bt=0,k=Rt;bt<k.length;bt++)nt=k[bt],this.TYt(w,nt,U,g+Ct,F);I.kYt||this.ZZt(w,U,I,F,g+Ct)},Ft.OYt=function(w){var I,U,g,F,ot,j,E,A,Y,L=w.rowModel,q=w.rowFields,J=w.rowValuePosition,P=w.valueFieldsInfo,bt=w.colFields;for((Y=q.length)===0&&P.length===1&&0<bt.length&&(Y=1),I=[],U=0,g=q;U<g.length;U++)F=g[U],I.push(F.Zc);for(J!==-1&&(Y+=1,I.splice(J,0,tt().Values)),L.setColCount(Y),ot={},j=[],E=0,A=I.length;E<A;E++)ot[I[E]]=E,j.push(I[E]);w.rowFieldsMap=ot,w.rowFieldsIndexes=j},Ft._type=S.PivotTableLayoutType.outline,o.PivotTableTabularLayout=Ft},"./dist/plugins/pivot/pivot-table/pivot-table-spread.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt;function ie(c){return c?c.defaultSubtotal==="0"?H.SubtotalsPosition.none:c.subtotalTop==="0"?H.SubtotalsPosition.top:H.SubtotalsPosition.bottom:H.SubtotalsPosition.bottom}function Xt(c){this.PYt=[],this.Mf=c,this.FYt={},this._Yt={}}function Qt(c,N,V){var O,pt,wt,et,ht=N.LYt,St=N.eZt;if(!Bt(ht))for(O=0;O<ht.rowCount;O++)for(pt=ht.row+O,Bt(c[pt])&&(c[pt]={}),wt=0;wt<ht.colCount;wt++)et=ht.col+wt,Bt(c[pt][et])&&(c[pt][et]={}),V(c[pt][et],(0,_.emr)(N,pt,et));if(!Bt(St))for(O=0;O<St.rowCount;O++)for(pt=St.row+O,Bt(c[pt])&&(c[pt]={}),wt=0;wt<St.colCount;wt++)et=St.col+wt,Bt(c[pt][et])&&(c[pt][et]={}),V(c[pt][et],(0,_.emr)(N,pt,et))}function dt(c,N,V){var O=(O=c.row)===void 0?-1:O,pt=(pt=c.col)===void 0?-1:pt,wt=(wt=c.rowCount)===void 0?V.getRowCount():wt;return V=(c=c.colCount)===void 0?V.getColumnCount():c,c=new Yt.Range(O,pt,wt,V),pt=(O=N.getRange()).page,V=wt=O.content,pt&&(V=wt.union(pt)),c.containsRange(V)}function xt(c,N,V){var O=(O=c.row)===void 0?-1:O,pt=(pt=c.col)===void 0?-1:pt,wt=(wt=c.rowCount)===void 0?V.getRowCount():wt;return V=(c=c.colCount)===void 0?V.getColumnCount():c,N=(c=N.getRange()).page,c=c.content,N&&N.intersect(O,pt,wt,V)||c.intersect(O,pt,wt,V)}function Mt(c,N,V,O){var pt,wt,et;return O==="deletingRows"||O==="deletingColumns"||O==="clear"?!xt(c,N,V)||dt(c,N,V):O==="addingRows"?(pt=(wt=N.getRange()).page,et=wt=wt.content,pt&&(et=wt.union(pt)),!xt(c,N,V)||c.row<=et.row):O==="addingColumns"&&(pt=(O=N.getRange()).page,et=wt=O.content,pt&&(et=wt.union(pt)),!xt(c,N,V)||c.col<=et.col)}function st(c,N){return c&&N&&c.color===N.color&&c.type===N.type||!c&&!N}function l(c,N,V,O){for(var pt,wt,et=N.getDefaultStyle(),ht=O.startRow,St=O.endRow;ht<St;ht++)for(pt=O.startCol,wt=O.endCol;pt<wt;pt++)T(N,ht,pt,et,V,c)}function T(c,N,V,O,pt,wt){var et,ht,St;if(c.Ut&&(N=(c=c.Ut.sheetModels[3].J_(N,V))&&c.style)&&wt&&typeof N=="string"){if(pt[N])c.style=pt[N];else if(et=wt.i3(N)){for(ht in et=et.clone(!0),Ct)!Ct.hasOwnProperty(ht)||Bt(et[ht])||((St=Ct[ht])===0?et[ht]===O[ht]&&(et[ht]=J):St===1?st(et[ht],O[ht])&&(et[ht]=J):St===2&&Yt.mt.rfe(et[ht],O[ht])&&(et[ht]=J));V=ut+Rt+N,Rt++,et.name=V,wt.$p(et),c.style=V,pt[N]=V}}}function D(c,N,V){for(var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It=c.fMt,t=c.sheets,r={},u=0;u<t.length;u++)for(pt=(O=t[u]).pivotTables.all(),wt=0;wt<pt.length;wt++)if((et=pt[wt])&&(ht=et.dh.L,!N||N===ht)&&(Bt(r[ht])&&(r[ht]={}),St=et.dh.Z))for($ in St)St.hasOwnProperty($)&&St[$]!==3&&(r[ht][$]=!0);if(n={},N)n[N]=1;else for(a=0,i=t;a<i.length;a++)if((O=i[a]).pivotTables&&O.pivotTables.PYt)for(h=0,b=O.pivotTables.PYt;h<b.length;h++)n[(et=b[h]).dh.L]=1;return Q=It&&It.toJson(r,Object.keys(n),V),it=M(Q,c),Object.keys(it).forEach(function(d){var m=it[d],R=Q[d];m&&R&&Object.keys(m).forEach(function(z){R[z]=m[z]})}),Q}function M(c,N){var V,O,pt,wt,et,ht,St,$,n={};for(V in c)if(c.hasOwnProperty(V)&&(n[V]={},typeof(O=c[V].EYt)=="string"&&0<O.indexOf("!")&&((pt=O.split("!"))[0]&&(pt[0][0]==="="&&(pt[0]=pt[0].slice(1)),pt[0][0]==="'")&&pt[0][pt[0].length-1]==="'"&&(pt[0]=pt[0].slice(1,pt[0].length-1)),O=(0,Yt.qTe)(pt[0])+"!"+pt[1]),!Bt(O))&&typeof O=="string"){wt=void 0;try{if((wt=vt.formulaToExpression((0,Yt.jf)(N),O,0,0,!0)).abt){et=wt.abt,n[V].sourceType="worksheet",n[V].sourceName=et.name();continue}}catch{}ht=void 0;try{if($=St=void 0,(ht=vt.formulaToRanges((0,Yt.jf)(N),O,0,0))[0]&&ht[0].ranges){if(n[V].sourceType="worksheet",wt&&wt.type===8&&wt.value){n[V].sourceName=wt.value;continue}St=ht[0].sheetName,$=ht[0].ranges[0],n[V].sheet=St,n[V].ref=vt.rangeToFormula($,0,0,15);continue}}catch{}0<O.indexOf("!")?(pt=O.split("!"),n[V].sourceType="worksheet",n[V].sheet=pt[0],n[V].ref=pt[1]):(n[V].sourceType="worksheet",n[V].sourceName=O)}return n}function s(c,N){var V;N.constructor.name==="Object"&&(V=vt.formulaToRange(c,N.ref),(c=c.pivotTables.add(N.name,N.dataRef,V.row,V.col))&&c.fromJson(N),N=c)}function y(c,N){for(var V,O,pt,wt,et,ht,St,$=N.colCount,n=0;n<$&&(V=c.fDi(n),Bt(V)||V.isGroup);n++)N.col++,N.colCount--;for(O=[[]],wt=0,et=N.colCount;wt<et;wt++)ht=void 0,(pt=c.fDi(N.col+wt))&&(St=pt.caption,ht=pt.value,typeof St=="string"&&St!==""?ht=St:Array.isArray(St)&&(ht=St[St.length-1])),O[0][wt]=ht;return O}function G(c,N){var V,O,pt,wt;return c=(0,Yt.jf)(c),(wt=vt.formulaToExpression(c,N,0,0)).abt?(O=(pt=wt.abt).range&&pt.range()||pt.dataRange&&pt.dataRange(),V=pt.Mf.name(),pt="="+(N=pt.name())):(wt=vt.formulaToRanges(c,N,0,0,!1,J,!0))[0]&&wt[0].ranges&&(V=wt[0].sheetName,O=wt[0].ranges[0],c=vt.rangeToFormula(O,0,0,15,!1),N="="+(0,Yt.qTe)(V)+"!"+c),{dataRefer:N,sheetName:V,tableName:pt,range:O}}function K(c,N){var V,O,pt,wt,et=N.styles,ht=N.conditionalFormats;if(et&&0<et.length)for(V=0;V<et.length;V++)(O=et[V].style)&&typeof O=="object"&&((pt=new Yt.Style).fromJSON(O,J,J),et[V].style=pt),Bt(O)&&(et[V].style=null);if(ht&&0<ht.length)for(V=0;V<ht.length;V++)wt=ht[V],wt=c.conditionalFormats.pJ(wt.conditionalRule,c,!1),ht[V].conditionalRule=wt}Object.defineProperty(o,"__esModule",{value:!0}),o.rFr=o.setDataTableForPivotExport=o.PivotTableManager=void 0,Yt=ft("Core"),At=ft("@spreadjs/js-sheets-common"),S=ft("Pivot"),at=ft("./dist/plugins/pivot/pivot-core/pivot-fields-model.js"),X=ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),H=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),f=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-empty-layout.js"),B=ft("./dist/plugins/pivot/pivot.ns.js"),vt=ft("SheetsCalc"),mt=ft("./dist/plugins/pivot/pivot-panel/pivot-panel.js"),tt=ft("ConditionalFormatting"),_=ft("./dist/plugins/pivot/pivot-util.js"),v=ft("./dist/plugins/pivot/sheet-range-to-pivot-area.js"),Ft=ft("Tables"),w=ft("./dist/plugins/pivot/pivot-table/pivot-table-theme.js"),I=ft("./dist/plugins/pivot/pivot-table/customPivotTableTheme.js"),U=At.Common.kh,g=Yt.mt.xr,F=Yt.mt.go,ot=Yt.Util.Sr,j=Yt.Util.wr,E=Yt.NodeHelper.ur,A=Yt.NodeHelper.sr,Y=Yt.Util.po,L=null,q=At.Common.lt.Nh,J=void 0,ft=new At.Common.ResourceManager(B.SR,"PivotTables"),P=ft.getResource.bind(ft),bt="pivot",k=Yt.GC$,nt=k.isEmptyObject,gt=Yt.UsedRangeUtil.hh,Z=Yt.UsedRangeUtil.vh,ut="__builtInPivotTableStyle",Ct={backColor:2,foreColor:Rt=0,borderBottom:1,borderLeft:1,borderRight:1,borderTop:1,font:0,textDecoration:0},Bt=At.Common.lt.ht,(0,Yt.qDr)(S.PivotCache),Xt.prototype.all=function(){return this.PYt.concat([])},Xt.prototype.add=function(c,N,V,O,pt,wt,et){var ht,St,$,n={};return($=(St=this.Mf).parent)&&!$.BYt(c)?((0,X.RYt)(new Yt.Range(0,0,0,0),new Yt.Range(V,O,18,3),St,c,!1,null,null,H.overlapCheck.value),typeof N=="string"&&(N=G($,N).dataRefer),(ht=$.GYt(N))||(ht=$.VYt(c,N,St),n.pivotCacheName=ht.Zc),N=$.UYt(ht.getName(),c),$=new X.PivotTable(c,St,V,O,pt,wt,et,N),Bt(n.pivotCache)||(n.fieldsModelName=N.getName()),this._Qt($,void 0,n),St.hP()&&St.repaint(),$):null},Xt.prototype._Qt=function(c,N,V){c&&(this.DT(c,"add",void 0,N,V),this.oFr(c),this.Mf.$Dr({type:"addPivotTable",pivotTable:c}))},Xt.prototype.oFr=function(c){c&&(this.PYt.push(c),this.Mf.Ut.L5e(),c.dh.addPivotView(c),this.Mf.parent&&this.Mf.parent.QYt(c.name(),!0),c.Oy()||c.dh.q3())},Xt.prototype.getUsedRange=function(){var c,N,V,O,pt={};if(O=this.all())for(c=void 0,N=0,V=O;N<V.length;N++)c=V[N].getRange(),Z(pt,gt(c.page)),Z(pt,gt(c.content));return pt},Xt.prototype.DT=function(c,N,V,O,pt){var wt,et;(et=this.Mf)&&(et=et.Ut).G8&&(N==="add"?wt={type:N,value:c.Zc,isMove:O,pivotType:0}:N==="remove"&&(wt={type:N,value:c,index:V,isMove:O,pivotType:0,pivotCacheInfo:pt}),et.WYt(c,wt))},Xt.prototype.AP=function(c){var N,V,O;c&&(O=(c.type?(N=c.type,V=c.value,c):(N=c.value.type,V=c.value.value,c.value)).isMove,N==="add"?this.zYt(V,O):N==="remove"&&this.ZYt(c.value))},Xt.prototype.zYt=function(c,N){this.TOt(c,N)},Xt.prototype.ZYt=function(c){var N,V=this.PYt,O=c.value,pt=c.index,wt=(N=this.Mf).parent;this.PYt=V.slice(0,pt).concat(O).concat(V.slice(pt)),(V=N.Ut)!=null&&V.L5e(),pt=O.dh,(0,S.o)(pt.z,function(et){et instanceof mt.PivotPanel&&et.attach(O)}),pt.q3(),wt&&(wt.QYt(O.Zc,!1),wt.EQt&&wt.EQt.undoRemovingPivotTable(O),c.pivotCacheInfo)&&wt.YYt(c.pivotCacheInfo,!0),N.repaint()},Xt.prototype.adrs=function(){var c;(c=this).qp={},c.PYt=[],(c=this.Mf&&this.Mf.parent)&&c.fMt&&c.fMt.reset(),this.Mf&&this.Mf.repaint()},Xt.prototype.HYt=function(c,N,V,O){for(var pt,wt,et=this.all(),ht=0;ht<et.length;ht++)if(pt=(wt=et[ht].getRange()).page,wt=wt.content,pt&&pt.intersect(c,N,V,O)||wt.intersect(c,N,V,O))return this.Mf.jT(10,P().PivotTableErrorMessage_MakeChange),!1;return!0},Xt.prototype.remove=function(c){0<this.PYt.length&&(this.TOt(c,!1),this.Mf.repaint())},Xt.prototype.TOt=function(c,N){for(var V,O,pt,wt,et=(wt=this.PYt).length,ht=this.Mf&&this.Mf.parent,St=et-1;0<=St;St--)if(wt[St].Zc===c){V=wt[St].dh,O=this.PYt.splice(St,1)[0],pt=void 0,N||(pt=ht&&ht.JYt(V.getName())),this.DT(O,"remove",St,N,pt),N||(0,S.o)(V.z,function($){$ instanceof mt.PivotPanel&&$.detach()}),ht&&ht.QYt(c,!1),N||ht&&ht.EQt&&ht.EQt.undoAddingPivotTable(O),this.PYt.length<1&&this.Mf.Ut.L5e(),this.Mf.$Dr({type:"removePivotTable",pivotTable:O,isMove:N});break}this.Mf.repaint()},Xt.prototype.get=function(c){for(var N,V=0,O=this.PYt;V<O.length;V++)if((N=O[V]).Zc===c)return N;return null},Xt.prototype.eG=function(){for(var c,N=0,V=this.PYt;N<V.length;N++)c=V[N],this.remove(c.name());this.PYt=[]},Xt.prototype.findPivotTable=function(c,N){var V,O,pt,wt,et,ht,St,$,n;if(this.FYt[c]&&this._Yt[N]){for(V=0,O=this.PYt;V<O.length;V++){for(wt=(St=(pt=O[V]).getRange().content).row,et=St.col,ht=St.rowCount,St=St.colCount,n=($=0,_.lcr)(pt);$<n.length;$++)if(n[$].contains(c,N))return pt;if(wt<=c&&c<ht+wt&&et<=N&&N<et+St)return pt}return L}},Xt.prototype.aFr=function(c){for(var N,V=0,O=this.PYt;V<O.length;V++)if((N=O[V]).jKe()===c)return N;return L},Xt.prototype.qYt=function(){var c=this;c.FYt={},c._Yt={},(0,S.o)(c.PYt,function(N){N.qYt(c.FYt,c._Yt)})},Xt.prototype.KYt=function(c,N,V){return!!this.ckr(N)&&(V.jT(11,{message:P().PivotTableErrorMessage_Overlap,cancel:!1,force:!0}),!0)},Xt.prototype.ckr=function(c){var N,V,O,pt=this;if(!Bt(c)&&pt.PYt.length!==0){for(N=0;N<pt.PYt.length;N++)if(V=(O=pt.PYt[N].getRange()).content,(O=O.page)&&O.intersect(c.row,c.col,c.rowCount,c.colCount)||V.intersect(c.row,c.col,c.rowCount,c.colCount))return!0}return!1},Xt.prototype.KB=function(c,N){var V=this;return c=(0,_.$Yt)(this.Mf,c),N&&(0,S.o)(c,function(O){for(var pt,wt=V.PYt,et=0;et<wt.length;et++)(pt=wt[et]).Zc===O.name&&(O.pt=pt,V.TOt(pt.Zc,!0))}),c},Xt.prototype.JB=function(c,N,V,O,pt,wt,et,ht,St,$){function n(a,i){return(a=a.getRange().page)&&(i+=a.rowCount+1),i}(0,S.o)(c,function(a){var i,h,b,Q=N.pivotTables.get(a.name),it=wt+a.startPoint[0],It=et+a.startPoint[1];if($){if(it=n(b=a.pt,it),b.suspendLayout(),b.position(it,It,pt.name()),pt.name()===N.name()){for(i=a.pt.dh.z,h=0;h<i.length;h++)if(i[h].Zc===a.pt.Zc){i.splice(h,1);break}pt.pivotTables._Qt(a.pt,!0)}b.resumeLayout()}else b=Q.serialize(),it=n(Q,it),(Q=Q.clone(Q.name(),pt,it,It)).tJt(b,7167),pt.pivotTables._Qt(Q)})},Xt.prototype.getRangePivotAreas=function(c){for(var N=this,V=(0,_.iJt)(N.Mf,c),O={},pt=function(ht){var St=N.get(ht),$=(ht=V[ht],[]);(0,S.o)(ht,function(n){$=$.concat.apply($,(0,v.rangeToAreas)(St,n))}),O[St.Zc]=$},wt=0,et=Object.keys(V);wt<et.length;wt++)pt(et[wt]);return O},Xt.prototype.jT=function(c,N){var V,O;(O=(V=this).Mf)&&(c?(V.nJt&&O.ki(Yt.Events.InvalidOperation,{sheet:O,sheetName:O.name(),invalidType:V.nJt.type,message:V.nJt.args},!0),V.nJt=L):!N||!N.args.force&&V.nJt||(V.nJt=N))},Xt.prototype.eJt=function(c,N,V){var O;return typeof V=="number"&&!!((O=this.findPivotTable(c,N))&&O.options.enableDataValueEditing&&O.rJt(c,N))&&(c=O.getNodeInfo(c,N),O.getNodeValue(c)!==V)&&(O.oJt(c,V,!0),!0)},kt=Xt,o.PivotTableManager=kt,o.setDataTableForPivotExport=Qt,k.extend(Yt.Worksheet.prototype,{ptwm:function(c,N,V){return V?[P().wmk1,0]:c===-1?V?[P().wmk1,0]:[P().wmk2,1]:void 0},aJt:function(c,N){var V,O,pt,wt,et,ht;return(ht=(et=this).pivotTables.findPivotTable(c,N))&&((pt=et.getParent())&&pt.options.enableAccessibility&&(wt=ht.sJt(c,N,!0))&&setTimeout(function(){pt.n2(wt)},0),V=ht.getValue(c,N),O=!0),{value:V,inPivot:O}},uJt:function(c,N){var V,O,pt,wt,et,ht,St,$,n=N.ctx,a=N.clipRect,i=(N=c.position()).row,h=N.col,b=0,Q=0,it=0,It=0,t=(N=this.getActiveColumnIndex(),this.getActiveRowIndex()),r=new Yt.Range(i,h,18,3),u=c.getName(),d=P().EmptyPivotTable_PromptMessage1;for(h<=N&&N<h+3&&i<=t&&t<i+18&&!this.isActualProtected()&&(d=P().EmptyPivotTable_PromptMessage2),V=0;V<18;V++)Q+=this.Gt(i+V);for(O=0;O<3;O++)b+=this.nn(h+O);for(pt=0;pt<=2;pt++)for(wt=0;wt<=2;wt++)et=(St=this.getRangeRect(pt,wt,r)).x,ht=St.y,$=St.width,St=St.height,$=new Yt.Rect(et,ht,$,St),(a=this.Fi().c9(pt,wt))&&a.width!==0&&a.height!==0&&a.intersectRect($)&&(it=et===0||wt!==0&&a.x>et?$.x-(b-$.width):$.x,It=ht===0||pt!==0&&a.y>ht?$.y-(Q-$.height):$.y,(0,f.jYt)(n,u,it,It,Q,b,a,d))},fcr:function(c,N){var V,O,pt,wt,et,ht,St,$,n;if(n=this.pivotTables.findPivotTable(c,N)){if(et=wt=pt=O=void 0,(V=n.getRange().content)&&V.contains(c,N))O=c===V.row,pt=c===V.row+V.rowCount-1,wt=N===V.col,et=N===V.col+V.colCount-1;else for(St=(ht=0,_.lcr)(n);ht<St.length;ht++)($=St[ht]).contains(c,N)&&(O=c===$.row,pt=c===$.row+$.rowCount-1,wt=N===$.col,et=N===$.col+$.colCount-1);return{top:O,right:et,bottom:pt,left:wt}}return{top:!0,right:!0,bottom:!0,left:!0}}}),Yt.Worksheet.ch("pivotTable",{init:function(){var c,N,V,O,pt=(O=this).pivotTables,wt=O.parent;if(!Bt(pt)&&!Bt(wt)&&(O=pt.all())&&0<O.length)for(c=0,N=O;c<N.length;c++)V=N[c],wt.QYt(V.name(),!1);this.pivotTables=new kt(this)},getUsedRange:function(c){var N;c.type&Yt.UsedRangeType.pivottable&&(N=this.pivotTables.getUsedRange(),Z(c.range,N))},dispose:function(c){c.clearCache!==!1&&(this.pivotTables&&this.pivotTables.eG(),this.pivotTables=null)},beforePaintAdornment:function(c){for(var N,V=0,O=this.pivotTables.all();V<O.length;V++)(N=O[V]).Oy()&&this.uJt(N,c)},onLayoutChanged:function(c){var N,V,O,pt,wt,et,ht,St,$,n,a,i,h,b;if(Bt(c.sheetArea)||c.sheetArea===3){if(N=this,V=c.changeType,O=c.row,pt=c.col,wt=c.rowCount,et=c.colCount,ht=new Yt.Range(O,pt,wt,et),St=N.pivotTables.all(),V==="deletingRows"||V==="deletingColumns")for($=0;$<St.length;$++){if(!Mt(ht,n=St[$],N,V)){c.canDelete=!1,N.jT(10,P().PivotTableErrorMessage_MakeChange);break}dt(ht,n,N)?N.pivotTables.remove(n.name()):(i=(a=n.position()).row,h=a.col,V==="deletingRows"?ht.row<i&&n.position(i-ht.rowCount,h):ht.col<h&&n.position(i,h-ht.colCount))}else if(V==="addingRows"||V==="addingColumns")for($=0;$<St.length;$++){if(!Mt(ht,n=St[$],this,V)){N.jT(10,P().PivotTableErrorMessage_MakeChange),c.canAdd=!1;break}i=(b=n.position()).row,h=b.col,V==="addingRows"?ht.row<=i&&n.position(i+ht.rowCount,h):ht.col<=h&&n.position(i,h+ht.colCount)}else if(V==="clear"&&!c.ignorePivotTable)for($=0;$<St.length;$++){if(!Mt(ht,n=St[$],N,V)){c.canClear=!1,N.ki(Yt.Events.InvalidOperation,{sheet:this,sheetName:this.name(),invalidType:10,message:P().PivotTableErrorMessage_MakeChange},N.QI);break}dt(ht,n,N)&&N.pivotTables.remove(n.name())}}},allowStartEdit:function(c){var N,V,O,pt,wt,et=c.row,ht=c.col;if(this.pivotTables){for(N=this.pivotTables.all(),V=0;V<N.length;V++)if(pt=(wt=(O=N[V]).getRange()).page,wt=wt.content,(pt&&pt.contains(et,ht)||wt&&wt.contains(et,ht))&&(!O.options.enableDataValueEditing||!O.rJt(et,ht)))return void(c.isAllow=!1)}},fromJson:function(c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It=(it=this).parent;if(!(Bt(It)||V&&V.ignoreStyle)){if(function(t){return(t=t.pivotTables)&&0<Object.keys(t).length&&!Array.isArray(t)}(c))(function(t,r){var u,d,m,R,z,ct,Tt,Ot,Pt=t.pivotTables,Jt=(Ot=t.parent).fMt,$t=r.pivotTables;if(Jt&&$t)for(d in u={},Rt=0,$t)$t.hasOwnProperty(d)&&(Tt=(m=$t[d]).serverInfo,!(R=Jt.getPivotCacheByCacheId(+Tt.cacheId))||nt(R.Pq)||(R=new at.PivotFieldsModel(Tt.name,R.Zc,Jt,Ot.Qy),Ot.BQt[Tt.name]=R,Tt.pageRange&&(z=Tt.pageRange,z=new Yt.Range(z.row,z.col,z.rowCount,z.colCount),t.clear(z.row,z.col,z.rowCount,z.colCount,3,Yt.StorageType.data),l(Ot,t,u,{startRow:z.row,startCol:z.col,endRow:z.row+z.rowCount,endCol:z.col+z.colCount})),z=Tt.contentRange,ct=new Yt.Range(z.row,z.col,z.rowCount,z.colCount),t.clear(ct.row,ct.col,ct.rowCount,ct.colCount,3,Yt.StorageType.data),l(Ot,t,u,{startRow:ct.row,startCol:ct.col,endRow:ct.row+ct.rowCount,endCol:ct.col+ct.colCount}),K(t,m),(ct=new X.PivotTable(Tt.name,t,z.row,z.col,null,null,null,R)).suspendLayout(),ct.tJt(m,40959),Bt(m.views)||ct.views.fromJson(m.views),Pt._Qt(ct),ct.Xst--,ct.iM(!1,!0),Tt=ct.eZt,Bt(Tt))||(t.getColumnCount()<Tt.col+Tt.colCount&&t.setColumnCount(Tt.col+Tt.colCount),t.getRowCount()<Tt.row+Tt.rowCount&&t.setRowCount(Tt.row+Tt.rowCount)))})(it,c);else if(O=It.fMt,pt=c.pivotTables,O&&pt&&0<pt.length)for(wt={},et=Rt=0;et<pt.length;et++)ht=pt[et],!(St=O.getPivotCacheByCacheId(+ht.cacheId))||nt(St.Pq)||(St=new at.PivotFieldsModel(ht.name,ht.cacheId,O,this.parent.Qy),It.BQt[ht.name]=St,a=vt.formulaToRanges(it,ht.ref,0,0,!0)[0].ranges,Q=ht.pageFields,$=ht.rowPageCount,n=ht.colPageCount,Q&&0<Q.length&&1<a[0].row&&(Q=new Yt.Range(a[0].row-$-1,a[0].col,$,3*n-1),it.clear(Q.row,Q.col,Q.rowCount,Q.colCount,3,Yt.StorageType.data),l(It,it,wt,{startRow:Q.row,startCol:Q.col,endRow:Q.row+Q.rowCount,endCol:Q.col+Q.colCount})),it.clear(a[0].row,a[0].col,a[0].rowCount,a[0].colCount,3,Yt.StorageType.data),l(It,it,wt,{startRow:a[0].row,startCol:a[0].col,endRow:a[0].row+a[0].rowCount,endCol:a[0].col+a[0].colCount}),($=new X.PivotTable(ht.name,it,a[0].row,a[0].col,null,null,null,St)).suspendLayout(),n=ht.outline,Q=ht.compact,a=ht.outlineData,i=ht.compactData,ht.fields&&0<ht.fields.length&&($.options.insertBlankLineAfterEachItem=!!ht.insertBlankRowDefault,$.options.subTotalsPosition=ht.enabledSubtotalsDefault===!1?H.SubtotalsPosition.none:ht.subtotalsOnTopDefault===!1?H.SubtotalsPosition.bottom:H.SubtotalsPosition.top,St.Dpi=$.options.subTotalsPosition,h=(b=ht.fields[0]).outline,b=b.compact,n===!0&&a===!0&&Q===!1&&i===!1&&b===!1?$.layoutType(H.PivotTableLayoutType.outline):h===!1?$.layoutType(H.PivotTableLayoutType.tabular):n===!0&&a===!0&&$.layoutType(H.PivotTableLayoutType.compact)),St.fromJson(ht,$),$.fromJson(ht,c),it.pivotTables._Qt($),$.Xst--,$.iM(!1,!0),Q=$.eZt,Bt(Q))||(it.getColumnCount()<Q.col+Q.colCount&&it.setColumnCount(Q.col+Q.colCount),it.getRowCount()<Q.row+Q.rowCount&&it.setRowCount(Q.row+Q.rowCount))}},toJson:function(c,N){var V,O,pt,wt,et;if((et=this.pivotTables.all())&&0<et.length)if(Bt(c.data.dataTable)&&(c.data.dataTable={}),V=c.data.dataTable,N&&N.ignoreStyle)for(O=0;O<et.length;O++)(pt=et[O]).toJson(c,N);else for(wt=c.pivotTables=[],O=0;O<et.length;O++)pt=et[O],wt.push(pt.toJson(c,N)),Qt(V,pt,function(ht,St){ht.value=St})},setName:function(c){var N,V,O,pt,wt=(pt=(pt=this.getParent())&&pt.fMt)&&pt.cut;if(!Bt(wt))for(N in wt)wt.hasOwnProperty(N)&&(V=wt[N],!Bt(V.sheet))&&c&&V.sheet===c.oldName&&(V.sheet=c.newName,Bt(V.sourceName))&&typeof V.EYt=="string"&&(O=V.EYt.split("!")[1],V.EYt="=".concat((0,Yt.qTe)(c.newName),"!").concat(O))},lastNonNullRowAndCol:function(){var c,N,V,O,pt,wt=0,et=0;if(pt=this.pivotTables.all())for(V=0,O=pt;V<O.length;V++)N=O[V].getRange(),c=Math.max(N.page?N.page.row+N.page.rowCount:-1,N.content.row+N.content.rowCount)-1,N=Math.max(N.page?N.page.col+N.page.colCount:-1,N.content.row+N.content.colCount)-1,wt=Math.max(wt,c),et=Math.max(et,N);return{lastNonNullRow:wt,lastNonNullCol:et}},yh:function(c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h=(i=(a=this).parent)&&i.v2&&i.v2.sheetsState,b=i&&i.v2&&i.v2.refSheetsState;if(!(V&&V.includeStyles===!1&&(O=!1,!h||(Object.keys(h).forEach(function(Q){h[Q]!==2&&h[Q]!==1||(O=!0)}),!O||i.getActiveSheet()===a)))&&i&&(pt=i.fMt,wt=a,ht=(et=c).rels&&et.rels.c_,!(h&&h[wt.name()]===2||b&&b[wt.name()]===2)))for(St={},$=function(Q){var it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt;if((Pt=(Q=ht[Q]).Type)===Yt.RelationshipConstants.oc&&(Pt=Q.Target.split("/").pop().slice(0,-4),Q=N.pivotTables)&&(Q=Q[Pt],pt)){if(Pt=pt.getPivotCacheByCacheId(+Q.cacheId),i.BQt[Q.name]&&(Q.name=(0,_.fJt)(Q.name,i.BQt)),!Pt||nt(Pt.Pq)||i.BQt[Q.name])return"continue";if(Pt=new at.PivotFieldsModel(Q.name,Q.cacheId,pt,a.parent.Qy),i.BQt[Q.name]=Pt,Ot=g(Q,"location"),r=vt.formulaToRanges(wt,Ot.ref,0,0,!0)[0].ranges,t=g(Q,"pageFields"),It=+Ot.rowPageCount,Ot=+Ot.colPageCount,t&&1<r[0].row&&(t=new Yt.Range(r[0].row-It-1,r[0].col,It,3*Ot-1),wt.clear(t.row,t.col,t.rowCount,t.colCount,3,Yt.StorageType.data),l(i,a,St,{startRow:t.row,startCol:t.col,endRow:t.row+t.rowCount,endCol:t.col+t.colCount})),wt.clear(r[0].row,r[0].col,r[0].rowCount,r[0].colCount,3,Yt.StorageType.data),l(i,a,St,{startRow:r[0].row,startCol:r[0].col,endRow:r[0].row+r[0].rowCount,endCol:r[0].col+r[0].colCount}),(it=new X.PivotTable(Q.name,wt,r[0].row,r[0].col,null,null,null,Pt)).suspendLayout(),It=E(Q.outline),Ot=E(Q.compact),t=E(Q.outlineData),r=E(Q.compactData),u=(ct=g(Q,"pivotFields"))&&ct.c_){for(d=u[0],m=ie(d),R=0,z=u.length;R<z;R++)if(ie(u[R])!==m){m=J;break}(ct=g(Q,"extLst"))&&(ct=ct.c_)&&ct.forEach(function(Jt){(Jt=g(Jt,"pivotTableDefinition16"))&&(m!==J?it.options.subTotalsPosition=m:Bt(Jt.EnabledSubtotalsDefault)||E(Jt.EnabledSubtotalsDefault)!==!1?Bt(Jt.SubtotalsOnTopDefault)||E(Jt.SubtotalsOnTopDefault)!==!1?it.options.subTotalsPosition=H.SubtotalsPosition.top:it.options.subTotalsPosition=H.SubtotalsPosition.bottom:it.options.subTotalsPosition=H.SubtotalsPosition.none,Bt(Jt.InsertBlankRowDefault)?it.options.insertBlankLineAfterEachItem=E(d.insertBlankRow):it.options.insertBlankLineAfterEachItem=E(Jt.InsertBlankRowDefault))}),Pt.Dpi=it.options.subTotalsPosition,ct=E(d.outline),Tt=E(d.compact),It===!0&&t===!0&&Ot===!1&&r===!1&&Tt===!1?it.layoutType(H.PivotTableLayoutType.outline):ct===!1?it.layoutType(H.PivotTableLayoutType.tabular):It===!0&&t===!0&&it.layoutType(H.PivotTableLayoutType.compact)}Pt.yh(Q,it,N),it.yh(Q,N,et),wt.pivotTables._Qt(it),it.Xst--,it.iM(!1,!0),Ot=it.eZt,Bt(Ot)||(wt.getColumnCount()<Ot.col+Ot.colCount&&wt.setColumnCount(Ot.col+Ot.colCount),wt.getRowCount()<Ot.row+Ot.rowCount&&wt.setRowCount(Ot.row+Ot.rowCount))}},n=Rt=0;n<ht.length;n++)$(n)},wh:function(c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it;if((it=this.pivotTables.all())&&0<it.length)if(O=g(c,"sheetData"),Bt(O)&&(O={n_:"sheetData"}),c.rels||(c.rels={}),pt=N.sharedStrings,wt=c.rels,V&&V.includeStyles===!1)for(et=0;et<it.length;et++)St=(i=(ht=it[et]).rZt.HWt)[0],$=i[1],n=i[2],a=i[3],i=i[4],h=ht.LYt,b=ht.getRange().content,(0,X.synchronizeDataTable)(h.row+St.DQ,h.col+St.jN,O,St.dataTable,function(It,t){(0,X.setDataForSJSPivotTable)(It,t,pt)}),(0,X.synchronizeDataTable)(b.row+$.DQ,b.col+$.jN,O,$.dataTable,function(It,t){(0,X.setDataForSJSPivotTable)(It,t,pt)}),(0,X.synchronizeDataTable)(b.row+n.DQ,b.col+n.jN,O,n.dataTable,function(It,t){(0,X.setDataForSJSPivotTable)(It,t,pt)}),(0,X.synchronizeDataTable)(b.row+a.DQ,b.col+a.jN,O,a.dataTable,function(It,t){(0,X.setDataForSJSPivotTable)(It,t,pt)}),(0,X.synchronizeDataTable)(b.row+i.DQ,b.col+i.jN,O,i.dataTable,function(It,t){(0,X.setDataForSJSPivotTable)(It,t,pt)});else for(et=0;et<it.length;et++)Qt(O,ht=it[et],function(It,t){(0,X.setDataForSJSPivotTable)(It,t,pt)}),Q=j(wt),Q=Yt.XFileConstants.Rr+Q,wt.c_.push({n_:Yt.XFileConstants.Lr,Id:Q,Type:Yt.RelationshipConstants.oc,Target:"../"+Yt.XFileConstants.Mu+"s/"+Yt.XFileConstants.Mu+ht.Mp+"."+Yt.XFileConstants.Cr})}}),Yt.Workbook.ch("pivotTable",{adlc:function(c){var N,V,O=c.flg,pt=c.checkRs,wt=c.m,et=c.d,ht=c.nl,St=(c=c.fn,["able","ivotT"]),$=this.ptwm||this.parent&&this.parent.ptwm;O&&O.indexOf("p".toUpperCase()+St[1]+St[0])===-1?(pt.wm=pt.wm||[],(N=$&&$(wt,et,!0))&&pt.wm.push(N),pt.nwm=!0,ht!==1&&kt&&(V=kt.prototype._Qt,kt.prototype._Qt=function(){V.apply(this,arguments),this.PYt=[]}),pt.state||(pt.state=[]),pt.state.push(["pte",0]),pt.dis||(pt.dis=[]),pt.dis.push("7069766f745461626c6573"),this.parent&&c&&c(this,pt.dis,"ad")):wt===-1&&(pt.wm=pt.wm||[],(N=$&&$(wt,et,!1))&&pt.wm.push(N),pt.nwm=!0)},setHost:function(){},init:function(){this.cJt(),Yt.Commands.fZt(this.commandManager()),this.customPivotTableThemes=new I.CustomPivotTableThemeManager(this,{create:function(){return new w.PivotTableTheme},buildIn:w.PivotTableThemes,prefixName:"PivotStyle"})},dispose:function(){if(this.fMt){for(var c in this.fMt.dispose(),this.fMt=null,this.BQt)this.BQt.hasOwnProperty(c)&&this.BQt[c].dispose();this.BQt=null,this.qp=null,this.lJt=null}this.customPivotTableThemes&&(this.customPivotTableThemes.L0(),this.customPivotTableThemes=null)},preFromJson:function(c,N,V){var O,pt,wt,et;if(this.cJt(),pt=this.fMt,wt=c.pivotCaches,!Bt(pt)){if(pt.dispose(),V&&V.ignoreStyle)return;pt.fromJson(wt)}for(O in this.BQt)this.BQt.hasOwnProperty(O)&&this.BQt[O]&&this.BQt[O].dispose();this.BQt={},(V=this)&&(pt=c.pivotTableStyles,wt=c.defaultPivotTableStyle,pt&&0<pt.length&&(et=[],pt.forEach(function(ht){var St=new w.PivotTableTheme;St.fromJSON(ht),et.push(St)}),V.customPivotTableThemes.xur=et),wt)&&V.defaultPivotTableTheme(wt)},preFromSJSFormat:function(c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It;if(this.cJt(),O=this.fMt,!Bt(O)){if(O.dispose(),V&&V.includeStyles===!1)return;if(pt=N.styleManager,N=(V=c.styles)&&V.tableStyles){if(pt.addDefaultStyleName("defaultPivotStyle",N.defaultPivotStyle||"PivotStyleLight16"),0<A(N.count,0)&&(St=F(N,"tableStyle"))){for(wt=0,et=[].concat(St);wt<et.length;wt++)+(ht=et[wt]).table==0&&+ht.pivot!=0&&new w.PivotTableTheme().yh(ht,pt);this.customPivotTableThemes.xur=Object.values(pt.SJt||{})}(V=this).customPivotTableThemes&&V.defaultPivotTableTheme&&(N=pt.getDefaultStyleName("defaultPivotStyle"),St=V.customPivotTableThemes.get(N)?N:N.replace(/^PivotStyle/,""),V.defaultPivotTableTheme(St))}if($=!1,N=g(c.workbook,"pivotCaches")){for(n=N.c_,a=c.pivotCache,i=0;i<n.length;i++)if(b=(h=n[i])["r:id"],h=h.cacheId,b=ot(c.workbook.rels.c_,b)){if(b=b.Target.split("/").pop().slice(0,-4),!(b=a&&a[b]))return;it=b["r:id"],Q=void 0,Bt(it)||(Q=a[((it=ot(b.rels.c_,it))&&it.Target).split("/").pop().slice(0,-4)]),O.yh(b,h,Q),$=!0}}$||O.resetDataAnalyzer()}for(It in this.BQt)this.BQt.hasOwnProperty(It)&&this.BQt[It]&&this.BQt[It].dispose();this.BQt={}},initCustomName:function(){var c,N,V,O,pt,wt,et;if((et=this).fMt&&(c=et.fMt.cut))for(N in c)c.hasOwnProperty(N)&&(V=c[N],(0,S.ht)(V)||(O="pivot"+V.Zc,0<(pt=V.EYt).indexOf("!")?((wt=pt.split("!"))[0]&&wt[0][0]==="="&&(wt[0]=wt[0].slice(1)),pt=(0,Yt.qTe)(wt[0])+"!"+wt[1]):V.sourceType==="worksheet"&&V.sheet&&(pt=(0,Yt.qTe)(V.sheet)+"!"+pt),!(0,S.ht)(pt)&&pt!==""&&(et.zwt(et.lJt,O,pt,null,null,!0,null),Bt(V.oQt)||V.oQt.length<1)&&et.kx(V.Zc,V)))},toJson:function(c,N){var V;N&&N.ignoreStyle||(c.pivotCaches=D(this,J,N),(N=this)&&(V=N.customPivotTableThemes.all(),N=N.isr,V&&0<V.length&&(c.pivotTableStyles=V.map(function(O){return O.toJSON()})),N)&&(c.defaultPivotTableStyle=N))},onCultureChanged:function(){P(),(0,S.getSR)()},wh:function(c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e=this;if(!V||V.includeStyles!==!1){for(Jt=($t=this).fMt,O=$t.sheets,pt={},wt=0;wt<O.length;wt++)for(ht=(et=O[wt]).pivotTables.all(),St=0;St<ht.length;St++)if(($=ht[St])&&(n=$.dh.L,Bt(pt[n])&&(pt[n]={}),a=$.dh.Z))for(i in a)a.hasOwnProperty(i)&&a[i]!==3&&(pt[n][i]=!0);for(h={},b=0,Q=O;b<Q.length;b++)if((et=Q[b]).pivotTables&&et.pivotTables.PYt)for(it=0,It=et.pivotTables.PYt;it<It.length;it++)h[($=It[it]).dh.L]=1;for(t=Jt.wh(pt,Object.keys(h)),r=M(Jt.cut,$t),Object.keys(r).forEach(function(p){var C,W=r[p];p=t[p],W&&p&&(p=g(p.pivotCacheDefinition,"cacheSource"))&&(W.sourceType&&(p.type=W.sourceType),W.sourceType==="worksheet")&&(C={n_:"worksheetSource"},(0,S.ht)(W.sourceName)||(C.name=Yt.util.vo(W.sourceName)),(0,S.ht)(W.ref)||(C.ref=Yt.util.vo(W.ref)),(0,S.ht)(W.sheet)||(C.sheet=Yt.util.vo(W.sheet)),p.c_=[C])}),Jt=Object.keys(t),u={},0<Jt.length&&($t=c.workbook.rels,d=$t.c_,m=d.length,R=c.pivotCache={},z=($t={n_:"pivotCaches",c_:[]}).c_,Jt.forEach(function(p,C){var W=(yt=t[p]).pivotCacheDefinition,x=yt.pivotCacheRecords,yt=yt.cacheId,_t=C+1,Lt=Yt.XFileConstants.yu+"/"+Yt.XFileConstants.bu+_t+"."+Yt.XFileConstants.Cr;u[p]=Lt,p=Yt.XFileConstants.Rr+(m+1+C),d.push({n_:Yt.XFileConstants.Lr,Id:p,Type:Yt.RelationshipConstants.ec,Target:Lt}),z.push({n_:"pivotCache",cacheId:yt,"r:id":p}),R["pivotCacheDefinition"+_t]=W,R["pivotCacheRecords"+_t]=x,W.rels={n_:Yt.XFileConstants.Dr,xmlns:Yt.RelationshipConstants._r,c_:[{n_:Yt.XFileConstants.Lr,Id:"rId1",Type:Yt.RelationshipConstants.ic,Target:Yt.XFileConstants.wu+_t+"."+Yt.XFileConstants.Cr}]}}),c.workbook.c_||(c.workbook.c_=[]),c.workbook.c_.push($t)),ct=0,Tt=this.customPivotTableThemes.all();ct<Tt.length;ct++)Pt=(Ot=Tt[ct]).name(),(Ot=Ot.wh(N.styleManager))&&0<Ot.length&&(Pt={n_:"tableStyle",name:Pt,table:"0",count:Ot.length,c_:Ot},N.styleManager.addTableStyle(Pt));$t=(Jt=this.defaultPivotTableTheme()||w.PivotTableThemes.light16).builtInName()?"PivotStyle".concat(Jt.name()):Jt.name(),N.styleManager.addDefaultStyleName("defaultPivotStyle",$t),O.forEach(function(p){var C,W,x,yt,_t,Lt=p.pivotTables.all(),Et=Y(c,p.name());if(Lt&&0<Lt.length)for(c.pivotTables||(c.pivotTables={}),C=c.pivotTables,W=0;W<Lt.length;W++)(_t=Lt[W]).theme()&&!_t.getThemeName()&&(yt=(0,X.generateCustomPivotTableThemeName)(e,_t.name()||""),(x=new w.PivotTableTheme).fromJSON(_t.theme().toJSON()),x.name(yt),x=x.wh(N.styleManager))&&0<x.length&&(yt={n_:"tableStyle",name:yt,table:"0",count:x.length,c_:x},N.styleManager.addTableStyle(yt)),x=_t.wh(Et,N,V),C[Yt.XFileConstants.Mu+_t.Mp]=x,yt=_t.dh.L,_t=u[yt],x.rels={n_:Yt.XFileConstants.Dr,xmlns:Yt.RelationshipConstants._r,c_:[{n_:Yt.XFileConstants.Lr,Id:"rId1",Type:Yt.RelationshipConstants.ec,Target:"../"+_t}]}})}}}),o.rFr=D,k.extend(Yt.Workbook.prototype,{UYt:function(c,N){var V=this.fMt;return this.BYt(N)&&(0,at.throwError)(P().RepeatName),V.hasPivotCache(c)||(0,at.throwError)("pivot cache not exist"),c=new at.PivotFieldsModel(N,c,V,this.Qy),this.BQt[N]=c},ptwm:function(c,N,V){return V?[P().wmk1,0]:c===-1?V?[P().wmk1,0]:[P().wmk2,1]:void 0},addPivotLayoutModelWithExistCache:function(c,N){var V=this.fMt;V.hasPivotCache(N)||(0,at.throwError)(P().NotExist),this.BQt[c]=new at.PivotFieldsModel(c,N,V)},BYt:function(c){return!!this.qp[c]},QYt:function(c,N,V){N?this.qp[c]=1:delete this.qp[c],Bt(V)||delete this.qp[V]},YYt:function(c,N){N?Bt(c.fieldsModel)||(this.BQt[c.fieldsModel.getName()]=c.fieldsModel,this.fMt.cut[c.fieldsModel.L]=c.pivotCache):(delete this.BQt[c.fieldsModelName],delete this.fMt.cut[c.pivotCacheName])},fJt:function(c){return this.fMt.hasPivotCache(c)?this.fJt(c+="1"):c},hJt:function(c){for(var N,V=[],O=0,pt=Object.keys(this.BQt);O<pt.length;O++)N=pt[O],(N=this.BQt[N]).L===c&&(0,S.o)(N.z,function(wt){if(wt instanceof X.PivotTable)return V.push(wt.getName()),!0});return V},JYt:function(c){var N,V,O,pt,wt,et,ht,St,$,n,a,i,h,b=(h=(i=this).BQt)[c];if(!Bt(b)){for(N=b.L,V=0,O=i.sheets;V<O.length;V++)if(pt=(pt=O[V]).pivotTables&&pt.pivotTables.PYt,!Bt(pt)&&0<pt.length){for(wt=0,et=pt;wt<et.length;wt++)if((ht=et[wt])._fieldModel&&ht._fieldModel.Zc===c)return}for(St=0,$=Object.keys(h);St<$.length;St++)if((n=$[St])!==c&&h[n].L===N)return;return b=h[c],a=i.fMt.cut[N],delete h[c],delete i.fMt.cut[N],i.$Dr({type:"removePivotCache",pivotCache:a}),{fieldsModel:b,pivotCache:a}}},JIr:function(c){for(var N,V=this.BQt,O=[],pt=0,wt=Object.keys(V);pt<wt.length;pt++)V[N=wt[pt]].L===c&&O.push(V[N]);return O},VYt:function(c,N,V){var O=this.sFr(c,N,V);return this.uFr(O),this.$Dr({type:"addPivotCache",pivotCacheName:c,sourceData:N,pivotSheet:V,pivotCache:O}),O},sFr:function(c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t,r,u,d;if(c=this.fJt(c),O=null,pt="",d=bt+c,typeof N=="string")try{pt=N=(i=G(this,N)).dataRefer,et=i.sheetName,ht=i.tableName,wt=i.range,Bt(this.vJt(d))||this.dJt(d),this.zwt(this.lJt,d,pt,null,null,!0,null),St=(0,Yt._f)(this,et),$=new Yt.Range(wt.row===-1?0:wt.row,wt.col===-1?0:wt.col,wt.rowCount===-1?St.getRowCount():wt.rowCount,wt.colCount===-1?St.getColumnCount():wt.colCount),n=St.NMi,Bt(n)||(O=y(n,$)),a=St.getArray($.row,$.col,$.rowCount,$.colCount),(O=Bt(O)?a:O.concat(a))||(0,at.throwError)(P().SourceError)}catch{(0,at.throwError)(P().SourceNotIsTableNameOrFormula)}else q(N)&&q(N[0])?O=N:(0,at.throwError)(P().SourceNotIsTableNameOrFormula);for(O.length<2&&(0,at.throwError)(P().SourceDataOnlyOne),Bt(ht)||((i=St.tables.findByName(ht))||ht[0]!=="="||(i=St.tables.findByName(ht.substring(1))),(0,_.imr)(i,O)),h=[],b=O[0],Q=O.slice(1),it={},t=0,r=b.length;t<r;t++){if(Bt(b[t]))return void V.jT(10,P().PivotTableErrorMessage_EmptySourceFieldName);u=this.pJt(Q,t),it[It=typeof(It=(0,_.dz)(it,b[t]))=="string"?It.replace(/\r/g,""):It]=!0,h.push({name:It,dataType:u,index:t})}return(d=new S.PivotCache(c,h,Q,N)).EYt=pt,Bt(et)||(d.sheet=et),Bt(ht)||(d.sourceName=ht),d},uFr:function(c){this.fMt.addPivotCache(c)},pJt:function(c,N){for(var V,O,pt=0;pt<c.length;){if((O=typeof(V=c[pt])[N])=="number")return 0;if(O=="object"&&V[N]instanceof Date)return 2;if(O=="string")return 1;pt+=1}return 5},ZIr:function(c,N,V,O,pt,wt){var et,ht,St=this;if(V=wt.pivotTables.get(V).dh,typeof O=="string")try{et=G(St,O)}catch{(0,at.throwError)(P().SourceNotIsTableNameOrFormula)}else(0,at.throwError)(P().SourceNotIsTableNameOrFormula);(ht=St.GYt(et.dataRefer))?(V.QIr(ht.getName()),at.PivotFieldsModel.et(V,"changePivotCache",{oldCacheName:c,newCache:ht})):(ht=St.qIr(c,O,wt,et))&&(ht.KIr(N,pt),V.QIr(ht.getName(),!!pt),at.PivotFieldsModel.et(V,"changePivotCache",{oldCacheName:c,newCache:ht})),St.JIr(c).length||delete this.fMt.cut[c]},qIr:function(c,N,V,O){var pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It;for(c=this.fJt(c),$=bt+c,pt=null,wt="",!O||(wt=N=O.dataRefer,et=O.sheetName,ht=O.tableName,O=O.range,Bt(this.vJt($))||this.dJt($),this.zwt(this.lJt,$,wt,null,null,!0,null),St=(0,Yt._f)(this,et),$=new Yt.Range(O.row===-1?0:O.row,O.col===-1?0:O.col,O.rowCount===-1?St.getRowCount():O.rowCount,O.colCount===-1?St.getColumnCount():O.colCount),O=St.NMi,Bt(O)||(pt=y(O,$)),O=St.getArray($.row,$.col,$.rowCount,$.colCount),pt=Bt(pt)?O:pt.concat(O))||(0,at.throwError)(P().SourceError),pt.length<2&&(0,at.throwError)(P().SourceDataOnlyOne),Bt(ht)||(($=St.tables.findByName(ht))||ht[0]!=="="||($=St.tables.findByName(ht.substring(1))),(0,_.imr)($,pt)),n=[],a=pt[0],i=pt.slice(1),h={},Q=0,it=a.length;Q<it;Q++){if(Bt(a[Q]))return void V.jT(10,P().PivotTableErrorMessage_EmptySourceFieldName);It=this.pJt(i,Q),h[b=typeof(b=(0,_.dz)(h,a[Q]))=="string"?b.replace(/\r/g,""):b]=!0,n.push({name:b,dataType:It,index:Q})}return(O=new S.PivotCache(c,n,i,N)).EYt=wt,Bt(et)||(O.sheet=et),Bt(ht)||(O.sourceName=ht),this.fMt.addPivotCache(O),O},kx:function(c,N,V,O){var pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t,r,u,d,m=null,R=this,z=bt+c;if(typeof c=="string"){wt=void 0;try{if(!R.mJt(c,V)||(wt=R.vJt(z),et={},ht=void 0,wt&&(ht=(St=wt.getExpression()).source&&St.source.Mf,St.abt?et=(pt=St.abt).range&&pt.range()||pt.dataRange&&pt.dataRange():($=vt.expressionToFormula(R.getActiveSheet(),St,0,0),(n=vt.formulaToRanges(R.getActiveSheet(),$,0,0,!1,void 0,!0))[0]&&n[0].ranges&&(et=n[0].ranges[0])),a=new Yt.Range(et.row<0?0:et.row,et.col<-1?0:et.col,et.rowCount<-1?ht.getRowCount():et.rowCount,et.colCount<-1?ht.getColumnCount():et.colCount),i=ht.NMi,Bt(i)||(m=y(i,a)),h=ht.getArray(a.row,a.col,a.rowCount,a.colCount),m=Bt(m)?h:m.concat(h)),!m||m.length<2))return}catch{return}for(Bt(pt)||(0,_.imr)(pt,m),b=[],Q=m[0],it=m.slice(1),It={},r=0,u=Q.length;r<u;r++){if(Bt(Q[r]))return void(O&&O.jT(10,P().PivotTableErrorMessage_EmptySourceFieldName));d=R.pJt(it,r),It[t=typeof(t=(0,_.dz)(It,Q[r]))=="string"?t.replace(/\r/g,""):t]=!0,b.push({name:t,dataType:d,index:r})}N.ln(b,it),R.$Dr({type:"updatePivotCache",sourceData:c,pivotCache:N,ptName:V,pivotSheet:O}),R.bJt(N.Zc)}},bJt:function(c){var N,V=this.BQt;for(N in V)U(V,N)&&V[N].L===c&&V[N].ok();for(N in V)U(V,N)&&V[N].L===c&&V[N].LS()},GYt:function(c){return this.fMt.gJt(c)},mJt:function(c,N){var V=this,O=this.BQt,pt=Object.keys(O).map(function(et){return O[et]}),wt=!0;return(0,S.o)(pt,function(et){wt&&et.Zc!==N&&et.L===c&&(0,S.o)(V.sheets,function(ht){wt&&ht.isActualProtected()&&ht.pivotTables.get(et.Zc)&&(ht.jT(10,P().PivotTableErrorMessage_Protect),wt=!1)})}),wt},vJt:function(c){return c?this.lJt[At.Common.zf.Gmt(c)]:void 0},wJt:function(){var c=[];return k.each(this.bp,function(N,V){c.push(V)}),c},dJt:function(c){var N;c&&(delete this.lJt[At.Common.zf.Gmt(c)],(N={})[c]=c,this.Zwt(N,!1))},ok:function(){var c,N,V=this.BQt;for(N in V)U(V,N)&&(c=V[N])&&c.JVt()},wQt:function(c){var N,V,O;if(O=this.sheets){for(V=0;V<O.length;V++)if((N=O[V].pivotTables)&&(N=N.get(c)))return N}return L},getPivotCaches:function(){var c={};return Yt.Workbook.fh.find(function(N){return N.name==="pivotTable"}).toJson.call(this,c),c},getPivotCacheByName:function(c){return this.fMt.getPivotCacheByName(c)},cJt:function(){var c=this;c.fMt=new S.PivotEngine,c.BQt={},c.qp={},c.lJt={}}}),k.extend(Yt.Y8.prototype,{yJt:function(c){var N=this.CJt;return!N||!N[c]},WYt:function(c,N){var V,O;(O=(V=this).G8)&&V.yJt(c.Zc)&&((V=O.pivotTableChanges)?delete V.isRestored:V=O.pivotTableChanges=[],V.push({pivotObj:c,value:N}))},TVt:function(c,N){var V,O;(O=this.G8)&&((V=O.pivotTableChanges)?delete V.isRestored:V=O.pivotTableChanges=[],V.push({pivotObj:c,value:N}))},IJt:function(c){for(var N,V,O={},pt=c.length-1;0<=pt;pt--)(N=c[pt]).pivotObj instanceof X.PivotTable&&!O[N.pivotObj.name()]&&(O[N.pivotObj.name()]=N.pivotObj);for(V in O)O.hasOwnProperty(V)&&O[V].suspendLayout();return O},AJt:function(c){var N;for(N in c)c.hasOwnProperty(N)&&c[N].resumeLayout()},NJt:function(c){for(var N,V=this.Mf.pivotTables,O=c.length-1;0<=O;O--)N=c[O],V.AP(N)},applyPivotTableChange:function(c,N){var V=c.value.type,O=this.Mf.pivotTables;N?V==="add"?O.get(c.pivotObj.name)||s(this.Mf,c.pivotObj):V==="remove"&&O.get(c.pivotObj.name)&&O.TOt(c.pivotObj.name):V==="add"?O.get(c.pivotObj.name)&&O.TOt(c.pivotObj.name):V!=="remove"||O.get(c.pivotObj.name)||s(this.Mf,c.pivotObj),this.applyPivotTableFieldChange(c,N)},applyPivotTableFieldChange:function(c,N){var V;(V=this.Mf.pivotTables.get(c.pivotObj.name))&&V.dh.fromJson(c.pivotObj,V)},TJt:function(c,N){var V=c.value.type,O=this.Mf.pivotTables;V!=="add"&&V!=="remove"||(O.AP(c),c.value.isMove)?c.pivotObj.AP(c.value):V==="add"&&N[c.pivotObj.name()]&&delete N[c.pivotObj.name()]},MJt:function(c){c.pivotObj.AP(c.value),Bt(c.pivotObj.copyFieldsModel)&&(c.pivotObj.copyFieldsModel=c.pivotObj.clone())}}),Yt.Y8.ch("PivotTable",{priority:8e3,isValid:function(c){c=-1<["getValue","setValue"].indexOf(c);var N=0<((N=(N=this.Mf.pivotTables)==null?void 0:N.PYt)==null?void 0:N.length);return!c||N},getValue:function(c){var N,V=c.row,O=c.col,pt=c.sheetArea,wt=(N=this.Mf).pivotTables.PYt;pt===3&&wt&&0<wt.length&&(wt=(pt=N.aJt(V,O)).inPivot,N=pt.value,wt)&&(c.isValueGet=!0,c.value=N)},setValue:function(c){var N,V,O=c.row,pt=c.col,wt=c.sheetArea,et=c.value,ht=(V=this.Mf).parent&&V.parent.Gie;wt===3&&(wt=V.pivotTables.findPivotTable(O,pt))&&(N=(V=wt.getRange()).page,V=V.content,N&&N.contains(O,pt)||V&&V.contains(O,pt))&&(N=!0,ht?wt.Kbt(O,pt,et):wt.options.enableDataValueEditing&&wt.rJt(O,pt)&&(V=wt.getNodeInfo(O,pt),N=!!wt.setNodeValue(V,et)),c.isValueSet=N)},applyChanges:function(c){var N,V,O,pt=this,wt=c.changes;if(c=c.isUndo,wt&&(N=wt.pivotTableChanges)){if(V={},c)for(O=N.length-1;0<=O;O--)V[N[O].pivotObj.name]=1,N[O].value.pivotType===0?pt.applyPivotTableChange(N[O],!1):pt.applyPivotTableFieldChange(N[O],!1);else for(O=0;O<N.length;O++)V[N[O].pivotObj.name]=1,N[O].value.pivotType===0?pt.applyPivotTableChange(N[O],!0):pt.applyPivotTableFieldChange(N[O],!0);Object.keys(V).forEach(function(et){(et=pt.Mf.pivotTables.get(et))&&et.refresh()})}},undo:function(c){var N,V,O,pt,wt,et,ht,St,$;if(($=this).CJt={},N=c.pivotTableChanges,$.Mf.pivotTables.xJt=!0,V={},N&&!N.isRestored){for(O=$.IJt(N),pt=N.length-1;0<=pt;pt--)N[pt].value.pivotType===0?$.TJt(N[pt],O):($.MJt(N[pt]),V[N[pt].pivotObj.Zc]=1);if($.AJt(O),c=Object.keys(V),wt=$.Mf.parent&&$.Mf.parent.BQt,!Bt(wt))for(et=0,ht=c;et<ht.length;et++)wt[St=ht[et]]&&wt[St].q3()}$.Mf.pivotTables.xJt=!1,delete $.CJt}}),Yt.Worksheet.ch("PivotTable",{priority:8e3,applyEditingSetFormula:function(c){var N,V,O,pt=c.row,wt=c.col;(O=c.sheetArea)!==3&&O!==L||(O=this.pivotTables.findPivotTable(pt,wt))&&(N=(V=O.getRange()).page,V=V.content,N&&N.contains(pt,wt)||V&&V.contains(pt,wt)&&!O.options.enableDataValueEditing)&&(c.isAllow=!1)},canAddingSpan:function(c){var N,V,O,pt,wt=c.row,et=c.col,ht=c.rowCount,St=c.colCount,$=c.sheetArea;if(Bt($)||$===Yt.SheetArea.viewport){for(N=this,$=new Yt.Range(wt,et,ht,St),wt=(0,_.iJt)(N,$),V=0,O=Object.keys(wt);V<O.length;V++)if(pt=O[V],!N.pivotTables.get(pt).v_e){c.isAllow=!1,N.jT(10,P().PivotTableErrorMessage_MakeChange);break}}}}),tt.ConditionalFormats&&tt.ConditionalFormats.ch("pivotTable",{onRuleRemoved:function(c){var N,V,O=this.pivotTables.all();if(V=c.priority)for(N=0;N<O.length;N++)O[N].DJt(V)}}),Ft.Table&&Ft.Table.ch("pivotTable",{tableNameChanged:function(c){var N;(N=this.getParent())&&(N=N.GYt(c.oldName))&&(N.EYt=c.newName)}})},"./dist/plugins/pivot/pivot-table/pivot-table-theme-helper.js":function(Ie,o,ft){var Yt,At,S;function at(){}Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableThemeHelper=void 0,Yt=ft("Core"),At=ft("./dist/plugins/pivot/pivot-table-entry.js"),S=ft("Pivot"),at.hcr=function(X,H,f,B,vt){this.vcr(X,H,f,B,vt),this.dcr(X,H,f,B,vt),this.pcr(X,H,f,B,vt),this.mcr(X,H,f,B,vt),this.bcr(X,H,f,B,vt),this.gcr(X,H,f,B,vt),this.wcr(X,H,f,B,vt),this.ycr(X,H,f,B,vt),this.Ncr(X,H,f,B,vt),this.Ccr(X,H,f,B,vt),this.Icr(X,H,f,B,vt),this.Acr(X,H,f,B,vt),this.Tcr(X,H,f,B,vt),this.Scr(X,H,f,B,vt),this.tlr(X,H,f,B,vt),this.xcr(X,H,f,B,vt),this.Mcr(X,H,f,B,vt)},at.vcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I,U=X[At.THEME_RES.WHOLE_TABLE_STYLE]();if(f=(X=f.Dcr)==null?void 0:X.wholeTableRanges,U&&f){for(v=_=tt=mt=void 0,Ft=0,w=f;Ft<w.length;Ft++)if((I=w[Ft]).contains(B,vt))return mt=B===I.row,tt=B===I.row+I.rowCount-1,_=vt===I.col,v=vt===I.col+I.colCount-1,void U.h5(H,mt,_,tt,v)}},at.dcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I,U=X[At.THEME_RES.REPORT_FILTER_LABELS_STYLE](),g=X[At.THEME_RES.REPORT_FILTER_VALUES_STYLE]();if(f=(X=f.Dcr)==null?void 0:X.pageLabelRanges,U&&f){for(Ft=0,w=f;Ft<w.length;Ft++)if((I=w[Ft]).contains(B,vt))return mt=B===I.row,tt=B===I.row+I.rowCount-1,_=vt===I.col,(I=vt===I.col+I.colCount-1)&&g&&g.borderLeft&&(I=!(v=!0)),void U.h5(H,mt,_,tt,I,!1,v)}},at.pcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I=X[At.THEME_RES.REPORT_FILTER_VALUES_STYLE]();if(f=(X=f.Dcr)==null?void 0:X.pageValueRanges,I&&f){for(v=0,Ft=f;v<Ft.length;v++)if((w=Ft[v]).contains(B,vt))return mt=B===w.row,tt=B===w.row+w.rowCount-1,_=vt===w.col,w=vt===w.col+w.colCount-1,void I.h5(H,mt,_,tt,w)}},at.mcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft=X[At.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](),w=X[At.THEME_RES.SECOND_COLUMN_STRIPE_STYLE](),I=X[At.PT_VARI.FIRST_COLUMN_STRIP_SIZE](),U=(X=X[At.PT_VARI.SECOND_COLUMN_STRIP_SIZE](),(tt=f.Dcr)==null?void 0:tt.colWidthInfo);if(Ft&&f.options.bandColumns&&U&&(tt=f.rZt.HWt[4],f=f.position(),X=I+X,(f=new Yt.Range(tt.DQ+f.row,tt.jN+f.col,tt.Sx,tt.Tx)).contains(B,vt))){for(tt=void(mt=0),_=f.col;_<=vt;_++)mt+=0<U[_]?1:0;I<(v=(v=mt%X)==0?X:v)||(X=B===f.row,B=B===f.row+f.rowCount-1,(I=v===I||vt===f.col+f.colCount-1)&&w&&w.borderLeft&&(tt=!(I=!1)),Ft.h5(H,X,v===1,B,I,!1,tt))}},at.bcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft=X[At.THEME_RES.SECOND_COLUMN_STRIPE_STYLE](),w=X[At.PT_VARI.FIRST_COLUMN_STRIP_SIZE](),I=(X=X[At.PT_VARI.SECOND_COLUMN_STRIP_SIZE](),(_=f.Dcr)==null?void 0:_.colWidthInfo);if(Ft&&f.options.bandColumns&&I&&(_=f.rZt.HWt[4],f=f.position(),X=w+X,(f=new Yt.Range(_.DQ+f.row,_.jN+f.col,_.Sx,_.Tx)).contains(B,vt))){for(mt=0,tt=f.col;tt<=vt;tt++)mt+=0<I[tt]?1:0;(_=(_=mt%X)==0?X:_)<=w||(v=B===f.row,B=B===f.row+f.rowCount-1,X=_===X||vt===f.col+f.colCount-1,Ft.h5(H,v,_===w+1,B,X))}},at.gcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft=X[At.THEME_RES.FIRST_ROW_STRIPE_STYLE](),w=X[At.THEME_RES.SECOND_ROW_STRIPE_STYLE](),I=X[At.PT_VARI.FIRST_ROW_STRIP_SIZE](),U=(X=X[At.PT_VARI.SECOND_ROW_STRIP_SIZE](),(tt=f.Dcr)==null?void 0:tt.rowHeightInfo);if(Ft&&f.options.bandRows&&(tt=f.rZt.HWt[4],v=f.rZt.HWt[3],tt.Tx)&&tt.Sx&&(f=f.position(),X=I+X,(f=new Yt.Range(tt.DQ+f.row,f.col,tt.Sx,tt.Tx+v.Tx)).contains(B,vt))){for(tt=void(mt=0),_=f.row;_<=B;_++)mt+=0<U[_]?1:0;I<(v=(v=mt%X)==0?X:v)||(X=v===I||B===f.row+f.rowCount-1,I=vt===f.col,vt=vt===f.col+f.colCount-1,X&&w&&w.borderLeft&&(tt=!(X=!1)),Ft.h5(H,v===1,I,X,vt,tt,!1))}},at.wcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft=X[At.THEME_RES.SECOND_ROW_STRIPE_STYLE](),w=X[At.PT_VARI.FIRST_ROW_STRIP_SIZE](),I=(X=X[At.PT_VARI.SECOND_ROW_STRIP_SIZE](),(_=f.Dcr)==null?void 0:_.rowHeightInfo);if(Ft&&f.options.bandRows&&(_=f.rZt.HWt[4],v=f.rZt.HWt[3],_.Tx)&&_.Sx&&(f=f.position(),X=w+X,(f=new Yt.Range(_.DQ+f.row,f.col,_.Sx,_.Tx+v.Tx)).contains(B,vt))){for(mt=0,tt=f.row;tt<=B;tt++)mt+=0<I[tt]?1:0;(_=(_=mt%X)==0?X:_)<=w||(v=_===w||B===f.row+f.rowCount-1,X=vt===f.col,vt=vt===f.col+f.colCount-1,Ft.h5(H,_===w+1,X,v,vt))}},at.ycr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I;if((X=X[At.THEME_RES.FIRST_COLUMN_STYLE]())&&f.options.showRowHeader&&(v=f.rZt.HWt[3],I=f.rZt.HWt[1],mt=f.position(),tt=new Yt.Range(mt.row,mt.col,I.Sx+v.Sx,I.Tx),_=(mt=f.Dcr)==null?void 0:mt.rowHeightInfo,tt.contains(B,vt))){for(v=B===tt.row,Ft=void 0,w=tt.row+tt.rowCount-1;w>=tt.row;w--)if(0<_[w]){Ft=w===B;break}I=vt===tt.col,f=vt===tt.col+tt.colCount-1,X.h5(H,v,I,Ft,f)}},at.Ncr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I;if((X=X[At.THEME_RES.HEADER_ROW_STYLE]())&&f.options.showColumnHeader&&(v=f.rZt.HWt[2],Ft=f.rZt.HWt[1],mt=f.position(),tt=new Yt.Range(mt.row,mt.col,Ft.Sx,v.Tx+Ft.Tx),_=(mt=f.Dcr)==null?void 0:mt.colWidthInfo,tt.contains(B,vt))){for(v=B===tt.row,Ft=B===tt.row+tt.rowCount-1,f=vt===tt.col,w=void 0,I=tt.col+tt.colCount-1;I>=tt.col;I--)if(0<_[I]){w=I===vt;break}X.h5(H,v,f,Ft,w)}},at.Ccr=function(X,H,f,B,vt){var mt,tt,_;(X=X[At.THEME_RES.FIRST_HEADER_CELL_STYLE]())&&f.options.showColumnHeader&&f.options.showRowHeader&&(tt=f.position(),(_=f.rZt.HWt[1]).Tx)&&(mt=f.dataPosition(),f=f.getFieldsByArea(At.PivotTableFieldType.rowField).length||mt.display&&mt.positionType===S.DataPosition.row?1:0,(mt=new Yt.Range(tt.row,tt.col,_.Sx-f,_.Tx)).contains(B,vt))&&(tt=B===mt.row,f=B===mt.row+mt.rowCount-1,_=vt===mt.col,B=vt===mt.col+mt.colCount-1,X.h5(H,tt,_,f,B))},at.Icr=function(X,H,f,B,vt){for(var mt,tt,_,v,Ft,w,I=X[At.THEME_RES.SUBTOTAL_COLUMN1_STYLE](),U=X[At.THEME_RES.SUBTOTAL_COLUMN2_STYLE](),g=X[At.THEME_RES.SUBTOTAL_COLUMN3_STYLE](),F=(X=f.Dcr)==null?void 0:X.colSubtotalRangeInfo,ot=Object.keys(F).length,j=0;j<ot;j++)for(v=0,Ft=F[j];v<Ft.length;v++)if((w=Ft[v]).contains(B,vt))return mt=B===w.row,tt=B===w.row+w.rowCount-1,_=vt===w.col,w=vt===w.col+w.colCount-1,void(j===0&&I?I.h5(H,mt,_,tt,w):j%2==1&&U?U.h5(H,mt,_,tt,w):1<j&&j%2==0&&g&&g.h5(H,mt,_,tt,w))},at.Acr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I;if((I=X[At.THEME_RES.BLANK_ROW_STYLE]())&&f.options.insertBlankLineAfterEachItem){for(mt=0,tt=(X=f.Dcr)==null?void 0:X.blankRowRanges;mt<tt.length;mt++)if((w=tt[mt]).contains(B,vt))return _=B===w.row,v=B===w.row+w.rowCount-1,Ft=vt===w.col,w=vt===w.col+w.colCount-1,void I.h5(H,_,Ft,v,w)}},at.Tcr=function(X,H,f,B,vt){for(var mt,tt,_,v,Ft,w,I=X[At.THEME_RES.SUBTOTAL_ROW1_STYLE](),U=X[At.THEME_RES.SUBTOTAL_ROW2_STYLE](),g=X[At.THEME_RES.SUBTOTAL_ROW3_STYLE](),F=(X=f.Dcr)==null?void 0:X.rowSubtotalRangeInfo,ot=Object.keys(F).length,j=0;j<ot;j++)for(v=0,Ft=F[j];v<Ft.length;v++)if((w=Ft[v]).contains(B,vt))return mt=B===w.row,tt=B===w.row+w.rowCount-1,_=vt===w.col,w=vt===w.col+w.colCount-1,void(j===0&&I?I.h5(H,mt,_,tt,w):j%2==1&&U?U.h5(H,mt,_,tt,w):1<j&&j%2==0&&g&&g.h5(H,mt,_,tt,w))},at.Scr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I,U,g,F,ot,j;if(f.options.showColumnHeader){for(mt=X[At.THEME_RES.COLUMN_SUBHEADING1_STYLE](),tt=X[At.THEME_RES.COLUMN_SUBHEADING2_STYLE](),_=X[At.THEME_RES.COLUMN_SUBHEADING3_STYLE](),v=(X=f.Dcr)==null?void 0:X.colHeadingRanges,Ft=Object.keys(v).length,g=0;g<Ft;g++)for(F=0,ot=v[g];F<ot.length;F++)if((j=ot[F]).contains(B,vt))return w=B===j.row,I=B===j.row+j.rowCount-1,U=vt===j.col,j=vt===j.col+j.colCount-1,void(g===0&&mt?mt.h5(H,w,U,I,j):g%2==1&&tt?tt.h5(H,w,U,I,j):1<g&&g%2==0&&_&&_.h5(H,w,U,I,j))}},at.tlr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I,U,g,F,ot,j;if(f.options.showRowHeader){for(mt=X[At.THEME_RES.ROW_SUBHEADING1_STYLE](),tt=X[At.THEME_RES.ROW_SUBHEADING2_STYLE](),_=X[At.THEME_RES.ROW_SUBHEADING3_STYLE](),v=(X=f.Dcr)==null?void 0:X.rowHeadingRanges,Ft=Object.keys(v).length,g=0;g<Ft;g++)for(F=0,ot=v[g];F<ot.length;F++)if((j=ot[F]).contains(B,vt))return w=B===j.row,I=B===j.row+j.rowCount-1,U=vt===j.col,j=vt===j.col+j.colCount-1,void(g===0&&mt?mt.h5(H,w,U,I,j):g%2==1&&tt?tt.h5(H,w,U,I,j):1<g&&g%2==0&&_&&_.h5(H,w,U,I,j))}},at.xcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I=X[At.THEME_RES.GRANDTOTAL_COLUMN_STYLE]();if(X=(f=(X=f.Dcr)==null?void 0:X.grandTotalRange)==null?void 0:f.colGrandTotalRange,I&&X)for(mt=0,tt=X;mt<tt.length;mt++)(w=tt[mt]).contains(B,vt)&&(_=B===w.row,v=B===w.row+w.rowCount-1,Ft=vt===w.col,w=vt===w.col+w.colCount-1,I.h5(H,_,Ft,v,w))},at.Mcr=function(X,H,f,B,vt){var mt,tt,_,v,Ft,w,I=X[At.THEME_RES.GRANDTOTAL_ROW_STYLE]();if(X=(f=(X=f.Dcr)==null?void 0:X.grandTotalRange)==null?void 0:f.rowGrandTotalRange,I&&X)for(mt=0,tt=X;mt<tt.length;mt++)(w=tt[mt]).contains(B,vt)&&(_=B===w.row,v=B===w.row+w.rowCount-1,Ft=vt===w.col,w=vt===w.col+w.colCount-1,I.h5(H,_,Ft,v,w))},o.PivotTableThemeHelper=at},"./dist/plugins/pivot/pivot-table/pivot-table-theme-range.js":function(Ie,o,ft){var Yt,At,S,at;function X(){}Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableThemeRangeHelper=void 0,Yt=ft("Core"),At=ft("./dist/plugins/pivot/pivot-table-entry.js"),S=ft("./dist/plugins/pivot/pivot-util.js"),at=ft("Pivot"),X.generateThemeRangeInfos=function(H){var f={};f.wholeTableRanges=this.jcr(H),f.pageLabelRanges=this.kcr(H),f.pageValueRanges=this._cr(H),f.colWidthInfo=this.Ocr(H),f.rowHeightInfo=this.Fcr(H),f.colSubtotalRangeInfo=this.Pcr(H),f.blankRowRanges=this.Lcr(H),f.rowSubtotalRangeInfo=this.Ecr(H),f.colHeadingRanges=this.Rcr(H),f.rowHeadingRanges=this.ilr(H),f.grandTotalRange=this.Bcr(H),H.Dcr=f},X.jcr=function(H){var f=H.getRange().content;return H=(0,S.lcr)(H),f&&0<f.rowCount&&0<f.colCount&&H.push(f),H},X.kcr=function(H){for(var f,B=[],vt=0,mt=(0,S.lcr)(H);vt<mt.length;vt++)f=mt[vt],B.push(new Yt.Range(f.row,f.col,f.rowCount,1));return B},X._cr=function(H){for(var f,B=[],vt=0,mt=(0,S.lcr)(H);vt<mt.length;vt++)f=mt[vt],B.push(new Yt.Range(f.row,f.col+1,f.rowCount,1));return B},X.Ocr=function(H){var f,B,vt=H.Ti,mt={};if((B=H.getRange().content)&&0<B.rowCount&&0<B.colCount)for(f=B.col;f<B.col+B.colCount;f++)mt[f]=+vt.getColumnWidth(f);return mt},X.Fcr=function(H){var f,B,vt=H.Ti,mt={};if((B=H.getRange().content)&&0<B.rowCount&&0<B.colCount)for(f=B.row;f<B.row+B.rowCount;f++)mt[f]=+vt.getRowHeight(f);return mt},X.Pcr=function(H){var f,B,vt,mt=H.getFieldsByArea(At.PivotTableFieldType.columnField).length;for((vt=H.dataPosition()).display&&vt.positionType===at.DataPosition.col&&mt++,f={},B=0;B<mt;B++)f[B]=this.Gcr(H,B);return f},X.Gcr=function(H,f){var B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot;if(H.getFieldsByArea(At.PivotTableFieldType.columnField).length-1<f)return[];if(B=this.Vcr(H,f),(0,at.ht)(B))return[];if(H.subtotalPosition(B.fieldName)===At.SubtotalsPosition.none)return[];for(vt=H.position(),mt=H.rZt.HWt[1],f=H.rZt.HWt[2],tt=H.rZt.HWt[4],_=this.rlr(H),Ft=v=0;Ft<_.length;Ft++)if(_[Ft]===B.fieldName){v=Ft;break}for(w=vt.row+v,I=tt.Sx+f.Sx-v,U=f.WWt,g=[],F=0;F<U.length;F++)!(ot=U[F])||!ot.isSubtotal||ot.grandTotalLevel!==B.pivotIndex+1||(ot=ot.rowPathMap)!=null&&ot.collapse||g.push(new Yt.Range(w,vt.col+mt.Tx+F,I,1));return g},X.rlr=function(H){for(var f,B,vt=[],mt=(B=H.getFieldsByArea(At.PivotTableFieldType.columnField)).length,tt=0,_=B;tt<_.length;tt++)f=_[tt],vt.push(f.fieldName);return(B=H.dataPosition()).display&&B.positionType===at.DataPosition.col&&mt++,H.rZt.HWt[2].Sx>mt&&vt.splice(0,0,null),vt},X.Vcr=function(H,f){var B;if(!((B=H.dataPosition()).display&&B.positionType===at.DataPosition.col&&B.positionIndex===f||(H=H.getFieldsByArea(At.PivotTableFieldType.columnField)).length-1<f))return B.display&&B.positionType===at.DataPosition.col&&B.positionIndex<=f&&f--,H[f]},X.Lcr=function(H){var f,B,vt,mt,tt,_,v=H.position(),Ft=H.rZt.HWt[1],w=H.rZt.HWt[3],I=[];if((_=H.rZt.HWt[2]).Tx)for(f=w.zWt,B=0,vt=Object.keys(f);B<vt.length;B++)(tt=f[mt=vt[B]])&&tt.isBlankRow&&I.push(new Yt.Range(+mt+v.row+Ft.Sx,v.col,1,Ft.Tx+_.Tx));return I},X.Ecr=function(H){var f,B,vt,mt=H.getFieldsByArea(At.PivotTableFieldType.rowField).length;for((vt=H.dataPosition()).display&&vt.positionType===at.DataPosition.row&&mt++,f={},B=0;B<mt;B++)f[B]=this.Qcr(H,B);return f},X.Qcr=function(H,f){var B,vt,mt,tt,_,v,Ft,w,I,U,g,F;if(H.getFieldsByArea(At.PivotTableFieldType.rowField).length-1<f)return[];if(B=this.zcr(H,f),(0,at.ht)(B))return[];if(_=H.subtotalPosition(B.fieldName),v=H.dataPosition(),vt=H.layoutType(),_===At.SubtotalsPosition.none)return[];if(_===At.SubtotalsPosition.top&&vt!==At.PivotTableLayoutType.tabular&&(v.display&&v.positionType===at.DataPosition.row&&v.positionIndex<=f||!v.display||v.positionType!==at.DataPosition.row))return[];for(mt=H.position(),tt=H.rZt.HWt[1],_=H.rZt.HWt[3],v=H.rZt.HWt[4],Ft=_.Tx+v.Tx,w=_.zWt,I=vt===At.PivotTableLayoutType.compact?mt.col:mt.col+f,U=[],g=0;g<w.length;g++)(F=w[g])&&F.isSubtotal&&F.grandTotalLevel===B.pivotIndex+1&&(0,at.ht)(F.collapseIndex)&&U.push(new Yt.Range(mt.row+tt.Sx+g,I,1,Ft));return U},X.zcr=function(H,f){var B;if(!((B=H.dataPosition()).display&&B.positionType===at.DataPosition.row&&B.positionIndex===f||(H=H.getFieldsByArea(At.PivotTableFieldType.rowField)).length-1<f))return B.display&&B.positionType===at.DataPosition.row&&B.positionIndex<=f&&f--,H[f]},X.Rcr=function(H){var f,B,vt,mt,tt,_,v,Ft,w,I,U,g={},F=H.getFieldsByArea(At.PivotTableFieldType.columnField).length;for((U=H.dataPosition()).display&&U.positionType===at.DataPosition.col&&F++,f=H.rZt.HWt[1],vt=(B=H.rZt.HWt[2]).Tx,mt=B.WWt,tt=H.position(),_=0;_<F;_++)g[_]||(g[_]=[]);for(v=U.display&&U.positionType===at.DataPosition.col?U.positionIndex:1/0,Ft=0;Ft<vt;Ft++)if(w=mt[Ft])for(_=0;_<F;_++)w.isGrandTotal||w.isSubtotal&&!(w.grandTotalLevel+(v<=_?1:0)>_+1)||g[_].push(new Yt.Range(tt.row+_+(1<B.Sx?1:0),tt.col+f.Tx+Ft,1,1));for(I=this.Wcr(H),_=0;_<F;_++)g[_]=(0,S.Ucr)(g[_],!0),I[_]&&(g[_]=g[_].concat(I[_]));return g},X.Wcr=function(H){var f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A={},Y=H.getFieldsByArea(At.PivotTableFieldType.columnField).length;for((E=H.dataPosition()).display&&E.positionType===at.DataPosition.col&&Y++,f=0;f<Y;f++)A[f]||(A[f]=[]);for(B=E.display&&E.positionType===at.DataPosition.col?E.positionIndex:1/0,vt=H.position(),mt=H.rZt.HWt[1],_=(tt=H.rZt.HWt[2]).WWt,v=0;v<Y;v++)for(Ft=0,w=this.Gcr(H,v);Ft<w.length;Ft++)for(U=(I=w[Ft]).row;U<vt.row+tt.Sx;U++)for(g=I.col;g<I.col+I.colCount;g++)A[v].push(new Yt.Range(U,g,1,1));if((H.options.grandTotalPosition===At.GrandTotalPosition.col||H.options.grandTotalPosition===At.GrandTotalPosition.both)&&(1<Y&&B===0||E.display&&E.positionType===at.DataPosition.col)){for(F=_.length-1;0<=F;F--)if((ot=_[F])&&ot.isGrandTotal)for(j=1<tt.Sx?1:0;j<tt.Sx;j++)A[0].push(new Yt.Range(vt.row+j,vt.col+mt.Tx+F,1,1))}return A},X.ilr=function(H){var f,B,vt,mt,tt,_={},v=(mt=H.getFieldsByArea(At.PivotTableFieldType.rowField)).length;for((tt=H.dataPosition()).display&&tt.positionType===at.DataPosition.row&&v++,f=H.layoutType()===At.PivotTableLayoutType.tabular,vt=B=0;vt<v-1;vt++)tt.display&&tt.positionType===at.DataPosition.row&&tt.positionIndex===vt?(B++,_[vt]=this.nlr(H)):_[vt]=f?this.nlr(H,mt[vt-B].fieldName||""):this.elr(H,mt[vt-B].fieldName||"");return _},X.elr=function(H,f){for(var B,vt,mt=[],tt=H.rZt.HWt[4],_=0,v=H.getPivotAreaRanges({references:[{fieldName:f}],labelOnly:!0});_<v.length;_++)for(B=v[_],vt=0;vt<B.rowCount;vt++)mt.push(new Yt.Range(B.row+vt,B.col,1,B.colCount+tt.Tx));return mt},X.nlr=function(H,f){var B,vt,mt,tt=[],_=H.position(),v=H.rZt.HWt[3],Ft=H.rZt.HWt[4],w=v.zWt,I=H.layoutType(),U=H.dataPosition(),g=[];if((0,at.ht)(f)){if(B=_.col+U.positionIndex,I===At.PivotTableLayoutType.compact&&(B=_.col),I===At.PivotTableLayoutType.outline)for(vt=0;vt<v.Sx;vt++)(mt=w[vt])&&!mt.isGrandTotal&&!(0,at.ht)(mt.valueFieldName)&&(mt.rowHeaderLevel>U.positionIndex||mt.rowHeaderLevel===U.positionIndex&&!mt.isSubtotal)&&tt.push(new Yt.Range(_.row+v.DQ+vt,B,1,1));else if(I===At.PivotTableLayoutType.tabular)for(vt=0;vt<v.Sx;vt++)(mt=w[vt])&&!mt.isGrandTotal&&mt.YAt>U.positionIndex&&tt.push(new Yt.Range(_.row+v.DQ+vt,B,1,1));else if(I===At.PivotTableLayoutType.compact)for(vt=0;vt<v.Sx;vt++)(mt=w[vt])&&mt.isSigmaValue&&tt.push(new Yt.Range(_.row+v.DQ+vt,B,1,v.Tx+Ft.Tx));U.positionIndex||(g=this.olr(H,B,I===At.PivotTableLayoutType.compact?v.Tx+Ft.Tx:1))}else tt=H.getPivotAreaRanges({references:[{fieldName:f}],labelOnly:!0});return(0,S.Ucr)(tt,!0).concat(g)},X.olr=function(H,f,B){var vt,mt,tt,_=(tt=H.getRange()).content.row+tt.content.rowCount-1,v=[];if(H.options.grandTotalPosition!==At.GrandTotalPosition.none)for(vt=H.getFieldsByArea(At.PivotTableFieldType.rowField).length,mt=0;mt<vt;mt++)v.push(new Yt.Range(_-mt,f,1,B));return v},X.Bcr=function(H){var f=H.rZt.HWt[1],B=H.rZt.HWt[2],vt=H.rZt.HWt[3],mt=H.dataPosition(),tt=H.position(),_=mt.display&&mt.positionType===at.DataPosition.col?H.getFieldsByArea(At.PivotTableFieldType.valueField).length:1,v=(mt=mt.display&&mt.positionType===at.DataPosition.row?H.getFieldsByArea(At.PivotTableFieldType.valueField).length:1,[]),Ft=[];return H.options.grandTotalPosition!==At.GrandTotalPosition.row&&H.options.grandTotalPosition!==At.GrandTotalPosition.both||B.WWt[B.WWt.length-1]&&B.WWt[B.WWt.length-1].isGrandTotal&&Ft.push(new Yt.Range(tt.row,tt.col+f.Tx+B.Tx-_,f.Sx+vt.Sx,_)),H.options.grandTotalPosition!==At.GrandTotalPosition.col&&H.options.grandTotalPosition!==At.GrandTotalPosition.both||vt.zWt[vt.Sx-1]&&vt.zWt[vt.Sx-1].isGrandTotal&&v.push(new Yt.Range(tt.row+f.Sx+vt.Sx-mt,tt.col,mt,f.Tx+B.Tx)),{rowGrandTotalRange:v,colGrandTotalRange:Ft}},o.PivotTableThemeRangeHelper=X},"./dist/plugins/pivot/pivot-table/pivot-table-theme.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt;function dt($,n,a,i,h,b,Q,it,It,t,r,u,d,m){var R=this,z=arguments;X(gt,function(ct,Tt){R[Tt]=1<ct?z[ct+1]:z[ct]}),f(a)&&(R.font=a)}function xt(){}function Mt($,n){return isNaN(n)?n:new At.LineBorder($,n)}function st($,n,a,i,h,b,Q,it,It,t){var r=new ie;return n&&(r.backColor=n),a&&(r.foreColor=a),i&&(r._fontWeight=A,r._fontSize=Y,r._fontFamily=L,r._font=E),h&&(r.borderLeft=Mt($,h)),b&&(r.borderTop=Mt($,b)),Q&&(r.borderRight=Mt($,Q)),it&&(r.borderBottom=Mt($,it)),It&&(r.borderHorizontal=Mt($,It)),t&&(r.borderVertical=Mt($,t)),r}function l($){return $===0?"Background 1":"Accent "+$}function T($){var n,a,i;return 0<=(i=_((a=$-1)/7))&&i<=3?((n=[D,M,s,y][i](a%7))[o.PT_VARI.FIRST_ROW_STRIP_SIZE](1),n[o.PT_VARI.FIRST_COLUMN_STRIP_SIZE](1),n[o.PT_VARI.SECOND_COLUMN_STRIP_SIZE](1),n[o.PT_VARI.SECOND_ROW_STRIP_SIZE](1),n.name(i="Light"+$),n.builtInName(i)):((n=new Xt).name(a="Light0"),n.builtInName(a)),n}function D($){var n=l($),a=($=$===0?(a=" -15",i=" -35",Z.TEXT1+" 50"):(a=" 80",i=" 60",n),n+a),i=n+i;return(n=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(a,0,0,0,Ct,Ct,Ct,Ct,ut)),n[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st($,0,0,0,Ct,ut,Ct,ut)),n[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st($,0,0,0,Ct,ut,Ct,ut)),n[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(i,a,0,0,ut,ut,ut,ut,ut,ut)),n[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(i,a,0,0,Ct,ut,Ct,ut)),n[o.THEME_RES.HEADER_ROW_STYLE](st($,0,0,1,Ct,ut,Ct,ut)),n[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(a,0,0,1)),n[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,0,1)),n[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Z.BLACK,0,0,1)),n[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,0,1)),n[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st($,0,0,1,Ct,ut,Ct,ut)),n}function M($){var n,a,i,h,b,Q=l($);return $===0?(n=" -15",a=" -35",h=Z.TEXT1,i=Z.TEXT1+" 50",b=Z.COLUMN_STRIPE):(n=" 80",a=" 60",h=Q+" -25",i=b=Q),n=Q+n,a=Q+a,($=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(n,0,h,0,Ct,Ct,Ct,Ct,ut)),$[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(b,0,0,0,ut,ut,ut,ut)),$[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(a,0,0,0,ut,ut,ut,ut)),$[o.THEME_RES.FIRST_COLUMN_STYLE](st(i,0,0,1,Ct,Ct,ut)),$[o.THEME_RES.HEADER_ROW_STYLE](st(i,0,Z.TEXT1,1,Rt,Rt,Rt,Rt)),$[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(a,n,Z.TEXT1,1,Ct,Ct,Ct,ut)),$[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),$[o.THEME_RES.COLUMN_SUBHEADING2_STYLE](st(a,0,0,0,Ct,ut)),$[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Q,n,Z.TEXT1,1)),$[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),$[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(i,0,Z.TEXT1,1,Rt,Rt,Rt,Rt)),$}function s($){var n=l($),a="Background 1 -25",i=($=$===0?(i=" -15",h=" -35",Z.TEXT1+" 50"):(i=" 80",h=" 40",n),n+i),h=n+h;return(n=new Xt)[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(h,i,0,0,Ct,Ct,Ct,ut)),n[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(h,i,0,0,Ct,Ct,Ct,ut)),n[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(a,Z.BACKGROUND_COLOR,0,0,ut,Ct,ut,Ct)),n[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(Z.BLACK,Z.BACKGROUND_COLOR)),n[o.THEME_RES.HEADER_ROW_STYLE](st(h,i,Z.TEXT1,1,Ct,Ct,Ct,ut)),n[o.THEME_RES.SUBTOTAL_COLUMN1_STYLE](st(Z.BLACK,a,Z.TEXT1)),n[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st($,0,0,1,Ct,ut,Ct,ut)),n[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,0,1)),n[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(h,0,Z.TEXT1,1,Ct,Ct,Ct,ut)),n[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),n[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(h,i,Z.TEXT1,1,Ct,ut)),n}function y($){var n,a,i,h,b=l($),Q=0;return $===0?(n=" -15",a=" -35",h=Z.TEXT1,i=Z.TEXT1+" 50",Q=1):(n=" 80",a=" 60",i=h=b),n=b+n,a=b+a,(b=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(i,0,h,0,ut,ut,ut,ut,0,ut)),b[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(Z.BLACK,0,h,Q)),b[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(Z.BLACK,n)),b[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(i,n,0,0,Ct,ut,Ct,ut)),b[o.THEME_RES.FIRST_COLUMN_STYLE](st(Z.BLACK,0,h,Q)),b[o.THEME_RES.HEADER_ROW_STYLE](st(i,0,h,Q,Ct,Ct,Ct,ut)),$===0?b[o.THEME_RES.SUBTOTAL_COLUMN1_STYLE](st(a,0,h,Q,ut,Ct,ut)):b[o.THEME_RES.SUBTOTAL_COLUMN1_STYLE](st(a,0,h,Q)),b[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,0,h,Q)),b[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,h,Q)),b[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(i,0,h,Q,Ct,ut)),b}function G($){var n,a,i=Ft;return 0<=(a=_((n=$-1)/7))&&a<4&&((i=[K,c,N,V][a](n%7))[o.PT_VARI.FIRST_ROW_STRIP_SIZE](1),i[o.PT_VARI.FIRST_COLUMN_STRIP_SIZE](1),i[o.PT_VARI.SECOND_COLUMN_STRIP_SIZE](1),i[o.PT_VARI.SECOND_ROW_STRIP_SIZE](1),i.name(a="Medium"+$),i.builtInName(a)),i}function K($){var n,a=l($),i=$===0?(h=" -15",b=" -35",Z.TEXT1+" 50"):(h=" 80",b=" 60",a+" -25"),h=a+h,b=a+b;return(n=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(h,0,Z.TEXT1,0,Ct,Ct,Ct,Ct,ut)),n[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(h,0,0,0,Ct,ut,Ct,ut)),n[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(h,0,0,0,Ct,ut,Ct,ut)),n[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(i,0,0,0,ut,Ct,ut)),n[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(i,0,0,0,Ct,ut,Ct,ut,ut)),n[o.THEME_RES.HEADER_ROW_STYLE](st(i,i,Z.WHITE,0,Ct,Ct,Ct,Ct,ut)),n[o.THEME_RES.FIRST_HEADER_CELL_STYLE](st(Z.BLACK,0,Z.WHITE,1)),n[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,b,Z.WHITE,1)),n[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,Z.BACKGROUND_COLOR,Z.TEXT1,1)),n[o.THEME_RES.COLUMN_SUBHEADING1_STYLE](st(h,0,0,0,Ct,Ct,Ct,ut)),n[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(h,b,Z.WHITE,0,Ct,Ct,Ct,ut,ut)),$!==0&&(n[o.THEME_RES.ROW_SUBHEADING1_STYLE]().borderHorizontal.color=b),n[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(a,h,0,0,Ct,Ct,Ct,ut)),n[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(i,0,Z.TEXT1,1,Ct,Bt)),n}function c($){var n,a,i,h,b=l($),Q=($=$===0?(Q=" -15",n=Z.TEXT1+" 50",a=b+" -25",i=Rt,h=Z.TEXT1,Z.TEXT1+" 50"):(Q=" 80",a=b+" 60",i=ut,h=n=b+" -25",b),b+Q);return(b=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(Z.BLACK,0,Z.TEXT1)),b[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(Z.BLACK,Q)),b[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(Z.BLACK,Q)),b[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(Q,0,0,0,i,Ct,i)),b[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(a,0,0,0,Ct,ut,Ct,ut,ut)),b[o.THEME_RES.HEADER_ROW_STYLE](st(n,$,Z.WHITE,1,Ct,i)),b[o.THEME_RES.SUBTOTAL_COLUMN1_STYLE](st(a,0,Z.TEXT1,1,i,i,i,i)),b[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,a,Z.TEXT1,1)),b[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),b[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Z.BLACK,Q,Z.TEXT1,1)),b[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),b[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(h,0,Z.TEXT1,1,Ct,ut,Ct,Rt)),b}function N($){var n,a,i=l($),h=($=$===0?(h=" -15",b=" -35",n=Z.TEXT1+" 50",a=i+" -5",i+" -25"):(a=i+(h=" 80"),i+(b=" 60")),i+h),b=i+b;return(i=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(h,a,Z.TEXT1,0,ut,Ct,ut,Ct,Ct,ut)),i[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(Z.TEXT1,0,0,0,Ct,ut,Ct,ut)),i[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(Z.TEXT1,0,Z.BLACK,0,Ct,ut,Ct,ut)),i[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st($,h,0,0,ut,Ct,ut)),i[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st($,h,0,0,Ct,ut,Ct,ut)),i[o.THEME_RES.HEADER_ROW_STYLE](st(Z.BLACK,Z.TEXT1,Z.WHITE,0,Ct,Ct,Ct,Ct,Ct,ut)),i[o.THEME_RES.SUBTOTAL_COLUMN1_STYLE](st(b,$,Z.TEXT1,0,ut,ut,ut)),i[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st($,0,Z.TEXT1,1)),i[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,n,1)),i[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),i[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,n,1)),i[o.THEME_RES.ROW_SUBHEADING3_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),i[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(Z.BLACK,Z.TEXT1,Z.WHITE,0,Ct,Ct,Ct,Ct,Ct,ut)),i}function V($){var n,a=l($),i=($=$===0?(i=" -15",n=Z.TEXT1+" 50",a+" -25"):(i=" 80",n=a+" -25",a+" 60"),a+i);return(a=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(Z.WHITE,i,n,0,Ct,Ct,Ct,Ct,Ct,ut)),a[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(Z.BLACK,$,n,1)),a[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(Z.BLACK,i,n,1)),a[o.THEME_RES.SECOND_COLUMN_STRIPE_STYLE](st(Z.BLACK,$,0)),a[o.THEME_RES.SECOND_ROW_STRIPE_STYLE](st(Z.BLACK,$)),a[o.THEME_RES.FIRST_COLUMN_STYLE](st(Z.BLACK,$,n,1)),a[o.THEME_RES.HEADER_ROW_STYLE](st(Z.WHITE,0,n,1,Ct,Ct,Ct,ut)),a[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),a[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),a[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),a[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(Z.BLACK,0,n,1)),a}function O($){var n,a,i=Ft;return 0<=(a=_((n=$-1)/7))&&a<4&&((i=[pt,wt,et,ht][a](n%7))[o.PT_VARI.FIRST_ROW_STRIP_SIZE](1),i[o.PT_VARI.FIRST_COLUMN_STRIP_SIZE](1),i[o.PT_VARI.SECOND_COLUMN_STRIP_SIZE](1),i[o.PT_VARI.SECOND_ROW_STRIP_SIZE](1),i.name(a="Dark"+$),i.builtInName(a)),i}function pt($){var n,a=l($),i=($=$===0?(i=" -15",h=" -35",n=Z.TEXT1+" 50",a+" -25"):(i=" 80",h=" 40",n=a+" -50",a+" 60"),a+i),h=a+h;return(a=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(i,$,Z.TEXT1,0,Ct,Ct,Ct,Ct,ut)),a[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(n,n,Z.WHITE,1,Ct,Ct,Ct,Ct,ut)),a[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(n,n,Z.WHITE,0,Ct,Ct,Ct,Ct,ut)),a[o.THEME_RES.SECOND_COLUMN_STRIPE_STYLE](st(i,0,0,0,ut,Ct,ut)),a[o.THEME_RES.SECOND_ROW_STRIPE_STYLE](st(Z.BLACK,h)),a[o.THEME_RES.HEADER_ROW_STYLE](st(Z.WHITE,n,Z.WHITE,1,Ct,Ct,Ct,ut,ut)),a[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(h,0,Z.TEXT1,1,Ct,Ct,Ct,ut)),a[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(h,i,Z.TEXT1,1,Ct,ut,Ct,ut)),a[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),a[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(Z.BLACK,n,Z.WHITE,1)),a}function wt($){var n,a,i=l($),h=Z.TEXT1+" -25",b=($=$===0?(b=" -15",n=Z.TEXT1+" 50",a=i+" -25",Z.COLUMN_STRIPE):(b=" 80",a=i+" 60",i+" 40"),i+b);return(i=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(n,b,Z.TEXT1,0,Rt,Rt,Rt,Rt)),i[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(n,0,0,0,ut,ut,Ct,ut)),i[o.THEME_RES.REPORT_FILTER_VALUES_STYLE](st(n,0,0,0,Ct,ut,ut,ut)),i[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st($,0,0,0,ut,Ct,ut)),i[o.THEME_RES.SECOND_COLUMN_STRIPE_STYLE](st($,0,0,0,ut,Ct,ut)),i[o.THEME_RES.SECOND_ROW_STRIPE_STYLE](st(a,0,0,0,Ct,ut,Ct,ut)),i[o.THEME_RES.HEADER_ROW_STYLE](st(Z.BLACK,h,Z.WHITE,1)),i[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,a,Z.TEXT1,1)),i[o.THEME_RES.COLUMN_SUBHEADING2_STYLE](st(a,0,0,0,Ct,ut)),i[o.THEME_RES.COLUMN_SUBHEADING3_STYLE](st(a,0,0,0,Ct,ut)),i[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(b,a,Z.TEXT1,1,Ct,Ct,Ct,ut)),i[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,Z.TEXT1,1)),i[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(Z.BLACK,h,Z.WHITE,1)),i}function et($){var n,a,i=(a=l($))+" -25",h=($=$===0?(h=" -15",b=" -35",n=Z.TEXT1+" 50",Z.COLUMN_STRIPE):(h=" 80",b=" 60",n=a+" -25",a),a+h),b=a+b;return(a=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(Z.BLACK,$,h)),a[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(Z.BLACK,0,Z.WHITE,1)),a[o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE](st(i,0,0,ut,Ct,ut)),a[o.THEME_RES.FIRST_ROW_STRIPE_STYLE](st(b,0,0,0,Ct,ut,Ct,ut)),a[o.THEME_RES.HEADER_ROW_STYLE](st(Z.BLACK,Z.TEXT1,Z.WHITE,1)),a[o.THEME_RES.SUBTOTAL_COLUMN1_STYLE](st(b,n,0,0,ut,ut,ut,ut)),a[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,0,Z.WHITE,1)),a[o.THEME_RES.COLUMN_SUBHEADING1_STYLE](st(b,0,0,0,Ct,Ct,Ct,ut)),a[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(n,n,Z.WHITE,1,Ct,Ct,Ct,ut)),a[o.THEME_RES.ROW_SUBHEADING2_STYLE](st(Z.BLACK,0,Z.WHITE,1)),a[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(Z.BLACK,Z.TEXT1,Z.WHITE,1)),a}function ht($){var n,a,i,h,b=l($);return $===0?(n=" -15",a=Z.TEXT1+" 50",i=b+" -50",h=Z.COLUMN_STRIPE):(n=" 80",a=b+" -25",h=b+" 40",i=b),n=b+n,(b=new Xt)[o.THEME_RES.WHOLE_TABLE_STYLE](st(Z.WHITE,i,n,0,Ct,Ct,Ct,Ct,Ct,ut)),b[o.THEME_RES.REPORT_FILTER_LABELS_STYLE](st(Z.BLACK,a,0,0)),b[o.THEME_RES.SECOND_COLUMN_STRIPE_STYLE](st(Z.BLACK,h,0)),b[o.THEME_RES.SECOND_ROW_STRIPE_STYLE](st(Z.BLACK,h)),b[o.THEME_RES.FIRST_COLUMN_STYLE](st(Z.BLACK,a)),b[o.THEME_RES.HEADER_ROW_STYLE](st(Z.WHITE,a,0,0,Ct,Ct,Ct,Rt)),b[o.THEME_RES.FIRST_HEADER_CELL_STYLE](st(Z.BLACK,0,Z.WHITE,1)),b[o.THEME_RES.SUBTOTAL_ROW1_STYLE](st(Z.BLACK,0,n,1)),b[o.THEME_RES.SUBTOTAL_ROW2_STYLE](st(Z.BLACK,0,$===0?Z.TEXT1:Z.WHITE,1)),b[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Z.BLACK,0,Z.WHITE,1)),b[o.THEME_RES.ROW_SUBHEADING1_STYLE](st(Z.BLACK,0,Z.WHITE,1)),b[o.THEME_RES.GRANDTOTAL_ROW_STYLE](st(Z.WHITE,0,Z.WHITE,1,Ct,Rt)),b}function St($,n){$.name(n.name()),X(F,function(a,i){$[i](n[i]())}),X(g,function(a,i){var h=n[i]();$[i](h?h.Gf():Ft)}),$.builtInName(n.builtInName(),!1)}Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTableThemes=o.PivotTableTheme=o.PivotTableStyle=o.PT_VARI=o.THEME_RES=void 0,Yt=ft("@spreadjs/js-sheets-common"),At=ft("Core"),S=ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),at=ft("./dist/plugins/pivot/pivot-table/pivot-table-theme-helper.js"),X=At.GC$.each,H=At.GC$.isEmptyObject,f=At.mt.T1,B=JSON.stringify,vt=JSON.parse,mt=At.mt.p0,tt=Yt.Common.lt.ht,_=Math.floor,v=void 0,Ft=null,w=At.util.go,I=At.NodeHelper.sr,o.THEME_RES={WHOLE_TABLE_STYLE:"wholeTableStyle",REPORT_FILTER_LABELS_STYLE:"reportFilterLabelsStyle",REPORT_FILTER_VALUES_STYLE:"reportFilterValuesStyle",FIRST_COLUMN_STRIPE_STYLE:"firstColumnStripeStyle",SECOND_COLUMN_STRIPE_STYLE:"secondColumnStripeStyle",FIRST_ROW_STRIPE_STYLE:"firstRowStripeStyle",SECOND_ROW_STRIPE_STYLE:"secondRowStripeStyle",FIRST_COLUMN_STYLE:"firstColumnStyle",HEADER_ROW_STYLE:"headerRowStyle",FIRST_HEADER_CELL_STYLE:"firstHeaderCellStyle",SUBTOTAL_COLUMN1_STYLE:"subtotalColumn1Style",SUBTOTAL_COLUMN2_STYLE:"subtotalColumn2Style",SUBTOTAL_COLUMN3_STYLE:"subtotalColumn3Style",BLANK_ROW_STYLE:"blankRowStyle",SUBTOTAL_ROW1_STYLE:"subtotalRow1Style",SUBTOTAL_ROW2_STYLE:"subtotalRow2Style",SUBTOTAL_ROW3_STYLE:"subtotalRow3Style",COLUMN_SUBHEADING1_STYLE:"columnSubheading1Style",COLUMN_SUBHEADING2_STYLE:"columnSubheading2Style",COLUMN_SUBHEADING3_STYLE:"columnSubheading3Style",ROW_SUBHEADING1_STYLE:"rowSubheading1Style",ROW_SUBHEADING2_STYLE:"rowSubheading2Style",ROW_SUBHEADING3_STYLE:"rowSubheading3Style",GRANDTOTAL_COLUMN_STYLE:"grandTotalColumnStyle",GRANDTOTAL_ROW_STYLE:"grandTotalRowStyle"},g=[o.THEME_RES.WHOLE_TABLE_STYLE,o.THEME_RES.REPORT_FILTER_LABELS_STYLE,o.THEME_RES.REPORT_FILTER_VALUES_STYLE,o.THEME_RES.FIRST_COLUMN_STRIPE_STYLE,o.THEME_RES.SECOND_COLUMN_STRIPE_STYLE,o.THEME_RES.FIRST_ROW_STRIPE_STYLE,o.THEME_RES.SECOND_ROW_STRIPE_STYLE,o.THEME_RES.FIRST_COLUMN_STYLE,o.THEME_RES.HEADER_ROW_STYLE,o.THEME_RES.FIRST_HEADER_CELL_STYLE,o.THEME_RES.SUBTOTAL_COLUMN1_STYLE,o.THEME_RES.SUBTOTAL_COLUMN2_STYLE,o.THEME_RES.SUBTOTAL_COLUMN3_STYLE,o.THEME_RES.BLANK_ROW_STYLE,o.THEME_RES.SUBTOTAL_ROW1_STYLE,o.THEME_RES.SUBTOTAL_ROW2_STYLE,o.THEME_RES.SUBTOTAL_ROW3_STYLE,o.THEME_RES.COLUMN_SUBHEADING1_STYLE,o.THEME_RES.COLUMN_SUBHEADING2_STYLE,o.THEME_RES.COLUMN_SUBHEADING3_STYLE,o.THEME_RES.ROW_SUBHEADING1_STYLE,o.THEME_RES.ROW_SUBHEADING2_STYLE,o.THEME_RES.ROW_SUBHEADING3_STYLE,o.THEME_RES.GRANDTOTAL_COLUMN_STYLE,o.THEME_RES.GRANDTOTAL_ROW_STYLE],U={wholeTable:"wholeTableStyle",pageFieldLabels:"reportFilterLabelsStyle",pageFieldValues:"reportFilterValuesStyle",firstRowStripe:"firstRowStripeStyle",secondRowStripe:"secondRowStripeStyle",firstColumnStripe:"firstColumnStripeStyle",secondColumnStripe:"secondColumnStripeStyle",firstColumn:"firstColumnStyle",headerRow:"headerRowStyle",firstHeaderCell:"firstHeaderCellStyle",firstSubtotalColumn:"subtotalColumn1Style",secondSubtotalColumn:"subtotalColumn2Style",thirdSubtotalColumn:"subtotalColumn3Style",blankRow:"blankRowStyle",firstSubtotalRow:"subtotalRow1Style",secondSubtotalRow:"subtotalRow2Style",thirdSubtotalRow:"subtotalRow3Style",firstColumnSubheading:"columnSubheading1Style",secondColumnSubheading:"columnSubheading2Style",thirdColumnSubheading:"columnSubheading3Style",firstRowSubheading:"rowSubheading1Style",secondRowSubheading:"rowSubheading2Style",thirdRowSubheading:"rowSubheading3Style",lastColumn:"grandTotalColumnStyle",totalRow:"grandTotalRowStyle"},o.PT_VARI={FIRST_ROW_STRIP_SIZE:"firstRowStripSize",SECOND_ROW_STRIP_SIZE:"secondRowStripSize",FIRST_COLUMN_STRIP_SIZE:"firstColumnStripSize",SECOND_COLUMN_STRIP_SIZE:"secondColumnStripSize"},F=[o.PT_VARI.FIRST_ROW_STRIP_SIZE,o.PT_VARI.SECOND_ROW_STRIP_SIZE,o.PT_VARI.FIRST_COLUMN_STRIP_SIZE,o.PT_VARI.SECOND_COLUMN_STRIP_SIZE],ot={firstRowStripeSize:o.PT_VARI.FIRST_ROW_STRIP_SIZE,secondRowStripeSize:o.PT_VARI.SECOND_ROW_STRIP_SIZE,firstColumnStripeSize:o.PT_VARI.FIRST_COLUMN_STRIP_SIZE,secondColumnStripeSize:o.PT_VARI.SECOND_COLUMN_STRIP_SIZE},j={firstColumnStripeStyle:o.PT_VARI.FIRST_COLUMN_STRIP_SIZE,firstRowStripeStyle:o.PT_VARI.FIRST_ROW_STRIP_SIZE,secondColumnStripeStyle:o.PT_VARI.SECOND_COLUMN_STRIP_SIZE,secondRowStripeStyle:o.PT_VARI.SECOND_ROW_STRIP_SIZE},ft="name",E="bold 14.667px calibri",A="bold",Y="14.667px",L="calibri",gt=["backColor","foreColor",q="borderLeft",J="borderTop",P="borderRight",bt="borderBottom",k="borderHorizontal",nt="borderVertical","textDecoration","fontStyle","fontWeight","fontSize","fontFamily","_fontVariant","_fontStretch","_lineHeight"],Z={TEXT1:"Text 1",BLACK:"rgb(0,0,0)",COLUMN_STRIPE:"rgb(140,140,140)",WHITE:"rgb(255,255,255)",BACKGROUND_COLOR:"Background 1 -15"},ut=At.LineStyle.thin,Rt=At.LineStyle.medium,Ct=At.LineStyle.empty,Bt=At.LineStyle.double,kt=At.W.F2e,Object.defineProperty(dt.prototype,"font",{get:function(){return this._font},set:function($){At.W.oce(this,$)},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"fontSize",{get:function(){return this._fontSize},set:function($){At.W.W2e(this,$)},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function($){var n=this;n._fontStyle=$,n._font=kt(n._fontStyle,n._fontWeight,n._fontSize,n._fontFamily,n._fontVariant,n._fontStretch,n._lineHeight)},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function($){var n=this;n._fontWeight=$,n._font=kt(n._fontStyle,n._fontWeight,n._fontSize,n._fontFamily,n._fontVariant,n._fontStretch,n._lineHeight)},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function($){var n=this;n._fontFamily=$,n._font=kt(n._fontStyle,n._fontWeight,n._fontSize,n._fontFamily,n._fontVariant,n._fontStretch,n._lineHeight)},enumerable:!1,configurable:!0}),dt.prototype.h5=function($,n,a,i,h,b,Q){var it=this;X(gt,function(It,t){0<=t.indexOf("border")?(a&&f(it[q])&&($[q]=it[q]),n&&f(it[J])&&($[J]=it[J]),b||i||!f(it[k])||($[bt]=it[k]),Q||h||!f(it[nt])||($[P]=it[nt]),h&&f(it[P])&&($[P]=it[P]),i&&f(it[bt])&&($[bt]=it[bt])):f(it[t])&&($[t]=it[t])})},dt.prototype.Gf=function(){var $=new dt,n=B(this.toJSON());return $.fromJSON(vt(n)),$},dt.prototype.toJSON=function(){var $=this,n={};return X(gt,function(a,i){var h=(h=$[i])&&h.toJSON?h.toJSON():h;n[i]=h!==Ft&&H(h)?v:h}),n.font=$.font,n},dt.prototype.fromJSON=function($,n){var a;$&&(a=this,X(gt,function(i,h){var b,Q=$[h];f(Q)&&!tt(Q)&&(0<=h.indexOf("border")?((b=new At.LineBorder).fromJSON(Q,n),a[h]=b):a[h]=Q)}),$.font)&&(a.font=$.font)},ie=dt,o.PivotTableStyle=ie,xt.prototype.h5=function($,n,a,i){var h;i.Oy&&i.Oy()||(h=new At.Style,at.PivotTableThemeHelper.hcr(this,h,i,$,n),this.P5t(a,h))},xt.prototype.P5t=function($,n){var a;$=$=tt($)?{}:$,tt($.backColor)&&($.backColor=n.backColor),$.foreColor===v&&($.foreColor=n.foreColor),tt($.themeFont)&&tt($._fontFamily)&&($.themeFont=n.themeFont),tt($._fontFamily)&&($._fontFamily=n._fontFamily),tt($._fontSize)&&($._fontSize=n._fontSize,$._fontSizeDigit=n._fontSizeDigit,$._fontSizeUnit=n._fontSizeUnit),$._fontStyle===v&&($._fontStyle=n._fontStyle),$._fontWeight===v&&($._fontWeight=n._fontWeight),$._fontVariant===v&&($._fontVariant=n._fontVariant),$._fontStretch===v&&($._fontStretch=n._fontStretch),$._lineHeight===v&&($._lineHeight=n._lineHeight),$._font=kt($._fontStyle,$._fontWeight,$._fontSize,$._fontFamily,$._fontVariant,$._fontStretch,$._lineHeight),tt($.borderLeft)&&(a=n.borderLeft,$.borderLeft=a&&a.Gf()||a,$.borderLeft)&&($.borderLeft.level=20),tt($.borderTop)&&(a=n.borderTop,$.borderTop=a&&a.Gf()||a,$.borderTop)&&($.borderTop.level=20),tt($.borderRight)&&(a=n.borderRight,$.borderRight=a&&a.Gf()||a,$.borderRight)&&($.borderRight.level=20),tt($.borderBottom)&&(a=n.borderBottom,$.borderBottom=a&&a.Gf()||a,$.borderBottom)&&($.borderBottom.level=20),tt($.textDecoration)&&($.textDecoration=n.textDecoration),tt($.cellType)&&($.cellType=n.cellType),tt($.formatter)&&($.formatter=n.formatter)},xt.prototype.toJSON=function(){var $,n,a={name:(n=this).name()};return X(g,function(i,h){($=n[h]())&&(a[h]=$.toJSON())}),X(F,function(i,h){($=n[h]())!==1&&(a[h]=$)}),H(a)?v:a},xt.prototype.wh=function($){var n,a=this,i=[];if(X(g,function(h,b){var Q;((n=a[b]())||j[b])&&(Q={n_:"tableStyleElement",type:At.SJSStylePropsToStyleProps[b]},n&&(Q.dxfId=$.getDxfIndex(n)),j[b]&&j[b]!==1&&(Q.size=a[j[b]]()),i.push(Q))}),0<i.length)return i},xt.prototype.fromJSON=function($,n){var a,i;$&&(a=this,i=$.name,f(i)&&a.name(i,!1),a.sUr($),X(g,function(h,b){var Q,it;(it=$[b]!==v?$[b]:$["_"+b])&&((Q=new ie).fromJSON(it,n),a[b](Q,!1))}))},xt.prototype.sUr=function($){var n=this,a=Object.keys(ot);X(a,function(i,h){var b=$[h]!==v?$[h]:$["_"+h];b&&n[ot[h]](b,!1)}),X(F,function(i,h){var b=$[h]!==v?$[h]:$["_"+h];b&&n[h](b,!1)})},xt.prototype.yh=function($,n){var a,i,h,b;if((b=this).name($.name),$=w($,"tableStyleElement")){for(a=function(Q){var it,It,t,r;if(tt(Q.dxfId))return"continue";it=I(Q.dxfId,0),It=Q.type,Q=I(Q.size,1),t=new ie,typeof b[r=U[It||"wholeTable"]]=="function"&&(n.getDxf(it,t,!0),X(gt,function(u,d){0<=d.indexOf("border")&&t[d]===Ft&&(t[d]=new At.LineBorder)}),b[r](t,!1)),It!=="firstRowStripe"&&It!=="secondRowStripe"&&It!=="firstColumnStripe"&&It!=="secondColumnStripe"||b[It.substr(0,It.length-1)+"Size"](Q,!1)},i=0,h=$;i<h.length;i++)a(h[i]);n.addPivotTableTheme(b)}},Xt=xt,o.PivotTableTheme=Xt,X(g,function($,n){Xt.prototype[n]=mt(n)}),X(F,function($,n){Xt.prototype[n]=mt(n,1)}),Xt.prototype.name=mt(ft),Xt.prototype.builtInName=mt("builtInName"),Qt=function(){},o.PivotTableThemes=Qt,function(){Qt.light0=T(0);for(var $=1;$<=28;$++)Qt["light"+$]=T($),Qt["medium"+$]=G($),Qt["dark"+$]=O($)}(),At.GC$.extend(At.StyleManager.prototype,{addPivotTableTheme:function($){(this.SJt||(this.SJt={}))[$.name()]=$},getPivotTableTheme:function($){var n,a,i;return i=(i=this.SJt)||(this.SJt={}),S.BuiltInPivotTableThemeNames[$.toUpperCase()]?i[n=$.replace("PivotStyle","").toLowerCase()]?i[n]:(St(a=new Xt,i[n]),this.addPivotTableTheme(a),a):i[$]}}),At.GC$.extend(At.Workbook.prototype,{defaultPivotTableTheme:function($){var n,a=(n=this).customPivotTableThemes;return 0<arguments.length?($=$&&$.toLowerCase(),n.isr=$,a.get($)||Qt[$]||void 0):($=n.isr)?(n=Qt[$])!=null?n:a.get($):void 0}})},"./dist/plugins/pivot/pivot-table/pivot-table.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l;function T(e){return e===Z?"":e}function D(e){var p="{type:"+T(e.type)+",fieldName:"+T(e.fieldName)+",offset:"+T(e.offset)+",dataLabel:"+T(function(C){return C.dataOnly===!1&&P(C.labelOnly)||C.dataOnly===!0&&C.labelOnly===!0?"all":C.dataOnly===!1&&C.labelOnly===!1||P(C.dataOnly)&&P(C.labelOnly)?"dataOnly":C.labelOnly!==!0||C.dataOnly?C.labelOnly||C.dataOnly?void 0:"none":"labelOnly"}(e))+",grandRow:"+T(e.grandRow)+",grandCol:"+T(e.grandCol)+",axis:"+T(e.axis);return e.references&&0<e.references.length&&(p+=",references:[",e.references.forEach(function(C){C&&(p+="{axis:"+T(C.fieldName)+",subtotal:"+T(C.subtotal)+",offset:"+T(C.offset),(C=C.items)&&0<C.length&&(p+=",items[",C.forEach(function(W){p+=T(W)+","}),p+="]"),p+="},")}),p+="]"),e.offset&&(e=e.offset,p+=",offset:{row:"+e.row+",col:"+e.col+",rowCount:"+e.rowCount+",colCount:"+e.colCount+"}"),p+="}"}function M(e,p,C,W){return new at.Range(e,p,C,W)}function s(e,p,C){this.b_r=new at.EventNotifier,this.kJt=e,this.jJt=p,this.views=[],C&&this.b_r.addListener(C)}function y(e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut){var Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe,ye=[],De=C.zWt,Ve=C.dataTable;if(C=De[e]){if(De=C.path,oe=C.isSubtotal,ae=C.isGrandTotal,te=C.isBlankRow,re=C.valueFieldName,Gt=C.collapseIndex,ee=C.isValueFieldDim,C=C.compactLevel,(0,H.ht)(re)||(Kt=re),ae&&_t&&(Wt||Ut))return{OJt:Kt,PJt:ye};if(Et&&!Ut&&(oe&&P(Gt)||ae)){for(jt="",de=0;de<Ve[e].length;de++)Ve[e]&&Ve[e][de]&&(jt+=Ve[e][de].value);return{PJt:le=[{fieldName:ae?Bt:kt,itemName:jt}],OJt:Kt}}for(se=De.split(H.Separator),ce=[].concat(W),he=void 0,ve=Et?Ct().sigmaValueTemp:Ct().sigmaValue,P(yt)||Wt||(ce.splice(yt,0,{Zc:ve}),se.splice(yt,0,ve)),me=_t||Wt||oe&&P(Gt)?se.length-1:Lt?Math.max(C,0):p,Ce=0;Ce<=me;Ce++)le={},Pe=ce[Ce],P(Pe)||(le={fieldName:Ne=Pe.Zc,itemName:Fe=Ne===ve?Kt:(0,X.FZt)(x,Pe.Zc,se[Ce])},Ce===me&&(he={name:Ne===ve?Fe:Ne,index:Ce}),Ce===se.length-1&&(te&&(le.isBlankRow=!0),oe&&(le.isSubtotal=!0),P(Gt)||(le.collapseIndex=Gt)),ae&&(le.isGrandTotal=!0),ye.push(le));return{isBlankRow:te,isValueFieldDim:ee,OJt:Kt,activeRowFieldInfo:he,PJt:ye}}}function G(e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut){var Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe=[],ye=C.WWt,De=C.dataTable;if(C=ye[p]){if(ye=C.path,oe=C.isSubtotal,ae=C.isGrandTotal,te=C.valueFieldName,re=C.isBlankColumn,Gt=C.collapseIndex,C=C.grandTotalLevel,(0,H.ht)(te)||(Kt=te),re)return{isBlankColumn:re};if(ae&&_t&&(Wt||Ut))return{OJt:Kt,FJt:Fe};if(Et&&!Ut&&(oe&&P(Gt)&&C===0||ae)){for(ee="",jt=0;jt<De.length;jt++)De[jt]&&De[jt][p]&&(ee+=De[jt][p].value);return{FJt:de=[{fieldName:ae?Bt:kt,itemName:ee}],OJt:Kt}}for(le=ye.split(H.Separator),se=[].concat(W),ce=void 0,he=Et?Ct().sigmaValueTemp:Ct().sigmaValue,P(yt)||Wt||(se.splice(yt,0,{Zc:he}),le.splice(yt,0,he)),ve=_t||Wt||oe&&P(Gt)?le.length-1:e-1,me=0;me<=ve;me++)de=void 0,Ce=se[me],P(Ce)||(de={fieldName:Pe=Ce.Zc,itemName:Ne=Pe===he?te:(0,X.FZt)(x,Ce.Zc,le[me])},me===ve&&(ce={name:Pe===he?Ne:Pe,index:me}),me===le.length-1&&oe&&(de.isSubtotal=!0),P(Gt)||(de.collapseIndex=Gt),ae&&(de.isGrandTotal=!0),Fe.push(de));return{activeColFieldInfo:ce,OJt:Kt,FJt:Fe}}}function K(e){var p=[];return e&&e.forEach(function(C){P(C.itemName)||p.push(C.itemName)}),p.join(" - ")}function c(e,p,C){return!P(e)&&!P(p)&&D(e)===D(p)}function N(e){switch(e){case"origin":return f.PivotAreaType.corner;case"button":return f.PivotAreaType.button;case"topRight":case"topEnd":return f.PivotAreaType.topRight;case"all":return f.PivotAreaType.all;default:return}}function V(e){switch(e){case f.PivotAreaType.corner:return"origin";case f.PivotAreaType.button:return"button";case f.PivotAreaType.topRight:return"topRight";case f.PivotAreaType.all:return"all";default:return}}function O(e,p,C){for(var W=p;W<=C;W++)if(!e[W]||!e[W].isBlankRow)return;return 1}function pt(e,p){return p.conditionalFormats.pJ(e.toJSON(Z,Z),e.context())}function wt(e){var p,C,W,x,yt,_t,Lt,Et,Wt={};if(Et=e.pivotArea){for(p in Wt.pivotArea={},Et)if(Et.hasOwnProperty(p))if(p==="references"&&Et.references)for(C=Wt.pivotArea.references=[],W=0;W<Et.references.length;W++){for(_t in yt={},x=Et.references[W])if(x.hasOwnProperty(_t))if(_t==="items"&&x.items){if(x.items)for(yt.items=[],Lt=0;Lt<x.items.length;Lt++)yt.items.push(x.items[Lt])}else yt[_t]=x[_t];C.push(yt)}else Wt.pivotArea[p]=Et[p]}return e.style&&(Wt.style=et(e.style)),Wt}function et(e){if(e instanceof at.Style)return e.clone();var p=new at.Style;if(typeof e=="string")p.fromJSON(JSON.parse(e),!1,void 0);else{if(typeof e!="object")return null;p.fromJSON(e,!1,void 0)}return p}function ht(e,p,C,W,x,yt,_t,Lt){var Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de;if(Lt===void 0&&(Lt=7),Gt=C.pivotTables.all(),Et=!1,x=!!x,Wt=_t?_t.union(p):p,Lt&f.overlapCheck.pt&&(0,H.o)(Gt,function(se){var ce,he;if((se.name()!==W||!W)&&(he=(se=se.getRange()).page,se=se.content,ce=!1,he&&(ce=he.getIntersect(Wt,0,0)!==null),se.getIntersect(Wt,0,0)!==null||ce))return he={message:Ct().PivotTableErrorMessage_Overlap,cancel:!1,force:!0},x?C.pivotTables.jT(!1,{type:11,args:he}):C.jT(11,he),Et=!0}),Et)return!0;function le(se,ce,he){var ve,me,Ce;if(ce&&he){for(ve=he.row;ve<he.row+he.rowCount;ve++)for(me=he.col;me<he.col+he.colCount;me++)if(se[ve]&&ce&&!ce.contains(ve,me)&&se[ve][me]&&se[ve][me].value)return Ce={message:Ct().PivotTableErrorMessage_ExistData.replace("{}",C.name()),cancel:!1,force:!1},x?C.pivotTables.jT(!1,{type:11,args:Ce}):C.jT(11,Ce),1}}if(Lt&f.overlapCheck.value){for(Ut=C.Ut.W_(3).dataTable,Kt=0,oe=[yt,e];Kt<oe.length;Kt++)for(ae=oe[Kt],te=0,re=[_t,p];te<re.length;te++)if(le(Ut,ae,re[te]))return!0}if(Lt&f.overlapCheck.table&&(Gt=C.tables&&C.tables.all())&&0<Gt.length){for(ee=0,jt=Gt;ee<jt.length;ee++)if(Jt(jt[ee].range(),_t,p))return de=Ct().PivotTableErrorMessage_ExistTable,C.pivotTables.jT(!(de={message:de,cancel:!1,force:!0}),{type:11,args:de}),!0}return!1}function St(e){this.qK=[],this._Jt={fieldLevel:{},itemLevel:{}},this.LJt=e}function $(e,p){return p.priority=e.priority&&e.priority(),p.scope=e.scope&&e.scope(),p.type=e.type&&e.type(),p}function n(e){var p,C;if(!e||bt(e))return 1;for(C in p=!0,e)if(e.hasOwnProperty(C)&&C!=="_id"){p=!1;break}return p}function a(e,p,C){var W,x,yt=p.row,_t=p.col,Lt=p.rowCount,Et=p.colCount;if(C.borderLeft)for(W=0;W<Lt;W++)e[yt+W]||(e[yt+W]={}),P(e[yt+W][_t])&&(e[yt+W][_t]={}),e[yt+W][_t].borderLeft=!0;if(C.borderRight)for(W=0;W<Lt;W++)e[yt+W]||(e[yt+W]={}),P(e[yt+W][_t+Et-1])&&(e[yt+W][_t+Et-1]={}),e[yt+W][_t+Et-1].borderRight=!0;if(C.borderTop)for(e[yt]||(e[yt]={}),x=0;x<Et;x++)P(e[yt][_t+x])&&(e[yt][_t+x]={}),e[yt][_t+x].borderTop=!0;if(C.borderBottom)for(e[yt+Lt-1]||(e[yt+Lt-1]={}),x=0;x<Et;x++)P(e[yt+Lt-1][_t+x])&&(e[yt+Lt-1][_t+x]={}),e[yt+Lt-1][_t+x].borderBottom=!0;if(C.borderHorizontal)for(W=0;W<Lt-1;W++)for(e[yt+W]||(e[yt+W]={}),x=0;x<Et;x++)P(e[yt+W][_t+x])&&(e[yt+W][_t+x]={}),e[yt+W][_t+x].borderBottom=!0;if(C.borderVertical)for(W=0;W<Lt;W++)for(e[yt+W]||(e[yt+W]={}),x=0;x<Et-1;x++)P(e[yt+W][_t+x])&&(e[yt+W][_t+x]={}),e[yt+W][_t+x].borderRight=!0}function i(e,p){e.sort(function(C,W){return p?C.row-W.row:C.col-W.col})}function h(e){var p,C,W,x;if(!e)return[];for(p=[],C=0;C<e.length;C++)e[C]&&p.push(e[C]);if(p.length<=1)return p;if(W=[],p[0].row===p[1].row&&p[0].rowCount===p[1].rowCount)for(i(p,!1),C=0;C<p.length-1;C++)for(x=C+1;x<p.length;x++){if(p[C].col+p[C].colCount!==p[x].col||p[C].row!==p[x].row||p[C].rowCount!==p[x].rowCount){W.push(p[C]),C=x-1,x===p.length-1&&W.push(p[x]);break}if(p[C].colCount=p[C].colCount+p[x].colCount,x===p.length-1){W.push(p[C]),C=x-1;break}}else if(p[0].col===p[1].col&&p[0].colCount===p[1].colCount)for(i(p,!0),C=0;C<p.length-1;C++)for(x=C+1;x<p.length;x++){if(p[C].row+p[C].rowCount!==p[x].row||p[C].col!==p[x].col||p[C].colCount!==p[x].colCount){W.push(p[C]),C=x-1,x===p.length-1&&W.push(p[x]);break}if(p[C].rowCount=p[C].rowCount+p[x].rowCount,x===p.length-1){W.push(p[C]),C=x-1;break}}else W=p;return W}function b(e,p){e.value=p}function Q(e,p){var C=new at.Style;return p=L(p.numFmtId),e=e.Dd&&e.Dd.uv(p),C.formatter=e,C}function it(e,p,C,W,x){var yt,_t,Lt,Et,Wt;for(yt in W)if(W.hasOwnProperty(yt)&&(_t=W[yt],!P(_t)))for(Et in P(C[+yt+e])&&(C[+yt+e]={}),Lt=C[+yt+e],_t)!_t.hasOwnProperty(Et)||P(_t[Et])||(Wt=_t[Et],P(Wt))||P(Wt.value)||(P(Lt[+Et+p])&&(Lt[+Et+p]={}),x(Lt[+Et+p],Wt.value))}function It(e){return P(e)||e<1||isNaN(e)?1:e}function t(e,p,C){return!(e.row!==0&&e.col!==0&&e.row!==Qt&&e.col!==Qt||!(e.row===Qt||e.row<=p)||!(e.col===Qt||e.col<=C)||e.row!==Qt&&e.rowCount!==Qt&&e.row+e.rowCount-1>p||e.col!==Qt&&e.colCount!==Qt&&e.col+e.colCount-1>C)}function r(e,p,C){var W=p.split(":");if(p=(e=mt&&mt.formulaToRanges(e,p,0,0,!0)[0].ranges)&&e[0])return W[0].indexOf("256")!==-1&&(p.row=C?0:Qt),W[0].indexOf("IV")!==-1&&(p.col=C?0:Qt),W[0]==="IV256"&&C?(p.row=Qt,p.col=0):W[0]==="IV1"&&(p.row=0,p.col=Qt),1<W.length&&(W[1].indexOf("256")!==-1&&(p.rowCount=Qt),W[1].indexOf("IV")!==-1)&&(p.colCount=Qt),p}function u(e){return e===Qt?255:e}function d(e){if(e&&mt)return e=M(u(e.row),u(e.col),u(It(e.rowCount)),u(It(e.colCount))),mt.rangesToFormula([e],0,0,15,!1)}function m(e,p,C){var W,x,yt;return M(W=e.row===Qt?p:e.row,x=e.col===Qt?C:e.col,yt=(yt=It(e.rowCount))===Qt?W===p?1:p-W+1:yt,p=(p=It(e.colCount))===Qt?x===C?1:C-x+1:p)}function R(e,p,C,W,x){return 0<(W=m(e,W,x)).row?W.colCount=1:0<W.col?W.rowCount=1:W.rowCount!==1&&W.colCount!==1&&(W.colCount!==Qt&&W.rowCount===Qt?W.rowCount=1:W.colCount=1),W.row!==0&&W.col!==0&&(e.row===Qt?W.row=0:e.col===Qt&&(W.col=0)),W.row=p+W.row,W.col=C+W.col,W}function z(e,p){return 1<e.Q.length&&(e.x2===H.DataPosition.col&&p===2||e.x2===H.DataPosition.row&&p===1)?e.P2:1/0}function ct(e,p){e.foreColor===p.foreColor&&(e.foreColor=Z),e.fontSize===p.fontSize&&(e.fontSize=Z),e.fontWeight===p.fontWeight&&(e.fontWeight=Z),e.fontFamily===p.fontFamily&&(e.fontFamily=Z),e.fontStyle===p.fontStyle&&(e.fontStyle=Z)}function Tt(e,p,C){var W,x;C.pivotArea&&(x=(x=(x=C.pivotArea.references)==null?void 0:x[0])==null?void 0:x.fieldName,W=C.pivotArea.dataOnly?e.dataFields:e.pivotFields,W=!C.pivotArea.dataOnly||C.pivotArea.references&&C.pivotArea.references.length!==0?W[x]:e.dataFields[Object.keys(e.dataFields)[0]])&&(e=(x=p.Dd).av(C.style.formatter))&&(W.numFmtId=e.n,x.md.getTextIndex("f:"+x.pd.getTextIndex(JSON.stringify(e))))}function Ot(e,p){var C="CustomPivotTableStyle_".concat(p);if(e)for(;e.customPivotTableThemes.get(C);)C="".concat(C," ").concat(2);return C}function Pt(e,p,C,W,x,yt,_t,Lt){var Et;return(e=l.call(this,e,Lt)||this).T$=0,(Et=e).Xst=0,Et.cFr=0,Et.eZt={row:P(C)?0:C,col:P(W)?3:W},Et.assignId(),Et.suspendLayout(),Et.rZt=new vt.PivotDataModel,Et.Ti=p,Et.eZt={row:P(C)?0:C,col:P(W)?3:W},C=Et.refresh.bind(Et),Et.options=(0,X.b0)(ie,e,C),Et.EJt(_t),Lt.Dpi=Et.options.subTotalsPosition,W=p&&p.getParent()&&p.getParent().defaultPivotTableTheme(),Et.theme(yt||W&&W.name()||"light16"),Et.HSt=[],Et.zSt=[],P(x)?Et.CWt=f.PivotTableLayoutType.outline:Et.CWt=x,Et.dh.setSigmaValuePosition(H.DataPosition.col,0),Et.EZt={LZt:[],BZt:[],RJt:[],GJt:[]},Et.VJt=[],Et.lZt=[],Et.UJt={},Et.WJt={},xt&&(Et.mJ=new xt(Et)),C=function(Wt){Et.lFr(Wt.type,Wt)},Et.views=new dt(Et.deserialize.bind(Et),Et.serialize.bind(Et),C),Et.zJt="",Et.ZJt="",Et.resumeLayout(),e}function Jt(e,p,C){var W=!1;return(W=p?e.intersect(p.row,p.col,p.rowCount,p.colCount):W)||e.intersect(C.row,C.col,C.rowCount,C.colCount)}function $t(e,p){var C,W,x,yt,_t,Lt;if(p&&p.rowCount*p.colCount){for(C=e.getSpans(p,3),W=[],x=e.Ut,yt=0,_t=C;yt<_t.length;yt++)(Lt=_t[yt]).getIntersect(p,Z,Z)&&W.push(Lt);(0,H.o)(W,function(Et){x.do("removeSpan",Et,3)})}}Yt=this&&this.__extends||(st=function(e,p){return(st=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(C,W){C.__proto__=W}:function(C,W){for(var x in W)Object.prototype.hasOwnProperty.call(W,x)&&(C[x]=W[x])}))(e,p)},function(e,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function C(){this.constructor=e}st(e,p),e.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}),At=this&&this.__assign||function(){return(At=Object.assign||function(e){for(var p,C,W=1,x=arguments.length;W<x;W++)for(C in p=arguments[W])Object.prototype.hasOwnProperty.call(p,C)&&(e[C]=p[C]);return e}).apply(this,arguments)},S=this&&this.__spreadArray||function(e,p,C){if(C||arguments.length===2)for(var W,x=0,yt=p.length;x<yt;x++)!W&&x in p||((W=W||Array.prototype.slice.call(p,0,x))[x]=p[x]);return e.concat(W||Array.prototype.slice.call(p))},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotTable=o.generateCustomPivotTableThemeName=o.synchronizeDataTable=o.setDataForSJSPivotTable=o.PivotTableConditionalFormats=o.RYt=o.isSamePivotArea=o.BuiltInPivotTableThemeNames=void 0,at=ft("Core"),Mt=ft("@spreadjs/js-sheets-common"),X=ft("./dist/plugins/pivot/pivot-util.js"),H=ft("Pivot"),f=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),B=ft("./dist/plugins/pivot/pivot-core/pivot-view.js"),vt=ft("./dist/plugins/pivot/pivot-table/pivot-data-model.js"),mt=ft("SheetsCalc"),tt=ft("./dist/plugins/pivot/pivot-table/pivot-table-theme.js"),_=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-compact-layout.js"),v=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-outline-layout.js"),Ft=ft("./dist/plugins/pivot/pivot-table/pivot-table-layout/pivot-table-tabular-layout.js"),w=ft("./dist/plugins/pivot/pivot.ns.js"),I=ft("@spreadjs/js-calc"),U=ft("./dist/plugins/pivot/pivot-table-entry.js"),g=at.mt.xr,F=at.mt.vo,ot=at.NodeHelper.dr,j=at.mt.Pr,E=at.mt.Hue,A=at.mt.go,Y=at.NodeHelper.ur,L=at.NodeHelper.sr,q=at.NodeHelper.ar,J=at.mt.St,ft=Mt.Common.lt,P=ft.ht,bt=ft._h,k=Mt.Common.zf,ft=Mt.Common.Uf,nt=ft.tR,gt=Mt.Common.kh,Z=void 0,ut=null,Rt=Mt.Common.lt.tv,ft=new Mt.Common.ResourceManager(w.SR,"PivotTables"),Ct=ft.getResource.bind(ft),ie={allowMultipleFiltersPerField:!(kt="subtotal"),fillDownLabels:!(Bt="grandTotal"),insertBlankLineAfterEachItem:!1,grandTotalPosition:f.GrandTotalPosition.both,subTotalsPosition:f.SubtotalsPosition.bottom,subtotalsPosition:f.SubtotalsPosition.bottom,displayFieldsInPageFilterArea:f.DisplayFields.downThenOver,reportFilterFieldsPerColumn:0,bandRows:!1,bandColumns:!1,showRowHeader:!0,showColumnHeader:!0,showDrill:!0,showMissing:!0,missingCaption:ut,rowLabelIndent:1,printDrill:ut,itemPrintTitles:ut,fieldPrintTitles:ut,showFilter:!0,showToolTip:!0,mergeItem:!1,isShowErrorValue:!1,errorValueInfo:ut,rowHeaderCaption:null,colHeaderCaption:null,showHeaders:!0,calcItemAggregation:f.CalcItemAggregation.include,enableDataValueEditing:!1,hideValuesRow:!0},Xt="4294967294",Qt=1/0,o.BuiltInPivotTableThemeNames=function(){for(var e={},p=1;p<=28;p++)e["PIVOTSTYLELIGHT"+p]=!0,e["PIVOTSTYLEMEDIUM"+p]=!0,e["PIVOTSTYLEDARK"+p]=!0;return e}(),s.prototype.save=function(e){var p,C=this;return!P(e)&&C.Hq(e)===ut&&(p=C.jJt(),C.views.push({name:e,config:p}),C.b_r.notify({type:"addPivotTableView",name:e,config:p}),!0)},s.prototype.add=function(e){var p=this;return!P(e.name)&&p.Hq(e.name)===ut&&(p.views.push(e),p.b_r.notify({type:"addPivotTableView",name:e.name,config:e.config}),!0)},s.prototype.remove=function(e){var p;(e=(p=this).Hq(e))!==ut&&(e=p.views.splice(e,1)[0],p.b_r.notify({type:"removePivotTableView",name:e.name}))},s.prototype.get=function(e){var p;if((e=(p=this).Hq(e))!==ut)return p.views[e]},s.prototype.all=function(){return this.views},s.prototype.apply=function(e){var p;(e=(p=this).Hq(e))!==null&&p.kJt(p.views[e].config)},s.prototype.Hq=function(e){for(var p=0;p<this.views.length;p++)if(this.views[p].name===e)return p;return null},s.prototype.toJson=function(){return(0,at.RF)(this.views)},s.prototype.fromJson=function(e){this.views=e},s.prototype.L0=function(){this.views=ut,this.b_r=ut},dt=s,o.isSamePivotArea=c,o.RYt=ht,St.prototype.L0=function(){this.LJt=ut,this.qK=ut,this._Jt=ut},St.prototype.YJt=function(e){for(var p,C=this.qK,W=[],x=P(e),yt=0;yt<C.length;yt++)if(C[yt].pivotAreas){for(p=0;p<C[yt].pivotAreas.length;p++)if(x||c(e,C[yt].pivotAreas[p])){W.push(C[yt].conditionalRule);break}}return W},St.prototype.HJt=function(e,p,C){this.JJt(e,p,C),this.LJt.lFr("addConditionalRule",{pivotAreas:e,conditionalRule:p})},St.prototype.JJt=function(e,p,C){var W,x,yt,_t,Lt,Et,Wt,Ut;if(!(P(e)||e.length<=0)&&p&&(Ut=(yt=this).qK,x=(W=yt.LJt).Ti,!P(x.conditionalFormats))&&(yt={conditionalRule:p,pivotAreas:e},p.pivotTableAreas=e,p.pivotTableName=W.name(),Ut.push(yt),!C)){for(_t=[],Et=0;Et<e.length;Et++)(Lt=W.getPivotAreaRanges(e[Et]))&&0<Lt.length&&(_t=_t.concat(Lt));if(0<_t.length&&(p.ranges(_t),Wt=x.conditionalFormats.qK.map(function(Kt){return Kt.priority()}),(Ut=1<p.priority()||!Wt.some(function(Kt){return Kt===1}))&&Wt.push(p.priority()),x.conditionalFormats.addRule(p),Ut))for(Et=0;Et<Wt.length;Et++)x.conditionalFormats.qK[Et].priority(Wt[Et])}},St.prototype.qJt=function(){var e,p,C,W,x=(W=this).qK,yt=W.LJt.Ti.conditionalFormats;if(!P(yt)){for(W.qK=[],e=0,p=x.length;e<p;e++)C=x[e],yt.removeRule(C.conditionalRule);for(e=0,p=x.length;e<p;e++)C=x[e],W.JJt(C.pivotAreas,C.conditionalRule)}},St.prototype.QP=function(){return this.qK},St.prototype.DJt=function(e){for(var p,C=this.qK,W=this.LJt,x=0;x<C.length;x++)C[x].conditionalRule&&C[x].conditionalRule.priority()===e&&(p=C.splice(x,1),W.lFr("removeConditionalRule",{conditionalRule:p[0].conditionalRule}))},St.prototype.KJt=function(e,p){for(var C,W,x=this.qK,yt=this.LJt,_t=0;_t<x.length;_t++){if(e===x[_t].conditionalRule){for(C=[],W=0;W<p.length;W++)C=C.concat(yt.getPivotAreaRanges(p[W]));e.ranges(C)}x[_t].pivotAreas=p}},St.prototype.XJt=function(e){for(var p=this.qK,C=this.LJt.Ti,W=0;W<p.length;W++)e===p[W].conditionalRule&&C.conditionalFormats.removeRule(e)},St.prototype.$Jt=function(e){for(var p,C,W,x,yt=this.qK,_t=(x=this.LJt).Ti,Lt=0;Lt<yt.length;Lt++)if((p=yt[Lt]).pivotAreas&&e.length===p.pivotAreas.length){for(C=!0,W=0;W<e.length;W++)if(!c(e[W],p.pivotAreas[W])){C=!1;break}C&&(_t.conditionalFormats.removeRule(p.conditionalRule),yt.splice(Lt,1),x.lFr("removeConditionalRule",{conditionalRule:p}))}},St.prototype.tqt=function(e,p,C,W,x){for(var yt,_t,Lt,Et,Wt=this.LJt,Ut=(Et=Wt.Ti).conditionalFormats,Kt=[],oe=Ut.GJ(e.ranges()),ae=Wt.Zc,te=0,re=nt(oe);te<re;te++)(yt=Ut.FX(oe[te],p,C,W,x))&&(Kt=Kt.concat(yt));if(0<nt(Kt)){for(_t=[],Lt=function(Gt){var ee=Et.pivotTables.getRangePivotAreas(Kt[Gt]);ee&&Object.keys(ee).forEach(function(jt){jt===ae&&ee[ae]&&(_t=S(S([],_t,!0),ee[ae],!0))})},te=0;te<Kt.length;te++)Lt(te);this.KJt(e,_t)}else this.XJt(e)},St.prototype.iqt=function(){this.qK.length=0,this._Jt={fieldLevel:{},itemLevel:{}}},St.prototype.count=function(){return nt(this.qK)},xt=St,o.PivotTableConditionalFormats=xt,o.setDataForSJSPivotTable=function(e,p,C){if(!P(p))switch(typeof p){case"boolean":e.b=p?1:0;break;case"string":e.v=C.getTextIndex(p);break;case"object":p instanceof Date?e.v=C.getTextIndex((0,H.kQt)(p)):e.v=p;break;default:e.n=p}},o.synchronizeDataTable=it,o.generateCustomPivotTableThemeName=Ot,Yt(Pt,l=B.PivotView),Pt.prototype.getFieldsModel=function(){return this.dh},Pt.prototype.showNoData=function(e,p){var C,W,x;if(!(C=(x=(W=this).dh)&&!P(e)&&e!==""?x.a1(e,p):C)||P(p))return C;W.refresh(),W.DT({pivotTable:W,type:"showNoData",cacheFieldName:e,isShow:p})},Pt.prototype.updateCalcItem=function(e,p,C,W){var x,yt,_t=(yt=this).dh,Lt=yt.Ti,Et=_t.up(e)[0];try{C!=="="&&C!==""||(C=null),x=_t.x1(e,p,C,W),yt.refresh()}catch(Wt){return Lt.jT(10,Wt.message),!1}return x&&yt.DT({pivotTable:yt,type:"updateCalcItem",calcItemInfo:Et}),x},Pt.prototype.getCalcItems=function(e){return this.dh.up(e)||[]},Pt.prototype.removeCalcItem=function(e,p){var C;(p=(C=this).dh.Rp(e,p))&&0<p.length&&C.DT({pivotTable:C,type:"removeCalcItem",sourceName:e,formulaInfos:p}),C.refresh()},Pt.prototype.addCalcItem=function(e,p,C){var W,x=this,yt=x.dh,_t=x.Ti;if(!P(e)&&p!==""){C!=="="&&C!==""||(C=null);try{W=yt.Db(e,p,C),x.refresh()}catch(Lt){return _t.jT(10,Lt.message),!1}return W&&x.DT({pivotTable:x,type:"addCalcItem",sourceName:e,calcItemName:p}),W}},Pt.prototype.getPivotDetails=function(e){if(P(e))throw new Error(Ct().param_error);if(this.dh)return this.dh.KM(e)},Pt.prototype.getSource=function(){var e;if((e=this.dh)&&typeof(e=e.LN())=="string")return e},Pt.prototype.getSourceFields=function(){var e,p,C,W,x,yt=[];if((x=this.dh)&&(x=x.ky(),!P(x)))for(p=0,C=x;p<C.length;p++)e={name:(W=C[p]).name},(0,H.ht)(W.fieldType)||(e.fieldType=W.fieldType),yt.push(e);return yt},Pt.prototype.updateSource=function(e,p){var C,W,x,yt,_t;(_t=(yt=this).dh)&&(C=yt.getSource(),W=_t.NGr(),x=yt.serialize(),_t.kx(yt.Ti,e,p),e&&yt.DT({pivotTable:yt,type:"updateSource",oldSource:C,oldLayoutInfo:x,oldCacheInfo:W,source:e}),yt.refresh())},Pt.prototype.serialize=function(){return this.nqt(8191)},Pt.prototype.nqt=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt=(Ut=this).layoutType(),oe={},ae=[],te=Ut.options,re=Ut.dh,Gt=Ut.eZt,ee=re.getSigmaValuePosition(),jt={};if(e&f.SerializeIndex.options){for(p in te)te.hasOwnProperty(p)&&typeof te[p]!="object"&&(oe[p]=te[p]);jt.options=oe}if(e&f.SerializeIndex.layout&&(jt.layoutType=Kt),e&f.SerializeIndex.position&&(jt.pivotTablePosition=[Gt.row,Gt.col]),e&f.SerializeIndex.theme&&((Kt=Ut.getThemeName())?jt.theme=Kt.toLowerCase():Ut.theme()&&(jt.theme=Ut.theme().toJSON())),e&f.SerializeIndex.styles)for(C=jt.styles=[],W=Ut.lZt,x=0;x<W.length;x++)C.push(wt(W[x]));if(e&f.SerializeIndex.conditionalFormats&&Ut.mJ&&0<Ut.mJ.count())for(yt=jt.conditionalFormats=[],_t=Ut.getHost(),Lt=Ut.mJ.QP(),x=0;x<Lt.length;x++)Et=Lt[x],yt.push({conditionalRule:pt(Et.conditionalRule,_t),pivotAreas:(0,at.RF)(Et.pivotAreas)});if(e&f.SerializeIndex.showNoData&&(Kt=Ut.dh.ac)&&(jt.showNoDataInfo=At({},Kt)),e&f.SerializeIndex.fields){for(e&f.SerializeIndex.serverInfo&&(Kt=re.Ti.getPivotCacheByName(re.L),jt.serverInfo={name:Ut.Zc,id:Ut.jKe(),cacheId:Kt.FVt,pageRange:Ut.LYt,contentRange:Gt}),Wt=function(de){var le,se,ce,he,ve,me,Ce,Pe,Ne=[];if(de===4&&e&f.SerializeIndex.filter)return le=Ut.getFieldsByArea().map(function(Fe){return Fe.sourceName}),se=re.getAllFieldNameList(),(0,H.o)(se,function(Fe){var ye,De;!(-1<le.indexOf(Fe))&&re.isFilter(Fe)&&(ye={sourceName:Fe},De=Ut.labelFilter(Fe),Fe=Ut.valueFilter(Fe),De&&(ye.labelFilter=De),Fe&&Fe.conditionByName&&(ye.valueFilter=Fe),ye.labelFilter||ye.valueFilter)&&Ne.push(ye)}),0<Ne.length&&(ae[de]=Ne),"break";for(ce=re.nw(de),he=0;he<ce.length;he++)me={sourceName:(ve=ce[he]).a,displayName:ve.Zc},(0,H.ht)(ve.Ar)||(me.subtotal=ve.Ar),(0,H.ht)(ve.Spi)||(me.isShowSubtotalTop=ve.Spi),(0,H.ht)(ve.Nwr)||(me.isShowSubtotal=ve.Nwr),e&f.SerializeIndex.filter&&(Pe=Ut.labelFilter(ve.Zc),Ce=Ut.valueFilter(ve.Zc),Pe&&(me.labelFilter=Pe),Ce)&&Ce.conditionByName&&(me.valueFilter=Ce),e&f.SerializeIndex.sort&&ve.nrt&&(me.sortInfo=ve.nrt),de===3&&e&f.SerializeIndex.showValueAs&&Ut.eqt&&(Pe=Ut.showDataAs(ve.Zc))&&(jt.showDataAsList||(jt.showDataAsList=[]),jt.showDataAsList.push({valueFieldName:ve.Zc,showDataAsInfo:Pe})),Ne.push(me);ae[de]=Ne},x=0;x<5&&Wt(x)!=="break";x++);ee&&(jt.valuePosition=ee),e&f.SerializeIndex.collapse&&(jt.collapseItems=(0,at.RF)(re.dv)||{}),jt.fieldsInfo=ae}return jt},Pt.prototype.deserialize=function(e){this.tJt(e,8191)},Pt.prototype.tJt=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe,ye;(ye=this).Ti.suspendPaint(),ye.suspendLayout();try{for(W=ye.dh,x=0;x<4;x++)W.RM(x);if(yt=W.getAllFieldNameList(),(0,H.o)(yt,function(De){W.clearFilterInfo(De,0)}),p&f.SerializeIndex.serverInfo&&(C=e.serverInfo)!=null&&C.name&&(ye.Zc=e.serverInfo.name,ye.UKn(e.serverInfo.id)),p&f.SerializeIndex.position&&ye.position(e.pivotTablePosition[0],e.pivotTablePosition[1]),p&f.SerializeIndex.layout&&ye.layoutType(e.layoutType),p&f.SerializeIndex.options)for(_t=Object.keys(e.options),x=0;x<_t.length;x++)ye.options[_t[x]]!==e.options[_t[x]]&&(ye.options[_t[x]]=e.options[_t[x]]);if(p&f.SerializeIndex.theme&&e.theme&&(typeof(Lt=e.theme)=="object"&&(Lt=new tt.PivotTableTheme).fromJSON(e.theme),ye.theme(Lt)),p&f.SerializeIndex.styles){for(ye.rqt(),Et=e.styles||[],x=0;x<Et.length;x++)ye.setStyle(Et[x].pivotArea,Et[x].style);ye.uqt()}if(p&f.SerializeIndex.conditionalFormats)for(ye.mJ.qJt(),Wt=e.conditionalFormats||[],x=0;x<Wt.length;x++)ye.mJ.HJt(Wt[x].pivotAreas,Wt[x].conditionalRule,!0);if(p&f.SerializeIndex.showNoData&&(e.showNoDataInfo?ye.dh.ac=At({},e.showNoDataInfo):ye.dh.ac=void 0),p&f.SerializeIndex.fields){for(x=0;x<4;x++)for(Ut=e.fieldsInfo[x],Kt=0;Kt<Ut.length;Kt++)(oe=Ut[Kt])&&(ae=oe.sourceName,te=oe.displayName,re=oe.subtotal,Gt=oe.isShowSubtotalTop,ee=oe.isShowSubtotal,W.isFieldActualExist(ae))&&(jt=W.addFieldByName(ae,te,x,re,void 0),P(jt)||(jt.Spi=Gt,jt.Nwr=ee));e.valuePosition&&W.setSigmaValuePosition(e.valuePosition.positionType,e.valuePosition.positionIndex)}for(x=0;x<5;x++)if(Ut=e.fieldsInfo[x])for(Kt=0;Kt<Ut.length;Kt++)(oe=Ut[Kt])&&(ae=oe.sourceName,de=oe.valueFilter,le=oe.labelFilter,se=oe.sortInfo,te=oe.displayName,p&f.SerializeIndex.filter&&(le&&W.isFieldActualExist(ae)&&W.setLabelFilterInfo(ae,le),de)&&W.isFieldActualExist(ae)&&W.setValueFilterInfo(ae,de),p&f.SerializeIndex.sort)&&se&&W.isFieldActualExist(ae)&&W.setSortInfo(te,se);if(p&f.SerializeIndex.collapse&&(ce=e.collapseItems))for(he=0,ve=Object.keys(ce);he<ve.length;he++)for(jt=ce[me=ve[he]],Ce=0,Pe=Object.keys(jt);Ce<Pe.length;Ce++)Ne=Pe[Ce],ye.collapse(me,Ne,jt[Ne]);p&f.SerializeIndex.showValueAs&&(Fe=e.showDataAsList)&&(0,H.o)(Fe,function(De){ye.showDataAs(De.valueFieldName,De.showDataAsInfo)})}catch(De){throw Error(De)}finally{ye.resumeLayout(),ye.Ti.resumePaint()}},Pt.prototype.EJt=function(e){var p,C=this.options,W=ie;if(!P(e))for(p in e)gt(e,p)&&gt(W,p)&&(C[p]=e[p])},Pt.prototype.altText=function(e,p){if(P(e)&&P(p))return{altText:this.zJt,altTextSummary:this.ZJt};P(e)||(this.zJt=e),P(p)||(this.ZJt=p)},Pt.prototype.name=function(e){var p;if(arguments.length===0)return this.Zc;if(this.Ti&&this.Ti.parent&&this.Ti.parent.BYt(e))throw new Error(Ct().RepeatName);p=this.Zc,this.Zc=e,this.Ti.parent.QYt(e,!0,p),this.lFr("name",{name:e}),this.DT({pivotTable:this,name:e,oldName:p,type:"name",pivotType:0})},Pt.prototype.position=function(e,p,C){var W,x,yt,_t,Lt,Et,Wt,Ut,Kt=this;if(arguments.length===0)return{row:Kt.eZt.row,col:Kt.eZt.col,sheetName:Kt.Ti.name()};if(yt=(W=Kt.Ti)&&W.parent,!P(Kt.Ti)&&typeof e=="number"&&typeof p=="number"){if(_t=Kt.eZt.row,Lt=Kt.eZt.col,Kt.eZt.row=e,Kt.eZt.col=p,!P(C)&&C!==W.name()){if(x=yt&&(0,at._f)(yt,C),P(x))return;for(Wt=(Et=(yt=W.pivotTables)&&yt.PYt).length,Ut=0;Ut<Wt;Ut++)if(Et[Ut].name()===Kt.Zc){Et.splice(Ut,1),W.$Dr({type:"removePivotTable",pivotTable:Kt,isMove:!0});break}Et.length<1&&W.Ut.L5e(),x.pivotTables.PYt.push(Kt),x.$Dr({type:"addPivotTable",pivotTable:Kt}),x.Ut.L5e()}Kt.DT({pivotTable:Kt,row:e,col:p,oldCol:Lt,oldRow:_t,sheetName:W.name(),type:"position",pivotType:0}),this.lFr("position",{row:e,col:p,toSheet:x}),Kt.refresh(),x&&(Kt.Ti=x,Kt.qYt(x.pivotTables.FYt,x.pivotTables._Yt))}},Pt.prototype.sort=function(e,p){if(arguments.length===1)return this.dh.getSortInfo(e);1<arguments.length&&(p=at.GC$.extend(!0,{},p),this.dh.setSortInfo(e,p)),this.refresh()},Pt.prototype.group=function(e){var p,C,W,x=(W=this).Ti,yt=W.dh;e=(0,at.RF)(e);try{(C=yt.bl(e.originFieldName)).W5!==H.PivotDataType.date||(0,H.ht)(C._by)||(e.originFieldName=C.y1),p=this.dh.dy(e)}catch(_t){return void x.jT(10,_t.message)}typeof p=="boolean"?(yt.q1=!0,W.refresh()):W.Ti.jT(10,p)},Pt.prototype.getGroupInfo=function(e){var p;if(!P(e)&&e!=="")return e=(p=this.dh).getSourceNameByFieldName(e)||e,p=p.rC(e),P(p)?void 0:At({},p)},Pt.prototype.ungroup=function(e){var p;e=(p=this.dh).getSourceNameByFieldName(e)||e,p.cy(e),p.q1=!0,(e=this.Ti)&&e.getParent().ok(),this.refresh()},Pt.prototype.add=function(e,p,C,W,x){var yt,_t,Lt=(_t=this).dh,Et=_t.Ti;if(!P(e)&&!P(p)&&P(Lt.Z[p])&&(yt=_t.dh.bl(e))){if(!P(yt.D5)){if(C!==f.PivotTableFieldType.valueField)return void(0,U.throwError)(Ct().FieldAreaLimited);W=H.SubtotalType.sum}try{Lt.addFieldByName(e,p,C,W,x),_t.refresh()}catch(Wt){Et.jT(10,Wt.message)}}},Pt.prototype.remove=function(e){var p,C=(p=this.dh).Z[e];this.suspendLayout(),p.removeFieldOrSigmaByName(e)instanceof U.PivotViewField&&(C===f.PivotTableFieldType.valueField?p.clearValueFilterOfValueField(e):p.y2(e,!1)),this.resumeLayout()},Pt.prototype.theme=function(e){var p,C,W;if(arguments.length===0)return(C=this.BJt)&&((p=new tt.PivotTableTheme).fromJSON(C.toJSON()),(C=p).builtInName(this.BJt.builtInName())),C;p=(C=(p=this.getThemeName())==null?void 0:p.toLowerCase())!=null?C:this.BJt,C=!1,typeof e=="string"?(e=((W=this.Ti)==null?void 0:W.getParent().customPivotTableThemes.get(e))||tt.PivotTableThemes[e.toLowerCase()]||tt.PivotTableThemes.light0)&&(this.Fur=e.name()):(e&&e instanceof tt.PivotTableTheme&&(W=e.toJSON(),(e=new tt.PivotTableTheme).fromJSON(W)),C=!0),C&&this.getThemeName()&&(this.Fur=void 0),this.DT({pivotTable:this,type:"changeTheme",oldTheme:p,pivotType:0}),this.BJt=e,this.lFr("theme",{theme:e}),this.refresh()},Pt.prototype.getThemeName=function(){return this.Fur},Pt.prototype.DT=function(e){var p,C;(C=this.Ti)&&(p=C.getParent(),(0,H.ht)(p.NVt)&&this.getRange&&(p.NVt={range:this.getRange()}),C.Ut.WYt(this,e))},Pt.prototype.AP=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe=this;switch(e.type){case"changeTheme":e.oldTheme&&((Kt=(Et=e.oldTheme).name)!=null&&Kt.call(Et))?oe.theme(e.oldTheme.name()):oe.theme(e.oldTheme);break;case"layoutType":for(oe.layoutType(e.oldLayoutType),p=e.oldFieldSubtotalInfo,C=0,W=Object.keys(p);C<W.length;C++)x=W[C],oe.subtotalPosition(x,p[x]);break;case"name":oe.name(e.oldName);break;case"position":oe.position(e.oldRow,e.oldCol,e.sheetName);break;case"setStyle":oe.lZt.pop();break;case"options":oe.options[e.pn]=e.old;break;case"addCalcField":oe.removeCalcField(e.fieldName);break;case"removeCalcField":oe.addCalcField(e.fieldName,e.formula);break;case"showDataAs":P(e.oldShowDataAs)?oe.showDataAs(e.fieldName,{showDataAs:H.PivotShowDataAs.normal}):oe.showDataAs(e.fieldName,e.oldShowDataAs);break;case"resetPivotStyle":oe.rqt(e.areaModel,e.rangeModel);break;case"adjustRange":oe.eZt.row=e.oldRow;break;case"conditionalRulesChange":oe.mJ.qK=e.originalConditionalRules,oe.mJ.qJt();break;case"addCalcItem":oe.removeCalcItem(e.sourceName,e.calcItemName);break;case"removeCalcItem":for(yt=0,_t=e.formulaInfos;yt<_t.length;yt++)Lt=_t[yt],oe.addCalcItem(e.sourceName,Lt.calcItemName,Lt.formula);break;case"updateCalcItem":Et=(Kt=e.calcItemInfo).sourceName,Wt=Kt.calcItemName,Ut=Kt.formula,Kt=Kt.priority,oe.updateCalcItem(Et,Wt,Ut,Kt);break;case"showNoData":oe.showNoData(e.cacheFieldName,!e.isShow);break;case"setNodeValue":oe.setNodeValue(e.nodeInfo,e.oldValue);break;case"isShowSubtotalTop":oe.subtotalPosition(e.fieldName,e.oldShowSubtotalPosition);break;case"isShowSubtotal":oe.subtotalVisible(e.fieldName,e.oldIsShowSubtotal);break;case"updateSource":oe.updateSource(e.oldSource,e.oldCacheInfo),oe.deserialize(e.oldLayoutInfo)}},Pt.prototype.updateField=function(e,p,C){var W=this,x=W.dh,yt=W.Ti;if(e===Ct().sigmaValue)x.setSigmaValuePosition(p-1,C);else if(!P(e))try{x.changeFieldArea(e,p,C),W.refresh()}catch(_t){return yt.jT(10,_t.message),!1}},Pt.prototype.sq=function(e,p,C){var W,x,yt,_t,Lt,Et,Wt,Ut=(Wt=(Et=this).dh).getFieldInfoByName(e),Kt=Wt.Z;if(p&&Ut){if(Kt[e]===f.PivotTableFieldType.valueField)(0,X.R$)(Et,e,Ut.Or&&Ut.Or.showDataAs),Et.showDataAs(e,{showDataAs:H.PivotShowDataAs.normal});else if(Kt[e]!==f.PivotTableFieldType.filterField)for(W=0,x=Wt.nw(f.PivotTableFieldType.valueField);W<x.length;W++)(yt=x[W]).Or&&yt.Or.baseFieldName===e&&(0,X.R$)(Et,yt.Zc,yt.Or&&yt.Or.showDataAs)}else if(Ut&&!p){if(Kt[e]===f.PivotTableFieldType.valueField&&C!==f.PivotTableFieldType.valueField)(0,X.R$)(Et,e,Ut.Or&&Ut.Or.showDataAs),Et.showDataAs(e,{showDataAs:H.PivotShowDataAs.normal});else if(!(Kt[e]!==f.PivotTableFieldType.rowField&&Kt[e]!==f.PivotTableFieldType.columnField||C!==f.PivotTableFieldType.filterField&&C!==f.PivotTableFieldType.valueField))for(_t=0,Lt=Wt.nw(f.PivotTableFieldType.valueField);_t<Lt.length;_t++)(yt=Lt[_t]).Or&&yt.Or.baseFieldName===e&&((0,X.R$)(Et,e,yt.Or&&yt.Or.showDataAs),Et.showDataAs(yt.Zc,{showDataAs:H.PivotShowDataAs.normal}))}},Pt.prototype.updateFieldName=function(e,p){e=this.dh.getFieldInfoByName(e),typeof p=="string"&&(e&&this.dh.changeFieldName(e,p)?(this.dh.q1=!0,this.refresh()):this.Ti.jT(10,Ct().PivotTableErrorMessage_EmptyFieldName))},Pt.prototype.autoFitColumn=function(){var e,p=this.oqt();(e=this.Ti).suspendPaint(),(0,H.o)(p,function(C){(0,H.o)(C,function(W){e.setColumnWidth(W.col,W.width)})}),e.resumePaint()},Pt.prototype.oqt=function(){var e,p,C,W,x,yt,_t,Lt,Et,Wt=this.eZt.col,Ut=(Et=this.rZt.HWt[2]).jN,Kt=Et.WWt,oe=Et.Tx,ae=this.mZt().length,te=[],re=[],Gt=!1,ee=!1;for((Et=this.dh.getSigmaValuePosition()).display&&Et.positionType===1&&(Et.positionIndex===(ae+=1)-2?Gt=!0:Et.positionIndex!==ae-1&&(ee=!0)),e=this.eZt.row+this.eZt.rowCount,p=this.eZt.col;p<this.eZt.col+Ut;p++)C=at.mt.qf(p,this.Ti,3,1,e),te.push([{col:p,width:C}]);for(W=ut,x=ee?3:2,p=0;p<oe;p++)_t=Kt[p].path,yt=Kt[p].isSubtotal,Lt=(_t=_t.split(H.Separator))[ae-x],Gt&&(Lt=Kt[p].valueFieldName),C=at.mt.qf(Wt+Ut+p,this.Ti,3,1,e),W!==null&&W!==Lt?(this.aqt(re,te),(re=[]).push({col:Wt+Ut+p,width:C}),p===Kt.length-1&&te.push(S([],re,!0))):(yt&&(this.aqt(re,te),re=[]),re.push({col:Wt+Ut+p,width:C}),p===Kt.length-1&&this.aqt(re,te)),W=_t[ae-x],Gt&&(W=Kt[p].valueFieldName);return te},Pt.prototype.aqt=function(e,p){var C,W,x=[];e.forEach(function(yt){x.push(yt.width)}),C=Math.max.apply(Math,x),W=[],e.forEach(function(yt){W.push({col:yt.col,width:C})}),p.push(S([],W,!0))},Pt.prototype.collapse=function(e,p,C){if(arguments.length===2)return this.dh.getCollapse(e,p);2<arguments.length&&(this.dh.setCollapse(e,p,C),this.refresh())},Pt.prototype.labelFilter=function(e,p){var C,W=(C=this.dh).getSourceNameByFieldName(e)||e;if(arguments.length===1)return C.getLabelFilterInfo(e)||W&&C.getLabelFilterInfo(W);C.setLabelFilterInfo(W,p),this.refresh()},Pt.prototype.valueFilter=function(e,p){var C,W=(C=this.dh).getSourceNameByFieldName(e);if(arguments.length===1)return C.getValueFilterInfo(e)||W&&C.getValueFilterInfo(W);C.setValueFilterInfo(W,p),this.refresh()},Pt.prototype.subtotalType=function(e,p){return this.subTotalType.apply(this,arguments)},Pt.prototype.subTotalType=function(e,p){var C=this,W=C.Ti;if(!P(C.dh)){if(arguments.length===1)return C.dh.xy(e);try{C.dh.xy(e,p)}catch(x){W.jT(10,x.message)}C.refresh()}},Pt.prototype.layoutType=function(e){var p,C,W,x,yt=(x=this).Ti;if(arguments.length===0)return x.CWt;if(yt.suspendPaint(),x.suspendLayout(),p={},(C=x.dh.nw()).forEach(function(_t){p[_t.Zc]=x.subtotalPosition(_t.Zc)}),W=x.CWt,x.CWt!==e)switch(x.CWt=e){case f.PivotTableLayoutType.compact:x.outline=!0,x.outlineData=!0,x.compact=void 0,x.compactData=void 0;break;case f.PivotTableLayoutType.outline:x.outline=!0,x.outlineData=!0,x.compact=!1,x.compactData=!1;break;case f.PivotTableLayoutType.tabular:x.compact=!1,x.compactData=!1,x.outline=void 0,x.outlineData=void 0}this.DT({pivotTable:this,layoutType:e,oldLayoutType:W,type:"layoutType",pivotType:0,oldFieldSubtotalInfo:p}),e!==f.PivotTableLayoutType.tabular&&C.forEach(function(_t){_t.Spi=!0}),this.lFr("layoutType",{type:e}),x.resumeLayout(),yt.resumePaint()},Pt.prototype.dataPosition=function(e,p){var C,W=this;if(arguments.length===0)return W.dh.getSigmaValuePosition();C=W.getFieldsByArea(e+1).length,p<0?p=0:C<p&&(p=C),W.dh.setSigmaValuePosition(e,p),W.refresh()},Pt.prototype.getItemsByField=function(e){return this.dh.Kz(e)},Pt.prototype.showDataAs=function(e,p){if(arguments.length===1)return this.dh.getFieldInfoByName(e).Or;var C=this.dh.getFieldInfoByName(e).Or;p.showDataAs===H.PivotShowDataAs.normal?this.eqt=!1:this.eqt=!0,this.dh.getFieldInfoByName(e).Or=p,this.lFr("showDataAs",{fieldName:e,showDataAsInfo:p}),C=C&&At({},C),this.DT({pivotTable:this,fieldName:e,oldShowDataAs:C,type:"showDataAs",pivotType:0}),this.refresh()},Pt.prototype.subtotalPosition=function(e,p){var C,W=(C=this.dh.getFieldInfoByName(e))&&C.Spi,x=P(W)?f.SubtotalsPosition.none:W?f.SubtotalsPosition.top:f.SubtotalsPosition.bottom;if(arguments.length===1)return x;x===p||!C||p!==f.SubtotalsPosition.top&&p!==f.SubtotalsPosition.bottom||(C.Spi=p===f.SubtotalsPosition.top,this.lFr("subtotalPosition",{fieldName:e,position:p}),this.DT({pivotTable:this,fieldName:e,isShowSubtotalTop:W,oldShowSubtotalPosition:x,type:"isShowSubtotalTop",pivotType:0}),this.refresh())},Pt.prototype.subtotalVisible=function(e,p){var C=this.dh.getFieldInfoByName(e),W=this.options.subtotalsPosition,x=C&&C.Nwr;if(arguments.length===1)return P(x)?W!==f.SubtotalsPosition.none:x;P(x)||((W===f.SubtotalsPosition.top||W===f.SubtotalsPosition.bottom)&&p||W===f.SubtotalsPosition.none&&!p)&&(p=void 0),x!==p&&C&&(C.Nwr=p,this.DT({pivotTable:this,fieldName:e,isShowSubtotal:p,oldIsShowSubtotal:x,type:"isShowSubtotal",pivotType:0}),this.refresh())},Pt.prototype.getFieldsByArea=function(e){var p,C,W=this.dh;return(this.dh.nw(e)||[]).map(function(x){return C=x.Zc,e=W.Z[C],p=W.nw(e),p=(0,U.in)(p,C),C={fieldName:C,sourceName:x.a,dataType:x.W5,pivotArea:e,pivotIndex:p},x.W5!==H.PivotDataType.string&&(C.start=x._startValue,C.end=x._endValue),C})},Pt.prototype.getField=function(e){var p,C,W;return(W=(C=this.dh).getFieldInfoByName(e))?(p=C.Z[e],C=C.nw(p),C=(0,U.in)(C,e),e={fieldName:e,sourceName:W.a,dataType:W.W5,pivotArea:p,pivotIndex:C},W.W5!==H.PivotDataType.string&&(e.start=W._startValue,e.end=W._endValue),e):null},Pt.prototype.addCalcField=function(e,p){var C=this,W=C.Ti;try{C.dh.QVt(e,p),C.dh.q1=!0,C.refresh()}catch(x){return void W.jT(10,x.message)}C.dh.QVt(e,p),C.dh.q1=!0,C.refresh(),C.DT({pivotTable:C,fieldName:e,formula:p,type:"addCalcField",pivotType:0})},Pt.prototype.getCalcFields=function(){return this.dh.WVt()},Pt.prototype.removeCalcField=function(e){var p,C,W,x,yt,_t=e;for((yt=(x=this).dh.getFieldInfoByName(e))&&(_t=yt.a),yt=this.dh.L,p=this.dh.Ti.getCalcFields(yt),x.dh.HVt(e),x.dh.fit(_t),x.dh.q1=!0,(yt=this.Ti)&&yt.getParent().ok(),this.refresh(),C=0;C<p.length;C++)(W=p[C]).Zc===e&&this.DT({pivotTable:this,fieldName:e,formula:W.D5,type:"removeCalcField",pivotType:0})},Pt.prototype.adjustRange=function(){var e,p=this.rZt.HWt[0].Sx,C=e=this.eZt.row,W=this.eZt.col;0<p&&e-(p+1)<0&&(this.eZt.row=p+1,this.lFr("adjustRange",{}),this.DT({pivotTable:this,oldRow:C,oldCol:W,type:"adjustRange",pivotType:0}))},Pt.prototype.Uct=function(){var e,p,C,W,x,yt,_t,Lt=(_t=this).Ti,Et=_t.m_e;Lt.suspendPaint(),_t.adjustRange(),e=(yt=this.rZt.HWt)[0],W=yt[1],p=yt[2],C=yt[3],yt=yt[4],e.setStartInfo(0,0),_t.LYt={row:this.eZt.row-(e.Sx+1),col:this.eZt.col,rowCount:e.Sx,colCount:e.Tx},_t.eZt.rowCount=W.Sx+C.Sx,_t.eZt.colCount=W.Tx+p.Tx,W.setStartInfo(0,0),p.setStartInfo(0,W.Tx),C.setStartInfo(p.Sx,0),yt.setStartInfo(p.Sx,C.Tx),Et&&($t(Lt,_t.LYt),$t(Lt,_t.eZt)),_t.sqt(),_t.uqt(),_t.mJ.qJt(),(e=_t.Ti&&_t.Ti.getParent())&&e.NVt&&(W=e.NVt.range,yt=_t.getRange(),W&&(p=W.page,C=W.content,W=W.page?W.page.union(W.content):W.content,x=yt.page,yt=yt.content,!Et)&&W.rowCount&&W.colCount&&ht(C,yt,_t.Ti,_t.Zc,!0,p,x)&&_t.Ti.pivotTables.jT(!0),e.NVt=ut),_t.m_e=!1,Lt.pivotTables.qYt(),Lt.resumePaint()},Pt.prototype.getValue=function(e,p){var C,W,x,yt,_t,Lt=(te=this).dh,Et=e-this.eZt.row,Wt=p-this.eZt.col,Ut=(te=te.rZt.HWt)[0],Kt=te[1],oe=te[2],ae=te[3],te=te[4],re=e,Gt=p;return(_t=0<Ut.Sx&&0<Ut.Tx)&&(re=e-this.LYt.row,Gt=p-this.LYt.col),_t&&Ut.Sx>re?Ut.Sl(re,Gt):Kt.Sx>Et?Kt.Tx>Wt?Kt.Sl(Et,Wt):(C=oe.Sl(Et,Wt-Kt.Tx),yt=(W=Lt.nw(2)[Et-1])&&W.W5,x=W&&Lt.cC(W.a),yt===2&&!x&&(p=(0,H.parseStringToDate)(C))?p:C):ae.Tx>Wt?(_t=ae.Sl(Et-Kt.Sx,Wt),yt=(W=Lt.nw(1)[Wt])&&W.W5,x=W&&Lt.cC(W.a),(0,H.ht)(_t)?_t:yt===2&&!x&&(Ut=(0,H.parseStringToDate)(_t))?Ut:this.CWt===f.PivotTableLayoutType.compact?_t+"":_t):Lt.nw(3).length===0||(C=te.Sl(Et-Kt.Sx,Wt-Kt.Tx))===X.GC_EMPTY_VALUE?ut:!this.cqt(ae,e)||(this.isTitleRow(ae,e)||this.isBlankRow(ae,e))&&!this.isSubtotalRow(ae,e)||(re=this.lqt(C),(0,H.ht)(re))?C:re},Pt.prototype.Kbt=function(e,p,C){var W,x=e-this.eZt.row,yt=p-this.eZt.col,_t=(Wt=this.rZt.HWt)[0],Lt=Wt[1],Et=Wt[2],Wt=Wt[3],Ut=e,Kt=p;(W=0<_t.Sx&&0<_t.Tx)&&(Ut=e-this.LYt.row,Kt=p-this.LYt.col),W&&_t.Sx>Ut&&_t.Kbt(Ut,Kt,C),Lt.Sx>x&&(Lt.Tx>yt?Lt.Kbt(x,yt,C):Et.Kbt(x,yt-Lt.Tx,C)),Wt.Tx>yt&&(e=this.CWt===f.PivotTableLayoutType.compact?C+"":C,Wt.Kbt(x-Lt.Sx,yt,e))},Pt.prototype.lqt=function(e){var p,C=this;if(P(e)){if(!C.eqt){if(C.options.showMissing){if(p=C.options.missingCaption,(0,X.kWt)(e)&&!(0,H.ht)(p))return p}else if((0,X.kWt)(e))return 0}}else if(e instanceof I.CalcError||e===1/0)return C.options.isShowErrorValue&&!P(C.options.errorValueInfo)?C.options.errorValueInfo:e===1/0?I.Errors.Number:void 0},Pt.prototype.qYt=function(e,p){var C,W=(C=this.getRange()).content;(C=C.page)&&this.fqt(e,p,C),this.fqt(e,p,W)},Pt.prototype.fqt=function(e,p,C){for(var W=C.row;W<C.row+C.rowCount;W++)e[W]=!0;for(W=C.col;W<C.col+C.colCount;W++)p[W]=!0},Pt.prototype.cqt=function(e,p){return e.QWt===3&&this.eZt.rowCount+this.eZt.row>p},Pt.prototype.isSubtotalRow=function(e,p){return(p=e.zWt[p-e.DQ-this.eZt.row])&&p.isSubtotal},Pt.prototype.isBlankRow=function(e,p){return(p=e.zWt[p-e.DQ-this.eZt.row])&&p.isBlankRow},Pt.prototype.isTitleRow=function(e,p){return this.CWt!==f.PivotTableLayoutType.tabular&&!(!(p=e.zWt[p-e.DQ-this.eZt.row])||p.isValueFieldDim!==void 0&&p.isValueFieldDim)},Pt.prototype.sJt=function(e,p,C){var W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee;if(ee=this.getPivotInfoImp(e,p,!0)){W=Z,yt=x=void 0,_t=ee.value,Lt=ee.area,Et=ee.menuArea,Wt=ee.valueFieldName,Ut=ee.rowInfos,Kt=ee.colInfos,oe=ee.colHeadFieldInfo,ae=ee.activeRowFieldInfo,te=ee.activeColFieldInfo,ee=this.hqt(e,p)&&this.hqt(e,p).formatter;try{P(ee)||ee==="General"||(typeof ee=="string"?_t=at.Be.Re(_t,ee):ee.format&&(_t=ee.format(_t)))}catch{}if(Et!==3){switch(this.options.showMissing&&(yt=this.options.missingCaption),Lt){case 3:if(!P(Ut)){if(Et===5||Ut.length===1&&Ut[0].fieldName===kt){_t=_t||Ut[0].itemName||yt,P(_t)||(W=[_t]);break}if(ae){for(;0<=ae.index&&Ut[ae.index]&&P(Ut[ae.index].itemName);)ae.index=ae.index-1;(re=Ut[ae.index])&&(x=re.itemName+" ("+re.fieldName+")")}W=[x,Ct().toolTipContent_Row+K(Ut)]}break;case 2:if(P(oe)&&!P(Kt)){if(Et===5||Kt.length===1&&Kt[0].fieldName===kt){_t=_t||Kt[0].itemName||yt,P(_t)||(W=[_t]);break}if(te){for(;0<=te.index&&Kt[te.index]&&P(Kt[te.index].itemName);)te.index=te.index-1;(re=Kt[te.index])&&(x=re.itemName+" ("+re.fieldName+")")}W=[x,Ct().toolTipContent_Column+K(Kt)]}break;case 4:P(Wt)||(P(_t=_t||yt)&&(_t=Ct().toolTipContent_NoValue),W=[Wt,x=Ct().toolTipContent_Value+_t],P(Ut)||(re=Ct().toolTipContent_Row+K(Ut),W.push(re)),P(Kt))||(re=Ct().toolTipContent_Column+K(Kt),W.push(re))}if(!P(W)){for(Gt=0;Gt<W.length;Gt++)W[Gt]=k.j0(W[Gt]);C?W.unshift(Ct().PivotTableForAccessibility+this.Zc):W[0]="<b>"+W[0]+"</b>",W=W.join(`\r
  77. `)}}return W}},Pt.prototype.getPivotInfo=function(e,p){var C,W;if(((W=(C=this).getRange()).content.contains(e,p)||W.page&&W.page.contains(e,p))&&(W=C.getPivotInfoImp(e,p),!P(W)))return W.row=e,W.col=p,W},Pt.prototype.getPivotInfoImp=function(e,p,C,W,x){var yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee=e-(Gt=this).eZt.row,jt=p-Gt.eZt.col;return Gt.Oy()?{menuArea:3}:(re=e-Gt.LYt.row,yt=p-Gt.LYt.col,te=(Wt=Gt.rZt.HWt)[0],_t=Wt[1],Lt=Wt[2],Et=Wt[3],Wt=Wt[4],Ut=(oe=Gt.dh).B,Kt=oe.R,oe=oe.Q,te.Sx>re?((ae=Gt.vqt(re,yt,te)).row=e,ae.col=p,(te=te.XWt(re,yt))&&(ae.pageFieldInfo={fieldName:te}),ae.menuArea=0,ae):_t.Sx>ee?_t.Tx>jt?((ae=Gt.vqt(ee,jt,_t)).row=e,ae.col=p,re=_t.ZWt[jt],ae.menuArea=3,ee==_t.Sx-1&&re?(ae.cornerFieldInfo={fieldName:re.fieldName,isDim:re.isDim,isCompactRoot:re.isCompactRoot},re.isCompactRoot||(ae.menuArea=2)):ee==0&&jt==0&&Gt.rot().length===1&&ae.value&&(ae.menuArea=1),ae):Gt.dqt(ee,jt-_t.Tx,Lt,Kt,!1,C,W,x):Et.Tx>jt?Gt.dqt(ee-_t.Sx,jt,Et,Ut,!0,C,W,x):Gt.pqt(ee-_t.Sx,jt-_t.Tx,[Et,Lt,Wt],[Ut,Kt,oe],C,W,x))},Pt.prototype.vqt=function(e,p,C){return{relativeRow:e,relativeColumn:p,value:C.Sl(e,p),area:C.QWt}},Pt.prototype.pqt=function(e,p,C,W,x,yt,_t){var Lt=this,Et=C[0],Wt=C[1],Ut=(C=C[2],W[0]),Kt=W[1],oe=(W=W[2],Lt.IZt),ae={},te=(ae=1<Lt.dh.Q.length?Lt.dh.getSigmaValuePosition():ae).positionType,re=(ae=ae.positionIndex,Lt.CWt===f.PivotTableLayoutType.compact);return Et=y(e,p,Et,Ut,oe,te===0?ae:Z,!0,re,x,yt,_t),Ut=G(e,p,Wt,Kt,oe,te===1?ae:Z,!0,0,x,yt,_t),(Wt=Lt.vqt(e,p,C)).menuArea=4,!Et||Et.isValueFieldDim!==!1||P(te)&&!_t||(Wt.menuArea=3),Et&&Et.isBlankRow&&(Wt.menuArea=3),Et&&(Wt.rowInfos=Et.PJt),Ut&&!Ut.isBlankColumn&&(Wt.colInfos=Ut.FJt),Kt=te===0?Et&&Et.OJt:Ut&&Ut.OJt,P(Kt)&&Lt.dh.Q.length===1&&(Kt=W[0].Zc),yt&&Lt.dh.Q.length===1&&(Kt=this.dh.getFieldInfoByName(Kt).a),Wt.area=C.QWt,Wt.valueFieldName=Kt,Wt},Pt.prototype.dqt=function(e,p,C,W,x,yt,_t,Lt){var Et,Wt,Ut,Kt,oe=(Kt=this).IZt,ae=Kt.CWt===f.PivotTableLayoutType.compact,te=Kt.vqt(e,p,C),re={},Gt=(re=1<Kt.dh.Q.length?Kt.dh.getSigmaValuePosition():re).positionType;return re=re.positionIndex,x?(x=C.zWt[e])&&(te.menuArea=2,x.isBlankRow&&(te.menuArea=3),x.isGrandTotal&&(te.menuArea=5),Wt=Gt===0?re:Z,(!ae&&!P(Wt)&&p===Wt&&x.valueFieldName||ae&&x.isSigmaValue)&&(te.menuArea=4),_t||(Et=y(e,p,C,W,oe,Wt,!1,ae,yt,_t,Lt))&&(te.activeRowFieldInfo=Et.activeRowFieldInfo,te.rowInfos=Et.PJt,Et.OJt)&&(te.valueFieldName=Et.OJt)):e===0?(x="",(Ut=C.ZWt[p])?(x=Ut.fieldName,Ut=Ut.isCompactRoot,x&&(te.colHeadFieldInfo={fieldName:x,itemName:"",isRootCell:!0,isCompactRoot:Ut},te.menuArea=ae?3:2)):W.length===0&&te.value&&1<=Kt.dh.Q.length?te.menuArea=4:te.menuArea=3):(x=C.WWt[p])&&(te.menuArea=2,Ut=x.isGrandTotal,x.isBlankColumn||(Ut&&(te.menuArea=5),P(Wt=Gt===1?re:Z)||e-1!==Wt||(te.menuArea=4),_t)||(Et=G(e,p,C,W,oe,Wt,!1,0,yt,_t,Lt))&&(te.activeColFieldInfo=Et.activeColFieldInfo,te.colInfos=Et.FJt,Et.OJt)&&(te.valueFieldName=Et.OJt)),te},Pt.prototype.Oy=function(){var e=(W=this.dh).G,p=W.B,C=W.R,W=W.Q;return!(0<e.length||0<p.length||0<C.length||0<W.length)},Pt.prototype.wZt=function(){return this.dh.queryItem()},Pt.prototype.Get=function(){return this.dh.Get()},Pt.prototype.bZt=function(){return this.dh.B},Pt.prototype.mZt=function(){return this.dh.R},Pt.prototype.gZt=function(){return this.dh.G},Pt.prototype.pZt=function(){return this.dh.Q},Pt.prototype.mqt=function(){return this.dh.getSigmaValuePosition().positionType},Pt.prototype.bit=function(){var e=this.dh;return[].concat(e.G,e.B,e.R)},Pt.prototype.rot=function(){var e=this.dh;return[].concat(e.Q)},Pt.prototype.getRange=function(){var e,p;return(p=this).Oy()?{page:ut,content:M(p.eZt.row,p.eZt.col,18,3)}:(e=M((e=p.eZt).row,e.col,e.rowCount,e.colCount),p.LYt&&(p=M((p=p.LYt).row,p.col,p.rowCount,p.colCount)).colCount*p.rowCount?{page:p,content:e}:{page:ut,content:e})},Pt.prototype.clone=function(e,p,C,W){var x,yt=(x=this).Ti.parent;if(!P(e)&&e.trim().length!==0&&yt&&(x=yt.fMt.getPivotCacheByName(x.dh.L)))return new Pt(e=(0,X.fJt)(e,yt.BQt),p,C,W,void 0,void 0,void 0,yt.UYt(x.getName(),e))},Pt.prototype.suspendLayout=function(){this.Xst<=0&&(this.bqt=this.getRange()),this.Xst++},Pt.prototype.resumeLayout=function(){this.Xst--,this.refresh()},Pt.prototype.refresh=function(){this.iM(!1)},Pt.prototype.iM=function(e,p){this.Xst<=0&&(this.Xst=0,this.dh.q3(Z,e,Z,p),this.bqt=ut,e=this.Ti)&&e.hP()&&e.repaint()},Pt.prototype.updateDataModel=function(){var e=this;switch(e.rZt.c5(),e.CWt){case f.PivotTableLayoutType.outline:v.PivotTableOutlineLayout.render(e);break;case f.PivotTableLayoutType.tabular:Ft.PivotTableTabularLayout.render(e);break;case f.PivotTableLayoutType.compact:_.PivotTableCompactLayout.render(e)}},Pt.prototype.paint=function(e,p,C,W){var x,yt,_t,Lt,Et,Wt;this.Ti.suspendPaint(),x=this.Ti,yt=this.LYt,_t=this.eZt,Wt=x.pivotTables.xJt,p||(x.suspendCalcService(),Lt=x.b3(),Et=W?at.StorageType.data:at.StorageType.data|at.StorageType.style,yt&&yt.rowCount*yt.colCount&&(Wt?Lt&&Lt.gF(yt.row,yt.col,yt.rowCount,yt.colCount):x.KI(yt.row,yt.col,yt.rowCount,yt.colCount,3,Et,!1,!1,!0)),_t&&(!Wt&&(Wt=W?at.UsedRangeType.data:at.UsedRangeType.data|at.UsedRangeType.style,Wt=(W=x.getUsedRange(Wt))==null?void 0:W.getIntersect(_t,_t.rowCount,_t.colCount))&&x.KI(Wt.row,Wt.col,Wt.rowCount,Wt.colCount,3,Et,!1,!1,!0,!!this.options.enableDataValueEditing),Lt)&&Lt.gF(_t.row,_t.col,_t.rowCount,_t.colCount)),C||this.updateDataModel(),p||((Lt=x.b3())&&!C&&(_t&&Lt.gF(_t.row,_t.col,_t.rowCount,_t.colCount),yt)&&yt.rowCount*yt.colCount&&Lt.gF(yt.row,yt.col,yt.rowCount,yt.colCount),x.resumeCalcService(!1)),this.Ti.resumePaint()},Pt.prototype.gqt=function(e,p){var C,W,x=e-(C=this).eZt.row,yt=p-C.eZt.col,_t=(Ut=C.rZt.HWt)[0],Lt=Ut[1],Et=Ut[2],Wt=Ut[3],Ut=Ut[4],Kt=e,oe=p;return(W=0<_t.Sx&&0<_t.Tx)&&(Kt=e-C.LYt.row,oe=p-C.LYt.col),W&&_t.Sx>Kt?_t.ML(Kt,oe):Lt.Sx>x?Lt.Tx>yt?Lt.ML(x,yt):Et.ML(x,yt-Lt.Tx):Wt.Tx>yt?Wt.ML(x-Lt.Sx,yt):Ut.ML(x-Lt.Sx,yt-Lt.Tx)},Pt.prototype.wqt=function(e,p,C){var W=this.BJt;(W=W&&Object.keys(W).length!==0?W:new tt.PivotTableTheme).h5(e,p,C,this)},Pt.prototype.hqt=function(e,p){var C=(x=this).UJt,W=x.WJt,x=(C=C[e]&&C[e][p],W=W[e]&&W[e][p],x.gqt(e,p));if(C||W||x)return e=new at.Style,P(C)||e.h5(C),P(W)||e.h5(W),P(x)||e.h5(x),e},Pt.prototype.getStyle=function(e){for(var p,C,W=!1,x=(C=this.lZt).length-1;0<=x;x--)c(e,C[x].pivotArea)&&(W=!0,C[x].style)&&(p?p.compose(C[x].style):p=C[x].style.clone());if(W)return p},Pt.prototype.setStyle=function(e,p){var C=this;P(e)||(e.references&&0<e.references.length&&function(W){W.references&&1<W.references.length&&(W.references.sort(function(x,yt){return x.fieldName>yt.fieldName?-1:x.fieldName<yt.fieldName?1:void 0}),W.references.forEach(function(x){x&&x.items&&1<x.items.length&&x.items.sort(function(yt,_t){return _t<yt?-1:1})}))}(e),C.yqt(e,p)&&this.DT({pivotTable:this,pivotArea:e,style:p,type:"setStyle"}),C.uqt(),C.lFr("setStyle",{pivotArea:e,style:p}),(C=this.Ti)&&C.hP()&&C.repaint())},Pt.prototype.yqt=function(e,p,C,W){var x;if(!P(e)&&(!C||p))return C=this,p?p.clone?x=p.clone():(x=new at.Style).fromJSON(p,!1,Z):x=p,C.lZt.push({style:x,pivotArea:e,isFakeStyle:W}),!0},Pt.prototype.getHost=function(){return this.Ti},Pt.prototype.rqt=function(e,p){var C=this,W=[],x={};at.GC$.extend(W,C.lZt),at.GC$.extend(x,C.UJt),C.lZt=e||[],C.UJt=p||{},C.lFr("resetPivotStyle",{areaModel:e,rangeModel:p}),C.DT({type:"resetPivotStyle",areaModel:W,rangeModel:x,pivotTable:C,pivotType:0})},Pt.prototype.clearAll=function(){var e,p,C,W,x,yt,_t,Lt;for((Lt=this).suspendLayout(),p=(e=Lt.getFieldsByArea()).length,C=Lt.dh,W=p-1;0<=W;W--)x=e[W].fieldName,Lt.remove(e[W].fieldName),x=C.getSourceNameByFieldName(x),C.cC(x)&&C.cy(x,null,!0);for(Lt.rqt(),_t=(yt=Lt.mJ.QP()).length-1;-1<_t;_t--)Lt.mJ.XJt(yt[_t].conditionalRule);Lt.resumeLayout()},Pt.prototype.getConditionalRules=function(e){return this.mJ.YJt(e)},Pt.prototype.addConditionalRule=function(e,p){this.DT({pivotTable:this,type:"conditionalRulesChange",originalConditionalRules:this.mJ.qK.slice(),pivotType:0}),this.mJ.HJt(e,p)},Pt.prototype.removeConditionalRule=function(e){this.DT({pivotTable:this,type:"conditionalRulesChange",originalConditionalRules:this.mJ.qK.slice(),pivotType:0}),this.mJ.XJt(e)},Pt.prototype.tqt=function(e,p,C,W,x){this.mJ.tqt(e,p,C,W,x)},Pt.prototype.iqt=function(){this.mJ.iqt()},Pt.prototype.DJt=function(e){this.mJ.DJt(e)},Pt.prototype.Cqt=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me;if(e&&0<e.length&&p){for(C=this.UJt,W=this.WJt,x=0,yt=e.length;x<yt;x++)if(_t=e[x])for(Lt=et(p),Et=_t.row,Wt=_t.col,Ut=_t.rowCount,Kt=_t.colCount,oe=void 0,(Lt.borderLeft||Lt.borderRight||Lt.borderTop||Lt.borderBottom||Lt.borderHorizontal||Lt.borderVertical)&&a(oe={},_t,Lt),ae=Lt.borderLeft,te=Lt.borderRight,re=Lt.borderTop,Gt=Lt.borderBottom,Lt.borderLeft=Z,Lt.borderRight=Z,Lt.borderTop=Z,Lt.borderBottom=Z,ee=0;ee<Ut;ee++)for(C[Et+ee]||(C[Et+ee]={}),oe&&oe[Et+ee]&&!W[Et+ee]&&(W[Et+ee]={}),jt=0;jt<Kt;jt++)P(C[Et+ee][Wt+jt])?(C[Et+ee][Wt+jt]=et(Lt),oe&&oe[Et+ee]&&oe[Et+ee][Wt+jt]&&(de=new at.Style,le=oe[Et+ee][Wt+jt],de.borderLeft=le.borderLeft?ae:Z,de.borderRight=le.borderRight?te:Z,de.borderTop=le.borderTop?re:Z,de.borderBottom=le.borderBottom?Gt:Z,W[Et+ee][Wt+jt]=de)):(se=C[Et+ee][Wt+jt],(ce=et(Lt)).h5(se),oe&&oe[Et+ee]&&oe[Et+ee][Wt+jt]&&(de=new at.Style,le=oe[Et+ee][Wt+jt],de.borderLeft=le.borderLeft?ae:Z,de.borderRight=le.borderRight?te:Z,de.borderTop=le.borderTop?re:Z,de.borderBottom=le.borderBottom?Gt:Z,W[Et+ee]&&W[Et+ee][Wt+jt]&&de.h5(W[Et+ee][Wt+jt]),W[Et+ee]||(W[Et+ee]={}),W[Et+ee][Wt+jt]=de),C[Et+ee][Wt+jt]=ce);if((he=p.formatter)&&typeof he=="string"&&J(he))for(ve=0;ve<e.length;ve++)(me=e[ve])&&this.Ti.SL(me.row||0,me.col||0,he)}},Pt.prototype.Iqt=function(e){return!(e.labelOnly===!0&&e.dataOnly===!0||e.labelOnly===!0&&!e.references&&P(e.type)&&!e.grandRow&&!e.grandCol)},Pt.prototype.rJt=function(e,p){var C,W=(C=this).eZt,x=C.rZt.HWt[4];return!C.Oy()&&x.Sx!==0&&x.Tx!==0&&(C=x.Sx,x=x.Tx,!!M(W.row+W.rowCount-C,W.col+W.colCount-x,C,x).contains(e,p))},Pt.prototype.setNodeValue=function(e,p){return this.oJt(e,p,!1)},Pt.prototype.oJt=function(e,p,C){var W,x,yt,_t=(yt=this).dh;if(!P(e))return typeof p=="number"?(e=yt.Aqt(e),(0,H.ht)(e)||(x=_t.tQt(e),W=_t.XVt(e,p),yt.DT({type:"setNodeValue",pivotTable:yt,nodeInfo:e,oldValue:x}))):(0,H.ht)(p)&&(e=yt.Aqt(e),(0,H.ht)(e)||(x=_t.tQt(e),W=_t.iQt(e),yt.DT({type:"setNodeValue",pivotTable:yt,nodeInfo:e,oldValue:x}))),yt.iM(C),W},Pt.prototype.Aqt=function(e,p){var C,W,x,yt,_t,Lt=(_t=this.dh).getAllFieldNameList(),Et=_t.X;if(!((e=(0,at.RF)(e))&&e.fieldInfos&&0<e.fieldInfos.length&&(C=this.getCalcItems(),(W=!1,H.o)(e.fieldInfos,function(Wt){var Ut,Kt=Wt.fieldName;if(p){if(!(Ut=Et[Kt]))return}else if(!(Ut=_t.getSourceNameByFieldName(Kt))){if(Lt.indexOf(Kt)===-1)return;Ut=Kt}C.some(function(oe){return oe.sourceName===Ut})?W=!0:Wt.fieldName=Ut}),W))){if(e.valueInfo){if(x=e.valueInfo.sourceName,p){if(!(yt=Et[x]))return}else if(!(yt=_t.getSourceNameByFieldName(x))){if(Lt.indexOf(x)===-1)return;yt=x}if(this.getCalcFields().some(function(Wt){return Wt.fieldName===x||Wt.fieldName===yt}))return;e.valueInfo.sourceName=yt}return e}},Pt.prototype.getNodeValue=function(e){var p=this.dh;if(!P(e))return e=this.Aqt(e,!0),(0,H.ht)(e)?ut:p.tQt(e)},Pt.prototype.getNodeInfo=function(e,p){var C,W,x=(W=this).dh;if(W.rJt(e,p)&&(e=(W=W.getPivotInfoImp(e,p)).valueFieldName,p=W.rowInfos,W=W.colInfos,x=x.getFieldInfoByName(e),!P(x.a))&&!P(x.Ar))return C={fieldInfos:[],valueInfo:{sourceName:e,subtotalType:x.Ar}},e=function(yt){var _t=yt.fieldName;yt=yt.itemName,(0,H.ht)(yt)||_t===Ct().sigmaValue||C.fieldInfos.push({fieldName:_t,fieldItem:yt})},p&&0<p.length&&(0,H.o)(p,e),W&&0<W.length&&(0,H.o)(W,e),C},Pt.prototype.getOverwriteList=function(){var e,p;return(p=(e=this.dh).eQt())&&0<p.length&&(0,H.o)(p,function(C){(C=C.fieldInfos)&&0<C.length&&(0,H.o)(C,function(W){var x=e.getFieldNameBySourceName(W.fieldName);x&&(W.fieldName=x)})}),p},Pt.prototype.clearOverwriteList=function(){this.dh.rQt(),this.refresh()},Pt.prototype.getPivotAreaRanges=function(e){return this.Fvr(e)},Pt.prototype.Fvr=function(e,p){var C,W,x;return P(e)||!this.Iqt(e)?[]:(C=this,e.grandRow||e.grandCol?C.Nqt(e):P(e.references)?P(e.type)?e.labelOnly!==!0?(W=C.rZt.HWt,x=C.eZt,[M(W[4].DQ+x.row,W[4].jN+x.col,W[3].Sx,W[2].Tx)]):[]:C.Tqt(e):C.Mqt(e,p))},Pt.prototype.Nqt=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se=(ce=(le=this).options.grandTotalPosition)===f.GrandTotalPosition.both||ce===f.GrandTotalPosition.row,ce=ce===f.GrandTotalPosition.both||ce===f.GrandTotalPosition.col;if(se||ce){if(x=(Ut=le.rZt.HWt)[4],yt=Ut[3],Ut=Ut[2],C=e.references,W=e.references&&0<e.references.length,_t=(jt=le.eZt).row,jt=jt.col,x=M(x.DQ+_t,x.jN+jt,yt.Sx,Ut.Tx),yt=M(yt.DQ+_t,yt.jN+jt,yt.Sx,yt.Tx),_t=M(Ut.DQ+_t+1,Ut.jN+jt,Ut.Sx-1,Ut.Tx),jt=le.dh.Q.length,ee=(Ut=le.dh.getSigmaValuePosition()).positionType===H.DataPosition.row,Ut=Ut.display,Lt=M(x.row+x.rowCount-(Ut&&ee?jt:1),yt.col,Ut&&ee?jt:1,yt.colCount+x.colCount),Et=M(_t.row,x.col+x.colCount-(Ut&&!ee?jt:1),_t.rowCount+x.rowCount,Ut&&!ee?jt:1),Ut=e.offset,Kt=e.grandRow===!0&&se,oe=e.grandCol===!0&&ce,Kt)Wt=Lt;else{if(!oe)return[];Wt=Et}if(W&&(ae={dataOnly:e.dataOnly,labelOnly:e.labelOnly,references:C},te=le.Mqt(ae))&&0<te.length){for(re=[],Gt=0;Gt<te.length;Gt++)Kt&&(te[Gt]=Lt.getIntersect(te[Gt],0,0)),oe&&te[Gt]&&(te[Gt]=Et.getIntersect(te[Gt],0,0)),te[Gt]&&re.push(te[Gt]);return Ut?[]:re}if(e.grandRow===!0&&e.grandCol===!0&&se&&ce&&!e.references&&(p=Lt.getIntersect(Et,0,0)))return[p];if(W){if((ae=Rt(e)).dataOnly=!0,ae.labelOnly=!1,(te=le.Mqt(ae))&&0<te.length){for(re=[],de=0;de<te.length;de++)(p=Wt.getIntersect(te[de],0,0))&&re.push(p);return Ut?[]:re=h(re)}}else if(ee=e.grandRow?yt:_t,p=Wt.getIntersect(e.labelOnly&&!e.dataOnly?ee:x,0,0))return Ut?e.labelOnly?(jt=R(Ut,p.row,p.col,Wt.row+Wt.rowCount-1,Wt.col+Wt.colCount-1),[p.getIntersect(jt)]):[]:[p]}return[]},Pt.prototype.Tqt=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae=(te=(Ut=this).eZt).row,te=te.col,re=(Kt=Ut.rZt.HWt[2]).DQ,Gt=Kt.jN,ee=Kt.Sx,jt=Kt.Tx,de=(oe=Ut.rZt.HWt[3]).DQ,le=oe.Tx,se=e.offset;if(e.type===f.PivotAreaType.corner)return ee=M(ae,te,ee-1,le),P(se)?[ee]:[M(ae+(Wt=m(se,de-2,Gt-1)).row,te+Wt.col,Wt.rowCount,Wt.colCount).getIntersect(ee,ee.rowCount,ee.colCount)];if(e.type===f.PivotAreaType.topRight)return de=M(ae+re,te+Gt+(le=Kt.ZWt.length),1,jt-le),P(se)?[de]:[M(ae+re+(Wt=m(se,0,jt-le-1)).row,te+Gt+le+Wt.col,Wt.rowCount,Wt.colCount).getIntersect(de,de.rowCount,de.colCount)];if(e.type!==f.PivotAreaType.button||P(e.fieldName)){if(e.type===f.PivotAreaType.all)return(ee=Ut.getRange()).page?[ee.page,ee.content]:[ee.content]}else{for(re=Ut.dh.Z[e.fieldName],p=se=void 0,P(re)&&e.fieldName===Ct().Values&&((jt=Ut.mqt())===H.DataPosition.row?re=f.PivotTableFieldType.rowField:jt===H.DataPosition.col&&(re=f.PivotTableFieldType.columnField)),re===0?p=Ut.LYt:re===1?p={row:ae+(se=oe).DQ,col:te+se.jN}:re===2&&(p={row:ae+(se=Kt).DQ,col:te+se.jN}),C=void 0,W=[],re===1?W=oe.WWt:re===2&&(W=Kt.zWt),x=0;x<W.length;x++)W[x]&&W[x].path===e.fieldName&&(C=x);if(P(C)){if(re===0){for(yt=Ut.dh.G,x=0;x<yt.length;x++)if(yt[x]&&yt[x].Zc===e.fieldName)return _t=Ut.options.displayFieldsInPageFilterArea,Lt=Ut.options.reportFilterFieldsPerColumn,Et=e.type!==f.PivotAreaType.button,_t===f.DisplayFields.downThenOver?Lt===0?[M(p.row+x,Et?p.col+1:p.col,1,1)]:[new at.Range(p.row+x%Lt,Et?p.col+3*Math.floor(x/Lt)+1:p.col+3*Math.floor(x/Lt),1,1)]:Lt===0?[M(p.row,Et?p.col+3*x+1:p.col+3*x,1,1)]:[M(p.row+Math.floor(x/Lt),Et?p.col+x%Lt*3+1:p.col+x%Lt*3,1,1)]}else if(re===1&&Ut.CWt===f.PivotTableLayoutType.compact&&(Wt=(le=(Gt=(se=oe)==null?void 0:se.ZWt)==null?void 0:Gt[0])==null?void 0:le.compactFieldList)&&0<=(C=Wt.findIndex(function(ce){return ce===e.fieldName})))return[M(p.row-1,p.col+C,1,1)];return[]}if(Ut.CWt===f.PivotTableLayoutType.compact)return[M(p.row-1,p.col,1,1)];if(re===1)return[M(p.row-1,p.col+ +C,1,1)];if(re===2)return[M(p.row,p.col+ +C-1,1,1)]}return[]},Pt.prototype.Mqt=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe,ye,De,Ve,Le,fe,Re,Ke,lo,ao,po,Xe,xe,yo,to,fo,mo,vo,co,So,Ge,We,Ye,qe,ge,go,$e,eo,To,Qe,ro,Fo,No,_o,Do,Io,wo,oo,He,io,Eo=(io=(He=this).dh).Ti.getPivotCacheByName(io.L);if(e=(0,at.RF)(e),Qe=He.rZt.HWt[4],C=He.eZt.row,W=He.eZt.col,x=Qe.DQ,yt=Qe.jN,_t=He.rZt.HWt[3].Sx,Lt=He.rZt.HWt[2].Tx,Et=io.Z,Wt=He.options.subTotalsPosition,Ut=io.Q.length,Kt=[],ae=(oe=e.references).length===1,re=e.offset,Qe=Ct().Values,Gt=io.getSigmaValuePosition(),re&&e.labelOnly!==!0)return Kt;for(ee={},jt=0,de=oe.length;jt<de;jt++)ee[se=(le=oe[jt]).fieldName]=le;for(he=io.B,ve=io.R,oo=Ce=me=ce=!1,jt=he.length-1;0<=jt;jt--)ee[he[jt].Zc]&&(me=!0,Pe||(Pe=ee[he[jt].Zc],Ne=jt),ce||e.offset?ee[he[jt].Zc].xqt=!0:ce===!1&&(ce=!0));for(ce=!1,jt=ve.length-1;0<=jt;jt--)ee[ve[jt].Zc]&&(Pe||(Pe=ee[ve[jt].Zc],Ne=jt),!(Ce=!0)===ce?ce=!0:ee[ve[jt].Zc].xqt=!0);if(ae&&oe[0].fieldName===Qe&&(oo=!0,Ne=Gt.positionIndex),re&&(me&&Ce||!me&&!Ce&&!oo||!Pe&&!oo))return Kt;for(jt=0,de=oe.length;jt<de;jt++){if(se=(le=oe[jt]).fieldName,Fe=le.items,ye=e.labelOnly,De=e.dataOnly,Ve=le.subtotal,!(Le=[])===De&&P(ye)?ye=De=!0:(De===!1&&ye===!1||De===Z&&ye===Z)&&(De=!0),(fe=se===Ct().Values)&&1<Ut)te=Gt.positionType===H.DataPosition.row?1:2;else{if(fe&&Ut===1&&(P(Fe)||Fe.length===1&&Fe[0]===io.Q[0].Zc)){ye&&(Le=[M((Re=Gt.positionType===H.DataPosition.row)?C+x:C,Re?W:W+yt,Re?_t:1,Re?1:Lt)],Kt.push(Le)),De&&(Le=[M(C+x,W+yt,_t,Lt)],Kt.push(Le));continue}te=Et[se]}if(Ye=(Re=io.getFieldInfoByName(se))&&Re.Spi,Ke=(0,X.getActualSubtotalPosition)(Wt,Ye,Re==null?void 0:Re.Nwr),Ye=void 0,te===1)Ye=He.rZt.HWt[3];else if(te===2)Ye=He.rZt.HWt[2];else{if(te!==0){Kt.push([]);continue}if(Ye=He.rZt.HWt[0],P(Fe)&&e.labelOnly){for(ao=io.G,po=He.LYt.row,Xe=He.LYt.col,xe=0;xe<ao.length;xe++)if(ao[xe]&&ao[xe].Zc===se){if(yo=He.options.displayFieldsInPageFilterArea,to=He.options.reportFilterFieldsPerColumn,fo=e.type!==f.PivotAreaType.button,yo===f.DisplayFields.downThenOver){if(to===0){Le=[M(po+xe,fo?Xe+1:Xe,1,1)];break}Le=[new at.Range(po+xe%to,fo?Xe+3*Math.floor(xe/to)+1:Xe+3*Math.floor(xe/to),1,1)];break}if(to===0){Le=[M(po,fo?Xe+3*xe+1:Xe+3*xe,1,1)];break}Le=[M(po+Math.floor(xe/to),fo?Xe+xe%to*3+1:Xe+xe%to*3,1,1)];break}Kt.push(Le);continue}}if(lo=Ye&&Ye.YWt){if(mo=void 0,P(Fe))if(p&&p[se])Le=p[se];else{if((qe=(Ye=Re&&Eo.zRt(Re.a))&&Ye.DH())&&0<qe.length){if(ge=lo[se]){for(vo=io.Q,co={},xe=0;xe<Ut;xe++)co[vo[xe].Zc]=xe;for(xe=0;xe<qe.length;xe++)P(qe[xe])||(We=ge[Ge=qe[xe]],P(We))||He.Dqt(Le,We,te,C,W,x,yt,_t,Lt,ye,De,Ve,Ke,ae,fe,Ge,co[Ge],le.xqt,Z,e.outline)}}else for($e in go=lo[se])go.hasOwnProperty($e)&&(We=lo[se]&&lo[se][$e],P(We)||He.Dqt(Le,We,te,C,W,x,yt,_t,Lt,ye,De,Ve,Ke,ae,fe,$e,0,le.xqt,Z,e.outline));Le=h(Le),p&&(p[se]=Le)}else{for(vo=io.Q,co={},xe=0;xe<Ut;xe++)co[vo[xe].Zc]=xe;for(xe=0,So=Fe.length;xe<So;xe++)Ge=Fe[xe],We=lo[se]&&lo[se][Ge],P(We)||(mo=He.collapse(se,Ge),He.Dqt(Le,We,te,C,W,x,yt,_t,Lt,ye,De,Ve,Ke,ae,fe,Fe[xe],co[Fe[xe]],le.xqt,mo,e.outline));Le=h(Le)}Kt.push(Le)}}if(To=eo=0,Qe=he.length+(Gt.display&&Gt.positionType===H.DataPosition.row?1:0),oo=ve.length+(Gt.display&&Gt.positionType===H.DataPosition.col?1:0),me?(He.CWt!==f.PivotTableLayoutType.compact&&(To=Qe-1-Ne),eo=(Qe=(Qe=Kt==null?void 0:Kt[0])==null?void 0:Qe[0])!=null&&Qe.rowCount?Kt[0][0].rowCount-1:0):(eo=(Qe=(Qe=Kt==null?void 0:Kt[0])==null?void 0:Qe[0])!=null&&Qe.rowCount?Kt[0][0].rowCount-1:oo-1-Ne,To=(oo=(Qe=Kt==null?void 0:Kt[0])==null?void 0:Qe[0])!=null&&oo.colCount?Kt[0][0].colCount-1:0),re&&!t(re,eo,To))return[];if(ae)return re?(Qe=Kt[0])?Qe.map(function(Co){return R(re,Co.row,Co.col,eo,To)}):[]:Kt[0];for(Kt.sort(function(Co,Oo){return Co.length-Oo.length}),ro=Kt[0],jt=1;jt<Kt.length;jt++){for(Fo=[],No=ro.length,Do=(_o=Kt[jt]).length,xe=0;xe<No;xe++)for(Io=0;Io<Do;Io++)(wo=ro[xe]&&_o[Io]&&ro[xe].getIntersect(_o[Io]))&&Fo.push(wo);ro=Fo}return ro=h(ro),re?ro&&ro[0]?(oo=ro[0],[R(re,oo.row,oo.col,eo,To)]):[]:ro},Pt.prototype.Dqt=function(e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de){var le,se,ce,he,ve=this,me=p.ranges,Ce=(p=p.level,oe===f.SubtotalsPosition.top||oe===f.SubtotalsPosition.bottom);me&&(me=function(Pe,Ne){for(var Fe,ye,De=[],Ve={start:ye=Pe[0],end:ye},Le=1,fe=Pe.length;Le<fe;Le++)(ye=Pe[Le])-1===(Fe=Pe[Le-1])||Ne&&O(Ne,Fe+1,ye-1)?Ve.end=ye:(De.push(Ve),Ve={start:ye,end:ye});return De.push(Ve),De}(me,C===1?ve.rZt.HWt[3].zWt:Z),se=le=void 0,ce=ve.dh.getSigmaValuePosition(),C===1?(he=ve.dh.B.length,le=1<p&&Ce&&!(p===2&&ce.display&&ce.positionType===H.DataPosition.row&&he+1-ce.positionIndex==1),se=ce.display&&ce.positionType===H.DataPosition.row&&he-ce.positionIndex<p?ve.dh.Q.length:1,ve.Sqt(e,me,p,W+yt,x+_t,Lt,Et,Wt,Ut,Kt,oe,ae,le,se,te,re,Gt,ee,jt,de)):C===2&&(he=ve.dh.R.length,le=1<p&&Ce&&!(p===2&&ce.display&&ce.positionType===H.DataPosition.col&&he+1-ce.positionIndex==1),se=ce.display&&ce.positionType===H.DataPosition.col&&he-ce.positionIndex<p?ve.dh.Q.length:1,ve.kqt(e,me,p,W+yt,x+_t,Lt,Et,Wt,Ut,Kt,oe,ae,le,se,te,re,Gt,jt)))},Pt.prototype.Sqt=function(e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de){for(var le,se,ce,he,ve,me=this.layoutType(),Ce=de===!1&&me===f.PivotTableLayoutType.outline,Pe=0,Ne=p.length;Pe<Ne;Pe++)P(p[Pe])||(!Lt||Wt&&!te||((le=M(0,0,0,0)).row=W+p[Pe].start,le.col=me===f.PivotTableLayoutType.compact?x-1:x-C,le.rowCount=me===f.PivotTableLayoutType.tabular||ee||Ce?p[Pe].end-p[Pe].start+1:1,le.colCount=me===f.PivotTableLayoutType.outline&&de!==!1||!Kt?C:1,e.push(le)),!Et||Wt&&!te||((se=M(0,0,0,0)).row=W+p[Pe].start,se.col=x,se.rowCount=me===f.PivotTableLayoutType.tabular||te||ee||Ce?p[Pe].end-p[Pe].start+1:1,se.colCount=_t,e.push(se)),oe&&Wt&&!jt&&!te&&(ce=Ut===f.SubtotalsPosition.top&&this.layoutType()!==f.PivotTableLayoutType.tabular?W+p[Pe].start:W+p[Pe].end+1,Ut===f.SubtotalsPosition.top&&me!==f.PivotTableLayoutType.tabular||(Lt&&((le=M(0,0,0,0)).row=ce,le.col=x-(me===f.PivotTableLayoutType.compact?1:C),le.rowCount=ae,le.colCount=me===f.PivotTableLayoutType.compact?1:C,e.push(le)),Et&&((se=M(0,0,0,0)).row=ce,se.col=x,se.rowCount=ae,se.colCount=_t,e.push(se)))));Et&&te&&(this.options.grandTotalPosition===f.GrandTotalPosition.row||this.options.grandTotalPosition===f.GrandTotalPosition.both)&&(he=this.dh.Q.length,(ve=M(0,0,0,0)).row=W+yt-(he-Gt),ve.col=x,ve.rowCount=1,ve.colCount=_t,e.every(function(Fe){return!ve.equals(Fe)}))&&e.push(ve)},Pt.prototype.kqt=function(e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee){for(var jt,de,le,se,ce=0,he=p.length;ce<he;ce++)P(p[ce])||(!Lt||Wt&&!te||((jt=M(0,0,0,0)).row=W-C,jt.col=x+p[ce].start,jt.rowCount=Kt?1:C,jt.colCount=p[ce].end-p[ce].start+1,e.push(jt)),!Et||Wt&&!te||((de=M(0,0,0,0)).row=W,de.col=x+p[ce].start,de.rowCount=yt,de.colCount=p[ce].end-p[ce].start+1,e.push(de)),oe&&Wt&&!te&&(Lt&&((jt=M(0,0,0,0)).row=W-C,jt.col=x+p[ce].end+1,jt.rowCount=C,jt.colCount=ae,e.push(jt)),Et)&&((de=M(0,0,0,0)).row=W,de.col=x+p[ce].end+1,de.rowCount=yt,de.colCount=ae,e.push(de)));Et&&te&&(this.options.grandTotalPosition===f.GrandTotalPosition.col||this.options.grandTotalPosition===f.GrandTotalPosition.both)&&(le=this.dh.Q.length,(se=M(0,0,0,0)).row=W,se.col=x+_t-(le-Gt),se.rowCount=yt,se.colCount=1,e.every(function(ve){return!se.equals(ve)}))&&e.push(se)},Pt.prototype.sqt=function(){var e,p,C=(e=this).EZt;(p=e.Ti).suspendPaint(),e.jqt(),e.options.mergeItem&&(e.Oqt(),e.Pqt()),p.resumePaint(),C.LZt=[],C.BZt=[]},Pt.prototype.jqt=function(){var e,p,C=(e=this).EZt,W=e.Ti,x=C.GJt;(p=C.RJt).length===0&&x.length===0||((0,H.o)(p,function(yt){W.removeSpan(yt.row,yt.col)}),(0,H.o)(x,function(yt){W.removeSpan(yt.row,yt.col)}),(0,H.o)(e.VJt,function(yt){W.getRange(yt.row,yt.col,yt.rowCount,yt.colCount).vAlign(yt.vAlign).hAlign(yt.hAlign)}),C.GJt=[],C.RJt=[],e.VJt=[])},Pt.prototype.Pqt=function(){var e,p,C,W,x,yt,_t,Lt,Et,Wt=(Et=this).Ti,Ut=Et.rZt.HWt[3],Kt=Et.rZt.HWt[2],oe=Et.EZt,ae=Kt.isHideFirstRow?2:3;(!Ut||Ut.Tx<2)&&(!Kt||Kt.Sx<ae)||(Et.v_e=!0,ae=Et.eZt,e=ae.row,p=ae.col,C=Ut.DQ,W=Ut.jN,x=Kt.DQ,yt=Kt.jN,ae=oe.BZt,Ut=oe.LZt,_t=oe.GJt,Lt=oe.RJt,(0,H.o)(Ut,function(te){var re=te.row,Gt=te.col,ee=te.rowCount;te=te.colCount,re+=C+e,Gt+=W+p;try{Wt.addSpan(re,Gt,ee,te),_t.push({row:re,col:Gt,rowCount:ee,colCount:te})}catch{}}),(0,H.o)(ae,function(te){var re=te.row,Gt=te.col,ee=te.rowCount;te=te.colCount,re+=x+e,Gt+=yt+p;try{Wt.addSpan(re,Gt,ee,te),Lt.push({row:re,col:Gt,rowCount:ee,colCount:te})}catch{}}),Et.v_e=!1)},Pt.prototype.Oqt=function(){var e,p=(e=this).Ti,C=e.VJt,W=e.rZt.HWt[3].getRange(),x=e.rZt.HWt[2].getRange(),yt=e.rZt.HWt[1].getRange(),_t=(Lt=e.eZt).row,Lt=Lt.col;e.layoutType()!==f.PivotTableLayoutType.compact&&C.push(e.Fqt(p.getRange(W.row+_t,W.col+Lt,W.rowCount,W.colCount))),C.push(e.Fqt(p.getRange(x.row+_t,x.col+Lt,x.rowCount,x.colCount))),C.push(e.Fqt(p.getRange(yt.row+_t,yt.col+Lt,yt.rowCount,yt.colCount)))},Pt.prototype.Fqt=function(e){var p={row:e.row,col:e.col,rowCount:e.rowCount,colCount:e.colCount,vAlign:e.vAlign(),hAlign:e.hAlign()};return e.hAlign(1).vAlign(1),p},Pt.prototype.zRt=function(e){return this.dh.getFieldInfoByName(e)},Pt.prototype.isSortValueField=function(e){var p,C,W,x;if(e)return(C=this.mqt())!==2&&(W=Ct(),(((p=e.cornerFieldInfo)==null?void 0:p.fieldName)||((p=e.colHeadFieldInfo)==null?void 0:p.fieldName))===W.Values||(x=W.sigmaValue,C===0&&e.area===3?(p=e.rowInfos)==null?void 0:p.some(function(yt){return yt.fieldName===x}):C===H.DataPosition.col&&e.area===2&&((W=e.colInfos)==null?void 0:W.some(function(yt){return yt.fieldName===x}))))},Pt.prototype.fromJson=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le;if((le=this).m_e=!0,le._qt(e),P(e.multipleFieldFilters)?le.options.allowMultipleFiltersPerField=!0:le.options.allowMultipleFiltersPerField=e.multipleFieldFilters,e.style&&!P(e.styleName)?(W=e.style,(C=new tt.PivotTableTheme).fromJSON(W),le.theme(C)):P(e.styleName)?e.style?(W=e.style,(C=new tt.PivotTableTheme).fromJSON(W),le.theme(C)):le.theme("light0"):(W=e.styleName,o.BuiltInPivotTableThemeNames[e.styleName.toUpperCase()]&&(W=e.styleName.replace("PivotStyle","").toLowerCase()),le.theme(W)),e.rowGrandTotals===!1&&e.colGrandTotals===!1?le.options.grandTotalPosition=f.GrandTotalPosition.none:e.rowGrandTotals===!1?le.options.grandTotalPosition=f.GrandTotalPosition.row:e.colGrandTotals===!1?le.options.grandTotalPosition=f.GrandTotalPosition.col:le.options.grandTotalPosition=f.GrandTotalPosition.both,P(e.showRowHeaders)||(le.options.showRowHeader=e.showRowHeaders),P(e.showColHeaders)||(le.options.showColumnHeader=e.showColHeaders),P(e.showRowStripes)||(le.options.bandRows=e.showRowStripes),P(e.showColStripes)||(le.options.bandColumns=e.showColStripes),P(e.pageOverThenDown)||(le.options.displayFieldsInPageFilterArea=e.pageOverThenDown?f.DisplayFields.overThenDown:f.DisplayFields.downThenOver),P(e.pageWrap)||(le.options.reportFilterFieldsPerColumn=e.pageWrap),P(e.showFilter)||(le.options.showFilter=e.showFilter),P(e.showDrill)||(le.options.showDrill=e.showDrill),P(e.showToolTip)||(le.options.showToolTip=e.showToolTip),P(e.showMissing)||(le.options.showMissing=e.showMissing),P(e.missingCaption)||(le.options.missingCaption=e.missingCaption),P(e.indent)?le.options.rowLabelIndent=2:le.options.rowLabelIndent=e.indent+1,P(e.errorCaption)||(le.options.errorValueInfo=e.errorCaption),P(e.showError)||(le.options.isShowErrorValue=e.showError),P(e.showDataTips)||(le.options.showToolTip=e.showDataTips),P(e.showHeaders)||(le.options.showHeaders=e.showHeaders),P(e.mergeItem)||(le.options.mergeItem=e.mergeItem),P(e.dataCaption)||(le.Cki=e.dataCaption),P(e.fillDownLabels)||(le.options.fillDownLabels=e.fillDownLabels),P(e.printDrill)||(le.options.printDrill=e.printDrill),P(e.itemPrintTitles)||(le.options.itemPrintTitles=e.itemPrintTitles),P(e.fieldPrintTitles)||(le.options.fieldPrintTitles=e.fieldPrintTitles),P(e.rowHeaderCaption)||(le.options.rowHeaderCaption=e.rowHeaderCaption),P(e.colHeaderCaption)||(le.options.colHeaderCaption=e.colHeaderCaption),P(e.enableDataValueEditing)||(le.options.enableDataValueEditing=e.enableDataValueEditing),!P(e.formats))for(x=0;x<e.formats.length;x++)yt=e.formats[x],P(yt.style)||bt(yt.style)||(_t=void 0,_t=(Lt=yt.pivotArea).missed?Lt.pivotArea:le.excelPivotAreaToSheetPivotArea(Lt),(Et=new at.Style).fromJSON(yt.style,!1,Z),le.yqt(_t,Et,!0));if(Ut=(Wt=le.Ti).conditionalFormats,!P(e.pivotTableConditionFormats)&&Ut){for(Kt=[],oe=[],x=0;x<e.pivotTableConditionFormats.length;x++)e.pivotTableConditionFormats[x]&&e.pivotTableConditionFormats[x].rule&&(Kt[e.pivotTableConditionFormats[x].rule.priority-1]=e.pivotTableConditionFormats[x]);for(x=Kt.length-1;0<=x;x--)Kt[x]&&oe.push(Kt[x]);for(e.pivotTableConditionFormats=oe,x=0;x<e.pivotTableConditionFormats.length;x++){for(ae=e.pivotTableConditionFormats[x],te=[],re=0;re<ae.pivotAreas.length;re++)_t=void 0,_t=(Lt=ae.pivotAreas[re]).missed?Lt.pivotArea:le.excelPivotAreaToSheetPivotArea(Lt),te.push(_t);ae.rule&&(Gt=void 0,ae.rule.ruleType?Gt=Ut.pJ(ae.rule,Wt,!1):ae.rule.priority&&p.conditionalFormats&&p.conditionalFormats.rules&&(Gt=Ut.pJ(p.conditionalFormats.rules[ae.rule.priority-1],Wt,!1)),le.mJ.HJt(te,Gt,!0))}}if(P(e.views)||le.views.fromJson(e.views),P(e.altText)||(le.zJt=e.altText),P(e.altTextSummary)||(le.ZJt=e.altTextSummary),P(e.hideValuesRow)||(le.options.hideValuesRow=e.hideValuesRow),e.dataFields&&0<e.dataFields.length)for(ee=0,jt=e.dataFields;ee<jt.length;ee++)de=jt[ee],P(de.showDataAs)||(le.eqt=!0);P(e[at.ID_SYMBOL])||le.UKn(e[at.ID_SYMBOL],!0)},Pt.prototype.yh=function(e,p,C){var W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce;if((ce=this).m_e=!0,W=p.styleManager,ce.Lqt(e,W),P(e.multipleFieldFilters)?ce.options.allowMultipleFiltersPerField=!0:ce.options.allowMultipleFiltersPerField=Y(e.multipleFieldFilters),ee=(jt=g(e,"pivotTableStyleInfo"))&&jt.name,ee=(ee=P(ee)?"PivotStyleLight0":ee)||W.getDefaultStyleName("defaultPivotStyle"),o.BuiltInPivotTableThemeNames[ee.toUpperCase()]?(ae=ee.replace("PivotStyle","").toLowerCase(),ce.theme(ae)):(ae=W.getPivotTableTheme(ee),ce.theme(ae==null?void 0:ae.name())),P(jt)||(ce.options.showRowHeader=Y(jt.showRowHeaders,!1),ce.options.showColumnHeader=Y(jt.showColHeaders,!1),P(jt.showRowStripes)||(ce.options.bandRows=Y(jt.showRowStripes)),P(jt.showColStripes))||(ce.options.bandColumns=Y(jt.showColStripes)),ee=Y(e.rowGrandTotals),ae=Y(e.colGrandTotals),ce.options.grandTotalPosition=ee===!1&&ae===!1?f.GrandTotalPosition.none:ee===!1?f.GrandTotalPosition.row:ae===!1?f.GrandTotalPosition.col:f.GrandTotalPosition.both,P(e.pageOverThenDown)||(ce.options.displayFieldsInPageFilterArea=Y(e.pageOverThenDown)?f.DisplayFields.overThenDown:f.DisplayFields.downThenOver),P(e.pageWrap)||(ce.options.reportFilterFieldsPerColumn=L(e.pageWrap)),(jt=e.lossless)&&(P(jt.showFilter)||(ce.options.showFilter=jt.showFilter),P(jt.showToolTip)||(ce.options.showToolTip=jt.showToolTip),P(jt.enableDataValueEditing)||(ce.options.enableDataValueEditing=jt.enableDataValueEditing),P(jt.views)||ce.views.fromJson(jt.views)),P(e.showDrill)||(ce.options.showDrill=Y(e.showDrill)),P(e.showMissing)||(ce.options.showMissing=Y(e.showMissing)),P(e.missingCaption)||(ce.options.missingCaption=e.missingCaption),P(e.indent)?ce.options.rowLabelIndent=2:ce.options.rowLabelIndent=L(e.indent)+1,P(e.errorCaption)||(ce.options.errorValueInfo=e.errorCaption),P(e.showError)||(ce.options.isShowErrorValue=Y(e.showError)),P(e.showDataTips)||(ce.options.showToolTip=Y(e.showDataTips)),P(e.showHeaders)||(ce.options.showHeaders=Y(e.showHeaders)),P(e.mergeItem)||(ce.options.mergeItem=Y(e.mergeItem)),P(e.dataCaption)||(ce.Cki=e.dataCaption),P(e.printDrill)||(ce.options.printDrill=Y(e.printDrill)),P(e.itemPrintTitles)||(ce.options.itemPrintTitles=Y(e.itemPrintTitles)),P(e.fieldPrintTitles)||(ce.options.fieldPrintTitles=Y(e.fieldPrintTitles)),P(e.rowHeaderCaption)||(ce.options.rowHeaderCaption=e.rowHeaderCaption),P(e.colHeaderCaption)||(ce.options.colHeaderCaption=e.colHeaderCaption),x=g(e,"formats"),(ee=jt&&jt.pivotStyles)&&0<ee.length)ee.forEach(function(he){var ve=new at.Style;ve.fromJSON(he.style,!1,Z),he.pivotArea&&he.pivotArea.offset&&(he.pivotArea.offset.row==="Infinity"&&(he.pivotArea.offset.row=Qt),he.pivotArea.offset.col==="Infinity"&&(he.pivotArea.offset.col=Qt),he.pivotArea.offset.rowCount==="Infinity"&&(he.pivotArea.offset.rowCount=Qt),he.pivotArea.offset.colCount==="Infinity")&&(he.pivotArea.offset.colCount=Qt),ce.yqt(he.pivotArea,ve,!0)});else if(!P(x)){for(x=x.c_||[],yt=[],_t=0;_t<x.length;_t++)Et=x[_t],Lt=L(Et.dxfId),Et=ce.excelPivotAreaSJSToSheetPivotArea(g(Et,"pivotArea")),Wt=new at.Style,W.getDxf(Lt,Wt,Z,!0),Wt.fromJSON(Wt,!1,Z),ce.yqt(Et,Wt,!0);for(_t=0;_t<yt.length;_t++)yt[_t]&&ce.yqt(yt[_t].pivotArea,yt[_t].style,!0)}if(Ut=ce.Ti,Kt=Ut.conditionalFormats,oe=!1,ae=g(e,"conditionalFormats"),jt&&jt.conditionalFormats&&0<jt.conditionalFormats.length)for(oe=!0,te=jt.conditionalFormats,_t=0;_t<te.length;_t++)(re=te[_t])&&(Gt=Kt.pJ(re.rule,Ut))&&ce.mJ.HJt(re.pivotAreas,Gt,!0);else!P(ae)&&ae.c_&&0<ae.c_.length&&ce.tCi(C,ae,Kt,p,W);if(ee=g(e,"extLst"),ce.options.hideValuesRow=!1,P(ee)||ee.c_.forEach(function(he){he=g(he,"pivotTableDefinition"),P(he)||(P(he.altText)||(ce.zJt=he.altText),P(he.fillDownLabelsDefault)||(ce.options.fillDownLabels=Y(he.fillDownLabelsDefault)),P(he.altTextSummary)||(ce.ZJt=he.altTextSummary),ce.options.hideValuesRow=Y(he.hideValuesRow,!1),he=g(he,"conditionalFormats"),oe!==!0&&!P(he)&&he.c_&&0<he.c_.length&&ce.tCi(C,he,Kt,p,W))}),jt=g(e,"dataFields"))for(de=function(he){var ve;if(ce.eqt)return"break";ve=he.showDataAs,(he=g(he,"extLst"))&&he.c_.forEach(function(me){(me=g(me,"dataField"))&&(ve=me.pivotShowAs)}),P(ve)||(ce.eqt=!0)},le=0,se=jt.c_;le<se.length&&de(se[le])!=="break";le++);},Pt.prototype.tCi=function(e,p,C,W,x){var yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re=[],Gt=[],ee=this.Ti,jt=p.c_,de=A(e,"conditionalFormatting").filter(function(le){return at.NodeHelper.ur(le.pivot)===!0});for((p=g(e,"extLst"))&&(e=E(p,"conditionalFormattings"))&&0<(p=A(e,"conditionalFormatting")).length&&(de=de.concat(p.filter(function(le){return(le.isExtRule=!0)===at.NodeHelper.ur(le.pivot)}))),yt=function(le){var se,ce=L(jt[le].priority);de&&((0,H.o)(de,function(he){var ve=he.c_;if((0,H.o)(ve,function(me){if(+me.priority===ce)return jt[le].rule=me,se=he,!0}),se)return!0}),jt[le].rule)&&(re[jt[le].rule.priority-1]={pivotCf:jt[le],sheetCf:se})},_t=0;_t<jt.length;_t++)yt(_t);for(_t=re.length-1;0<=_t;_t--)re[_t]&&Gt.push(re[_t]);for(_t=0;_t<Gt.length;_t++){for(Lt=Gt[_t].pivotCf,Wt=(Et=Gt[_t].sheetCf).isExtRule,Ut=[],Kt=g(Lt,"pivotAreas").c_,oe=0;oe<Kt.length;oe++)Ut.push(this.excelPivotAreaSJSToSheetPivotArea(Kt[oe]));Lt.rule&&(te=Et.sqref,Wt&&(te=(ae=g(Et,"sqref"))&&ae.c_[0]),ae=at.range_parser.Dc(te),te=void 0,Lt.rule.type?te=C.xJ(Lt.rule,ae,x,ee,void 0,Wt):Lt.rule.priority&&Et&&Et.c_&&(te=C.xJ(Et.c_[Lt.rule.priority-1],ae,x,ee,void 0,Wt)),te)&&this.mJ.HJt(Ut,te,!0)}},Pt.prototype._qt=function(e){for(var p,C,W,x,yt,_t,Lt=this,Et=0,Wt=(_t=e.fields).length;Et<Wt;Et++)p=_t[Et],P(p.numberFormat)||(C={labelOnly:!0,references:[{fieldName:p.name}]},(W=new at.Style).formatter=p.numberFormat,Lt.yqt(C,W,!0,!0));if((x=e.dataFields)&&0<x.length)if((yt=x.length)!==1||P(x[0].numberFormat))for(Et=0;Et<yt;Et++)p=x[Et],P(p.numberFormat)||(C={dataOnly:!0,references:[{fieldName:Ct().Values,items:[p.name]}]},(W=new at.Style).formatter=p.numberFormat,Lt.yqt(C,W,!0,!0));else C={dataOnly:!0},(W=new at.Style).formatter=x[0].numberFormat,Lt.yqt(C,W,!0,!0)},Pt.prototype.Lqt=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut=this;if(Wt=g(e,"pivotFields"))for(C=0,W=Wt.c_.length;C<W;C++)x=Wt.c_[C],P(x.numFmtId)||(yt={labelOnly:!0,references:[{fieldName:x.name}]},_t=Q(p,x),Ut.yqt(yt,_t,!0,!0));if(Et=(Lt=g(e,"dataFields"))&&Lt.c_.length,Lt&&0<Et)if(Et!==1||P(Lt.c_[0].numFmtId))for(C=0;C<Et;C++)x=Lt.c_[C],P(x.numFmtId)||(yt={dataOnly:!0,references:[{fieldName:Ct().Values,items:[x.name]}]},_t=Q(p,x),Ut.yqt(yt,_t,!0,!0));else yt={dataOnly:!0},_t=Q(p,Lt.c_[0]),Ut.yqt(yt,_t,!0,!0)},Pt.prototype.excelPivotAreaToSheetPivotArea=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt=this.dh.Pq,oe={};if(P(e.labelOnly)||(oe.labelOnly=e.labelOnly),P(e.dataOnly)||(oe.dataOnly=e.dataOnly),P(e.grandCol)||(oe.grandCol=e.grandCol),P(e.grandRow)||(oe.grandRow=e.grandRow),e.outline===!1&&(oe.outline=!1),e.axis==="axisRow"?oe.axis=f.PivotAreaAxisType.row:e.axis==="axisCol"&&(oe.axis=f.PivotAreaAxisType.col),e.offset&&(oe.offset=r(this.Ti,e.offset,!!e.references)),!P(e.references)&&0<e.references.length){for(oe.references=[],p=0;p<e.references.length;p++)if(W={},x=(C=e.references[p]).field===Xt||C.field===+Xt?{Zc:Ct().Values,_items:[]}:Kt[C.field]){if(yt=x.Zc,C.indexes){for(_t=[],Lt=0,Et=C.indexes.length;Lt<Et;Lt++)Wt=C.indexes[Lt],P(Wt)||_t.push(yt===Ct().Values?this.dh.Q[Wt].Zc:x._items[Wt]&&x._items[Wt].value);0<_t.length&&(W.items=_t)}W.fieldName=yt,P(C.defaultSubtotal)||(W.subtotal=C.defaultSubtotal),oe.references.push(W)}}else P(e.type)||(oe.type=N(e.type),Ut=e.field,oe.fieldName=Ut===-2?Ct().Values:(Ut=Kt==null?void 0:Kt[Ut])==null?void 0:Ut.Zc);return oe},Pt.prototype.excelPivotAreaSJSToSheetPivotArea=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae=this.dh.Pq,te={};if(P(e.labelOnly)||(te.labelOnly=Y(e.labelOnly)),P(e.dataOnly)||(te.dataOnly=Y(e.dataOnly)),P(e.grandCol)||(te.grandCol=Y(e.grandCol)),P(e.grandRow)||(te.grandRow=Y(e.grandRow)),e.outline==="0"&&(te.outline=!1),e.axis==="axisRow"?te.axis=f.PivotAreaAxisType.row:e.axis==="axisCol"&&(te.axis=f.PivotAreaAxisType.col),e.offset&&(te.offset=r(this.Ti,e.offset,e.c_&&0<e.c_.length)),p=g(e,"references"),P(p))P(e.type)||(te.type=N(e.type),x=L(e.field),te.fieldName=x===-2?Ct().Values:(e=ae==null?void 0:ae[x])==null?void 0:e.Zc);else for(p=p.c_,te.references=[],C=0;C<p.length;C++)if(W=p[C],yt={},_t=(x=q(W.field))===Xt||x===+Xt?{Zc:Ct().Values,_items:[]}:ae[x]){if(Lt=_t.Zc,Et=W.c_,!P(Et)){for(Wt=[],Ut=0,Kt=Et.length;Ut<Kt;Ut++)oe=L(Et[Ut].v),P(oe)||Wt.push(Lt===Ct().Values?this.dh.Q[oe].Zc:_t._items[oe]&&_t._items[oe].value);0<Wt.length&&(yt.items=Wt)}yt.fieldName=Lt,P(W.defaultSubtotal)||(yt.subtotal=Y(W.defaultSubtotal)),te.references.push(yt)}return te},Pt.prototype.toJson=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe,ye,De,Ve,Le,fe,Re=(fe=this).getRange().content;if(!p||!p.ignoreStyle){switch(x=(W=fe.dh)&&W.cft?W.cft:{},yt=fe.layoutType()){case f.PivotTableLayoutType.outline:x.compact=!1,x.compactData=!1,x.outline=!0,x.outlineData=!0;break;case f.PivotTableLayoutType.tabular:x.compact=!1,x.compactData=!1,x.outline=!1,x.outlineData=!1;break;default:x.outline=!0,x.outlineData=!0}if(P(fe.Zc)||(p&&p.newWorkSheetName&&fe.Ti&&fe.Ti.parent?(_t=fe.Ti.parent,x.name=fe.Eqt=(0,X.fJt)(fe.Zc,_t.BQt)):x.name=fe.Zc),P(fe.options.allowMultipleFiltersPerField)||(x.multipleFieldFilters=fe.options.allowMultipleFiltersPerField),_t=W.getSigmaValuePosition(),x.dataOnRows=void 0,_t.display&&_t.positionType===H.DataPosition.row&&(x.dataOnRows=!0),(_t=fe.theme())&&((Lt=fe.getThemeName())?(tt.PivotTableThemes[Lt.toLowerCase()]&&(Lt="PivotStyle"+Lt.replace(/^[a-z]{1}/g,function(Ke){return Ke.toUpperCase()})),x.styleName=Lt):x.style=_t.toJSON()),P(fe.options.showRowHeader)||(x.showRowHeaders=fe.options.showRowHeader),P(fe.options.showColumnHeader)||(x.showColHeaders=fe.options.showColumnHeader),P(fe.options.bandRows)||(x.showRowStripes=fe.options.bandRows),P(fe.options.bandColumns)||(x.showColStripes=fe.options.bandColumns),P(fe.options.displayFieldsInPageFilterArea)||(x.pageOverThenDown=fe.options.displayFieldsInPageFilterArea===f.DisplayFields.overThenDown),P(fe.options.reportFilterFieldsPerColumn)||(x.pageWrap=fe.options.reportFilterFieldsPerColumn),P(fe.options.showFilter)||(x.showFilter=fe.options.showFilter),P(fe.options.showDrill)||(x.showDrill=fe.options.showDrill),P(fe.options.showMissing)||(x.showMissing=fe.options.showMissing),P(fe.options.showToolTip)||(x.showToolTip=fe.options.showToolTip),P(fe.options.missingCaption)||(x.missingCaption=fe.options.missingCaption),P(fe.options.fillDownLabels)||(x.fillDownLabels=fe.options.fillDownLabels),P(fe.options.rowLabelIndent)||fe.options.rowLabelIndent===2||(x.indent=fe.options.rowLabelIndent-1),P(fe.options.printDrill)||(x.printDrill=fe.options.printDrill),P(fe.options.itemPrintTitles)||(x.itemPrintTitles=fe.options.itemPrintTitles),P(fe.options.fieldPrintTitles)||(x.fieldPrintTitles=fe.options.fieldPrintTitles),P(fe.options.mergeItem)||(x.mergeItem=fe.options.mergeItem),delete x.colGrandTotals,delete x.rowGrandTotals,P(fe.options.grandTotalPosition)||((Lt=fe.options.grandTotalPosition)!==f.GrandTotalPosition.none&&Lt!==f.GrandTotalPosition.col||(x.colGrandTotals=!1),Lt!==f.GrandTotalPosition.none&&Lt!==f.GrandTotalPosition.row)||(x.rowGrandTotals=!1),P(fe.Cki)?x.dataCaption="Values":x.dataCaption=fe.Cki,P(fe.options.errorValueInfo)||(x.errorCaption=fe.options.errorValueInfo),P(fe.options.isShowErrorValue)||(x.showError=fe.options.isShowErrorValue),P(fe.options.showToolTip)||(x.showDataTips=fe.options.showToolTip),P(fe.options.showHeaders)||(x.showHeaders=fe.options.showHeaders),P(fe.options.rowHeaderCaption)||(x.rowHeaderCaption=fe.options.rowHeaderCaption),P(fe.options.colHeaderCaption)||(x.colHeaderCaption=fe.options.colHeaderCaption),P(fe.options.enableDataValueEditing)||(x.enableDataValueEditing=fe.options.enableDataValueEditing),P(fe.options.hideValuesRow)||(x.hideValuesRow=fe.options.hideValuesRow),P(fe.views)||(x.views=fe.views.toJson()),P(fe.zJt)||(x.altText=fe.zJt),P(fe.ZJt)||(x.altTextSummary=fe.ZJt),P(x.createdVersion)&&(x.createdVersion=6),_t=fe.rZt&&fe.rZt.HWt&&fe.rZt.HWt&&fe.rZt.HWt[4]&&fe.rZt.HWt[4].DQ||0,Lt=fe.rZt&&fe.rZt.HWt&&fe.rZt.HWt&&fe.rZt.HWt[4]&&fe.rZt.HWt[4].jN||0,Kt=fe.gZt()&&fe.gZt().length,Et=fe.mZt()&&fe.mZt().length,oe=fe.bZt()&&fe.bZt().length,Wt=fe.pZt()&&fe.pZt().length,Ut=fe.mqt(),Kt&&(Et||oe||Wt)&&(Et||Ut!==H.DataPosition.col)||Ut===H.DataPosition.row||Wt===1||Et||yt===f.PivotTableLayoutType.tabular&&!(1<Wt&&Ut===H.DataPosition.col)?x.firstHeaderRow=1:x.firstHeaderRow=0,x.firstDataRow=_t,x.firstDataCol=Lt,Kt=fe.dh.G&&fe.dh.G.length,oe=!P(fe.options.reportFilterFieldsPerColumn),fe.options.displayFieldsInPageFilterArea===f.DisplayFields.overThenDown?fe.options.reportFilterFieldsPerColumn===0?(x.rowPageCount=1,x.colPageCount=Kt):(x.rowPageCount=oe?Math.ceil(Kt/fe.options.reportFilterFieldsPerColumn):1,x.colPageCount=oe?Math.min(fe.options.reportFilterFieldsPerColumn,Kt):Kt):fe.options.reportFilterFieldsPerColumn===0?(x.rowPageCount=Kt,x.colPageCount=1):(x.rowPageCount=Kt&&Math.min(fe.options.reportFilterFieldsPerColumn,Kt),x.colPageCount=Kt?Math.ceil(Kt/fe.options.reportFilterFieldsPerColumn):1),x.ref=mt&&mt.rangesToFormula([Re],0,0,15,!1),W.PVt(),fe.lZt&&0<fe.lZt.length){for(x.formats=[],ae=0;ae<fe.lZt.length;ae++)if(re=(te=fe.lZt[ae]).pivotArea,!n(Gt=te.style)&&!te.isFakeStyle&&(ee=fe.sheetPivotAreaToExcelPivotArea(re),x.formats.push({style:Gt,pivotArea:ee=ee||{pivotArea:re,missed:!0}}),re.references)&&re.references.length===1&&te.style&&!P(te.style.formatter))if(ve=fe.dh,re.references[0].fieldName===Ct().Values){for(de=(jt=ve.Q).length,le={},se=0;se<de;se++)le[jt[se].Zc]=se;if(!(ce=re.references[0].items))for(ce=[],he=0;he<de;he++)ce.push(jt[he].Zc);for(he=0;he<ce.length;he++)P(le[ce[he]])||(jt[le[ce[he]]].bbt=te.style.formatter)}else!re.labelOnly||re.dataOnly||re.references[0].items&&re.references[0].items.length!==0||(ve=ve.DB(re.fieldName))&&(ve.bbt=te.style.formatter);for(Pe in C=(e=e||{data:fe.Ti.Ut.sheetModels[3].toJSON(3,p)}).data.dataTable,me=fe.UJt,Ce=fe.WJt,me)if(me.hasOwnProperty(Pe))for(Fe in Ne=me[Pe])Ne.hasOwnProperty(Fe)&&(P(C[Pe])&&(C[Pe]={}),P(C[Pe][Fe])&&(C[Pe][Fe]={}),Gt=et(Ne[Fe]),(ye=Ce[Pe]&&Ce[Pe][Fe])&&Gt.h5(ye),C[Pe][Fe].style&&Gt.h5(C[Pe][Fe].style),C[Pe][Fe].style=Gt)}if(fe.mJ.qK&&0<fe.mJ.qK.length)for(x.pivotTableConditionFormats=[],ae=0;ae<fe.mJ.qK.length;ae++){for(De=(Le=fe.mJ.qK[ae]).pivotAreas,Ve=[],he=0;he<De.length;he++)ee=(ee=fe.sheetPivotAreaToExcelPivotArea(De[he]))||{pivotArea:De[he],missed:!0},Ve.push(ee);Le=$(Le.conditionalRule,Le.conditionalRule.toJSON(fe.Ti)),x.pivotTableConditionFormats.push({rule:Le,pivotAreas:Ve})}return W.toJson(fe,x),x.rowItems=fe.Bqt(),x.columnItems=fe.OGr(),fe.options.subtotalsPosition===f.SubtotalsPosition.none?(x.enabledSubtotalsDefault=!1,x.subtotalsOnTopDefault=!1):fe.options.subtotalsPosition===f.SubtotalsPosition.bottom?(x.subtotalsOnTopDefault=!1,delete x.enabledSubtotalsDefault):fe.options.subtotalsPosition===f.SubtotalsPosition.top&&(delete x.subtotalsOnTopDefault,delete x.enabledSubtotalsDefault),x.insertBlankRowDefault=!!fe.options.insertBlankLineAfterEachItem,p!=null&&p.isServer&&(x[at.ID_SYMBOL]=fe.jKe()),x}e=e||{data:fe.Ti.Ut.sheetModels[3].toJSON(3,p)},yt=(Et=fe.rZt.HWt)[0],Wt=Et[1],Ut=Et[2],_t=Et[3],Lt=Et[4],oe=fe.LYt,C=e.data.dataTable,it(oe.row+yt.DQ,oe.col+yt.jN,C,yt.dataTable,b),it(Re.row+Wt.DQ,Re.col+Wt.jN,C,Wt.dataTable,b),it(Re.row+Ut.DQ,Re.col+Ut.jN,C,Ut.dataTable,b),it(Re.row+_t.DQ,Re.col+_t.jN,C,_t.dataTable,b),it(Re.row+Lt.DQ,Re.col+Lt.jN,C,Lt.dataTable,b)},Pt.prototype.wh=function(e,p,C){var W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe,Ne,Fe,ye,De,Ve,Le,fe,Re,Ke,lo,ao,po,Xe,xe,yo,to,fo,mo,vo,co,So,Ge,We,Ye,qe,ge,go=(ge=this).getRange().content;switch(P(e)&&(e={n_:"sheetData"}),yt=(x=ge.dh).sc||{n_:"pivotTableDefinition"},qe=ge.layoutType(),yt.xmlns=Z,yt["xmlns:mc"]=Z,yt["mc:Ignorable"]=Z,yt["xmlns:xr"]=Z,yt.r_=[13,14,15,16],_t=p==null?void 0:p.defaultStyle,qe){case f.PivotTableLayoutType.outline:yt.compact="0",yt.compactData="0",yt.outline="1",yt.outlineData="1";break;case f.PivotTableLayoutType.tabular:yt.compact="0",yt.compactData="0",yt.outline="0",yt.outlineData="0";break;default:yt.outline="1",yt.outlineData="1"}if(P(ge.Zc)||(C&&C.newWorkSheetName&&ge.Ti&&ge.Ti.parent?(oe=ge.Ti.parent,ge.Eqt=(0,X.fJt)(ge.Zc,oe.BQt),yt.name=F(ge.Eqt)):yt.name=F(ge.Zc)),ge.options.allowMultipleFiltersPerField===!1&&(yt.multipleFieldFilters=ot(ge.options.allowMultipleFiltersPerField)),C=x.getSigmaValuePosition(),yt.dataOnRows=void 0,C.display&&C.positionType===H.DataPosition.row&&(yt.dataOnRows="1"),C=yt.c_=[],Lt=p.styleManager,ge.theme()?(p={n_:"pivotTableStyleInfo"},We=ge.getThemeName(),P(We)?(oe=(Ge=ge.Ti)==null?void 0:Ge.parent)&&(We=Ot(oe,yt.name)):((Ge=ge.Ti)==null?void 0:Ge.parent).customPivotTableThemes.isBuildInStyle(We)&&(We="PivotStyle"+We.replace(/^[a-z]{1}/g,function($e){return $e.toUpperCase()})),p.name=We,ge.options.showRowHeader&&(p.showRowHeaders="1"),ge.options.showColumnHeader&&(p.showColHeaders="1"),p.showRowStripes=ot(ge.options.bandRows,1),p.showColStripes=ot(ge.options.bandColumns,1),C.push(p)):C.push({n_:"pivotTableStyleInfo",showRowStripes:"1",showColStripes:"1"}),ge.options.displayFieldsInPageFilterArea===f.DisplayFields.overThenDown&&(yt.pageOverThenDown="1"),0<ge.options.reportFilterFieldsPerColumn&&(yt.pageWrap=""+ge.options.reportFilterFieldsPerColumn),ge.options.showMissing===!1&&(yt.showMissing="0"),P(ge.options.missingCaption)||(yt.missingCaption=ge.options.missingCaption),!P(ge.options.rowLabelIndent)&&ge.options.rowLabelIndent!==2&&0<=ge.options.rowLabelIndent-1&&(yt.indent=""+(ge.options.rowLabelIndent-1)),ge.options.printDrill&&(yt.printDrill="1"),ge.options.itemPrintTitles&&(yt.itemPrintTitles="1"),ge.options.fieldPrintTitles&&(yt.fieldPrintTitles="1"),ge.options.mergeItem&&(yt.mergeItem="1"),delete yt.colGrandTotals,delete yt.rowGrandTotals,P(ge.options.grandTotalPosition)||((oe=ge.options.grandTotalPosition)!==f.GrandTotalPosition.none&&oe!==f.GrandTotalPosition.col||(yt.colGrandTotals="0"),oe!==f.GrandTotalPosition.none&&oe!==f.GrandTotalPosition.row)||(yt.rowGrandTotals="0"),P(ge.Cki)?yt.dataCaption="Values":yt.dataCaption=ge.Cki,P(ge.options.errorValueInfo)||(yt.errorCaption=ge.options.errorValueInfo),ge.options.isShowErrorValue&&(yt.showError="1"),ge.options.showHeaders===!1&&(yt.showHeaders="0"),P(ge.options.colHeaderCaption)||(yt.colHeaderCaption=ge.options.colHeaderCaption),P(ge.options.rowHeaderCaption)||(yt.rowHeaderCaption=ge.options.rowHeaderCaption),P(yt.createdVersion)&&(yt.createdVersion="7"),P(yt.updatedVersion)&&(yt.updatedVersion="7"),ge.options.showToolTip===!1&&(yt.showDataTips="0"),ge.options.showFilter===!1&&(yt.showHeaders="0"),ge.options.showDrill===!1&&(yt.showDrill="0"),Et=yt.lossless={},P(ge.options.fillDownLabels)||(yt.lossless.fillDownLabels=ge.options.fillDownLabels),P(ge.options.enableDataValueEditing)||(yt.lossless.enableDataValueEditing=ge.options.enableDataValueEditing),P(ge.views)||(yt.lossless.views=ge.views.toJson()),Ge=ge.rZt&&ge.rZt.HWt&&ge.rZt.HWt&&ge.rZt.HWt[4]&&ge.rZt.HWt[4].DQ||0,We=ge.rZt&&ge.rZt.HWt&&ge.rZt.HWt&&ge.rZt.HWt[4]&&ge.rZt.HWt[4].jN||0,p=ge.gZt()&&ge.gZt().length,oe=ge.mZt()&&ge.mZt().length,Fe=ge.bZt()&&ge.bZt().length,Wt=ge.pZt()&&ge.pZt().length,Kt=ge.mqt(),p=p&&(oe||Fe||Wt)&&(oe||Kt!==H.DataPosition.col)||Kt===H.DataPosition.row||Wt===1||oe||qe===f.PivotTableLayoutType.tabular&&!(1<Wt&&Kt===H.DataPosition.col)?1:0,Fe=ge.dh.G&&ge.dh.G.length,oe=!P(ge.options.reportFilterFieldsPerColumn),qe=ge.options.displayFieldsInPageFilterArea===f.DisplayFields.overThenDown?ge.options.reportFilterFieldsPerColumn===0?(Ye=1,Fe):(Ye=oe?Math.ceil(Fe/ge.options.reportFilterFieldsPerColumn):1,oe?Math.min(ge.options.reportFilterFieldsPerColumn,Fe):Fe):ge.options.reportFilterFieldsPerColumn===0?(Ye=Fe,1):(Ye=Fe&&Math.min(ge.options.reportFilterFieldsPerColumn,Fe),Fe?Math.ceil(Fe/ge.options.reportFilterFieldsPerColumn):1),Wt={n_:"location",ref:mt.rangesToFormula([go],0,0,15,!1)},0<=Ge&&(Wt.firstDataRow=""+Ge),0<=We&&(Wt.firstDataCol=""+We),0<=p&&(Wt.firstHeaderRow=""+p),0<Ye&&(Wt.rowPageCount=""+Ye),0<qe&&(Wt.colPageCount=""+qe),C.push(Wt),x.PVt(),x.wh(ge,yt),ge.lZt&&0<ge.lZt.length){for(Ut={pivotFields:{},dataFields:{}},(Kt=g(yt,"pivotFields"))&&Kt.c_.forEach(function($e){Ut.pivotFields[$e.name]=$e}),(oe=g(yt,"dataFields"))&&oe.c_.forEach(function($e){Ut.dataFields[$e.name]=$e}),ae=[],Et.pivotStyles||(Et.pivotStyles=[]),te=function($e,eo){return eo===1/0?"Infinity":eo},re=0;re<ge.lZt.length;re++)if(ee=(Gt=ge.lZt[re]).pivotArea,!n(jt=Gt.style)){if(Gt.isFakeStyle&&(W=Gt.style)!=null&&W.formatter)Tt(Ut,Lt,Gt);else if((W=Gt.pivotArea)!=null&&W.offset&&(Gt=JSON.parse(JSON.stringify(Gt,te))),Et.pivotStyles.push(Gt),(Ce=Lt.getDxfIndex(jt,!0))!==Z&&(de=ge.sheetPivotAreaToSJSPivotArea(ee,!0))&&ae.push({n_:"format",dxfId:Ce,c_:[de]}),ee.references&&ee.references.length===1&&Gt.style&&!P(Gt.style.formatter))if(Ce=ge.dh,ee.references[0].fieldName===Ct().Values){for(se=(le=Ce.Q).length,ce={},he=0;he<se;he++)ce[le[he].Zc]=he;if(!(ve=ee.references[0].items))for(ve=[],me=0;me<se;me++)ve.push(le[me].Zc);for(me=0;me<ve.length;me++)P(ce[ve[me]])||(le[ce[ve[me]]].bbt=Gt.style.formatter)}else!ee.labelOnly||ee.dataOnly||ee.references[0].items&&ee.references[0].items.length!==0||(Ce=Ce.DB(ee.fieldName))&&(Ce.bbt=Gt.style.formatter)}for(ye in Pe=ge.UJt,Ne=ge.WJt,ae.length&&((Fe={n_:"formats",c_:ae}).count=""+ae.length,C.push(Fe)),Pe)if(Pe.hasOwnProperty(ye))for(Ve in De=Pe[ye])De.hasOwnProperty(Ve)&&(P(e[ye])&&(e[ye]={}),P(e[ye][Ve])&&(e[ye][Ve]={}),jt=et(De[Ve]),(Le=Ne[ye]&&Ne[ye][Ve])&&jt.h5(Le),e[ye][Ve].style&&jt.h5(e[ye][Ve].style),ge.wqt(+ye,+Ve,jt),_t&&ct(jt,_t),e[ye][Ve].s=Lt.getStyleIndex(jt))}if(fe=ge.rZt.HWt[3].dataTable,Re=ge.rZt.HWt[3].zWt,ge.options.rowLabelIndent&&ge.CWt===f.PivotTableLayoutType.compact&&fe&&fe.length){for(go=ge.position(),Ke=ge.rZt.HWt[3].DQ+go.row,lo=ge.rZt.HWt[3].jN+go.col,ao=0;ao<fe.length;ao++)if(ye=ao+Ke,(po=fe[ao])&&po.length)for(Xe=0;Xe<po.length;Xe++)Ve=Xe+lo,(xe=po[Xe].style)!=null&&xe.textIndent&&(P(e[ye])&&(e[ye]={}),P(e[ao+Ke][Ve])&&(e[ye][Ve]={}),typeof(xe=e[ye][Ve])=="object")&&(yo=xe.s,jt=void 0,P(yo)?jt=new at.Style:typeof(jt=Lt.getStyle(yo))=="string"&&(jt=ge.Ti.getNamedStyle(jt)),P(jt.textIndent))&&Re[ao].compactLevel&&(yo=Re[ao].compactLevel*ge.options.rowLabelIndent)&&(jt.textIndent=yo,xe.s=Lt.getStyleIndex(jt))}if(ge.mJ.qK&&0<ge.mJ.qK.length){for(fo=!(to=[]),re=0;re<ge.mJ.qK.length;re++){for(vo=(mo=ge.mJ.qK[re]).pivotAreas,co=[],me=0;me<vo.length;me++)(de=ge.sheetPivotAreaToSJSPivotArea(vo[me],!1))?co.push(de):fo=!0;co.length<=0||($(mo.conditionalRule,So={n_:"conditionalFormat",c_:[{n_:"pivotAreas",count:""+co.length,c_:co}]}),to.push(So))}if(C.push({n_:"conditionalFormats",count:""+to.length,c_:to}),fo===!0)for(Et.conditionalFormats||(Et.conditionalFormats=[]),re=0;re<ge.mJ.qK.length;re++)mo=ge.mJ.qK[re],Et.conditionalFormats[re]={pivotAreas:mo.pivotAreas,rule:mo.conditionalRule.toJSON(ge.Ti)}}return(Ge=ge.mc())&&0<Ge.length&&C.push({n_:"rowItems",c_:Ge,count:Ge.length}),(We=ge._wr())&&0<We.length&&C.push({n_:"colItems",c_:We,count:We.length}),delete(p={n_:"pivotTableDefinition",r_:[2]}).c_,ge.zJt&&(p.altText=ge.zJt),ge.ZJt&&(p.altTextSummary=ge.ZJt),ge.options.hideValuesRow&&(p.hideValuesRow="1"),Ye={n_:"pivotTableDefinition16"},ge.options.subtotalsPosition===f.SubtotalsPosition.none?(Ye.EnabledSubtotalsDefault="0",Ye.SubtotalsOnTopDefault="0"):ge.options.subtotalsPosition===f.SubtotalsPosition.bottom?Ye.SubtotalsOnTopDefault="0":ge.options.subtotalsPosition===f.SubtotalsPosition.top&&delete Ye.SubtotalsOnTopDefault,ge.options.insertBlankLineAfterEachItem&&(Ye.InsertBlankRowDefault="1"),qe=[],(ge.zJt||ge.ZJt||ge.options.hideValuesRow)&&qe.push({n_:"ext",r_:[49,1],c_:[p]}),qe.push({n_:"ext",r_:[51,52],c_:[Ye]}),yt.c_.push({n_:"extLst",c_:qe}),j(yt,["location","pivotFields","rowFields","rowItems","colFields","colItems","pageFields","dataFields","formats","conditionalFormats","pivotTableStyleInfo","filters","extLst"]),yt},Pt.prototype.sheetPivotAreaToExcelPivotArea=function(e){var p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt={},de=(ee=this).dh;if(jt.type=V(e.type),jt.offset=d(e.offset),p=de.DB(e.fieldName))for(jt.field=p.lp,C=[],(p=ee.dh.Z[e.fieldName])===0?(jt.axis="axisPage",C=ee.dh.G):p===1?(jt.axis="axisRow",C=ee.dh.B):p===2&&(jt.axis="axisCol",C=ee.dh.R),W=z(de,p),x=0;x<C.length;x++)C[x]&&C[x].Zc===e.fieldName&&(jt.fieldPosition=W<=x?x+1:x);else e.fieldName===Ct().Values&&1<de.Q.length&&(jt.field="-2",de.x2===H.DataPosition.col?jt.axis="axisCol":de.x2===H.DataPosition.row&&(jt.axis="axisRow"),jt.fieldPosition=de.P2);if(jt.dataOnly=e.dataOnly,jt.labelOnly=e.labelOnly,e.labelOnly===!0&&jt.dataOnly===Z&&(jt.dataOnly=!1),e.labelOnly===!0&&jt.dataOnly===!0&&(jt.dataOnly=!1,jt.labelOnly=!1),e.outline===!1&&(jt.outline=e.outline),jt.grandRow=e.grandRow,jt.grandCol=e.grandCol,P(e.axis)||(jt.axis=e.axis===f.PivotAreaAxisType.row?"axisRow":"axisCol"),e.references&&0<e.references.length){for(yt=[],_t=0;_t<e.references.length;_t++){if(Lt={},Wt=void 0,(Et=e.references[_t]).fieldName===Ct().Values){for(Lt.field=Xt,Kt=(Ut=de.Q).length,oe={},ae=0;ae<Kt;ae++)oe[Ut[ae].Zc]=ae;if(Et.items&&0<Et.items.length){for(te=[],ae=0;ae<Et.items.length;ae++){if(oe[Et.items[ae]]===Z)return;te.push(oe[Et.items[ae]])}Lt.indexes=te}}else{if(Wt=de.DB(Et.fieldName),P(Wt))continue;if(re=Wt.tl(de),Lt.field=Wt.lp,Et.items&&0<Et.items.length){for(te=[],ae=0;ae<Et.items.length;ae++)Gt=Wt.cs(Et.items[ae],re),P(Gt)||te.push(Gt);Lt.indexes=te}}Lt.defaultSubtotal=Et.subtotal,yt.push(Lt)}0<yt.length&&(jt.references=yt)}return jt},Pt.prototype.sheetPivotAreaToSJSPivotArea=function(e,p){var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee={n_:"pivotArea"},jt=this.dh;if((Gt=V(e.type))&&Gt!=="normal"&&(ee.type=Gt),ee.offset=d(e.offset),Gt=jt.DB(e.fieldName))for(Gt.lp!==-1&&(ee.field=""+Gt.lp),Gt=jt.Z[e.fieldName],C=[],p&&(Gt===0?(ee.axis="axisPage",C=jt.G):Gt===1?(ee.axis="axisRow",C=jt.B):Gt===2&&(ee.axis="axisCol",C=jt.R)),W=z(jt,Gt),x=0;x<C.length;x++)C[x]&&C[x].Zc===e.fieldName&&(ee.fieldPosition=""+(W<=x?x+1:x));else e.fieldName===Ct().Values&&1<jt.Q.length&&(ee.field="-2",jt.x2===H.DataPosition.col?ee.axis="axisCol":jt.x2===H.DataPosition.row&&(ee.axis="axisRow"),ee.fieldPosition=""+jt.P2);if(p=e.dataOnly,(Gt=e.labelOnly)===!0&&p===Z&&(p=!1),Gt===!0&&p===!0&&(Gt=p=!1),ee.dataOnly=ot(p,Z),e.outline===!1&&(ee.outline="0"),Gt===!0&&(ee.labelOnly="1"),e.grandRow===!0&&(ee.grandRow="1"),e.grandCol===!0&&(ee.grandCol="1"),P(e.axis)||(ee.axis=e.axis===f.PivotAreaAxisType.row?"axisRow":"axisCol"),e.references&&0<e.references.length){for(yt=[],_t=0;_t<e.references.length;_t++){if(Lt={n_:"reference"},Wt=void 0,(Et=e.references[_t]).fieldName===Ct().Values){for(Lt.field=Xt,Kt=(Ut=jt.Q).length,oe={},ae=0;ae<Kt;ae++)oe[Ut[ae].Zc]=ae;if(Et.items&&0<Et.items.length)for(Lt.count=""+Et.items.length,Lt.c_=[],ae=0;ae<Et.items.length;ae++){if(oe[Et.items[ae]]===Z)return;Lt.c_.push({n_:"x",v:oe[Et.items[ae]]})}}else{if(Wt=jt.DB(Et.fieldName),P(Wt))continue;if(te=Wt.tl(jt),Lt.field=Wt.lp,Et.items&&0<Et.items.length){for(Lt.c_=[],ae=0;ae<Et.items.length;ae++)re=Wt.cs(Et.items[ae],te),P(re)||Lt.c_.push({n_:"x",v:re+""});Lt.count=""+Lt.c_.length}else Lt.count="0"}Et.subtotal===!0&&(Lt.defaultSubtotal="1"),yt.push(Lt)}0<yt.length&&(ee.c_=[{n_:"references",count:yt.length+"",c_:yt}])}return ee},Pt.prototype.Bqt=function(){var e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce;if((ce=this).Oy())return[];if(e=ce.rZt.HWt[3].zWt,p=ce.dh,C=ce.layoutType()===f.PivotTableLayoutType.tabular,W=ce.options.subtotalsPosition===f.SubtotalsPosition.top,x=[],yt=ce.getFieldsByArea(f.PivotTableFieldType.rowField),_t=ce.Owr(H.DataPosition.row),p.B.length===0)for(Lt=0;Lt<e.length;Lt++)(Et={pivotItemIndexes:[]}).pivotItemIndexes.push(Lt),x.push(Et);else for(Wt={},Ut=ce.dh.getLabelSortMap(),Kt={},oe=0,ae=e;oe<ae.length;oe++)if(te=ae[oe],Et={},!P(te)){if(Gt=(re=te.path.split(H.Separator)).length,Et.pivotItemIndexes=[],se=void 0,C){for(ee=void 0,jt=0;jt<re.length;jt++)de=Wt[jt]||ce.Iki(jt,!0,Ut),Wt[jt]=Wt[jt]||de,jt===_t&&(ee=p.RVt(te.valueFieldName),!P(ee)&&0<ee?Et.pivotItemIndexes.push(ee):Et.pivotItemIndexes.push(null)),0<=+re[jt]&&(ee=de?de[re[jt]]:re[jt],!P(ee)&&0<ee?Et.pivotItemIndexes.push(ee):Et.pivotItemIndexes.push(null));re.length===_t&&(ee=p.RVt(te.valueFieldName),!P(ee)&&0<ee?Et.pivotItemIndexes.push(ee):Et.pivotItemIndexes.push(null)),Kt[re[0]]?(se=te.path===""?-1:Gt-1,P(_t)||!(_t<=Gt-1||te.isSigmaValue)||te.isGrandTotal||se++):se=0,Kt[re[0]]=!0}else Gt&&(de=Wt[le=Gt-1]||ce.Iki(le,!0,Ut),Wt[le]=Wt[le]||de,0<=+re[le]&&(ee=void 0,ee=te.isSigmaValue?p.RVt(te.valueFieldName):de?de[re[le]]:re[le],!P(ee)&&0<ee?Et.pivotItemIndexes.push(ee):Et.pivotItemIndexes.push(null)),se=te.path===""?-1:le,P(_t)||!(_t<=le||te.isSigmaValue)||te.isGrandTotal||se++);Et.repeatCount=0<se?se:Z,se=(W||this.subtotalPosition((le=yt[Gt-1])==null?void 0:le.fieldName)===f.SubtotalsPosition.top)&&(P(_t)||_t<=se),te.isGrandTotal?Et.type="grand":te.isBlankRow?(Et.type="blank",delete Et.repeatCount):!te.isSubtotal||te.collapseIndex===0||se&&!C||(Et.type="default",se=Wt[Gt-1],Et.pivotItemIndexes.length===0?Et.pivotItemIndexes.push(se&&se[re[Gt-1]]):C&&Et.pivotItemIndexes.splice(0,Et.pivotItemIndexes.length-1)),te.valueFieldName&&0<(se=p.RVt(te.valueFieldName))&&(Et.dataFieldIndex=se),x.push(Et)}return x},Pt.prototype.OGr=function(){var e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le;if((le=this).Oy())return[];if(p=(e=le.rZt.HWt)[2].WWt,C=le.dh,W=[],x=e[2].colValueTable,yt=le.Owr(H.DataPosition.col),C.R.length===0)for(_t=0;_t<p.length;_t++)(Lt={pivotItemIndexes:[]}).pivotItemIndexes.push(_t),W.push(Lt);else for(Et={},Wt=le.dh.getLabelSortMap(),Ut=p.length,Kt=x.length,ae=oe=0;ae<Ut;ae++){for(re=(te=p[ae]).path.split(H.Separator),Gt=void 0,Lt={pivotItemIndexes:[]},ee=0;ee<Kt;ee++)de=(de=x[ee])==null?void 0:de[ae],jt=void 0,P(de)||(jt=ee===yt?C.RVt(te.valueFieldName):(de=Et[ee-oe]||le.Iki(ee-oe,!1,Wt),Et[ee-oe]=Et[ee-oe]||de,de?de[re[ee-oe]]:re[ee-oe]),!P(jt)&&0<jt?Lt.pivotItemIndexes.push(jt):Lt.pivotItemIndexes.push(null),te.isGrandTotal&&(Lt.type="grand"),P(Gt)&&(Gt=ee),te.valueFieldName&&0<(de=C.RVt(te.valueFieldName))&&(Lt.dataFieldIndex=de)),ee===yt&&(oe=1),te.isSubtotal&&P(te.collapseIndex)&&(Lt.type="default");!P(Gt)&&0<Gt&&(Lt.repeatCount=Gt),W.push(Lt),oe=0}return W},Pt.prototype.mc=function(){var e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce;if(!(Ce=this).Oy()){if(e=Ce.rZt.HWt[3].zWt,p=Ce.dh,C=Ce.layoutType()===f.PivotTableLayoutType.tabular,W=Ce.options.subtotalsPosition===f.SubtotalsPosition.top,x=[],yt=Ce.getFieldsByArea(f.PivotTableFieldType.rowField),_t=Ce.Owr(H.DataPosition.row),p.B.length===0)for(Lt=0;Lt<e.length;Lt++)Et={n_:"x"},Lt!==0&&(Et.v=Lt),x.push({n_:"i",c_:[Et]});else for(Wt={},Ut=Ce.dh.getLabelSortMap(),Kt={},oe={},ae=0,te=e;ae<te.length;ae++)if(re=te[ae],Gt={n_:"i"},!P(re)){if(jt=(ee=re.path.split(H.Separator)).length,me={value:null},de=p.RVt(re.valueFieldName),this.QGr(oe,ee,0,me),P(me.value)?(P(Kt[re.path])||!P(_t)&&P(me.value)&&_t===jt)&&(Kt[re.path]=ee.length-1):Kt[re.path]=me.value,Gt.c_=[],me=void 0,le=Kt[re.path],C){for(se=void 0,ce=0;ce<ee.length;ce++)ce<le||(he=Wt[ce]||Ce.Iki(ce,!0,Ut),Wt[ce]=Wt[ce]||he,ce===_t&&le!==_t&&(!P(se=de)&&0<se?Gt.c_.push({n_:"x",v:se}):Gt.c_.push({n_:"x"})),0<=+ee[ce]&&(se=he?he[ee[ce]]:ee[ce],!P(se)&&0<se?Gt.c_.push({n_:"x",v:se}):Gt.c_.push({n_:"x"})));ee.length===_t&&(!P(se=de)&&0<se?Gt.c_.push({n_:"x",v:se}):Gt.c_.push({n_:"x"})),me=le,P(_t)||!(_t<=jt-1||re.isSigmaValue)||re.isGrandTotal||me++}else jt&&(he=Wt[ve=jt-1]||Ce.Iki(ve,!0,Ut),Wt[ve]=Wt[ve]||he,0<=+ee[ve]&&(se=void 0,se=re.isSigmaValue?p.RVt(re.valueFieldName):he?he[ee[ve]]:ee[ve],!P(se)&&0<se?Gt.c_.push({n_:"x",v:se}):Gt.c_.push({n_:"x"})),me=re.path===""?-1:ve,P(_t)||!(_t<=ve||re.isSigmaValue)||re.isGrandTotal||me++);Gt.r=0<me?me:Z,me=(W||this.subtotalPosition((ve=yt[jt-1])==null?void 0:ve.fieldName)===f.SubtotalsPosition.top)&&(P(_t)||_t<=me),re.isGrandTotal?Gt.t="grand":re.isBlankRow?(Gt.t="blank",delete Gt.r):!re.isSubtotal||re.collapseIndex===0||me&&!C||(Gt.t="default",me=Wt[jt-1],Gt.c_.length===0?Gt.c_.push({n_:"x",v:me&&me[ee[jt-1]]}):C&&Gt.c_.splice(0,Gt.c_.length-1)),re.valueFieldName&&0<(me=p.RVt(re.valueFieldName))&&(Gt.i=""+me),x.push(Gt)}return x}},Pt.prototype.QGr=function(e,p,C,W){p.length>C&&(e[p[C]]||(e[p[C]]={},P(W.value)&&(W.value=C)),this.QGr(e[p[C]],p,++C,W))},Pt.prototype._wr=function(){var e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se;if(!(se=this).Oy()){if(p=(e=se.rZt.HWt)[2].WWt,C=se.dh,W=[],x=e[2].colValueTable,yt=se.Owr(H.DataPosition.col),C.R.length===0)for(_t=0;_t<p.length;_t++)Lt={n_:"x"},_t!==0&&(Lt.v=_t),W.push({n_:"i",c_:[Lt]});else for(Et={},Wt=se.dh.getLabelSortMap(),Ut=p.length,Kt=x.length,ae=oe=0;ae<Ut;ae++){for(re=(te=p[ae]).path.split(H.Separator),Gt={n_:"i",c_:[]},ee=void 0,jt=0;jt<Kt;jt++)le=(le=x[jt])==null?void 0:le[ae],de=void 0,P(le)||(de=jt===yt?C.RVt(te.valueFieldName):(le=Et[jt-oe]||se.Iki(jt-oe,!1,Wt),Et[jt-oe]=Et[jt-oe]||le,le?le[re[jt-oe]]:re[jt-oe]),!P(de)&&0<de?Gt.c_.push({n_:"x",v:de}):Gt.c_.push({n_:"x"}),te.isGrandTotal&&(Gt.t="grand"),P(ee)&&(ee=jt),te.valueFieldName&&0<(le=C.RVt(te.valueFieldName))&&(Gt.i=""+le)),jt===yt&&(oe=1),te.isSubtotal&&P(te.collapseIndex)&&(Gt.t="default");!P(ee)&&0<ee&&(Gt.r=ee+""),W.push(Gt),oe=0}return W}},Pt.prototype.Owr=function(e){var p=this.dataPosition();if(p.display&&p.positionType===e)return p.positionIndex},Pt.prototype.Iki=function(e,p,C){var W=this.dh;return p=(p?W.B:W.R)[e].a,(e=C==null?void 0:C.customSortMap[p])||W.bl(p).tsr()},Pt.prototype.Rqt=function(){var e={},p=this.dh.bit();return(0,H.o)(p,function(C,W){C=C.Zc,e[C]=W}),e},Pt.prototype.evaluateGetPivotDataFunction=function(e,p){for(var C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve=[],me=(ce=this).IZt,Ce=ce.Rqt(),Pe=(he=ce.dh).getSigmaValuePosition().positionType,Ne=he.B.length,Fe=he.Q.length,ye=0;ye<p.length;ye++){if(C=(W=p[ye]).fieldName,W=W.itemName,x=Ce[C],P(x)&&(x=Ce[C=C==null?void 0:C.replace(/\r/g,"")],P(x))||!me[C]||(_t=he.FC(C),W instanceof Date?W=(0,X.formatDateToString)(W):this.CWt===f.PivotTableLayoutType.compact&&_t.W5===0&&(W=isNaN(+W)?W:+W),(yt=_t.W5===2&&_t.cC()&&typeof W=="number"?_t._by===H.DateGroupType.years?_t.AQt&&_t.AQt[W]:W:me[C].indexOf(W))<0))return I.Errors.Reference;ve[x]=yt}for(ye=(Lt=ve.slice(0,Ne)).length-1;0<=ye&&Lt[ye]===Z;ye--)Lt.pop();for(Et=Lt.join(H.Separator),ye=(Wt=ve.slice(Ne)).length-1;0<=ye&&Wt[ye]===Z;ye--)Wt.pop();for(Ne=Wt.join(H.Separator),Ut={},Kt={},oe=ce.rZt.HWt[3].zWt,ae=ce.rZt.HWt[2].WWt,te=ce.rZt.HWt[4].dataTable,ye=0;ye<oe.length;ye++)re=(ee=oe[ye]).path,Gt=ee.valueFieldName,ee=ee.isBlankRow,Pe===0&&1<Fe?(P(Ut[re])&&(Ut[re]={}),Ut[re][Gt]=ye):ee||(Ut[re]=ye);for(ye=0;ye<ae.length;ye++)re=(jt=ae[ye]).path,jt=jt.valueFieldName,Pe===1&&1<Fe?(P(Kt[re])&&(Kt[re]={}),Kt[re][jt]=ye):Kt[re]=ye;if(0<he.Q.length&&(de=he.v_(e),le=he.getFieldInfoByName(e),e=de&&de.Zc||le&&le.Zc),P(e)||(de=Ut[Et]instanceof Object?Ut[Et][e]:Ut[Et],le=Kt[Ne]instanceof Object?Kt[Ne][e]:Kt[Ne],P(de)||P(le)))return I.Errors.Reference;try{se=te[de][le],ce.options.showMissing&&P(se)&&(se={value:ce.options.missingCaption})}catch{return I.Errors.Reference}return se&&se.value!==void 0?se&&se.value:null},Pt.prototype.uqt=function(){var e,p,C,W,x,yt,_t,Lt,Et;if(!(0<(Et=this).Xst)){for(e=Et.lZt.concat([]),Et.UJt={},Et.WJt=[],Et.lZt=[],p={},C=[],W=e.length-1;0<=W;W--)(x=e[W])&&x.pivotArea&&(yt=D(x.pivotArea),x.style||(p[yt]=!0),p[yt]||C.push(x));for(W=C.length-1;0<=W;W--)Et.yqt((x=C[W]).pivotArea,x.style,Z,x.isFakeStyle);for(_t={},W=0;W<Et.lZt.length;W++)x=Et.lZt[W],Lt=Et.Fvr(x.pivotArea,_t),Et.Cqt(Lt,x.style)}},Pt.prototype.getAllFields=function(e){return this.dh.getAllFieldNameListWithoutCalcField(e)},Pt.prototype.Gqt=function(){var e,p=(e=this).getFieldsByArea();(0,H.o)(p,function(C){var W,x;C=C.sourceName,e.dh.isFilter(C)&&(W=(x=e.dh.getFilterInfo(C)).labelFilter,x=x.valueFilter,[W==null?void 0:W.condition,W==null?void 0:W.textItem,x].some(Boolean))&&e.dh.clearFilterInfo(C,0)})},Pt.prototype.dispose=function(){l.prototype.dispose.call(this);var e=this;e.Ti=ut,e.rZt=ut,e.lZt=ut,e.WJt=ut,e.UJt=ut,e.options=ut,e.eZt=ut,e.LYt=ut,e.HSt=ut,e.zSt=ut,e.IZt=ut,e.EZt=ut,e.VJt=ut,e.BJt=ut,e.bqt=ut,e.Xst=0,e.cFr=0,P(e.mJ)||(e.mJ.L0(),e.mJ=ut),P(e.views)||(e.views.L0(),e.views=ut)},Pt.prototype.lFr=function(e,p){this.Ti.pivotTables.PYt.includes(this)&&this.$Dr({type:"updatePivotTableLayout",propertyName:e,params:p})},Pt.prototype.$Dr=function(e){this.Ti.$Dr(At({pivotTable:this},e))},o.PivotTable=Mt=Pt,(0,at.qDr)(Mt)},"./dist/plugins/pivot/pivot-ui/dropdown-list.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l,T,D,M,s,y,G;function K(a,i,h,b,Q,it,It){return(a=st.call(this,a,0)||this).dh=i,a.Vqt=h,a.rYt=b,a.Uqt=Q,a.RPt=it,a.Cut=It,a}function c(a,i,h,b,Q,it,It){return(a=l.call(this,a,i,h,b,Q,it)||this).Qqt=It,a.Wqt="244px",a}function N(a,i,h,b,Q,it,It){return(a=T.call(this,a,i,h,b,Q,it)||this).Wqt="95px",a.Qqt=It,a}function V(a,i,h,b,Q,it,It){return(a=D.call(this,a,i,h,b,Q,it)||this).Cut=It,a}function O(a,i,h,b,Q,it,It){return M.call(this,a,i,h,b,Q,it,It)||this}function pt(a,i,h,b,Q,it,It){return(a=s.call(this,a,i,h,b,Q,it)||this).Cut=It,a}function wt(a,i,h,b,Q,it,It){return(a=y.call(this,a,i,h,b,Q,it)||this).Cut=It,a}function et(a,i,h,b,Q,it,It){return(a=G.call(this,a,i,h,b,Q,it)||this).Cut=It,a}function ht(a){for(var i="",h=0;h<a.child.length;h++)i+=St(a.child[h],h===0);return'<div class="'.concat(a.className,`" height="21px">
  78. `).concat(i,`
  79. <span class="`).concat(a.ListSpan,`"></span>
  80. </div>`)}function St(a,i){return'<div id="gc-pivot-filter-dialog-'.concat(a.command,'" class="').concat(a.class," ").concat(k,'" command="').concat(a.command,'" tabindex="').concat(i?0:-1,`">
  81. <div class="`).concat(a.iconClass,`"></div>
  82. <div class="`).concat(a.linkClass,'">').concat(a.text,`</div>
  83. </div>`)}function $(a,i){var h,b,Q=0;switch(a){case 0:Q=i.G.length;break;case 1:Q=i.B.length;break;case 2:Q=i.R.length;break;case 3:Q=i.Q.length;break;default:return 0}return h=0,(b=i.getSigmaValuePosition()).display&&b.positionType===a-1&&h++,Q+h}function n(a,i,h){var b=i.dh,Q=i.rYt,it=i,It=i.Vqt;(a=(0,S.GC$)(a).attr("command"))==="ClearFilter"?(b.wVt({cmd:"ClearCommand",sheetName:"",cmdOption:{fieldName:Q,pivotName:It,command:a,clearType:1}}),i.Cut.close(),i.close()):isNaN(+a)?(i.Cut.close(),i.close()):(i.Cut.close(),i.close(),b.wVt({cmd:"createDialogForLabelFilter",sheetName:"",cmdOption:{fieldName:Q,pivotName:It,host:it,command:a,needFocus:h}}))}Yt=this&&this.__extends||(xt=function(a,i){return(xt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(h,b){h.__proto__=b}:function(h,b){for(var Q in b)Object.prototype.hasOwnProperty.call(b,Q)&&(h[Q]=b[Q])}))(a,i)},function(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function h(){this.constructor=a}xt(a,i),a.prototype=i===null?Object.create(i):(h.prototype=i.prototype,new h)}),At=this&&this.__assign||function(){return(At=Object.assign||function(a){for(var i,h,b=1,Q=arguments.length;b<Q;b++)for(h in i=arguments[b])Object.prototype.hasOwnProperty.call(i,h)&&(a[h]=i[h]);return a}).apply(this,arguments)},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotNumberFilter=o.PivotDateSecondaryFilterDialog=o.PivotDateFilterDialog=o.PivotStringFilterDialog=o.PivotValuesDialog=o.PivotCacheFieldsDropdownDialog=o.PivotDropDown=o.PivotDropDownDialog=void 0,Mt=ft("@spreadjs/js-sheets-common"),Qt=ft("./dist/plugins/pivot/pivot.ns.js"),S=ft("Core"),at=ft("Pivot"),X=ft("./dist/plugins/pivot/pivot-ui/keyboard-event-handler.js"),ft=new Mt.Common.ResourceManager(Qt.SR,"PivotTables"),H=ft.getResource.bind(ft),mt=(f="gc-drop-down-list")+"-block",_=f+"-icon",v=f+"-link",Ft=(tt=f+"-item")+" "+(vt=f+"-item-noHover"),w=f+"-span",I=tt+" "+(B=f+"-link-hover"),U="icon-Move-Report",g="icon-Move-Row",F="icon-Move-Col",ot="icon-Move-Value",j="icon-Be-Used",E="clear-filter-icon-default",A="clear-filter-icon",Y="label-of-string",L="valueFilter",q="label-of-number",J="label-of-date",P="sub-label-of-date",bt="all-date",k="selectable-item",nt=null,gt=void 0,Z=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_DropDownList_Up,command:"moveUp",class:I,iconClass:_,linkClass:v},{text:H().PivotPanel_DropDownList_Down,command:"moveDown",class:I,iconClass:_,linkClass:v},{text:H().PivotPanel_DropDownList_Beginning,command:"moveBeginning",class:I,iconClass:_,linkClass:v},{text:H().PivotPanel_DropDownList_End,command:"moveEnd",class:I,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_DropDownList_ReportFilter,command:"moveReportFilter",class:I,iconClass:_+" "+U,linkClass:v},{text:H().PivotPanel_DropDownList_Row,command:"moveRow",class:I,iconClass:_+" "+g,linkClass:v},{text:H().PivotPanel_DropDownList_Col,command:"moveCol",class:I,iconClass:_+" "+F,linkClass:v},{text:H().PivotPanel_DropDownList_Values,command:"moveValue",class:I,iconClass:_+" "+ot,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_DropDownList_Remove,command:"removeField",class:I,iconClass:_+" icon-Move-Remove",linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_DropDownList_Set,command:"fieldSet",class:I,iconClass:_+" icon-Move-Setting",linkClass:v}]}]},ut=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_Fields_MoveTo_ReportField,command:"AddToReportField",class:I,iconClass:_+" "+U,linkClass:v},{text:H().PivotPanel_Fields_MoveTo_RowLabel,command:"AddToRowLabel",class:I,iconClass:_+" "+g,linkClass:v},{text:H().PivotPanel_Fields_MoveTo_ColLabel,command:"AddToColLabel",class:I,iconClass:_+" "+F,linkClass:v},{text:H().PivotPanel_Fields_MoveTo_Value,command:"AddToValue",class:I,iconClass:_+" "+ot,linkClass:v}]}]},Rt=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_LabelOrValue_ClearFilter,command:"ClearFilter",class:I+" "+Y,iconClass:E+" "+_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Equals,command:at.PivotCaptionFilterOperator.equalsTo,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotEqual,command:at.PivotCaptionFilterOperator.notEqualsTo,class:I+" "+Y,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_IsBeginWith,command:at.PivotCaptionFilterOperator.beginsWith,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotBegin,command:at.PivotCaptionFilterOperator.doesNotBeginWith,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_End,command:at.PivotCaptionFilterOperator.endsWith,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotEndWith,command:at.PivotCaptionFilterOperator.doesNotEndWith,class:I+" "+Y,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Contain,command:at.PivotCaptionFilterOperator.contains,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotContain,command:at.PivotCaptionFilterOperator.doesNotContain,class:I+" "+Y,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_GreaterThan,command:at.PivotCaptionFilterOperator.greaterThan,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_GreaterOrTo,command:at.PivotCaptionFilterOperator.greaterThanOrEqualsTo,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LessThan,command:at.PivotCaptionFilterOperator.lessThan,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LessOrTo,command:at.PivotCaptionFilterOperator.lessThanOrEqualsTo,class:I+" "+Y,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Between,command:at.PivotCaptionFilterOperator.between,class:I+" "+Y,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotBetween,command:at.PivotCaptionFilterOperator.notBetween,class:I+" "+Y,iconClass:_,linkClass:v}]}]},Ct=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_LabelOrValue_ClearFilter,command:"ClearFilter",class:I+" "+J,iconClass:E+" "+_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Equals,command:at.PivotDateFilterOperator.equalsTo,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Before,command:at.PivotDateFilterOperator.before,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_After,command:at.PivotDateFilterOperator.after,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_Between,command:at.PivotDateFilterOperator.Between,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Tomorrow,command:at.PivotDateFilterOperator.tomorrow,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_Today,command:at.PivotDateFilterOperator.today,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_Yesterday,command:at.PivotDateFilterOperator.yesterday,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_NextWeek,command:at.PivotDateFilterOperator.nextWeek,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ThisWeek,command:at.PivotDateFilterOperator.thisWeek,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LastWeek,command:at.PivotDateFilterOperator.lastWeek,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_NextMonth,command:at.PivotDateFilterOperator.nextMonth,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ThisMonth,command:at.PivotDateFilterOperator.thisMonth,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LastMonth,command:at.PivotDateFilterOperator.lastMonth,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_NextQuarter,command:at.PivotDateFilterOperator.nextQuarter,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ThisQuarter,command:at.PivotDateFilterOperator.thisQuarter,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LastQuarter,command:at.PivotDateFilterOperator.lastQuarter,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_NextYear,command:at.PivotDateFilterOperator.nextYear,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ThisYear,command:at.PivotDateFilterOperator.thisYear,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LastYear,command:at.PivotDateFilterOperator.lastYear,class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_YearToDate,command:at.PivotDateFilterOperator.yearToDate,class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_QuarterToDate,command:at.PivotDateFilterOperator.dateToDate+"-1",class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_MonthToDate,command:at.PivotDateFilterOperator.dateToDate+"-2",class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ParallelYearToDate,command:at.PivotDateFilterOperator.dateToDate+"-3",class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ParallelQuarterToDate,command:at.PivotDateFilterOperator.dateToDate+"-4",class:I+" "+J,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_ParallelMonthToDate,command:at.PivotDateFilterOperator.dateToDate+"-5",class:I+" "+J,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_AllDates,command:"all Dates",class:I+" "+bt,iconClass:_,linkClass:v}]}]},Bt=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_LabelOrValue_ClearFilter,command:"ClearFilter",class:I+" "+q,iconClass:E+" "+_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Equals,command:at.PivotCaptionFilterOperator.equalsTo,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotEqual,command:at.PivotCaptionFilterOperator.notEqualsTo,class:I+" "+q,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_IsBeginWith,command:at.PivotCaptionFilterOperator.beginsWith,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotBegin,command:at.PivotCaptionFilterOperator.doesNotBeginWith,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_End,command:at.PivotCaptionFilterOperator.endsWith,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotEndWith,command:at.PivotCaptionFilterOperator.doesNotEndWith,class:I+" "+q,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Contain,command:at.PivotCaptionFilterOperator.contains,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotContain,command:at.PivotCaptionFilterOperator.doesNotContain,class:I+" "+q,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_GreaterThan,command:at.PivotCaptionFilterOperator.greaterThan,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_GreaterOrTo,command:at.PivotCaptionFilterOperator.greaterThanOrEqualsTo,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LessThan,command:at.PivotCaptionFilterOperator.lessThan,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LessOrTo,command:at.PivotCaptionFilterOperator.lessThanOrEqualsTo,class:I+" "+q,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Between,command:at.PivotCaptionFilterOperator.between,class:I+" "+q,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotBetween,command:at.PivotCaptionFilterOperator.notBetween,class:I+" "+q,iconClass:_,linkClass:v}]}]},kt=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_LabelOrValue_ClearFilter,command:"ClearFilter",class:I+" "+L,iconClass:E+" "+_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Equals,command:at.PivotValueFilterOperator.equalsTo,class:I+" "+L,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotEqual,command:at.PivotValueFilterOperator.notEqualsTo,class:I+" "+L,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_GreaterThan,command:at.PivotValueFilterOperator.greaterThan,class:I+" "+L,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_GreaterOrTo,command:at.PivotValueFilterOperator.greaterThanOrEqualsTo,class:I+" "+L,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LessThan,command:at.PivotValueFilterOperator.lessThan,class:I+" "+L,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_LessOrTo,command:at.PivotValueFilterOperator.lessThanOrEqualsTo,class:I+" "+L,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilterOrLabel_Between,command:at.PivotValueFilterOperator.between,class:I+" "+L,iconClass:_,linkClass:v},{text:H().PivotPanel_ValueFilterOrLabel_NotBetween,command:at.PivotValueFilterOperator.notBetween,class:I+" "+L,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().PivotPanel_ValueFilter_Top10,command:"Top10",class:I+" "+L,iconClass:_,linkClass:v}]}]},ie=function(){return[{disAble:!1,className:mt,ListSpan:w,child:[{text:H().Q1,command:at.PivotDateFilterOperator.Q1,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Q2,command:at.PivotDateFilterOperator.Q2,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Q3,command:at.PivotDateFilterOperator.Q3,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Q4,command:at.PivotDateFilterOperator.Q4,class:I+" "+P,iconClass:_,linkClass:v}]},{disAble:!1,className:mt,ListSpan:w,child:[{text:H().Jan,command:at.PivotDateFilterOperator.M1,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Feb,command:at.PivotDateFilterOperator.M2,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Mar,command:at.PivotDateFilterOperator.M3,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Apr,command:at.PivotDateFilterOperator.M4,class:I+" "+P,iconClass:_,linkClass:v},{text:H().May,command:at.PivotDateFilterOperator.M5,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Jun,command:at.PivotDateFilterOperator.M6,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Jul,command:at.PivotDateFilterOperator.M7,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Aug,command:at.PivotDateFilterOperator.M8,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Sep,command:at.PivotDateFilterOperator.M9,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Oct,command:at.PivotDateFilterOperator.M10,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Nov,command:at.PivotDateFilterOperator.M11,class:I+" "+P,iconClass:_,linkClass:v},{text:H().Dec,command:at.PivotDateFilterOperator.M12,class:I+" "+P,iconClass:_,linkClass:v}]}]},(Mt=Xt=Xt||{})[Mt.teamLeader=1]="teamLeader",Mt[Mt.teamMiddle=2]="teamMiddle",Mt[Mt.teamTail=3]="teamTail",Yt(K,st=S.zc),K.prototype.rQ=function(a,i){var h;(h=this).u_=a,h.LEt=i,h.WX(a.x,a.y).html(this.zqt(this.Zqt(i))),this.$c(),this.rmr()},K.prototype.$c=function(){st.prototype.$c.call(this),this.Yqt(),this.aY(),this.Hqt()&&this.uf()},K.prototype.rmr=function(){var a,i=this;this.omr()[0].focus(),this.amr=new X.KeyboardEventHandler(this,{leftCallback:a=function(){var h;(h=i.Cut)&&(h=h.smr)&&h.focus(),i.close()},escCallback:a})},K.prototype.omr=function(){return this.Wc[0].querySelectorAll(".".concat(k))},K.prototype.Hqt=function(){return!1},K.prototype.WX=function(a,i){var h=this.Xc();return h.css(["left","top","height"],[a,i,this.Wqt]),h.css("position","fixed"),h.addClass(f+" gc-no-user-select"),h},K.prototype.Yqt=function(){var a,i,h,b,Q,it,It,t,r,u,d=(r=this).Wc;(u=(0,S.GC$)(r.Ti)).hasClass("filter-condition")&&(a=r.Cut.qc().getBoundingClientRect(),i=(0,S.GC$)(r.Cut.Wc),t=u.position(),h=i.position(),b=i[0].getBoundingClientRect(),Q=(0,S.GC$)(d).width(),d=(0,S.GC$)(d).height(),it=(It=document.documentElement).clientWidth,It=It.clientHeight,u=u.width(),t=t.top,a.left+u+h.left+Q>=it?r.u_.x=-Q+b.left:r.u_.x=u+b.left,a.top+t+h.top+d>=It?(r.u_.y=i.height()-d+b.top,Math.abs(i.height()-d)>h.top&&(r.Xc().css(["height","overflow-y","overflow-x"],[i.height()+"px","scroll","hidden"]),r.u_.y=b.top)):r.u_.y=t+b.top,r.WX(r.u_.x,r.u_.y))},K.prototype.close=function(){this.KX(),this.eG(),st.prototype.close.call(this)},K.prototype.eG=function(){this.amr.eG(),this.Vqt=gt,this.rYt=gt,this.Uqt=gt,this.RPt=gt,this.Cut=nt,this.Ti=nt,this.dh=nt},o.PivotDropDownDialog=Qt=K,Yt(c,l=Qt),c.prototype.sendCommand=function(a){var i,h,b=(i=this).Uqt,Q=i.RPt,it=i.dh;switch(h=(0,S.GC$)(a).attr("command")){case"moveUp":h="moveField",Q--;break;case"moveDown":h="moveField",Q++;break;case"moveBeginning":h="moveField",Q=0;break;case"moveEnd":h="moveField",Q=$(b,it)+1;break;case"moveReportFilter":h="moveField",Q=$(b=0,it);break;case"moveRow":h="moveField",Q=$(b=1,it);break;case"moveCol":h="moveField",Q=$(b=2,it);break;case"moveValue":h="moveField",Q=$(b=3,it)}i.dh.wVt({cmd:h,sheetName:"",cmdOption:{fieldName:i.rYt,targetArea:b,targetIndex:Q,pivotName:i.Vqt,isSusPaint:i.Qqt}})},c.prototype.initSeatData=function(a,i){if(a.isAlone)for(var h=0;h<i.length;h++)i[h].class=Ft;else a.location!==Xt.teamMiddle&&(a.location===Xt.teamLeader?(i[0].class=Ft,i[2].class=Ft):(i[1].class=Ft,i[3].class=Ft))},c.prototype.initAreaData=function(a,i){switch(a.area){case 0:i[0].class=Ft;break;case 1:i[1].class=Ft;break;case 2:i[2].class=Ft;break;case 3:i[3].class=Ft}a.isSigma&&(i[0].class=Ft,i[3].class=Ft)},c.prototype.initSettingData=function(a,i){a.area===3&&(i[0].text=H().PivotPanel_DropDownList_ValueSet,i[0].command="openValueFieldSettingDialogCmd",i[0].class=I),a.isSigma&&(i[0].class=Ft)},c.prototype.zqt=function(a){for(var i="",h=0;h<a.length;h++)i+=ht(a[h]);return i},c.prototype.Zqt=function(a){return this.rT=S.GC$.extend(!0,[],Z()),this.initSeatData(a,this.rT[0].child),this.initAreaData(a,this.rT[1].child),this.initSettingData(a,this.rT[3].child),this.rT},c.prototype.aY=function(){var a=this;(0,S.GC$)("."+tt).bind("click",function(i){(0,S.GC$)(this).hasClass(vt)||(a.uf(),a.sendCommand(this),a.close())})},c.prototype.KX=function(){(0,S.GC$)("."+tt).unbind("click")},o.PivotDropDown=c,Yt(N,T=Qt),N.prototype.sendCommand=function(a){var i,h=(i=this).Uqt||-1;switch((0,S.GC$)(a).attr("command")){case"AddToReportField":h=0;break;case"AddToRowLabel":h=1;break;case"AddToColLabel":h=2;break;case"AddToValue":h=3}i.dh.wVt({cmd:"AddField",sheetName:"",cmdOption:{fieldName:i.rYt,targetArea:h,pivotName:i.Vqt,isSusPaint:i.Qqt}})},N.prototype.zqt=function(a){return ht(a[0])},N.prototype.Zqt=function(){return this.rT=S.GC$.extend(!0,[],ut()),this.rT},N.prototype.aY=function(){var a=this;(0,S.GC$)("."+B).bind("click",function(i){a.sendCommand(this),a.close()})},N.prototype.KX=function(){(0,S.GC$)("."+B).unbind("click")},o.PivotCacheFieldsDropdownDialog=N,Yt(V,D=Qt),V.prototype.rQ=function(a,i){var h=this;D.prototype.rQ.call(this,a,i),a=function(b){b.classList.contains(L)?h.Rmr(b,!0):b.click()},(i=this.amr).xZi(At(At({},i.Spn()),{spaceCallback:a,enterCallback:a}))},V.prototype.sendCommand=function(){},V.prototype.zqt=function(a){for(var i="",h=0;h<a.length;h++)i+=ht(a[h]);return i},V.prototype.Hqt=function(){return!0},V.prototype.Zqt=function(a){var i,h,b;for(this.rT=S.GC$.extend(!0,[],kt()),a.existed&&a.existed.length!==0?this.rT[0].child[0].iconClass=A+" "+_:this.rT[0].child[0].class=Ft,h=i=0;h<a.existed.length;h++)for(i=a.existed[h],b=1;b<this.rT.length;b++){if(!(i>=this.rT[b].child.length)){this.rT[b].child[i].iconClass+=" "+j;break}i-=this.rT[b].child.length}return this.rT},V.prototype.aY=function(){var a=this;(0,S.GC$)(a.Ti).bind("mouseleave",function(i){a.close()}),(0,S.GC$)("."+L).bind("click",function(i){a.Rmr(this)})},V.prototype.KX=function(){(0,S.GC$)(this.Ti).unbind("mouseleave"),(0,S.GC$)("."+L).unbind("click")},V.prototype.Rmr=function(a,i){var h,b,Q=(b=this).dh,it=b.rYt,It=a,t=b.Vqt;(a=(0,S.GC$)(a).attr("command"))==="ClearFilter"?(Q.wVt({cmd:"ClearCommand",sheetName:"",cmdOption:{fieldName:it,pivotName:t,command:a,clearType:2}}),b.Cut.close(),b.close()):isNaN(+a)&&a!=="Top10"?(b.Cut.close(),b.close()):(h=H().getValueFilterItemText(),b.Cut.close(),b.close(),Q.wVt({cmd:"createDialogForValueFilter",sheetName:"",cmdOption:{fieldName:it,pivotName:t,host:It,content:h,command:a,needFocus:i}}))},o.PivotValuesDialog=V,Yt(O,M=Qt),O.prototype.rQ=function(a,i){var h=this;M.prototype.rQ.call(this,a,i),a=function(b){b.classList.contains(Y)?n(b,h,!0):b.click()},(i=this.amr).xZi(At(At({},i.Spn()),{spaceCallback:a,enterCallback:a}))},O.prototype.sendCommand=function(){},O.prototype.zqt=function(a){for(var i="",h=0;h<a.length;h++)i+=ht(a[h]);return i},O.prototype.Hqt=function(){return!0},O.prototype.Zqt=function(a){var i,h,b;for(this.rT=S.GC$.extend(!0,[],Rt()),a.existed&&a.existed.length!==0?this.rT[0].child[0].iconClass=A+" "+_:this.rT[0].child[0].class=Ft,h=i=0;h<a.existed.length;h++)for(i=a.existed[h],b=1;b<this.rT.length;b++){if(!(i>=this.rT[b].child.length)){this.rT[b].child[i].iconClass+=" "+j;break}i-=this.rT[b].child.length}return this.rT},O.prototype.aY=function(){var a=this;(0,S.GC$)("."+Y).bind("click",function(i){n(this,a)}),(0,S.GC$)(a.Ti).bind("mouseleave",function(i){a.close()})},O.prototype.KX=function(){(0,S.GC$)(this.Ti).unbind("mouseleave"),(0,S.GC$)("."+Y).unbind("click")},o.PivotStringFilterDialog=O,Yt(pt,s=Qt),pt.prototype.sendCommand=function(){},pt.prototype.rQ=function(a,i){var h=this;s.prototype.rQ.call(this,a,i),a=function(b){b.classList.contains(J)?h.Bmr(b,!0):b.click()},this.amr.xZi(At(At({},this.amr.Spn()),{rightCallback:function(b){h.umr(b)},spaceCallback:a,enterCallback:a}))},pt.prototype.zqt=function(a){for(var i="",h=0;h<a.length;h++)i+=ht(a[h]);return i},pt.prototype.Hqt=function(){return!0},pt.prototype.Zqt=function(a){var i,h,b,Q,it,It,t;for(this.rT=S.GC$.extend(!0,[],Ct()),i=a.existed,h=this.rT,i&&i.length!==0?this.rT[0].child[0].iconClass=A+" "+_:h[0].child[0].class=Ft,it=1;it<h.length;it++)for(Q=h[it].child,It=0;It<Q.length;It++)for(b=+Q[It].command,t=0;t<i.length;t++)if(i[t]>at.PivotDateFilterOperator.Q1&&i[t]<=at.PivotDateFilterOperator.M12&&(h[9].child[0].iconClass=_+" "+j),i[t]===b){h[it].child[It].iconClass+=" "+j,i.splice(t,1);break}return this.rT},pt.prototype.aY=function(){var a=this;(0,S.GC$)(a.Ti).bind("mouseleave",function(i){a.close()}),(0,S.GC$)("."+J).bind("click",function(i){a.Bmr(this)}),(0,S.GC$)("."+bt).bind("mouseenter",function(i){a.cmr(this)})},pt.prototype.cmr=function(a){var i,h=(i=this).dh,b=i.Vqt,Q=i.rYt,it=i.LEt,It=[];it.existed.forEach(function(t){24<=t&&t<=39&&It.push(t)}),it=new dt(a,h,b,Q,nt,nt,i),h=a.getBoundingClientRect(),it.rQ({x:0,y:0},{existed:It,dataType:2}),it.Wc.css(["position","left","top"],["fixed",h.right+"px",h.bottom-(0,S.GC$)(it.Wc).height()+"px"])},pt.prototype.umr=function(a){a.classList.contains(bt)&&this.cmr(a)},pt.prototype.Bmr=function(a,i){var h=this,b=H().getDateLabelFilterItemText(),Q=h.dh,it=h.rYt,It=document.body,t=h.Vqt;(a=(0,S.GC$)(a).attr("command"))==="ClearFilter"?(Q.wVt({cmd:"ClearCommand",sheetName:"",cmdOption:{fieldName:it,pivotName:t,clearType:1}}),h.Cut.close(),h.close()):(h.Cut.close(),h.close(),Q.wVt({cmd:"dialogForDateFilter",sheetName:"",cmdOption:{fieldName:it,pivotName:t,host:It,command:a,dateLabel:b,isWholeDay:!1,needFocus:i}}))},pt.prototype.KX=function(){(0,S.GC$)(this.Ti).unbind("mouseleave"),(0,S.GC$)("."+J).unbind("click"),(0,S.GC$)("."+bt).unbind("mouseenter")},o.PivotDateFilterDialog=pt,Yt(wt,y=Qt),wt.prototype.sendCommand=function(){},wt.prototype.rQ=function(a,i){var h=this;y.prototype.rQ.call(this,a,i),a=function(){h.Cut.Wc[0].querySelector(".".concat(bt)).focus(),h.close()},i=function(b){b.classList.contains(P)?h.Gmr(b,!0):b.click()},this.amr.xZi(At(At({},this.amr.Spn()),{leftCallback:a,escCallback:a,spaceCallback:i,enterCallback:i}))},wt.prototype.zqt=function(a){for(var i="",h=0;h<a.length;h++)i+=ht(a[h]);return i},wt.prototype.Hqt=function(){return!0},wt.prototype.Zqt=function(a){var i,h,b;for(this.rT=S.GC$.extend(!0,[],ie()),h=i=0;h<a.existed.length;h++)for(i=a.existed[h]-24,b=0;b<this.rT.length;b++){if(this.rT[b].child[i]){this.rT[b].child[i].iconClass+=" "+j;break}i-=this.rT[b].child.length}return this.rT},wt.prototype.aY=function(){var a=this;(0,S.GC$)(a.Ti).bind("mouseleave",function(i){a.close()}),(0,S.GC$)("."+P).bind("click",function(i){a.Gmr(this)})},wt.prototype.Gmr=function(a,i){var h,b,Q=(h=this).dh,it=h.rYt,It=a,t=h.Vqt;a=(0,S.GC$)(a).attr("command"),(b=h.Cut).Cut.close(),b.close(),h.close(),Q.wVt({cmd:"dialogForDateFilter",sheetName:"",cmdOption:{fieldName:it,pivotName:t,host:It,command:a,isWholeDay:!1,needFocus:i}})},wt.prototype.KX=function(){(0,S.GC$)(this.Ti).unbind("mouseleave"),(0,S.GC$)("."+P).unbind("click")},dt=wt,o.PivotDateSecondaryFilterDialog=dt,Yt(et,G=Qt),et.prototype.rQ=function(a,i){var h=this;G.prototype.rQ.call(this,a,i),a=function(b){b.classList.contains(q)?n(b,h,!0):b.click()},(i=this.amr).xZi(At(At({},i.Spn()),{spaceCallback:a,enterCallback:a}))},et.prototype.sendCommand=function(){},et.prototype.zqt=function(a){for(var i="",h=0;h<a.length;h++)i+=ht(a[h]);return i},et.prototype.Hqt=function(){return!0},et.prototype.Zqt=function(a){var i,h,b;for(this.rT=S.GC$.extend(!0,[],Bt()),a.existed&&a.existed.length!==0?this.rT[0].child[0].iconClass=A+" "+_:this.rT[0].child[0].class=Ft,h=i=0;h<a.existed.length;h++)for(i=a.existed[h],b=1;b<this.rT.length;b++){if(!(i>=this.rT[b].child.length)){this.rT[b].child[i].iconClass+=" "+j;break}i-=this.rT[b].child.length}return this.rT},et.prototype.aY=function(){var a=this;(0,S.GC$)(a.Ti).bind("mouseleave",function(i){a.close()}),(0,S.GC$)("."+q).bind("click",function(i){n(this,a)})},et.prototype.KX=function(){(0,S.GC$)(this.Ti).unbind("mouseleave"),(0,S.GC$)("."+q).unbind("click")},o.PivotNumberFilter=et},"./dist/plugins/pivot/pivot-ui/filter-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt;function Qt(l,T,D){return Bt.call(this,l,T,D)||this}function dt(l,T,D,M,s,y){return(l=kt.call(this,l,2e3,!0)||this).Jqt=T,l.dh=D,l.rYt=M,l.Vqt=s,l.qqt=y,l.uf(),l.$c(),l}function xt(l,T,D,M,s,y,G,K){return(l=ie.call(this,l,2e3,!0)||this).Kqt=T,l.dh=M,l.rYt=s,l.Vqt=y,l.Xqt=D,l.qqt=G,l.$qt=K,l.uf(),l.$c(),l}function Mt(l,T,D,M,s,y){return(l=Xt.call(this,l,2e3,!0)||this).Jqt=T,l.dh=D,l.rYt=M,l.Vqt=s,l.qqt=y,l.uf(),l.$c(),l}function st(l,T){var D="",M="";return T&&(D="type = 'number'",M=q),l?'<input class="'.concat(E+" "+ot+" "+M," ").concat(k,'" tabindex="0" ').concat(D,` width=100px></input>
  84. <div class="`).concat(A,'">').concat(B().AndJoiner,`</div>
  85. <input class="`).concat(E+" "+ot+" "+M," ").concat(k,'" tabindex="0" ').concat(D," width=100px></input>"):'<input class="'.concat(g+" "+ot+" "+M," ").concat(k,'" tabindex="0" ').concat(D,"></input>")}Yt=this&&this.__extends||(Ct=function(l,T){return(Ct=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(D,M){D.__proto__=M}:function(D,M){for(var s in M)Object.prototype.hasOwnProperty.call(M,s)&&(D[s]=M[s])}))(l,T)},function(l,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function D(){this.constructor=l}Ct(l,T),l.prototype=T===null?Object.create(T):(D.prototype=T.prototype,new D)}),Object.defineProperty(o,"__esModule",{value:!0}),o.DateFilterDialog=o.ValueFilter=o.LabelFilter=o.opi=void 0,At=ft("@spreadjs/js-sheets-common"),Rt=ft("./dist/plugins/pivot/pivot.ns.js"),S=ft("Core"),at=ft("Pivot"),X=ft("./dist/plugins/pivot/pivot-ui/keyboard-event-handler.js"),H=ft("./dist/plugins/pivot/pivot-util.js"),ft=new At.Common.ResourceManager(Rt.SR,"PivotTables"),f=At.Common.zf.j0,B=ft.getResource.bind(ft),vt=At.Formatter.GeneralFormatter,mt="label-title",tt="sjs-cancel-icon",_="cancel-class",v="label-show",Ft="prompt-info",w="ok-label",I="filter-confirm",U="label-select",g="label-input",F="confirm-class",ot="label_input",j="input-between-container",E="input-between",A="and-joiner",Y="value-select",L="field-value",q="value-filter",J="value-of-top-ten",P="top-ten-select",bt="top-ten",k="selectable-item",nt="date-select",gt="is-whole-days",Z=null,ut=void 0,Yt(Qt,Bt=S.Ase),Qt.prototype.Eot=function(){var l=(M=this).Wc.width(),T=M.Wc.height(),D=M.Fc.width(),M=M.Fc.height();this.Wc.css(["position","left","top"],["absolute",(D-l)/2+"px",(M-T)/2+"px"])},Qt.prototype.api=function(l){var T=this;!l&&T.rf()&&(T.Wc.css("display","none"),T.uf()),l&&(T.Wc.css("display","block"),T.tf()||T.nf())},Qt.prototype.$c=function(){var l=this;l.Wc.html(l.tKt()),Bt.prototype.$c.call(this),l.Eot(),l.aY(),l.rmr(),l.Wc[0].focus()},Qt.prototype.rmr=function(){var l=this;this.amr=new X.KeyboardEventHandler(this,{enterCallback:function(T){!T.classList.contains(_)&&(T=(T=l.Wc[0])==null?void 0:T.querySelector(".".concat(w)))==null||T.click()}})},Qt.prototype.lQ=function(){this.amr.eG(),this.KX(),this.eG(),Bt.prototype.close.call(this)},o.opi=Rt=Qt,Yt(dt,kt=Rt),dt.prototype.$c=function(){kt.prototype.$c.call(this),this.iKt(),this.Wc[0].focus()},dt.prototype.Lmr=function(){var l;(l=this.qc())&&(l=l.querySelector(".".concat(U)))&&l.focus()},dt.prototype.eG=function(){this.Jqt=Z,this.rYt=ut,this.Vqt=ut,this.qqt=ut,this.Ti=Z,this.dh=Z},dt.prototype.tKt=function(){for(var l,T="",D=this.Jqt,M=this.qqt,s=0;s<D.length;s++)T+=this.b0(D[s],s);return M=M>=at.PivotCaptionFilterOperator.between?st(!0):st(!1),l=f(this.rYt),'<div class="'.concat("filter-dialog-container",`">
  86. <div class="`).concat("label-title-class",`">
  87. <span class="`).concat(mt,'">').concat(B().Label_Title+"("+(0,H.NUr)(l)+")",`</span>
  88. <span class="`).concat(_+" "+tt,`">\xD7</span>
  89. </div>
  90. <div class="`).concat("label-filter-body",`">
  91. <div class="`).concat(F,`">
  92. <span class="`).concat(v,'">').concat(B().Label_Show,`</span>
  93. <span class="`).concat("split-line",`"></span>
  94. </div>
  95. <div class="`).concat(F,`">
  96. <select class="`).concat(U," ").concat(k,'" tabindex="0">').concat(T,`</select>
  97. <div class="`).concat(j,`">
  98. `).concat(M,`
  99. </div>
  100. </div>
  101. <div class="`).concat(F,`">
  102. <span class="`).concat(Ft,'">').concat(B().Use_Single_Character,`</span>
  103. <span class="`).concat(Ft,'">').concat(B().Use_Series_Characters,`</span>
  104. </div>
  105. <div>
  106. <span class="`).concat(w+" "+I," ").concat(k,'" tabindex="0">').concat(B().Ok,`</span>
  107. <span class="`).concat(_+" "+I," ").concat(k,'" tabindex="0">').concat(B().Cancel,`</span>
  108. </div>
  109. </div>
  110. </div>`)},dt.prototype.b0=function(l,T){var D="";return T===this.qqt&&(D="selected"),'<option command="'.concat(T,'" ').concat(D,">").concat(l,"</option>")},dt.prototype.aY=function(){var l,T=(l=this).Wc[0];(0,S.GC$)("."+_,T).bind("click",function(D){l.lQ()}),(0,S.GC$)("."+w,T).bind("click",function(D){var M,s,y,G,K=(0,S.GC$)("."+g)[0],c=Z;0<(G=(0,S.GC$)("."+E)).length&&(K=G[0],c=G[1]),G=K?K.value:Z,K=c?c.value:Z,c=l.qqt,M=l.dh,s=l.rYt,y=l.Vqt,M.wVt({cmd:"updateCondition",sheetName:"",cmdOption:{fieldsModel:M,fieldName:s,pivotName:y,selectValue:c,inputValue:G,inputValueEnd:K}}),l.lQ()}),(0,S.GC$)("."+U,T).bind("change",function(D){var M=(0,S.GC$)(this.options[this.selectedIndex]).attr("command");l.nKt(M)})},dt.prototype.KX=function(){var l=this.Wc[0];(0,S.GC$)("."+_,l).unbind("click"),(0,S.GC$)("."+w,l).unbind("click"),(0,S.GC$)("."+U,l).unbind("change")},dt.prototype.nKt=function(l){var T,D=this;((l=+l)>=at.PivotCaptionFilterOperator.between&&D.qqt<at.PivotCaptionFilterOperator.between||l<at.PivotCaptionFilterOperator.between&&D.qqt>=at.PivotCaptionFilterOperator.between)&&(T=l>=at.PivotCaptionFilterOperator.between?st(!0):st(!1),(0,S.GC$)("."+j).html(T)),D.qqt=l},dt.prototype.iKt=function(){var l,T=(M=this).dh,D=M.rYt,M=M.qqt;(T=T.getFilterInfo(T.getSourceNameByFieldName(D)))&&T.labelFilter&&T.labelFilter.condition&&(T=(D=T.labelFilter.condition.toJSON()).val,D=D.operator,l=T[0],T=T[1],D===M)&&(M=(D=(0,S.GC$)("."+ot))[0],D=D[1],M.value=l,D)&&(D.value=T)},o.LabelFilter=dt,Yt(xt,ie=Rt),xt.prototype.$c=function(){ie.prototype.$c.call(this),this.eKt()},xt.prototype.eG=function(){this.Kqt=Z,this.rYt=ut,this.Vqt=ut,this.qqt=ut,this.Ti=Z,this.dh=Z},xt.prototype.eKt=function(){var l=this;l.$qt?l.rKt():l.iKt()},xt.prototype.tKt=function(){return this.$qt?this.oKt():this.aKt()},xt.prototype.oKt=function(){for(var l,T="",D=this.Xqt,M=0;M<D.length;M++)T+=this.b0(D[M],M);return l=f(this.rYt),'<div class="'.concat("filter-top-ten-container",`">
  111. <div class="`).concat("top-ten-title-class",`">
  112. <span class="`).concat(mt,'">').concat(B().Top_Ten_Filter+"("+(0,H.NUr)(l)+")",`</span>
  113. <span class="`).concat(_+" "+tt,`">\xD7</span>
  114. </div>
  115. <div class="`).concat("top-ten-filter-body",`">
  116. <div class="`).concat(F,`">
  117. <span class="`).concat(v,'">').concat(B().TopTenShow,`</span>
  118. <span class="`).concat("split-line-of-top-ten",`"></span>
  119. </div>
  120. <div class="`).concat(F+" top-ten-content",`">
  121. <select class="`).concat(P," ").concat(k,`" tabindex="0">
  122. <option>`).concat(B().Top,`</option>
  123. <option>`).concat(B().Bottom,`</option>
  124. </select>
  125. <input class="`).concat(J," ").concat(k,`" tabindex="0" type="number" value=10 min=1></input>
  126. <select class="`).concat(P," ").concat(k,`" tabindex="0">
  127. <option>`).concat(B().Top_Item,`</option>
  128. <option>`).concat(B().Top_Percent,`</option>
  129. <option>`).concat(B().Top_Sum,`</option>
  130. </select>
  131. <div class="`).concat("by-joiner-class",'">').concat(B().ByJoiner,`</div>
  132. <select class="`).concat(P," ").concat(k,'" tabindex="0">').concat(T,`</select>
  133. </div>
  134. <div class="`).concat("close-dialog",`">
  135. <span class="`).concat(w+" "+I+" "+bt," ").concat(k,'" tabindex="0">').concat(B().Ok,`</span>
  136. <span class="`).concat(_+" "+I," ").concat(k,'" tabindex="0">').concat(B().Cancel,`</span>
  137. </div>
  138. </div>
  139. </div>`)},xt.prototype.aKt=function(){for(var l,T,D,M="",s=this.Kqt,y=this.qqt,G=0;G<s.length;G++)M+=this.b0(s[G],G);for(l="",T=this.Xqt,G=0;G<T.length;G++)l+=this.b0(T[G],G);return y=y===at.PivotValueFilterOperator.between||y===at.PivotValueFilterOperator.notBetween?st(!0,!0):st(!1,!0),D=f(this.rYt),'<div class="'.concat("filter-value-dialog-container",`">
  140. <div class="`).concat("value-title-class",`">
  141. <span class="`).concat(mt,'">').concat(B().Value_Title+"("+D+")",`</span>
  142. <span class="`).concat(_+" "+tt,`">\xD7</span>
  143. </div>
  144. <div class="`).concat("value-filter-body",`">
  145. <div class="`).concat(F,`">
  146. <span class="`).concat(v,'">').concat(B().Value_Show,`</span>
  147. <span class="`).concat("split-line-class",`"></span>
  148. </div>
  149. <div class="`).concat(F,`">
  150. <select class="`).concat(Y," ").concat(k,'" tabindex="0">').concat(l,`</select>
  151. <select class="`).concat(Y+" "+L," ").concat(k,'" tabindex="0">').concat(M,`</select>
  152. <div class="`).concat(j,`">
  153. `).concat(y,`
  154. </div>
  155. </div>
  156. <div>
  157. <span class="`).concat(w+" "+I," ").concat(k,'" tabindex="0">').concat(B().Ok,`</span>
  158. <span class="`).concat(_+" "+I," ").concat(k,'" tabindex="0">').concat(B().Cancel,`</span>
  159. </div>
  160. </div>
  161. </div>`)},xt.prototype.b0=function(l,T){var D="";return T===this.qqt&&(D="selected"),'<option command="'.concat(T,'" ').concat(D,">").concat((0,H.NUr)(l),"</option>")},xt.prototype.aY=function(){var l,T=(l=this).Wc[0];(0,S.GC$)("."+_,T).bind("click",function(D){l.lQ()}),(0,S.GC$)("."+w,T).bind("click",function(D){(0,S.GC$)(this).hasClass(bt)?l.sKt():l.uKt(),l.lQ()}),(0,S.GC$)("."+L).bind("change",function(D){var M=(0,S.GC$)(this.options[this.selectedIndex]).attr("command");l.nKt(M)})},xt.prototype.Lmr=function(){var l;(l=this.qc())&&(l=l.querySelectorAll("select")[0])&&l.focus()},xt.prototype.rKt=function(){var l,T,D=(s=this).Xqt,M=s.dh,s=s.rYt;(M=M.getFilterInfo(M.getSourceNameByFieldName(s)))&&M.valueFilter&&M.valueFilter.conditionByName&&(s=M.valueFilter.condition).getConditionType()===at.PivotConditionType.top10&&(l=(s=s.toJSON()).val,T=s.type,s=s.operator,(0,S.GC$)("."+P)[2].selectedIndex=D.indexOf(M.valueFilter.conditionByName),(0,S.GC$)("."+P)[0].selectedIndex=0<s?0:1,(0,S.GC$)("."+P)[1].selectedIndex=T,(0,S.GC$)("."+J).attr("value",l))},xt.prototype.nKt=function(l){var T,D=this;((l=+l)>=at.PivotValueFilterOperator.between&&D.qqt<at.PivotValueFilterOperator.between||l<at.PivotValueFilterOperator.between&&D.qqt>=at.PivotValueFilterOperator.between)&&(T=l>=at.PivotValueFilterOperator.between?st(!0,!0):st(!1,!0),(0,S.GC$)("."+j).html(T)),D.qqt=l},xt.prototype.iKt=function(){var l,T=(M=this).dh,D=M.rYt,M=M.qqt;(T=T.getFilterInfo(T.getSourceNameByFieldName(D)))&&T.valueFilter&&T.valueFilter.condition&&(T=(D=T.valueFilter.condition.toJSON()).val,D=D.operator,l=T[0],T=T[1],D===M)&&(M=(D=(0,S.GC$)("."+ot))[0],D=D[1],M.value=l,D)&&(D.value=T)},xt.prototype.KX=function(){var l=this.Wc[0];(0,S.GC$)("."+_,l).unbind("click"),(0,S.GC$)("."+w,l).unbind("click"),(0,S.GC$)("."+L).unbind("change")},xt.prototype.uKt=function(){var l,T,D=this,M=(s=(0,S.GC$)("."+Y))[0],s=s[1],y=(0,S.GC$)("."+g)[0],G=Z;0<(T=(0,S.GC$)("."+E)).length&&(y=T[0],G=T[1]),T=(0,S.GC$)(M.options[M.selectedIndex]).text(),M=(0,S.GC$)(s.options[s.selectedIndex]).attr("command"),s=y?y.value:Z,y=G?G.value:Z,G=D.dh,l=D.rYt,D=D.Vqt,G.wVt({cmd:"updateValueCondition",sheetName:"",cmdOption:{fieldName:l,pivotName:D,valueOfField:(0,H.DUr)(T),valueOfFieldValue:M,inputValue:s,inputValueEnd:y}})},xt.prototype.sKt=function(){var l=this.dh,T=this.Vqt,D=(y=(0,S.GC$)("."+P))[0],M=(0,S.GC$)("."+J)[0],s=y[1],y=y[2];D=(0,S.GC$)(D.options[D.selectedIndex]).text(),M=M.value,s=(0,S.GC$)(s.options[s.selectedIndex]).text(),y=(0,S.GC$)(y.options[y.selectedIndex]).text(),l.wVt({cmd:"TopTenCondition",sheetName:"",cmdOption:{fieldsModel:l,fieldName:this.rYt,valueFieldName:(0,H.DUr)(y),pivotName:T,TopOrBottomValue:D,inputValue:M,selectTypeValue:s}})},o.ValueFilter=xt,Yt(Mt,Xt=Rt),Mt.prototype.$c=function(){Xt.prototype.$c.call(this),this.iKt()},Mt.prototype.Lmr=function(){var l;(l=this.qc())&&(l=l.querySelector(".".concat(nt)))&&l.focus()},Mt.prototype.eG=function(){this.rYt=ut,this.Vqt=ut,this.qqt=ut,this.Jqt=Z,this.Ti=Z,this.dh=Z},Mt.prototype.tKt=function(){for(var l,T,D="",M=this.Jqt,s=0;s<M.length;s++)D+=this.b0(M[s],s);return l=this.qqt>=at.PivotDateFilterOperator.Between?st(!0):st(!1),T=f(this.rYt),'<div class="'.concat("filter-date-dialog-container",`">
  162. <div class="`).concat("date-title-class",`">
  163. <span class="`).concat(mt,'">').concat(B().DateFilterTitle+"("+(0,H.NUr)(T)+")",`</span>
  164. <span class="`).concat(_+" "+tt,`">\xD7</span>
  165. </div>
  166. <div class="`).concat("date-filter-body",`">
  167. <div class="`).concat(F,`">
  168. <span class="`).concat(v,'">').concat(B().DateShow,`</span>
  169. <span class="`).concat("date-split-line",`"></span>
  170. </div>
  171. <div class="`).concat(F,`">
  172. <select class="`).concat(nt," ").concat(k,'" tabindex="0">').concat(D,`</select>
  173. <div class="`).concat(j,`">
  174. `).concat(l,`
  175. </div>
  176. </div>
  177. <div class="`).concat(F,`">
  178. <input type="checkbox" id="WholeDays" name="WholeDays" class="`).concat(gt," ").concat(k,`" tabindex="0">
  179. <label for="WholeDays">`).concat(B().WholeDays,`</label>
  180. </div>
  181. <div>
  182. <span class="`).concat(w+" "+I," ").concat(k,'" tabindex="0">').concat(B().Ok,`</span>
  183. <span class="`).concat(_+" "+I," ").concat(k,'" tabindex="0">').concat(B().Cancel,`</span>
  184. </div>
  185. </div>
  186. </div>`)},Mt.prototype.b0=function(l,T){var D="";return T===this.qqt&&(D="selected"),'<option command="'.concat(T,'" ').concat(D,">").concat((0,H.NUr)(l),"</option>")},Mt.prototype.aY=function(){var l,T=(l=this).Wc[0];(0,S.GC$)("."+_,T).bind("click",function(D){l.lQ()}),(0,S.GC$)("."+w,T).bind("click",function(D){var M,s,y=(0,S.GC$)("."+nt)[0],G=(0,S.GC$)("."+g)[0],K=Z,c=(0,S.GC$)("."+E),N=(0,S.GC$)("."+gt)[0].checked;0<c.length&&(G=c[0],K=c[1]),c=(0,S.GC$)(y.options[y.selectedIndex]).attr("command"),y=G?G.value:Z,G=K?K.value:Z,K=l.dh,M=l.rYt,s=l.Vqt,K.wVt({cmd:"dialogForDateFilter",sheetName:"",cmdOption:{fieldName:M,pivotName:s,command:c,isWholeDay:N,value1:y,value2:G}}),l.lQ()}),(0,S.GC$)("."+nt).bind("change",function(D){var M=(0,S.GC$)(this.options[this.selectedIndex]).attr("command");l.nKt(M)})},Mt.prototype.nKt=function(l){var T,D=this;((l=+l)>=at.PivotDateFilterOperator.Between&&D.qqt<at.PivotDateFilterOperator.Between||l<at.PivotDateFilterOperator.Between&&D.qqt>=at.PivotDateFilterOperator.Between)&&(T=l>=at.PivotDateFilterOperator.Between?st(!0):st(!1),(0,S.GC$)("."+j).html(T)),D.qqt=l},Mt.prototype.iKt=function(){var l,T,D,M=(D=this).dh,s=D.rYt,y=D.qqt;(M=M.getFilterInfo(M.getSourceNameByFieldName(s)))&&M.labelFilter&&M.labelFilter.condition&&(M=(s=M.labelFilter.condition.toJSON()).isWholeDay,l=s.operator,s=s.val,l===y)&&(l=s[0],y=s[1],l=(s=D.formatDate(l,y)).value1,y=s.value2,D=(0,S.GC$)("."+ot),s=(0,S.GC$)("#WholeDays"),T=D[0],D=D[1],T.value=l,D&&y&&0<y.length&&(D.value=y),s.attr("checked",M))},Mt.prototype.formatDate=function(l,T){var D=(M=new vt).getPreferredEditingFormatter(l),M=M.getPreferredEditingFormatter(T);return{value1:D.format(l),value2:M.format(T)}},Mt.prototype.KX=function(){var l=this.Wc[0];(0,S.GC$)("."+_,l).unbind("click"),(0,S.GC$)("."+w,l).unbind("click"),(0,S.GC$)("."+nt).unbind("change")},o.DateFilterDialog=Mt},"./dist/plugins/pivot/pivot-ui/keyboard-event-handler.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt;function _(v,Ft){var w=this;this.lmr=function(I){var U,g=document.activeElement,F=(U=w.MU).leftCallback,ot=U.rightCallback,j=U.spaceCallback,E=U.enterCallback,A=U.escCallback,Y=U.tabCallback,L=U.upCallback,q=U.downCallback;switch(I.key){case at:A?A(g):w.fmr(),At(I);break;case S:E?E(g):w.hmr(g),mt(g)||tt(g)||At(I);break;case" ":j?j(g):w.vmr(g),mt(g)||tt(g)||At(I);break;case X:L?L(g):w.kgr(I,I.key,g),At(I);break;case H:q?q(g):w.kgr(I,I.key,g),At(I);break;case vt:Y?Y(g):w.kgr(I,I.key,g);break;case f:F&&F(g),mt(g)||At(I);break;case B:ot&&ot(g),mt(g)||At(I)}},this.Ti=v,this.MU=Ft,this.omr(),this.dmr()}Object.defineProperty(o,"__esModule",{value:!0}),o.KeyboardEventHandler=void 0,Yt=ft("Core"),At=Yt.mt.vi,S="Enter",at="Escape",X="ArrowUp",H="ArrowDown",f="ArrowLeft",B="ArrowRight",vt="Tab",mt=function(v){return v&&v.tagName==="INPUT"},tt=function(v){return v&&v.tagName==="SELECT"},_.prototype.Spn=function(){return this.MU},_.prototype.xZi=function(v){this.MU=v},_.prototype.zmr=function(){return this.j0t&&Array.from(this.j0t).find(function(v){var Ft=((Ft=getComputedStyle(v))==null?void 0:Ft.display)!=="none";return v=v==null?void 0:v.disabled,Ft&&!v})},_.prototype.dmr=function(){var v=this;(0,Yt.GC$)(this.Ti.Wc[0]).bind("keydown",function(Ft){v.lmr(Ft)}).bind("keyup",function(Ft){At(Ft)})},_.prototype.af=function(){(0,Yt.GC$)(this.Ti.Wc[0]).unbind("keydown"),(0,Yt.GC$)(this.Ti.Wc[0]).unbind("keyup")},_.prototype.omr=function(){this.j0t=this.Ti.Wc[0].querySelectorAll(".selectable-item"),this.pmr=this.Ti.Wc[0].querySelectorAll('.selectable-item[tabindex="0"]')},_.prototype.Vmr=function(){var v=this,Ft=this.Ti.Wc[0].querySelectorAll(".selectable-item");Array.from(Ft).some(function(w,I){return w.className!==((w=v.j0t[I])==null?void 0:w.className)})&&this.omr()},_.prototype.kgr=function(v,Ft,w){(Ft=this.mmr(Ft,w,v.shiftKey))&&(Ft.focus(),v.preventDefault())},_.prototype.mmr=function(v,Ft,w){var I,U,g,F,ot;return this.Vmr(),F=this.j0t,ot=this.pmr,Ft?(v===X?I=this.bmr(Ft):v===H?I=this.gmr(Ft):v===vt&&(I=w?Ft===ot[0]?ot[ot.length-1]:null:(U=ot[ot.length-1],g=Array.from(F).findIndex(function(j){return j===U}),F=Array.from(F).findIndex(function(j){return j===Ft}),Ft===U||g<F?ot[0]:null)),F=(I&&((g=getComputedStyle(I))==null?void 0:g.display))!=="none",ot=I==null?void 0:I.disabled,F&&!ot?I:this.mmr(v,I,w)):(0,Yt.GC$)(this.j0t[0])[0]},_.prototype.bmr=function(v){var Ft,w=this.j0t;return(Ft=Array.from(w).findIndex(function(I){return I instanceof HTMLElement&&I===v}))===-1||Ft===0?w[w.length-1]:w[Ft-1]},_.prototype.gmr=function(v){var Ft,w=this.j0t;return(Ft=Array.from(w).findIndex(function(I){return I instanceof HTMLElement&&I===v}))===-1||Ft===w.length-1?w[0]:w[Ft+1]},_.prototype.vmr=function(v){v.click()},_.prototype.hmr=function(v){v.click()},_.prototype.fmr=function(){var v=this.Ti;v.close&&v.close()},_.prototype.eG=function(){this.af(),this.Ti=null,this.j0t=null,this.MU=null},o.KeyboardEventHandler=_},"./dist/plugins/pivot/pivot-ui/pivot-date-group-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot;function j(E,A,Y,L,q,J,P,bt,k,nt,gt){var Z;return gt!==void 0&&gt!=="General"||(gt="m/d/yyyy"),(Z=E=ot.call(this,E,0,!0)||this).cKt=A,Z.rYt=Y,Z.dh=L,typeof gt!="string"&&gt.format?(Z.T=J&&gt.format(J)||"",Z.lKt=q&&gt.format(q),Z.gd=bt&&gt.format(bt)||"",Z.hKt=P&&gt.format(P)):typeof gt=="string"&&(Z.T=J&&At.Be.Re(J,gt)||"",Z.lKt=q&&At.Be.Re(q,gt),Z.gd=bt&&At.Be.Re(bt,gt)||"",Z.hKt=P&&At.Be.Re(P,gt)),Z.fKt=Z.lKt===Z.T,Z.vKt=Z.hKt===Z.gd,Z.dKt=k,Z._selections=nt,Z.uf(),E}Yt=this&&this.__extends||(F=function(E,A){return(F=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(Y,L){Y.__proto__=L}:function(Y,L){for(var q in L)Object.prototype.hasOwnProperty.call(L,q)&&(Y[q]=L[q])}))(E,A)},function(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function Y(){this.constructor=E}F(E,A),E.prototype=A===null?Object.create(A):(Y.prototype=A.prototype,new Y)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotDateGroupDialog=void 0,At=ft("Core"),at=ft("@spreadjs/js-sheets-common"),S=ft("Pivot"),ft=ft("./dist/plugins/pivot/pivot.ns.js"),at=new at.Common.ResourceManager(ft.SR,"PivotTables"),X=at.getResource.bind(at),H=At.mt.En,f="cancel-class",B="ok-label",vt="filter-confirm",mt="date-group-startingAt-isActive",tt="date-group-startingAt-value",_="date-group-endingAt-isActive",v="date-group-endingAt-value",Ft="date-group-dialog-sub-container",w="date-group-by",I="date-group-by-selected",U="click",g="change",Yt(j,ot=At.zc),j.prototype.$c=function(){this.pKt(),ot.prototype.$c.call(this),this.Eot(),this.Fz()},j.prototype.pKt=function(){var E=(0,At.GC$)(H("div"));E[0].innerHTML=this.mKt(),this.Wc.append(E)},j.prototype.Fz=function(){var E=this;(0,At.GC$)("."+f).bind(U,function(A){E.lQ()}),(0,At.GC$)("."+B).bind(U,function(A){var Y=E.cKt,L=E.rYt,q=(0,At.GC$)("."+tt).val().trim(),J=(0,At.GC$)("."+v).val().trim(),P=E.dKt;E.dh.wVt({cmd:"pivotTableGroup",cmdOption:{dataType:S.PivotDataType.date,fieldName:L,pivotName:Y,startingAtValue:q,endingAtValue:J,groupByValueArray:P,selections:E._selections}}),E.lQ()}),(0,At.GC$)("."+w).bind(U,function(A){var Y=parseInt((0,At.GC$)(this).attr("value"),10);-1<E.dKt.indexOf(Y)?((0,At.GC$)("."+w).css("border","initial"),(0,At.GC$)(this).removeClass(I),E.dKt.splice(E.dKt.indexOf(Y),1)):((0,At.GC$)("."+w).css("border","initial"),(0,At.GC$)(this).addClass(I),(0,At.GC$)(this).css("border","1px dotted rgb(255,135,34)"),E.dKt.push(Y))}),(0,At.GC$)("."+tt).bind(g,function(A){(E.fKt=!1,At.GC$)("."+mt)[0].checked=!1}),(0,At.GC$)("."+v).bind(g,function(A){(E.vKt=!1,At.GC$)("."+_)[0].checked=!1}),(0,At.GC$)("."+mt).bind(U,function(A){this.checked&&(0,At.GC$)("."+tt).val(E.lKt)}),(0,At.GC$)("."+_).bind(U,function(A){this.checked&&(0,At.GC$)("."+v).val(E.hKt)})},j.prototype.mKt=function(){var E=w+(-1<this.dKt.indexOf(S.DateGroupType.seconds)?" "+I:""),A=w+(-1<this.dKt.indexOf(S.DateGroupType.minutes)?" "+I:""),Y=w+(-1<this.dKt.indexOf(S.DateGroupType.hours)?" "+I:""),L=w+(-1<this.dKt.indexOf(S.DateGroupType.days)?" "+I:""),q=w+(-1<this.dKt.indexOf(S.DateGroupType.months)?" "+I:""),J=w+(-1<this.dKt.indexOf(S.DateGroupType.quarters)?" "+I:""),P=w+(-1<this.dKt.indexOf(S.DateGroupType.years)?" "+I:"");return`<div class="date-group-dialog-container">
  187. <div class="date-group-dialog-header">
  188. <span class="date-group-dialog-header-title">`.concat(X().grouping,`</span>
  189. <span class="`).concat(f+" sjs-cancel-icon",`">\xD7</span>
  190. </div>
  191. <div class="date-group-dialog-content">
  192. <div class="date-group-dialog-content-header">
  193. <span>`).concat(X().auto,`</span>
  194. <span class="date-group--header-horizontal-auto-line"></span>
  195. </div>
  196. <div class="`).concat(Ft,`">
  197. <input type="checkbox" class="`).concat(mt,'" ').concat(this.fKt?"checked":"unchecked",`>
  198. <span>`).concat(X().startingAt,`</span>
  199. <input class="`).concat(tt,'" value = "').concat(this.T,`"></input>
  200. </div>
  201. <div class="`).concat(Ft,`">
  202. <input type="checkbox" class="`).concat(_,'" ').concat(this.fKt?"checked":"unchecked",`>
  203. <span>`).concat(X().endingAt,`</span>
  204. <input class="`).concat(v,'" value = "').concat(this.gd,`"></input>
  205. </div>
  206. <div class="`).concat(Ft,`">
  207. <span style = "display: inline-block;">`).concat(X().groupBy,`</span>
  208. <span class="date-group--header-horizontal-group-line"></span>
  209. <div class="`).concat("date_group_dialog_group-by-subContainer",`">
  210. <span value = `).concat(S.DateGroupType.seconds,' class="').concat(E,'">').concat(X().seconds,`</span>
  211. <span value = `).concat(S.DateGroupType.minutes,' class="').concat(A,'">').concat(X().minutes,`</span>
  212. <span value = `).concat(S.DateGroupType.hours,' class="').concat(Y,'">').concat(X().hours,`</span>
  213. <span value = `).concat(S.DateGroupType.days,' class="').concat(L,'">').concat(X().days,`</span>
  214. <span value = `).concat(S.DateGroupType.months,' class="').concat(q,'">').concat(X().months,`</span>
  215. <span value = `).concat(S.DateGroupType.quarters,' class="').concat(J,'">').concat(X().quarters,`</span>
  216. <span value = `).concat(S.DateGroupType.years,' class="').concat(P,'">').concat(X().years,`</span>
  217. </div>
  218. </div>
  219. <div class="date-group-dialog-bottom-confirm">
  220. <span class="`).concat(f+" "+vt,'">').concat(X().Cancel,`</span>
  221. <span class="`).concat(B+" "+vt,'">').concat(X().Ok,`</span>
  222. </div>
  223. </div>
  224. </div>`)},j.prototype.Eot=function(){var E=(L=this).Wc.width(),A=L.Wc.height(),Y=L.Fc.width(),L=L.Fc.height();this.Wc.css(["position","left","top","z-index"],["absolute",(Y-E)/2+"px",(L-A)/2+"px",1001])},j.prototype.eG=function(){this.dh=null},j.prototype.KX=function(){(0,At.GC$)("."+f).unbind(U),(0,At.GC$)("."+B).unbind(U)},j.prototype.lQ=function(){this.eG(),this.KX(),ot.prototype.close.call(this)},o.PivotDateGroupDialog=j},"./dist/plugins/pivot/pivot-ui/pivot-field-setting-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt;function kt(dt){return(dt=new H.PivotFieldSettingNumberFormatDialog(dt,dt.bKt,dt.gKt,dt.bbt)).$c(),dt}function ie(dt,xt,Mt,st,l){var T;return(T=Rt.call(this,document.body,999,!0)||this).YC=374,T.ZC=317.5,T.k1=!1,T.bbt="",T.wKt=[],T.yKt=xt,T.dh=dt,T.rYt=Mt,T.CKt=Mt,T.Vqt=st,T.RN=l,xt=T.dh.getFieldInfoByName(Mt),T.IKt=xt.a,T.AKt=xt.getSubTotalType(),T.NKt(l),T.uf(),T}function Xt(dt,xt,Mt,st){return(dt=Ct.call(this,dt,vt().ValueSetting,xt,Mt,st)||this).TKt(),dt.Dn(),dt.MKt(),dt.Fz(),dt}function Qt(dt,xt,Mt,st,l,T,D){return(dt=Bt.call(this,dt,vt().FieldSetting,xt,Mt,st)||this).xKt=l,dt.Opi=T,dt.Ppi=D,dt.TKt(),dt.Dn(),dt.Fz(),dt}Yt=this&&this.__extends||(ut=function(dt,xt){return(ut=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(Mt,st){Mt.__proto__=st}:function(Mt,st){for(var l in st)Object.prototype.hasOwnProperty.call(st,l)&&(Mt[l]=st[l])}))(dt,xt)},function(dt,xt){if(typeof xt!="function"&&xt!==null)throw new TypeError("Class extends value "+String(xt)+" is not a constructor or null");function Mt(){this.constructor=dt}ut(dt,xt),dt.prototype=xt===null?Object.create(xt):(Mt.prototype=xt.prototype,new Mt)}),At=this&&this.__spreadArray||function(dt,xt,Mt){if(Mt||arguments.length===2)for(var st,l=0,T=xt.length;l<T;l++)!st&&l in xt||((st=st||Array.prototype.slice.call(xt,0,l))[l]=xt[l]);return dt.concat(st||Array.prototype.slice.call(xt))},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotDimFieldSettingDialog=o.PivotValuesFieldSettingDialog=o.PivotSettingBaseDialog=void 0,S=ft("Core"),at=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),X=ft("Pivot"),Z=ft("@spreadjs/js-sheets-common"),gt=ft("./dist/plugins/pivot/pivot.ns.js"),H=ft("./dist/plugins/pivot/pivot-ui/pivot-field-setting-number-format-dialog.js"),f=ft("./dist/plugins/pivot/pivot-util.js"),ft=new Z.Common.ResourceManager(gt.SR,"PivotTables"),B=Z.Common.zf.j0,vt=ft.getResource.bind(ft),mt=S.mt.En,tt=".pivot-field-content-base-field-item.active",_=".pivot-field-content-base-item-item.active",v="pivot-field-content-hide",Ft="pivot-field-content-base-item-item",w=".pivot-field-show-value-as-content-base-item",I=".pivot-field-show-value-as-content-base-field",U=".pivot-field-show-value-as-content-type-list",g=".pivot-field-setting-control-format",F=".pivot-field-setting-control-ok",ot=".pivot-field-setting-control-cancel",j=".gc-filter-dialog-close",E=".pivot-field-custom-name",A="gc-sjs-field-settings-layout-showNoData",Y="gc-sjs-field-settings-layout-showSubtotalTop",L="click",q="change",J="active",P="disable",bt="pivot-field-content-item",k="pivot-field-summarize-item",nt="pivot-field-summarize-content",gt=function(){return`
  225. <div class="pivot-field-summarize-header">
  226. <div id="SummarizeValue" class="`.concat(k," ").concat(J,'">').concat(vt().SummarizeValue,`</div>
  227. <div id="ShowValueAs" class="`).concat(k,'">').concat(vt().ShowValueAs,`</div>
  228. </div>
  229. `)},Yt(ie,Rt=S.zc),ie.prototype.NKt=function(dt){var xt,Mt,st,l,T,D,M=this;if(dt){for(xt=0;xt<dt.length;xt++)if((Mt=dt[xt]&&dt[xt].pivotArea)&&(st=Mt.references)){for(l=0;l<st.length;l++)if(D=(T=st[l]).items,T=T.fieldName,D&&-1<D.indexOf(M.rYt)||T===M.rYt){(D=dt[xt].style)&&D.formatter&&(M.bbt=D.formatter);break}}}},ie.prototype.$c=function(){Rt.prototype.$c.call(this),this.Eot()},ie.prototype.Eot=function(){var dt=(st=this).Wc.width(),xt=st.Wc.height(),Mt=st.Fc.width(),st=st.Fc.height();this.bKt=(Mt-dt)/2+"px",this.gKt=(st-xt)/2+"px",this.Wc.css(["position","left","top","z-index"],["absolute",this.bKt,this.gKt,1001])},ie.prototype.dialogHeader=function(dt){return`
  230. <div style="width: 100%; height: 34px; background-color: rgb(255, 255, 255); padding: 0px 0px 0px 12px; box-sizing: border-box;">
  231. <span style="float: left; height: 34px; line-height: 34px; display: inline-block;">
  232. `.concat(dt,`
  233. </span>
  234. <span class="gc-filter-dialog-close gc-pivot-dialog-close" style="float: right; height: 34px; line-height: 30px; display: inline-block; font-size: 28px; width: 54px; text-align: center;">\xD7</span>
  235. </div>
  236. `)},ie.prototype.dialogFieldNameArea=function(dt,xt){var Mt="pivot-field-row-wrap";return dt=B(dt),xt=B(xt),`
  237. <div class ="pivot-field-setting-name-area">
  238. <div class=`.concat(Mt,`>
  239. <label>`).concat(vt().SourceName," </label> <span>").concat((0,f.NUr)(dt),`</span>
  240. </div>
  241. <div class=`).concat(Mt,`>
  242. <label>`).concat(vt().CustomName,' </label> <span><input class="pivot-field-custom-name" type="text" value="').concat(xt,`"></span>
  243. </div>
  244. </div>
  245. `)},ie.prototype.dialogFooter=function(dt){return dt=dt===X.PivotDataType.number||dt===X.PivotDataType.date?vt().NumberFormat:vt().LabelFormat,`
  246. <div class="pivot-field-setting-footer">
  247. <div class="pivot-field-setting-control-wrap-left">
  248. <input class= "pivot-field-setting-control-format" type ="button" value= "`.concat(dt,`">
  249. </div>
  250. <div class="pivot-field-setting-control-wrap"><input class= "pivot-field-setting-control pivot-field-setting-control-ok" type ="button" value= "`).concat(vt().Ok,`">
  251. <input class= "pivot-field-setting-control pivot-field-setting-control-cancel" type ="button" value= "`).concat(vt().Cancel,`">
  252. </div>
  253. </div>
  254. `)},ie.prototype.Dn=function(){var dt=(0,S.GC$)(mt("div"));dt.addClass("gc-pivot-field-setting-wrapper gc-popup ui-widget gc-filter-dialog-style"),dt[0].innerHTML="".concat(this.dialogHeader(this.yKt),`
  255. <div class="gc-pivot-field-setting-content">
  256. `).concat(this.dialogFieldNameArea(this.IKt,this.rYt),`
  257. `).concat(this.wKt.join(`
  258. `),`
  259. </div>
  260. `).concat(this.dialogFooter(this.dh.rBt(this.rYt))),this.Wc.append(dt),(0,S.GC$)(".pivot-field-content-item[data-subtype='"+this.AKt+"']",this.Wc[0]).addClass(J),this.Wc.width(this.YC),this.Wc.height(this.ZC)},ie.prototype.eG=function(){this.dh=null,this.rYt=void 0},ie.prototype.lQ=function(){this.eG(),Rt.prototype.close.call(this)},ie.prototype.lf=function(dt){return!(!this.Wc||!Rt.prototype.hf.call(this,this.Wc.get(0),dt))||this.DKt&&Rt.prototype.hf.call(this,this.DKt.get(0),dt)},o.PivotSettingBaseDialog=Z=ie,Yt(Xt,Ct=Z),Xt.prototype.TKt=function(){this.SKt()},Xt.prototype.MKt=function(){var dt,xt,Mt,st,l,T=this;if((l=this.dh.getFieldInfoByName(T.rYt).Or)&&(T.kKt=l.showDataAs,T.jKt=l.baseFieldName,T.OKt=l.baseFieldItem,dt=l.showDataAs+"",(0,S.GC$)(U,this.Wc[0]).value=dt,-1<["4","7","8","9","10","11","12","13"].indexOf(dt))){for((0,S.GC$)(I).removeClass(P),xt=At(At([],T.dh.nw(1),!0),T.dh.nw(2),!0),Mt=0;Mt<xt.length;Mt++)if(xt[Mt].Zc===l.baseFieldName){T.PKt=Mt;break}if(-1<["4","8","9"].indexOf(dt)){if((0,S.GC$)(w).removeClass(P),l.baseFieldItemType===1)T.FKt=1,T._Kt=1,T.OKt=vt().BaseItemNext;else if(l.baseFieldItemType===2)T.FKt=0,T._Kt=0,T.OKt=vt().BaseItemPrevious;else for(st=At([],T.dh.Kz(l.baseFieldName),!0),Mt=0;Mt<st.length;Mt++)if(st[Mt]+""===l.baseFieldItem){T.FKt=Mt+2;break}}}},Xt.prototype.SKt=function(){var dt=this.LKt(),xt=this.EKt(),Mt=this.BKt();this.wKt.push(`
  261. <div class="pivot-field-summarize-area">
  262. `.concat(dt,`
  263. `).concat(xt,`
  264. `).concat(Mt,`
  265. </div>
  266. `))},Xt.prototype.LKt=gt,Xt.prototype.EKt=function(){return`
  267. <div class="`.concat(nt,`">
  268. <div class="`).concat(nt,'-header">').concat(vt().SummarizeValueField,`</div>
  269. <div class="`).concat(nt,'-desc">').concat(vt().ChooseType,`</div>
  270. <ul class="`).concat(nt,`-list">
  271. <li data-subtype="8" class="`).concat(bt,'">').concat(vt().Sum,`</li>
  272. <li data-subtype="1" class="`).concat(bt,'">').concat(vt().Count,`</li>
  273. <li data-subtype="0" class="`).concat(bt,'">').concat(vt().Average,`</li>
  274. <li data-subtype="3" class="`).concat(bt,'">').concat(vt().Max,`</li>
  275. <li data-subtype="4" class="`).concat(bt,'">').concat(vt().Min,`</li>
  276. <li data-subtype="5" class="`).concat(bt,'">').concat(vt().Product,`</li>
  277. <li data-subtype="2" class="`).concat(bt,'">').concat(vt().CountNumbers,`</li>
  278. <li data-subtype="6" class="`).concat(bt,'">').concat(vt().StdDev,`</li>
  279. <li data-subtype="7" class="`).concat(bt,'">').concat(vt().StdDevp,`</li>
  280. <li data-subtype="9" class="`).concat(bt,'">').concat(vt().Var,`</li>
  281. <li data-subtype="10" class="`).concat(bt,'">').concat(vt().Varp,`</li>
  282. </ul>
  283. </div>
  284. `)},Xt.prototype.BKt=function(){return`
  285. <div class="pivot-field-show-value-as-content pivot-field-content-hide">
  286. <div class="pivot-field-show-value-as-content-header">`.concat(vt().ShowValueAsField,`</div>
  287. <select name="list" class="pivot-field-show-value-as-content-type-list">
  288. <option value="0">`).concat(vt().noCalculation,`</option>
  289. <option value="1">`).concat(vt().percentGrandTotal,`</option>
  290. <option value="3">`).concat(vt().percentColumnTotal,`</option>
  291. <option value="2">`).concat(vt().percentRowTotal,`</option>
  292. <option value="4">`).concat(vt().percentEllipsis,`</option>
  293. <option value="5">`).concat(vt().percentParentRowTotal,`</option>
  294. <option value="6">`).concat(vt().percentParentColumnTotal,`</option>
  295. <option value="7">`).concat(vt().percentParentTotal,`</option>
  296. <option value="8">`).concat(vt().difference,`</option>
  297. <option value="9">`).concat(vt().percentDifference,`</option>
  298. <option value="10">`).concat(vt().runningTotal,`</option>
  299. <option value="11">`).concat(vt().percentRunningTotal,`</option>
  300. <option value="12">`).concat(vt().rankSmallestLargest,`</option>
  301. <option value="13">`).concat(vt().rankLargestSmallest,`</option>
  302. <option value="14">`).concat(vt().index,`</option>
  303. </select>
  304. <div class="pivot-field-show-value-as-content-base-field-list">
  305. <div>`).concat(vt().baseField,`</div>
  306. <ul class="pivot-field-show-value-as-content-base-field `).concat(P,`">
  307. </ul>
  308. </div>
  309. <div class="pivot-field-show-value-as-content-base-item-list">
  310. <div>`).concat(vt().baseItem,`</div>
  311. <ul class="pivot-field-show-value-as-content-base-item `).concat(P,`">
  312. </ul>
  313. </div>
  314. </div>
  315. `)},Xt.prototype.Fz=function(){var dt=this;(0,S.GC$)(j,this.Wc[0]).bind(L,function(){dt.lQ()}),(0,S.GC$)(ot,this.Wc[0]).bind(L,function(){dt.lQ()}),(0,S.GC$)(E,this.Wc[0]).bind(q,function(){dt.k1=!0,dt.rYt=(0,S.GC$)(this).val()}),(0,S.GC$)(".".concat(bt),this.Wc[0]).bind(L,function(){(0,S.GC$)(".".concat(bt,".").concat(J)).removeClass(J),dt.k1=!0,dt.AKt=+(0,S.GC$)(this).addClass(J).attr("data-subtype");var xt=dt.dh.getFieldInfoByName(dt.CKt).a;xt=dt.dh.FG(xt,xt,dt.AKt),(0,S.GC$)(E).val(xt),dt.rYt=xt}),(0,S.GC$)(F,this.Wc[0]).bind(L,function(){var xt,Mt=(0,X.ht)(dt.kKt)?"0":dt.kKt+"",st=dt.jKt,l=dt.OKt,T=dt._Kt;-1<["4","7","8","9","10","11","12","13"].indexOf(Mt)&&-1<["4","8","9"].indexOf(Mt)&&(xt={value:l,index:T}),dt.dh.wVt({cmd:"UpdatePivotValueFieldCmd",sheetName:"",cmdOption:{pivotName:dt.Vqt,oldFieldName:dt.CKt,subtotalType:dt.AKt,fieldName:dt.rYt,showValueAsType:parseInt(Mt,10),baseField:st,baseItem:xt},formatter:dt.bbt}),dt.bbt="",dt.lQ()}),(0,S.GC$)(".".concat(k),this.Wc[0]).bind(L,function(){var xt;(0,S.GC$)(".".concat(k,".").concat(J)).removeClass(J),(0,S.GC$)(".pivot-field-content-hide").removeClass(v),(0,S.GC$)(this).addClass(J),(0,S.GC$)(I).empty(),this.id==="SummarizeValue"?(0,S.GC$)(".pivot-field-show-value-as-content").addClass(v):(-1<dt.kKt&&((0,S.GC$)(U)[0].value=dt.kKt,-1<dt.PKt)&&((0,S.GC$)(I).removeClass(P),-1<dt.FKt)&&(0,S.GC$)(w).removeClass(P),(0,S.GC$)(".".concat(nt)).addClass(v),dt.RKt=At(At([],dt.dh.nw(1),!0),dt.dh.nw(2),!0),dt.RKt.forEach(function(Mt,st){var l=document.createElement("li");l.className="pivot-field-content-base-field-item",l.value=st,-1<dt.PKt&&dt.PKt===st&&l.classList.add(J),l.innerHTML=(0,f.NUr)(Mt.Zc),(0,S.GC$)(I)[0].appendChild(l)}),-1<dt.FKt&&(xt=dt.dh.getFieldInfoByName(dt.rYt).Or,(xt=At([],dt.dh.Kz(xt.baseFieldName),!0)).unshift(vt().BaseItemNext),xt.unshift(vt().BaseItemPrevious),xt.forEach(function(Mt,st){var l=document.createElement("li");l.className=Ft,l.value=st,l.innerHTML=(0,f.NUr)(Mt),st===dt.FKt&&l.classList.add(J),(0,S.GC$)(w)[0].appendChild(l)})))}),(0,S.GC$)(I,this.Wc[0]).bind(L,function(xt){this.classList.contains(P)||xt.target.tagName!=="LI"||((0,S.GC$)(tt).removeClass(J),(0,S.GC$)(w).empty(),xt.target.classList.add(J),xt=xt.target.textContent,dt.jKt=xt,["4","8","9"].indexOf(dt.kKt+"")<0)||((xt=At([],dt.dh.Kz(xt),!0)).unshift(vt().BaseItemNext),xt.unshift(vt().BaseItemPrevious),xt.forEach(function(Mt,st){var l=document.createElement("li");l.className=Ft,l.value=st,l.innerHTML=(0,f.NUr)(Mt),st===0&&l.classList.add(J),(0,S.GC$)(w)[0].appendChild(l)}))}),(0,S.GC$)(w,this.Wc[0]).bind(L,function(xt){this.classList.contains(P)||xt.target.tagName!=="LI"||((0,S.GC$)(_).removeClass(J),xt.target.classList.add(J),dt.OKt=xt.target.textContent,dt._Kt=xt.target.value)}),(0,S.GC$)(U,this.Wc[0]).bind(q,function(xt){var Mt;xt=xt.target.value,(0,S.GC$)(w).empty(),dt.bbt=void 0,dt.kKt=parseInt(xt,10),-1<["4","7","8","9","10","11","12","13"].indexOf(xt)?((0,S.GC$)(I).removeClass(P),0<(0,S.GC$)(".pivot-field-content-base-field-item").length&&((0,S.GC$)(".pivot-field-content-base-field-item")[0].classList.add(J),Mt=dt.RKt[0].Zc,dt.jKt=Mt,-1<["4","8","9"].indexOf(xt))&&((0,S.GC$)(w).removeClass(P),(xt=At([],dt.dh.Kz(Mt),!0)).unshift(vt().BaseItemNext),xt.unshift(vt().BaseItemPrevious),xt.forEach(function(st,l){var T=document.createElement("li");T.className=Ft,(T.value=l)===0&&(T.classList.add(J),dt._Kt=0),T.innerHTML=(0,f.NUr)(st),(0,S.GC$)(w)[0].appendChild(T)}))):((0,S.GC$)(w).addClass(P),(0,S.GC$)(I).addClass(P),(0,S.GC$)(tt).removeClass(J),(0,S.GC$)(_).removeClass(J))}),(0,S.GC$)(g,this.Wc[0]).bind(L,function(){var xt=kt(dt);dt.DKt=xt.Xc()})},Xt.prototype.KX=function(){(0,S.GC$)(j).unbind(L),(0,S.GC$)(I).unbind(L),(0,S.GC$)(w).unbind(L),(0,S.GC$)(U).unbind(q),(0,S.GC$)(g).unbind(L)},Xt.prototype.lQ=function(){this.KX(),Ct.prototype.lQ.call(this)},o.PivotValuesFieldSettingDialog=Xt,Yt(Qt,Bt=Z),Qt.prototype.TKt=function(){this.SKt()},Qt.prototype.GKt=gt,Qt.prototype.VKt=function(){return`
  316. <div class="field-settings-layout-container">
  317. <span class="gc-sjs-field-settings-layout-style">`.concat(vt().Layout,`</span>
  318. <div class="gc-sjs-field-settings-layout-line"></div>
  319. <div class="gc-sjs-field-settings-layout-showNoData-container">
  320. <input type="checkbox" `).concat(this.xKt?"checked":""," class=").concat(A,`>
  321. <span class="gc-sjs-field-settings-layout-showNoData-label">`).concat(vt().showNoData,`</span>
  322. </div>
  323. <div class="gc-sjs-field-settings-layout-showNoData-container">
  324. <input type="checkbox" `).concat(this.Ppi===at.PivotTableLayoutType.tabular?"disabled":""," ").concat(this.Opi?"checked":""," class=").concat(Y,`>
  325. <span class="gc-sjs-field-settings-layout-showNoData-label">`).concat(vt().showSubtotalTop,`</span>
  326. </div>
  327. </div>`)},Qt.prototype.SKt=function(){var dt=this.VKt();this.wKt.push(`
  328. <div class="pivot-field-summarize-area">
  329. `.concat(dt,`
  330. </div>
  331. `))},Qt.prototype.Fz=function(){var dt=this;(0,S.GC$)(j,this.Wc[0]).bind(L,function(){dt.lQ()}),(0,S.GC$)(ot,this.Wc[0]).bind(L,function(){dt.lQ()}),(0,S.GC$)(E,this.Wc[0]).bind(q,function(){dt.k1=!0,dt.rYt=(0,S.GC$)(this).val()}),(0,S.GC$)("."+A,this.Wc[0]).bind(L,function(){dt.xKt=this.checked}),(0,S.GC$)("."+Y,this.Wc[0]).bind(L,function(){dt.Opi=this.checked}),(0,S.GC$)(g,this.Wc[0]).bind(L,function(){var xt=kt(dt);dt.DKt=xt.Xc()}),(0,S.GC$)(F,this.Wc[0]).bind(L,function(){dt.dh.wVt({cmd:"UpdatePivotFieldCmd",sheetName:"",cmdOption:{pivotName:dt.Vqt,oldFieldName:dt.CKt,fieldName:dt.rYt,showNoData:dt.xKt,showSubtotalTop:dt.Opi},formatter:dt.bbt}),dt.bbt="",dt.lQ()})},Qt.prototype.KX=function(){(0,S.GC$)(j).unbind(L),(0,S.GC$)(ot).unbind(L),(0,S.GC$)(E).unbind(q),(0,S.GC$)(g).unbind(L),(0,S.GC$)(F).unbind(L)},Qt.prototype.lQ=function(){this.KX(),Bt.prototype.lQ.call(this)},o.PivotDimFieldSettingDialog=Qt},"./dist/plugins/pivot/pivot-ui/pivot-field-setting-number-format-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_;function v(Ft,w,I,U){var g=_.call(this,null,1e4)||this;return g.Pc=!0,g.A0=I,g.I0=w,g.UKt=Ft,U&&typeof U!="string"&&U.format&&U.formatString?g.bbt=U.formatString():g.bbt=U,g.pKt(),g}Yt=this&&this.__extends||(tt=function(Ft,w){return(tt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(I,U){I.__proto__=U}:function(I,U){for(var g in U)Object.prototype.hasOwnProperty.call(U,g)&&(I[g]=U[g])}))(Ft,w)},function(Ft,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");function I(){this.constructor=Ft}tt(Ft,w),Ft.prototype=w===null?Object.create(w):(I.prototype=w.prototype,new I)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotFieldSettingNumberFormatDialog=void 0,At=ft("Core"),S=At.mt.En,at=ft("@spreadjs/js-sheets-common"),ft=ft("./dist/plugins/pivot/pivot.ns.js"),at=new at.Common.ResourceManager(ft.SR,"PivotTables"),X=at.getResource.bind(at),H=".pivot-field-number-format-show-value",f=".pivot-field-number-format-sample-value",B=At.mt.St,vt="click",mt="active",Yt(v,_=At.zc),v.prototype.Eot=function(){this.Wc.css(["position","left","top"],["absolute",this.I0,this.A0])},v.prototype.eG=function(){this.UKt=null,this.bbt=void 0},v.prototype.lQ=function(){this.KX(),this.eG(),_.prototype.close.call(this)},v.prototype.KX=function(){(0,At.GC$)(".pivot-field-content-number-format-item").unbind(vt),(0,At.GC$)(".pivot-field-setting-number-format-control-ok").unbind(vt),(0,At.GC$)(".gc-filter-dialog-close",this.Wc[0]).unbind(vt),(0,At.GC$)(".pivot-field-setting-number-format-control-cancel").unbind(vt),(0,At.GC$)(H).unbind(vt)},v.prototype.$c=function(){_.prototype.$c.call(this),this.QKt(),this.Fz(),this.Eot()},v.prototype.Fz=function(){var Ft=this;(0,At.GC$)(".pivot-field-content-number-format-item",this.Wc[0]).bind(vt,function(w){(0,At.GC$)(".pivot-field-content-number-format-item.active").removeClass(mt),this.classList.add(mt),(0,At.GC$)(H)[0].value=this.innerText,B(this.innerText)||((0,At.GC$)(f)[0].value=At.Be.Re(12345,this.innerText))}),(0,At.GC$)(".pivot-field-setting-number-format-control-ok",this.Wc[0]).bind(vt,function(){var w,I=(0,At.GC$)(H)[0].value;(w=X().CustomFormats).indexOf(I)<0&&w.push(I),Ft.UKt.bbt=(0,At.GC$)(H)[0].value,Ft.lQ()}),(0,At.GC$)(".gc-filter-dialog-close",this.Wc[0]).bind(vt,function(){Ft.lQ()}),(0,At.GC$)(".pivot-field-setting-number-format-control-cancel",this.Wc[0]).bind(vt,function(){Ft.lQ()}),(0,At.GC$)(H,this.Wc[0]).bind("input",function(){if(!B(this.value))try{(0,At.GC$)(f)[0].value=At.Be.Re(12345,this.value)}catch{}})},v.prototype.pKt=function(){var Ft=(0,At.GC$)(S("div"));Ft.addClass("gc-pivot-field-setting-wrapper gc-popup ui-widget gc-filter-dialog-style"),Ft[0].innerHTML=this.WKt()+'<div class="gc-pivot-field-setting-content">'+this.zKt()+"</div>"+this.ZKt(),this.Wc.append(Ft)},v.prototype.WKt=function(){return'<div style="width: 100%; height: 34px; background-color: rgb(255, 255, 255); padding: 0px 0px 0px 12px; box-sizing: border-box;"><span style="float: left; height: 34px; line-height: 34px; display: inline-block;">'.concat(X().FormatCells,`</span>
  332. <span class="gc-filter-dialog-close gc-pivot-dialog-close" style="float: right; height: 34px; line-height: 30px; display: inline-block; font-size: 28px; width: 54px; text-align: center;">\xD7</span></div>`)},v.prototype.ZKt=function(){return`<div class="pivot-field-setting-footer">
  333. <div class="pivot-field-setting-control-wrap"><input class= "pivot-field-setting-control pivot-field-setting-number-format-control-ok" type ="button" value= "`.concat(X().Ok,`">
  334. <input class= "pivot-field-setting-control pivot-field-setting-number-format-control-cancel" type ="button" value= "`).concat(X().Cancel,`">
  335. </div>
  336. </div>`)},v.prototype.zKt=function(){var Ft=this.YKt();return`
  337. <div class="pivot-field-number-format-area">
  338. <div class="pivot-field-summarize-header">
  339. <div style="margin-top: 6px" id="SummarizeValue" class="pivot-field-summarize-item active">`.concat(X().Number,`</div>
  340. </div>
  341. `).concat(Ft,`
  342. </div>
  343. `)},v.prototype.YKt=function(){return`
  344. <div style="background: white; padding-bottom: 10px;" class="gc-pivot-field-setting-content">
  345. <div class="pivot-field-summarize-area">
  346. <div class="pivot-field-show-value-as-content-header">`.concat(X().Sample,`</div>
  347. <input class="pivot-field-number-format-sample-value" value="12345" disabled="disabled" />
  348. <div class="pivot-field-show-value-as-content-header">`).concat(X().Type,`</div>
  349. <input class="pivot-field-number-format-show-value" />
  350. <ul class="pivot-field-number-format-content-list">
  351. </ul>
  352. </div>
  353. </div>
  354. `)},v.prototype.QKt=function(){var Ft,w,I=X().CustomFormats;(w=this).bbt&&I.indexOf(w.bbt)<0&&I.push(w.bbt),Ft=null,I.forEach(function(U,g){var F=document.createElement("li");F.className="pivot-field-content-number-format-item",F.value=g,F.innerText=U,w.bbt||g!==0?w.bbt===U&&(F.classList.add(mt),(0,At.GC$)(H)[0].value=U,B(U)||((0,At.GC$)(f)[0].value=At.Be.Re(12345,U),Ft=F)):(F.classList.add(mt),(0,At.GC$)(H)[0].value=U),(0,At.GC$)(".pivot-field-number-format-content-list")[0].appendChild(F)}),Ft&&Ft.scrollIntoView()},o.PivotFieldSettingNumberFormatDialog=v},"./dist/plugins/pivot/pivot-ui/pivot-filter-dialogs.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l,T,D,M,s,y,G,K,c,N,V,O;function pt(){}function wt(et,ht,St,$){var n=O.call(this,et,1e3)||this;return n.ter=at.DialogFeatureType.filter,n.wmr=function(a){var i,h,b=v(n.emi)?1:n.emi;switch(a.key){case M:n.ymr(b,!1),b!==(i=n.JKt?0:1)&&i<=(i=n.Omr(b))&&(n.ymr(i,!0),n.emi=i,Ft(a),n.Fmr(i));break;case s:n.ymr(b,!1),0<(i=n.Pmr(b))&&i<n.tXt.length&&(n.ymr(i,!0),n.emi=i,Ft(a),n.Fmr(i));break;case" ":(i=n.Mut.getActiveSheet()).suspendPaint(),h=i.getValue(b,0),i.setValue(b,0,!h),i.resumePaint(),h?n.qKt--:n.qKt++,b===0&&(n.KKt=!h),n.nXt(),Ft(a);break;case D:(0,at.GC$)("."+kt)[0].click(),Ft(a);break;case y:n.ymr(b,!1),(a.shiftKey?(0,at.GC$)("."+Rt):(0,at.GC$)("."+kt))[0].focus(),Ft(a)}},n.dh=ht,n.Vqt=St,n.Zue=$,n}Yt=this&&this.__extends||(V=function(et,ht){return(V=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(St,$){St.__proto__=$}:function(St,$){for(var n in $)Object.prototype.hasOwnProperty.call($,n)&&(St[n]=$[n])}))(et,ht)},function(et,ht){if(typeof ht!="function"&&ht!==null)throw new TypeError("Class extends value "+String(ht)+" is not a constructor or null");function St(){this.constructor=et}V(et,ht),et.prototype=ht===null?Object.create(ht):(St.prototype=ht.prototype,new St)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotFilterDialog=void 0,At=ft("@spreadjs/js-sheets-common"),S=ft("./dist/plugins/pivot/pivot.ns.js"),at=ft("Core"),X=ft("CellTypes"),H=ft("Pivot"),f=ft("./dist/plugins/pivot/pivot-ui/keyboard-event-handler.js"),B=ft("./dist/plugins/pivot/pivot-util.js"),ft=new At.Common.ResourceManager(S.SR,"PivotTables"),vt=At.Common.zf.j0,mt=ft.getResource.bind(ft),tt=At.Common.$T,_=At.Common.zf,v=At.Common.lt.ht,Ft=at.mt.vi,w=at.mt.En,I="gc-Filter-list-block",U="gc-Filter-list-icon",g="gc-Filter-list-link",F="gc-Filter-list-item",ot="gc-Filter-list-sort-item",E="item-hover",A="item-noHover",Y="clear-filter-icon",L="gc-Filter-list-span",q="filter-list-box",J="filter-dialog-confirm",P="filter-confirm-enable",bt="filter-sort-icon-one",k="filter-sort-icon-two",nt="filter-list-box-container",gt="filter-select-icon",Z="filter-select-all-link",ut="check-all",Rt="uncheck-all",Ct=j="gc-Filter-list-icon-selected",Bt="select-class",kt="ok-class",ie="cancel-class",Xt="filter-sort",Qt="filter-sort-dialog",dt="filter-condition",xt="gc-pivot-search-box-input",Mt="gc-pivot-search-box-icon",st="selectable-item",l="expandable-item",T=null,D="Enter",M="ArrowUp",s="ArrowDown",y="Tab",G=function(){return{type:2,child:[{text:mt().PivotPanel_Sort_A_Z,className:ot+" "+Xt,iconClass:U+" "+bt,commandName:"asc"},{text:mt().PivotPanel_Sort_Z_A,className:ot+" "+Xt,iconClass:U+" "+k,commandName:"desc"},{text:mt().PivotPanel_Sort_More,className:ot+" "+Qt,iconClass:U}]}},K=function(){return{type:3,child:[{text:mt().PivotPanel_Filter_Clear,className:ot+" "+dt,iconClass:U+" clear-filter-icon-default",commandName:"ClearFilter"},{text:mt().PivotPanel_Filter_Label,className:ot+" "+E+" "+dt,iconClass:U,commandName:"LabelFilter",rightArrow:!0},{text:mt().PivotPanel_Filter_Value,className:ot+" "+E+" "+dt,iconClass:U,commandName:"ValueFilter",rightArrow:!0}]}},c=function(){return{type:5,child:[{text:mt().Cancel,className:"".concat(J," ").concat(P),commandName:"Cancel"},{text:mt().Ok,className:"".concat(J," ").concat(P),commandName:"OK"}]}},pt.getData=function(et,ht,St){return pt.getDataModel(et,ht,St)},pt.getDataModel=function(et,ht,St){var $=[];return 1&et&&$.push(pt.getSelectData(St)),2&et&&$.push(pt.getSortSData(St)),4&et&&$.push(pt.getFilterData(St,ht)),8&et&&$.push(pt.getListBoxData(St)),16&et&&$.push(pt.getConfirmData()),$},pt.getSelectData=function(et){var ht,St={type:1,child:[]};if(et.areaFieldName)for(ht=0;ht<et.areaFieldName.length;ht++)St.child.push({text:""}),St.child[ht].text=et.areaFieldName[ht];return St},pt.getSortSData=function(et){var ht=at.GC$.extend(!0,{},G());return et.fieldIsNumber&&(ht.child[0].text=mt().PivotPanel_Sort_Smallest_Largest,ht.child[1].text=mt().PivotPanel_Sort_Largest_Smallest),et.isColOrRow?(ht.child[0].className+=" "+E,ht.child[1].className+=" "+E,ht.child[2].className+=" "+E):(ht.child[0].className+=" "+A,ht.child[1].className+=" "+A,ht.child[2].className+=" "+A),(0,H.ht)(et.sortInfo)||(et=ht.child[et.sortInfo],(0,H.ht)(et))||(~et.iconClass.indexOf(bt)?et.iconClass=et.iconClass.replace(bt,j):~et.iconClass.indexOf(k)&&(et.iconClass=et.iconClass.replace(k,j))),ht},pt.getFilterData=function(et,ht){var St=at.GC$.extend(!0,{},K());return St.child[0].text=St.child[0].text.replace("{0}",'"'.concat(ht,'"')),et.hasLabelCondition||et.hasValueCondition||et.hasLabelManual?St.child[0].className+=" "+E:St.child[0].className+=" "+A,et.hasLabelCondition&&(St.child[1].iconClass+=" "+Ct,St.child[0].iconClass=U+" "+Y),et.isDateType&&(St.child[1].text=mt().PivotPanel_Date_Filter),et.hasValueCondition&&(St.child[2].iconClass+=" "+Ct,St.child[0].iconClass=U+" "+Y),St},pt.getListBoxData=function(et){var ht={type:4,child:[]};return ht.child=et.fields,ht},pt.updateListBoxData=function(et,ht,St){var $,n;if(et&&et.child.length!==0){if($=et.child,ht===0)for(n=0;n<$.length;n++)$[n].status=St;else $[ht].status=St;return et}},pt.getConfirmData=function(){return at.GC$.extend(!0,{},c())},N=pt,Yt(wt,O=at.zc),wt.prototype.init=function(et,ht,St,$){this.c5(),this.rYt=ht,this.HKt=et,this.u_=St,this.LEt=$,this.JKt=!1,this.qKt=0,this.KKt=!1,this.XKt="",O.prototype.Hc.call(this),this.dh.getFieldInfoByName(ht)?$.isDateType=this.dh.getFieldInfoByName(ht).W5===2:$.isDateType=this.dh.hr(ht)===2,et=N.getData(et,ht,$),this.open(et,St),this.Wc.focus()},wt.prototype.c5=function(){this.Mut&&(this.Mut.L0(),this.Mut=null),this.KX(),this.Wc.empty(),this.Wc=null,this.Nmr=null},wt.prototype.open=function(et,ht){var St=this;et=this.Cmr(et),(ht=this.WX(ht.x,ht.y)).html(et),et=this.rf(),this.$c(),et&&window.gcGlobal.cf(),this.$Kt(),this.aY(),this.tpi=ht.width(),this.ipi=ht.height(),(et=this.Zue)!=null&&et.allowResize&&(ht.addClass("gc-Filter-list-resizable"),this.Wue=new at.Ose(ht[0],function(){St.Mut.Cg(),St.Mut.repaint()},40)),(et=this.Zue)!=null&&et.keepDialogSize&&(et=this.dh.npi)&&(ht.width(et.width),ht.height(et.height)),this.epi(),this.if(),this.rmr()},wt.prototype.epi=function(){var et=this.Xc();et.css(["minWidth","minHeight"],[this.tpi+"px",this.ipi+"px"]),this.ipi=et.height(),this.tpi=et.width()},wt.prototype.WX=function(et,ht){var St=this.Xc();return St.css(["left","top"],[et,ht]),St.addClass("gc-Filter-list"),St},wt.prototype.$c=function(){O.prototype.$c.call(this)},wt.prototype.close=function(){var et,ht=this.Xc();(et=this.Zue)==null||!et.keepDialogSize||this.ipi===ht.height()&&this.tpi===ht.width()||(this.dh.npi={width:ht.width(),height:ht.height()}),this.KX(),this.amr.eG(),this.eG(),O.prototype.close.call(this)},wt.prototype.eG=function(){this.Wue&&this.Wue.disconnect(),this.Wue=T,this.tXt=T,this.iXt=T,this.dh=T,this.u_=T,this.LEt=T,this.Mut=T},wt.prototype.aY=function(){var et,ht,St=this;(ht=(et=this).Mut).bind(at.Events.CellClick,function($,n){var a,i=St.tXt;(a=n.sheet).Oi&&a.aR("transparent"),n.row>=i.length||(n.row===0?(et.KKt=!et.KKt,a.setValue(0,0,et.KKt)):(i=a.getValue(n.row,0),a.setValue(n.row,0,!i),i?et.qKt--:et.qKt++),et.nXt())}),ht.bind(at.Events.TouchToolStripOpening,function($,n){n.handled=!0}),ht.bind(at.Events.ButtonClicked,function($,n){var a=St.tXt,i=n.sheet;n.row>=a.length||(n.row===0?(et.KKt=!et.KKt,i.setValue(0,0,et.KKt)):(a=i.getValue(n.row,0),i.setValue(n.row,0,!a),a?et.qKt--:et.qKt++),et.nXt())}),(0,at.GC$)("."+ut).bind("click",function($){var n,a,i=St.tXt,h=ht&&(0,at.jf)(ht);if(!(i.length<=0)){if(h){for(h.suspendPaint(),n=0,a=1;a<i.length;a++)h.getRowVisible(a)&&(h.setValue(a,0,!0),n++);h.resumePaint(),et.qKt=n}(0,at.GC$)("."+kt).addClass(P)}}),(0,at.GC$)("."+Rt).bind("click",function($){var n,a=St.tXt,i=ht&&(0,at.jf)(ht);if(!(a.length<=0)){if(i){for(i.suspendPaint(),n=1;n<a.length;n++)i.getRowVisible(n)&&i.setValue(n,0,!1);i.resumePaint(),et.qKt=0}(0,at.GC$)("."+kt).removeClass(P)}}),(0,at.GC$)("."+Bt).bind("change",function($){var n=this.options[this.selectedIndex].value,a=et.dh,i=et.Vqt,h=et.u_,b=et.HKt;a.wVt({cmd:"updateListBox",sheetName:"",cmdOption:{fieldName:n,pivotName:i,configurationNumber:b,position:h,filterDialog:et}})}),(0,at.GC$)("."+kt).bind("click",function($){var n,a,i,h;(0,at.GC$)(this).hasClass(P)&&(n=et.rYt,a=et.dh,i=et.Vqt,h=et.eXt(),a.wVt({cmd:"filterFieldLabelValue",sheetName:"",cmdOption:{fieldName:n,pivotName:i,dataOfListBox:h}}),et.close())}),(0,at.GC$)("."+ie).bind("click",function($){et.close()}),(0,at.GC$)("."+Xt).bind("click",function($){var n,a,i,h;(0,at.GC$)(this).hasClass(A)||(n=(0,at.GC$)(this).attr("command"),a=et.dh,i=et.rYt,h=et.Vqt,a.wVt({cmd:"pivotSort",sheetName:"",cmdOption:{fieldName:i,pivotName:h,commandName:n}}),et.close())}),(0,at.GC$)("."+Qt).bind("click",function(){et.Umr(this)}),(0,at.GC$)("."+dt).bind("click",function($){var n,a,i,h=(0,at.GC$)(this).attr("command");(0,at.GC$)(this).hasClass(A)||h!=="ClearFilter"||(n=et.dh,a=et.rYt,i=et.Vqt,n.wVt({cmd:"ClearCommand",sheetName:"",cmdOption:{fieldName:a,pivotName:i,commandName:h,clearType:0}}),et.close())}),(0,at.GC$)("."+dt).bind("mouseenter",function($){et.Imr(this)}),(0,at.GC$)("."+xt).bind("input",function($){et.JKt=!0,et.XKt=this.value.toLocaleLowerCase(),et.rXt()}),(0,at.GC$)("."+Mt).bind("click",function($){(0,at.GC$)("."+xt).val(""),et.JKt=!1,et.XKt="",et.rXt(),(0,at.GC$)("."+xt)[0].focus()}),et.Wc.bind("keydown",function($){var n=document.activeElement;Array.from(et.Nmr).includes(n)&&et.smr!==n&&(et.smr=n)}),(0,at.GC$)("."+nt).bind("focus",function($){var n,a;!et.JKt||(n=et.tXt,a=et.Mut.getActiveSheet(),n.some(function(i,h){return a.getRowVisible(h)}))?et.Amr($):(et.smr.classList.contains(Rt)?(0,at.GC$)("."+kt):(0,at.GC$)("."+Rt))[0].focus()}),(0,at.GC$)("."+nt).bind("keydown",function($){et.wmr($)}),(0,at.GC$)("."+kt).bind("keydown",function($){$.key===y&&$.shiftKey&&((0,at.GC$)("."+nt)[0].focus(),Ft($))})},wt.prototype.rmr=function(){var et,ht,St=this;this.Tmr(),ht={spaceCallback:et=function($){$.classList.contains(Qt)?St.Umr($,!0):$.classList.contains(dt)&&$.getAttribute("command")!=="ClearFilter"?St.Imr($):$.click()},enterCallback:function($){$.classList.contains(ut)||$.classList.contains(Rt)||$.classList.contains(nt)||$.classList.contains(xt)?(0,at.GC$)("."+kt)[0].click():et($)},rightCallback:function($){St.umr($)}},this.amr=new f.KeyboardEventHandler(this,ht)},wt.prototype.KX=function(){(0,at.GC$)("."+ut).unbind("click"),(0,at.GC$)("."+Rt).unbind("click"),(0,at.GC$)("."+Bt).unbind("change"),(0,at.GC$)("."+kt).unbind("click"),(0,at.GC$)("."+ie).unbind("click"),(0,at.GC$)("."+Xt).unbind("click"),(0,at.GC$)("."+dt).unbind("click"),(0,at.GC$)("."+dt).unbind("mouseenter"),(0,at.GC$)(".filter-search-input").unbind("change"),(0,at.GC$)("."+xt).unbind("input"),(0,at.GC$)("."+Mt).unbind("click"),(0,at.GC$)("."+nt).unbind("focus"),(0,at.GC$)("."+nt).unbind("keydown"),(0,at.GC$)("."+kt).unbind("keydown"),this.Wc.unbind("keydown")},wt.prototype.Umr=function(et,ht){var St,$,n=this;(0,at.GC$)(et).hasClass(A)||(et=n.dh,St=n.rYt,$=n.Vqt,n.close(),et.wVt({cmd:"createDialogForPivotSort",sheetName:"",cmdOption:{fieldName:St,pivotName:$,needFocus:ht}}))},wt.prototype.Amr=function(et){Ft(et),v(this.emi)&&(this.emi=this.JKt?0:1),this.ymr(this.emi,!0)},wt.prototype.ymr=function(et,ht){var St;(St=this.Mut.getActiveSheet()).suspendPaint(),ht=this.xmr(et,ht),St.setStyle(et,-1,ht),St.resumePaint()},wt.prototype.xmr=function(et,ht){var St="",$="";return ht&&(ht=(0,at.GC$)(w("div")),(0,at.GC$)(ht).addClass("gc-pivot-filter-selectable-item"),this.Wc.append(ht),St=ht.css("backgroundColor"),$=ht.css("color"),ht.remove()),(et=(ht=this.Mut.getActiveSheet().Z_(et,-1,at.SheetArea.viewport))&&ht.clone()||new at.Style).backColor=St,et.foreColor=$,et},wt.prototype.umr=function(et){var ht;(ht=this.Wc[0].contains(et)?et.id:ht)===l&&this.Imr(et)},wt.prototype.Imr=function(et){var ht,St=(ht=(0,at.GC$)(et)).attr("command");ht.hasClass(A)||ht.attr("command")==="ClearFilter"||this.Smr(et,St)},wt.prototype.Smr=function(et,ht){var St=this.dh,$=this.rYt,n=this.Vqt,a={x:this.u_.x,y:this.u_.y};St.wVt({cmd:"createFilterSecondaryMenu",sheetName:"",cmdOption:{fieldName:$,pivotName:n,commandName:ht,host:et,position:a,filterDialog:this}})},wt.prototype.Cmr=function(et){for(var ht="",St=0;St<et.length;St++)switch(et[St].type){case 1:ht+=this.renderSelectField(et[St]);break;case 2:ht+=this.renderSort(et[St]);break;case 3:ht+=this.renderFilters(et[St]);break;case 4:ht+=this.renderListBox(et[St]);break;case 5:ht+=this.renderConfirm(et[St])}return ht},wt.prototype.Tmr=function(){this.Nmr=this.Wc[0].querySelectorAll(".".concat(st))},wt.prototype.renderSelectField=function(et){for(var ht='<select class="'.concat(Bt," ").concat(st,`" style="width:100%" tabindex='0'>`),St=0;St<et.child.length;St++)ht+=this.renderDropDown(et.child[St].text);return"<div class='".concat("gc-Filter-list-select-block",`'>
  355. <div class='`).concat(F,`'>
  356. `).concat(mt().Select_Field,`
  357. </div>
  358. <div class='`).concat(F,`'>
  359. `).concat(ht,`
  360. </select>
  361. </div>
  362. </div>`)},wt.prototype.renderSort=function(et){for(var ht="",St=0;St<et.child.length;St++)ht+=this.createItem(et.child[St],St===0?0:-1);return'<div class="'.concat(I,`">
  363. `).concat(ht,`
  364. <div class="`).concat(L,`"></div>
  365. </div>`)},wt.prototype.renderFilters=function(et){for(var ht="",St=0;St<et.child.length;St++)ht+=this.createItem(et.child[St],St===0?0:-1,!!St);return'<div class="'.concat(I,`">
  366. `).concat(ht,`
  367. <div class="`).concat(L,`"></div>
  368. </div>`)},wt.prototype.renderListBox=function(et){var ht,St,$,n;for(this.iXt=nt,this.tXt=et.child,ht="",St=et.child,$=0;$<St.length;$++)if(St[$].status===!1){ht=j+" "+U;break}return et=this.oXt(),n=this.aXt(),'<div class="'.concat(q,`">
  369. `).concat(et,`
  370. `).concat(n,`
  371. <div class="`).concat("filter-list-box-host",`">
  372. <div class="`).concat("filter-list-box-icon",`">
  373. <div class="`).concat(ht,`"></div>
  374. </div>
  375. <div class="`).concat(nt," ").concat(st,`" tabindex=0></div>
  376. </div>
  377. <div>`)},wt.prototype.renderConfirm=function(et){return'<div class="'.concat(I,`">
  378. <div class="`).concat(ot," ").concat("gc-Filter-list-button-container",`">
  379. <div class="`).concat(et.child[1].className+" "+kt," ").concat(st,'" command="').concat(et.child[1].commandName,`" tabindex='0'>`).concat(et.child[1].text,`</div>
  380. <div class="`).concat(et.child[0].className+" "+ie," ").concat(st,'" command="').concat(et.child[0].commandName,`" tabindex='0'>`).concat(et.child[0].text,`</div>
  381. </div>
  382. </div>`)},wt.prototype.renderDropDown=function(et){return et=vt(et),"<option>".concat((0,B.NUr)(et),"</option>")},wt.prototype.createItem=function(et,ht,St){return ht=v(ht)?"":'tabindex="'.concat(ht,'"'),et.rightArrow?"<div id=".concat(St?l:"",' class="').concat(et.className," ").concat(st,'" command="').concat(et.commandName,'" ').concat(ht,`>
  383. <div class="`).concat(et.iconClass,`"></div>
  384. <div class="`).concat(g,'">').concat((0,B.NUr)(_.j0(et.text)),`</div>
  385. <div class="`).concat("gc-Filter-list-link-arrow",`"></div>
  386. </div>`):'<div class="'.concat(et.className," ").concat(st,'" command="').concat(et.commandName,'" ').concat(ht,`>
  387. <div class="`).concat(et.iconClass,`"></div>
  388. <div class="`).concat(g,'">').concat((0,B.NUr)(_.j0(et.text)),`</div>
  389. </div>`)},wt.prototype.$Kt=function(et){var ht,St,$,n;et=et||this.tXt,ht=this.iXt,(ht=new at.Workbook(document.getElementsByClassName(ht)[0],{sheetCount:1})).xU=!0,ht.options.scrollByPixel=!0,St=(this.Mut=ht).sheets[0],ht.suspendEvent(),St.suspendPaint(),n=ht.options,$=St.options,n.allowContextMenu=!1,n.showHorizontalScrollbar=!1,n.showVerticalScrollbar=!1,n.scrollbarMaxAlign=!0,n.tabStripVisible=!1,n.allowUserResize=!1,n.allowUserDragDrop=!1,n.allowDragHeaderToMove=at.AllowDragHeaderToMove.none,n.allowUserDragFill=!1,n.allowUserZoom=!1,n.grayAreaBackColor="white",$.colHeaderVisible=!1,$.rowHeaderVisible=!1,$.selectionBackColor="transparent",$.selectionBorderColor="transparent",$.gridline={showVerticalGridline:!1,showHorizontalGridline:!1},$.isProtected=!0,St.defaults.rowHeight=21,St.defaults.colWidth=23,et.unshift({value:mt().AddSearchResult,status:this.KKt,text:mt().AddSearchResult}),this.sXt(),St.resumePaint(),ht.resumeEvent(),(n=(0,at.GC$)("."+q)).css("height","calc(100% - ".concat(this.Wc.height()-n.height(),"px)"))},wt.prototype.oXt=function(){return"<div class = '".concat("gc-pivot-search-box",`'>
  390. <div class = '`).concat("gc-pivot-search-box-input-container",`'>
  391. <input class = '`).concat(xt," ").concat(st,`' placeholder="`).concat(mt().search,`" tabindex='0'/>
  392. <div class = '`).concat(Mt," ").concat(st,`' tabindex='0'>
  393. <div class = '`).concat("gc-pivot-search-box-icon-background-clear",`'></div>
  394. </div>
  395. </div>
  396. </div>`)},wt.prototype.aXt=function(){var et=gt+" filter-check-all-icon",ht=gt+" filter-uncheck-all-icon",St=Z+" "+ut,$=Z+" "+Rt;return'<div class="'.concat("filter-select-all-container",`">
  397. <a class="`).concat(St," ").concat(st,`" tabindex='0'>
  398. <span class="`).concat(et,`"></span>
  399. <span>`).concat(mt().PivotPanel_Filter_SelectAll,`</span>
  400. </a>
  401. <a class="`).concat($," ").concat(st,`" tabindex='0'>
  402. <span class="`).concat(ht,`"></span>
  403. <span>`).concat(mt().PivotPanel_Filter_NoSelectAll,`</span>
  404. </a>
  405. </div>`)},wt.prototype.uXt=function(){var et=(St=this).Mut,ht=St.qKt,St=St.JKt;(0,H.ht)(et)||(St&&ht++,et.options.showVerticalScrollbar=8<ht)},wt.prototype.tst=function(et){var ht,St,$=(a=this).Mut,n=a.qKt,a=a.JKt;(0,H.ht)($)||(ht=(0,at.jf)($),St=170,$.options.showVerticalScrollbar&&(St-=20),St<(et=a&&n&&et<at.q.Wt(mt().AddSearchResult)?at.q.Wt(mt().AddSearchResult):et)?($.options.showHorizontalScrollbar=!0,ht.autoFitColumn(1)):($.options.showHorizontalScrollbar=!1,ht.setColumnWidth(1,500)))},wt.prototype.eXt=function(){var et,ht,St,$,n,a,i=(a=this).JKt,h=a.KKt,b=a.tXt,Q=(a=a.Mut)&&(0,at.jf)(a),it={},It=!0;if(!(0,H.ht)(Q)){if(i)if(h){for(ht=1;ht<b.length;ht++)Q.getRowVisible(ht)&&((et=Q.getValue(ht,0))&&(It=!1),it[ht]=b[ht].status,b[ht].status=et);if(It)for(St=0,$=Object.keys(it);St<$.length;St++)b[n=$[St]].status=it[n]}else for(ht=1;ht<b.length;ht++)Q.getRowVisible(ht)&&Q.getValue(ht,0)?b[ht].status=!0:b[ht].status=!1;else for(ht=1;ht<b.length;ht++)Q.getValue(ht,0)?b[ht].status=!0:b[ht].status=!1;b.shift()}return b},wt.prototype.nXt=function(){this.KKt||this.qKt?(0,at.GC$)("."+kt).addClass(P):(0,at.GC$)("."+kt).removeClass(P)},wt.prototype.rXt=function(){var et,ht,St,$,n,a,i=(a=this).tXt,h=a.XKt;if(a.cXt(),(0,H.ht)(h)||h.length<1)a.JKt=!1,a.sXt();else if(et=(h=a.Mut)&&(0,at.jf)(h)){for(et.suspendPaint(),et.setRowVisible(0,!0),ht=void(a.qKt=0),St=0,$=a.lXt(),n=1;n<i.length;n++)(ht=i[n]).text&&$(ht.text)?(et.setRowVisible(n,!0),et.setValue(n,0,!0),a.qKt++,St=ht.textLength>St?ht.textLength:St):et.setRowVisible(n,!1);a.qKt===0?(et.setRowVisible(0,!1),(0,at.GC$)("."+kt).removeClass(P)):(0,at.GC$)("."+kt).addClass(P),a.uXt(),a.tst(St),et.resumePaint()}a.emi=null},wt.prototype.lXt=function(){var et,ht,St,$=this.XKt;return(St=tt.jJ($))?(et=tt.OJ(St),function(n){return ht=et.exec(n),et.lastIndex=0,ht&&ht.index===0}):function(n){return-1<n.toLocaleLowerCase().indexOf($)}},wt.prototype.cXt=function(){var et=this.XKt,ht=(0,at.GC$)("."+Mt);et?ht.css("display","block"):ht.css("display","none")},wt.prototype.sXt=function(){var et,ht,St,$,n,a=(n=($=this).Mut)&&(0,at.jf)(n),i=$.tXt,h=at.GC$.extend(!0,[],i);for(a.suspendPaint(),$.qKt=0,a.setRowVisible(0,!1),et=0,St=1;St<h.length;St++)(ht=h[St]).status&&$.qKt++,a.setRowVisible(St,!0),(0,H.ht)(ht.textLength)&&(i[St].textLength=at.q.Wt(ht.text)),et=ht.textLength>et?ht.textLength:et;a.setDataSource(h),a.bindColumns([{name:"status",cellType:new X.CheckBox},{name:"text"}]),(n=a.getActualStyle(-1,2)).hAlign=0,a.setStyle(-1,2,n),$.uXt(),$.tst(et),a.resumePaint()},wt.prototype.if=function(){var et,ht,St,$,n,a,i,h,b,Q=(0,at.GC$)(this.Wc[0]),it=this.qc();Q.length===0||(it=(0,at.GC$)(it).offset(),et=parseInt(Q.css("left"),10)+it.left,ht=parseInt(Q.css("top"),10)+it.top,St=Q.width(),$=Q.height(),isNaN(et))||isNaN(ht)||isNaN(St)||isNaN($)||(a=n=0,i=(h=document.documentElement).clientWidth,h=h.clientHeight,(b=Q[0].getBoundingClientRect()).left+St>i&&(a=b.left+St-i),b.top+$>h&&(n=b.top+$-h),(et<0||ht<0||0<n||0<a)&&Q.css({left:(et=(et-=a)<0?0:et)-it.left+"px",top:(ht=(ht-=n)<0?0:ht)-it.top+"px"}))},wt.prototype.Fmr=function(et){var ht,St,$,n,a,i,h,b,Q;if(Q=(b=this.Mut)&&(0,at.jf)(b)){for(Q.suspendPaint(),b=Q.getViewportHeight(1),ht=Q.getViewportTopRow(1),St=Q.getViewportTopRowOffset(),$=Q.getViewportLeftColumnOffset(),n=21*Math.max(ht-1,0)-St,a=0,i=ht;i<et;i++)Q.getRowVisible(i)&&a++;h=n+21*(a+1)+St,a===0?(ht!==et&&Q.showRow(et,at.VerticalPosition.top),St!==0&&Q.scroll(St,-$)):n+b<h&&Q.showRow(et,at.VerticalPosition.bottom),Q.resumePaint()}},wt.prototype.Pmr=function(et){for(var ht=et+1,St=this.tXt;ht<St.length&&!this.Mut.getActiveSheet().getRowVisible(ht);)ht++;return ht},wt.prototype.Omr=function(et){for(var ht=this.JKt?0:1,St=et-1;ht<=St&&!this.Mut.getActiveSheet().getRowVisible(St);)St--;return St},o.PivotFilterDialog=wt},"./dist/plugins/pivot/pivot-ui/pivot-number-group-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g;function F(ot,j,E,A,Y,L,q,J,P){return(ot=g.call(this,ot,0,!0)||this).cKt=j,ot.rYt=E,ot.dh=A,ot.T=L||0,ot.lKt=Y,ot.fKt=Y===ot.T,ot.gd=J||0,ot.hKt=q,ot.vKt=q===ot.gd,ot.fXt=P,ot.uf(),ot}Yt=this&&this.__extends||(U=function(ot,j){return(U=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(E,A){E.__proto__=A}:function(E,A){for(var Y in A)Object.prototype.hasOwnProperty.call(A,Y)&&(E[Y]=A[Y])}))(ot,j)},function(ot,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");function E(){this.constructor=ot}U(ot,j),ot.prototype=j===null?Object.create(j):(E.prototype=j.prototype,new E)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotNumberGroupDialog=void 0,At=ft("Core"),S=ft("@spreadjs/js-sheets-common"),at=ft("./dist/plugins/pivot/pivot.ns.js"),X=ft("Pivot"),ft=new S.Common.ResourceManager(at.SR,"PivotTables"),H=ft.getResource.bind(ft),f=At.mt.En,B="cancel-class",vt="ok-label",mt="filter-confirm",tt="number-group-startingAt-isActive",_="number-group-startingAt-value",v="number-group-endingAt-isActive",Ft="number-group-endingAt-value",w="number-group-by-value",I="number-group-dialog-sub-container",Yt(F,g=At.zc),F.prototype.$c=function(){this.pKt(),g.prototype.$c.call(this),this.Eot(),this.Fz()},F.prototype.pKt=function(){var ot=(0,At.GC$)(f("div"));ot[0].innerHTML=this.mKt(),this.Wc.append(ot)},F.prototype.Fz=function(){var ot=this;(0,At.GC$)("."+B).bind("click",function(j){ot.lQ()}),(0,At.GC$)("."+vt).bind("click",function(j){var E=ot.cKt,A=ot.rYt,Y=parseInt((0,At.GC$)("."+_).val().trim(),10),L=parseInt((0,At.GC$)("."+Ft).val().trim(),10),q=parseInt((0,At.GC$)("."+w).val().trim(),10);ot.dh.wVt({cmd:"pivotTableGroup",cmdOption:{dataType:X.PivotDataType.number,fieldName:A,pivotName:E,startingAtValue:Y,endingAtValue:L,groupByValue:q}}),ot.lQ()}),(0,At.GC$)("."+_).bind("change",function(j){(ot.fKt=!1,At.GC$)("."+tt)[0].checked=!1}),(0,At.GC$)("."+Ft).bind("change",function(j){(ot.vKt=!1,At.GC$)("."+v)[0].checked=!1}),(0,At.GC$)("."+tt).bind("click",function(j){this.checked&&(0,At.GC$)("."+_).val(ot.lKt)}),(0,At.GC$)("."+v).bind("click",function(j){this.checked&&(0,At.GC$)("."+Ft).val(ot.hKt)})},F.prototype.mKt=function(){return`<div class="number-group-dialog-container">
  406. <div class="number-group-dialog-header">
  407. <span class="date-group-dialog-header-title">`.concat(H().grouping,`</span>
  408. <span class="`).concat(B+" sjs-cancel-icon",`">\xD7</span>
  409. </div>
  410. <div class="number-group-dialog-content">
  411. <div class="number-group-dialog-content-header">
  412. <span>`).concat(H().auto,`</span>
  413. <span class="number-group--header-horizontal-line"></span>
  414. </div>
  415. <div class="`).concat(I,`">
  416. <input type="checkbox" class="`).concat(tt,'" ').concat(this.fKt?"checked":"unchecked",`>
  417. <span>`).concat(H().startingAt,`</span>
  418. <input class="`).concat(_,'" value = ').concat(this.T,`></input>
  419. </div>
  420. <div class="`).concat(I,`">
  421. <input type="checkbox" class="`).concat(v,'" ').concat(this.fKt?"checked":"unchecked",`>
  422. <span>`).concat(H().endingAt,`</span>
  423. <input class="`).concat(Ft,'" value = ').concat(this.gd,`></input>
  424. </div>
  425. <div class="`).concat(I,`">
  426. <span style = "margin-left: 24px">`).concat(H().groupBy,`</span>
  427. <input class="`).concat(w,'" value= ').concat(this.fXt,`></input>
  428. </div>
  429. <div class="number-group-dialog-bottom-confirm">
  430. <span class="`).concat(B+" "+mt,'">').concat(H().Cancel,`</span>
  431. <span class="`).concat(vt+" "+mt,'">').concat(H().Ok,`</span>
  432. </div>
  433. </div>
  434. </div>`)},F.prototype.Eot=function(){var ot=(A=this).Wc.width(),j=A.Wc.height(),E=A.Fc.width(),A=A.Fc.height();this.Wc.css(["position","left","top","z-index"],["absolute",(E-ot)/2+"px",(A-j)/2+"px",1001])},F.prototype.eG=function(){this.dh=null},F.prototype.KX=function(){(0,At.GC$)("."+B).unbind("click"),(0,At.GC$)("."+vt).unbind("click")},F.prototype.lQ=function(){this.eG(),this.KX(),g.prototype.close.call(this)},o.PivotNumberGroupDialog=F},"./dist/plugins/pivot/pivot-ui/pivot-show-value-as-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F;function ot(j,E,A,Y,L,q){var J,P;if((j=F.call(this,j,0,!0)||this).dh=E,j.rYt=A,j.Twt=q,j.Vqt=Y,L){if(j.OJt=L.valueFieldName,J=void 0,E=j.dh.B,A=j.dh.R,L.menuArea===4)if(L.area===4){for(P=L.rowInfos&&L.rowInfos.length-1;0<=P;P--)if(L.rowInfos[P].fieldName!==vt().sigmaValue){J=L.rowInfos[P];break}}else L.area===3?((q=L.activeRowFieldInfo&&L.activeRowFieldInfo.index)===0?q+=1:q===L.rowInfos&&L.rowInfos.length-1?q=L.rowInfos.length-2:q-=1,J=L.rowInfos[q]):L.area===2&&(q=Y=void 0,E[0]?(Y=E[0]&&E[0].Zc,q=E[0]._items[0].value):A[0]&&(Y=A&&A[0].Zc,q=A[0]._items[0].value),J={fieldNameTemp:Y,itemNameTemp:q});j.hXt=J.fieldName,j.vXt=J.itemName}return j.uf(),j.$c(),j}Yt=this&&this.__extends||(g=function(j,E){return(g=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(A,Y){A.__proto__=Y}:function(A,Y){for(var L in Y)Object.prototype.hasOwnProperty.call(Y,L)&&(A[L]=Y[L])}))(j,E)},function(j,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function A(){this.constructor=j}g(j,E),j.prototype=E===null?Object.create(E):(A.prototype=E.prototype,new A)}),At=this&&this.__spreadArray||function(j,E,A){if(A||arguments.length===2)for(var Y,L=0,q=E.length;L<q;L++)!Y&&L in E||((Y=Y||Array.prototype.slice.call(E,0,L))[L]=E[L]);return j.concat(Y||Array.prototype.slice.call(E))},Object.defineProperty(o,"__esModule",{value:!0}),o.PivotShowValueAsDialog=void 0,S=ft("Core"),at=ft("Pivot"),X=ft("@spreadjs/js-sheets-common"),H=ft("./dist/plugins/pivot/pivot.ns.js"),f=ft("./dist/plugins/pivot/pivot-util.js"),ft=new X.Common.ResourceManager(H.SR,"PivotTables"),B=X.Common.zf.j0,vt=ft.getResource.bind(ft),mt=S.mt.En,tt="cancel-class",_="ok-label",v="filter-confirm",Ft="show-value-as-dialog-content-item",w="show-value-as-dialog-content-select",I=".baseFieldList",U=".baseFieldItem",Yt(ot,F=S.zc),ot.prototype.$c=function(){this.pKt(this.Twt,this.OJt,this.dXt()),F.prototype.$c.call(this),this.Eot(),this.Fz()},ot.prototype.dXt=function(){return At(At([],this.dh.nw(1),!0),this.dh.nw(2),!0)},ot.prototype.getBaseItemList=function(j){return At([],this.dh.Kz(j),!0)},ot.prototype.pKt=function(j,E,A){var Y=(0,S.GC$)(mt("div"));Y[0].innerHTML=this.mKt(j,E,A),this.Wc.append(Y)},ot.prototype.b0=function(j,E,A){return A=A?"selected":"",'<option value="'.concat(E,'" ').concat(A,">").concat((0,f.NUr)(B(j)),"</option>")},ot.prototype.Fz=function(){var j=this;(0,S.GC$)("."+tt).bind("click",function(E){j.lQ()}),(0,S.GC$)("."+_).bind("click",function(E){var A,Y=j.dh,L=(0,S.GC$)(I)[0],q=(0,S.GC$)(U)[0];L=L&&L.options[L.selectedIndex].text,q&&(A={index:q.selectedIndex,value:q.options[q.selectedIndex].text}),Y.wVt({cmd:"UpdatePivotValueFieldCmd",sheetName:"",cmdOption:{showValueAsType:j.Twt,pivotName:j.Vqt,fieldName:j.rYt,baseField:L,baseItem:A}}),j.lQ()}),(0,S.GC$)(I).bind("change",function(E){var A,Y,L,q;if(!(0,at.ht)((0,S.GC$)(U)[0])){for(A=(0,S.GC$)(this.options[this.selectedIndex]).text(),(Y=At([],j.dh.Kz((L="",f.DUr)(A)),!0))&&0<Y.length&&(Y.unshift(vt().BaseItemNext),Y.unshift(vt().BaseItemPrevious)),q=0;q<Y.length;q++)L+=j.b0(Y[q],q);(0,S.GC$)(U)[0].innerHTML=L}})},ot.prototype.mKt=function(j,E,A){var Y,L,q,J,P,bt,k,nt,gt,Z,ut="",Rt="";for((Z=this.dh.getFieldInfoByName(this.OJt).Or)&&(L=Z.showDataAs,q=Z.baseFieldName,J=Z.baseFieldItem,P=Z.baseFieldItemType),bt=j===L&&q||this.hXt,k=0;k<A.length;k++)Y=bt===A[k].Zc,ut+=this.b0(A[k].Zc,k,Y);if((nt=this.getBaseItemList(bt))&&0<nt.length)for(nt.unshift(vt().BaseItemNext),nt.unshift(vt().BaseItemPrevious),gt=this.pXt(nt,J,P),k=0;k<nt.length;k++)Rt+=this.b0(nt[k],k,gt===k);return Z=-1<[4,8,9].indexOf(j)?' <div class="'.concat(Ft,`">
  435. <span>`).concat(vt().BaseItemForDialog,`</span>
  436. <select class="`).concat(w,' baseFieldItem">').concat(Rt,`</select>
  437. </div>`):"",'<div class="'.concat("show-value-as-dialog-container",`">
  438. <div class="`).concat("show-value-as-dialog-header",`">
  439. <span>`).concat(vt().ShowValueAs+"("+(0,f.NUr)(B(E))+")",`</span>
  440. <span class="`).concat(tt+" sjs-cancel-icon",`">\xD7</span>
  441. </div>
  442. <div class="`).concat("show-value-as-dialog-content",`">
  443. <div>
  444. <span>`).concat(vt().CalculationForDialog,`</span>
  445. <span>`).concat(vt().showValueAsDialog[j],`</span>
  446. </div>
  447. <div class="`).concat(Ft,`">
  448. <span>`).concat(vt().BaseFieldForDialog,`</span>
  449. <select class="`).concat(w,' baseFieldList">').concat(ut,`</select>
  450. </div>
  451. `).concat(Z,`
  452. <div class="show-value-as-dialog-bottom-confirm">
  453. <span class="`).concat(tt+" "+v,'">').concat(vt().Cancel,`</span>
  454. <span class="`).concat(_+" "+v,'">').concat(vt().Ok,`</span>
  455. </div>
  456. </div>
  457. </div>`)},ot.prototype.pXt=function(j,E,A){var Y,L,q=this.vXt;if(A===at.PivotShowDataAsBaseItemType.previous)return 0;if(A===at.PivotShowDataAsBaseItemType.next)return 1;if(!(Y=0,at.ht)(E)||!(0,at.ht)(q))for(L=2;L<j.length;L++){if(E===j[L])return L;j[L]===q&&(Y=L)}return Y},ot.prototype.Eot=function(){var j=(Y=this).Wc.width(),E=Y.Wc.height(),A=Y.Fc.width(),Y=Y.Fc.height();this.Wc.css(["position","left","top","z-index"],["absolute",(A-j)/2+"px",(Y-E)/2+"px",1001])},ot.prototype.eG=function(){this.dh=null},ot.prototype.KX=function(){(0,S.GC$)("."+tt).unbind("click"),(0,S.GC$)("."+_).unbind("click"),(0,S.GC$)(I).unbind("change")},ot.prototype.lQ=function(){this.eG(),this.KX(),F.prototype.close.call(this)},o.PivotShowValueAsDialog=ot},"./dist/plugins/pivot/pivot-ui/pivot-sort-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt,st,l,T,D,M,s,y,G,K,c,N,V,O,pt,wt,et;function ht(i,h,b,Q,it){var It=O.call(this,i,2e3,!0)||this;return It.Ise=function(){(0,S.GC$)(".rangeSelectFocusItem",It.Wc[0]).focus(),window.removeEventListener("mousemove",It.Sse),It.Mse=!1},It.spi=Q,It.rYt=b,It.Mf=h,It.hce=it,It.$c(),It.uf(),It}function St(i,h,b,Q,it){return(i=pt.call(this,i,2e3,!0)||this).cpi=Q,i.dh=b,i.Mf=h,i.hce=it,i.LJt=b.z.filter(function(It){return It instanceof mt.PivotTable})[0],i.uf(),i.$c(),i}function $(i,h,b,Q,it,It){return(i=wt.call(this,i,2e3,!0)||this).dh=b,i.rYt=Q,i.Vqt=it,i.Mf=It,i.Xqt=h,(it=b.getSortInfo(Q))&&it.sortValueFieldName?i.upi=it.sortValueFieldName:i.upi=Q,i.nrt=it,i.uf(),i.$c(),i}function n(i,h,b,Q,it){return(i=et.call(this,i,2e3,!0)||this).LJt=b,i.lpi=Q,i.Mf=h,i.fpi=!!it,it||(b=Q.rowInfos,h=Q.colInfos,it=_().sigmaValue,b&&b.length===1&&b[0].fieldName===it&&(i.fpi=!0),h&&h.length===1&&h[0].fieldName===it&&(i.fpi=!0)),i.uf(),i.$c(),i}function a(i,h){var b;i&&0<i.length&&(i.some(function(Q){return Q.isGrandTotal})||((b=i.findIndex(function(Q){return Q.fieldName===_().sigmaValue}))!==-1&&(h.sortValueFieldName=i[b].itemName,i.splice(b,1)),h.sortByPivotReferences=i.map(function(Q){return{fieldName:Q.fieldName,items:[Q.itemName]}})))}Yt=this&&this.__extends||(V=function(i,h){return(V=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(b,Q){b.__proto__=Q}:function(b,Q){for(var it in Q)Object.prototype.hasOwnProperty.call(Q,it)&&(b[it]=Q[it])}))(i,h)},function(i,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");function b(){this.constructor=i}V(i,h),i.prototype=h===null?Object.create(h):(b.prototype=h.prototype,new b)}),At=this&&this.__assign||function(){return(At=Object.assign||function(i){for(var h,b,Q=1,it=arguments.length;Q<it;Q++)for(b in h=arguments[Q])Object.prototype.hasOwnProperty.call(h,b)&&(i[b]=h[b]);return i}).apply(this,arguments)},Object.defineProperty(o,"__esModule",{value:!0}),o.SortValueDialog=o.SortFieldDialog=void 0,S=ft("Core"),at=ft("@spreadjs/js-sheets-common"),X=ft("FormulaTextBox"),H=ft("SheetsCalc"),f=ft("./dist/plugins/pivot/pivot.ns.js"),B=ft("Pivot"),vt=ft("./dist/plugins/pivot/pivot-ui/filter-dialog.js"),mt=ft("./dist/plugins/pivot/pivot-table/pivot-table.js"),tt=ft("./dist/plugins/pivot/pivot-util.js"),ft=new at.Common.ResourceManager(f.SR,"PivotTables"),_=ft.getResource.bind(ft),v=at.Common.zf.j0,Ft=null,w=void 0,I=H.formulaToRanges,U=H.rangeToFormula,g="label-title",F="sjs-cancel-icon",ot="cancel-class",j="label-show",E="split-line",A="ok-label",Y="filter-confirm",L="confirm-class",q="gc-pivot-sort-dialog-container",J="gc-sort-dialog-title",P="gc-sort-dialog-body",bt="gc-sort-more-options",k="gc-sort-close-dialog",nt="gc-sort-summary",gt="gc-sort-select",Z="gc-sort-range-select",ut="gc-sort-range-selector",Rt="gc-sort-range-input",Ct="gc-sort-disabled",Bt="gc-sort-range-select-button",kt="gc-pivot-sort-option",ie="gc-pivot-sort-options-asc",Xt="gc-pivot-sort-options-desc",Qt="gc-pivot-sort-label-asc",dt="gc-pivot-sort-label-desc",xt="gc-pivot-sort-by-total",Mt="gc-pivot-sort-by-value",st="gc-pivot-sort-half-split-area",l="gc-pivot-sort-direction-top-to-bottom",T="gc-pivot-sort-direction-left-to-right",D="gc-pivot-sort-direction",M="{{FIELD_NAME}}",s="{{SELECTED_FIELD_NAME}}",y="{{ORDER}}",G="{{ROW_COLUMN}}",K="selectable-item",Yt(ht,O=S.Ase),ht.prototype.$c=function(){var i=this;i.Wc.html(this.tKt()),O.prototype.$c.call(this),i.lgi(),i.Eot(),i.aY()},ht.prototype.Eot=function(){var i=(Q=this).Wc.width(),h=Q.Wc.height(),b=Q.Fc.width(),Q=Q.Fc.height();this.Wc.css(["position","left","top"],["absolute",(b-i)/2+"px",(Q-h)/2+"px"])},ht.prototype.lQ=function(){this.KX(),this.eG(),O.prototype.close.call(this),this.hpi()},ht.prototype.eG=function(){this.vpi&&(this.vpi.endSelectMode(),this.vpi.workbook(Ft),this.vpi=Ft,this.Mf.parent.setActiveSheetIndex(this.dpi)),this.dpi=Ft,this.Ti=Ft,this.Mf=Ft},ht.prototype.tKt=function(){var i=v(this.rYt);return`
  458. <div class="`.concat("gc-sort-range-select-container",`">
  459. <div class="`).concat(J,`">
  460. <span class="`).concat(g,'">').concat(_().Sort_Field_Dialog_Title+" ("+(0,tt.NUr)(i)+")",`</span>
  461. <span class="`).concat(ot+" "+F,`">\xD7</span>
  462. </div>
  463. <div class="`).concat("gc-sort-range-select-body",`">
  464. <div class="`).concat(L,`">
  465. <div class=`).concat(ut,`></div>
  466. </div>
  467. </div>
  468. </div>`)},ht.prototype.aY=function(){var i=this;(0,S.GC$)("."+ot,i.Wc[0]).bind("click",function(h){i.lQ()}),i.bindMoveEvent((0,S.GC$)("."+J,i.Wc[0])[0])},ht.prototype.KX=function(){var i=this;(0,S.GC$)("."+ot,i.Wc[0]).unbind("click"),i.Mf.parent.unbind("RangeSelectEnding",i.ppi),window.removeEventListener("keydown",i.mpi,!0)},ht.prototype.bpi=function(i){var h;return 1<i.length&&i.slice(0,1)==="="&&(h=i.slice(1,i.length),isFinite(h))?h:i},ht.prototype.mpi=function(i){i.key!=="Enter"&&i.key!=="Escape"||(this.spi=this.bpi(this.vpi.text()),this.lQ())},ht.prototype.ppi=function(){this.spi=this.bpi(this.vpi.text()),this.lQ()},ht.prototype.lgi=function(){var i,h,b=(h=this).Mf.parent;h.dpi=b.getActiveSheetIndex(),i=(0,S.GC$)("."+ut)[0],h.vpi=new X.FormulaTextBox(i,{rangeSelectMode:!0,absoluteReference:!0,needSheetName:!0},b),h.ppi=h.ppi.bind(h),b.bind("RangeSelectEnding",h,h.ppi),h.mpi=h.mpi.bind(h),window.addEventListener("keydown",h.mpi,!0),h.vpi.workbook(b),h.vpi.startSelectMode(h.spi),(0,S.GC$)("div[gcuielement$='gcAttachedFormulaTextBox']",i)[0].classList.add("rangeSelectFocusItem")},ht.prototype.hpi=function(){this.hce(this.spi)},c=ht,Yt(St,pt=vt.opi),St.prototype.$c=function(){var i=this;pt.prototype.$c.call(this),i.gpi(),i.wpi(),i.amr.xZi(At(At({},i.amr.Spn()),{escCallback:function(){i.hpi(!1),i.lQ()}}))},St.prototype.Lmr=function(){var i;(i=this.qc())&&((i=i.querySelector("#".concat(xt)))&&!i.disabled||(i=this.amr.zmr()))&&i.focus()},St.prototype.eG=function(){this.cpi=w,this.dh=w,this.LJt=w,this.spi=w,this.Mf=Ft,this.nrt=w,this.Ti=Ft},St.prototype.tKt=function(){var i=this,h=_(),b=i.cpi,Q=v(b.fieldName),it=(t=i.dh).Z[Q]===1?h.Sort_In_Column:h.Sort_In_Row,It=(i=i.spi||"",b.selectedFieldName),t=t.Z[It]===3;return It=b.sortInfo,b=!0,It&&It.sortValueFieldName&&It.sortByPivotReferences&&(b=!1),`
  469. <div class="`.concat(q,`">
  470. <div class="`).concat(J,`">
  471. <span class="`).concat(g,'">').concat(h.Sort_Field_Dialog_Title+" ("+(0,tt.NUr)(Q)+")",`</span>
  472. <span class="`).concat(ot+" "+F,`">\xD7</span>
  473. </div>
  474. <div class="`).concat(P,`">
  475. <div class="`).concat(L,`">
  476. <span class="`).concat(j,'">').concat(h.Sort_Field_More_Dialog_Sort_By,`</span>
  477. <span class="`).concat(E,`"></span>
  478. </div>
  479. <div class="`).concat(L,`">
  480. <div class="`).concat(t?"":Ct,`">
  481. <input type="radio" class="`).concat(K,'" tabindex="0" id="').concat(xt,'" ').concat(b?"checked":""," ").concat(t?"":"disabled",` name="gc-pivot-sort-by">
  482. <label for="`).concat(xt,'">').concat(h.GrandTotal,`</label>
  483. </div>
  484. <div class="`).concat(t?"":Ct,`">
  485. <input type="radio" class="`).concat(K,'" tabindex="0" id="').concat(Mt,'" ').concat(b?"":"checked"," ").concat(t?"":"disabled",` name="gc-pivot-sort-by">
  486. <label for="`).concat(Mt,'">').concat(h.Sort_Field_More_Dialog_Values_In_Selected_Area.replace("{{AREA}}",it),`</label>
  487. </div>
  488. <div class="`).concat(Z+(t&&!b?"":" "+Ct),`">
  489. <input class="`).concat(Rt," ").concat(K,'" tabindex="0" value="').concat(i,'" ').concat(t&&!b?"":"disabled",`>
  490. <div class="`).concat(Bt,`">
  491. <span></span>
  492. </div>
  493. </div>
  494. </div>
  495. <div class="`).concat(L,`">
  496. <span class="`).concat(j,'">').concat(h.Sort_Field_Dialog_Summary,`</span>
  497. <span class="`).concat(E,`"></span>
  498. </div>
  499. <div class="`).concat(L,`">
  500. <div class="`).concat(nt,`"></div>
  501. </div>
  502. <div class="`).concat(k,`">
  503. <span class= "`).concat(A+" "+Y," ").concat(K,'" tabindex="0">').concat(h.Ok,`</span>
  504. <span class= "`).concat(ot+" "+Y," ").concat(K,'" tabindex="0">').concat(h.Cancel,`</span>
  505. </div>
  506. </div>
  507. </div>`)},St.prototype.aY=function(){var i,h=(i=this).Wc[0];(0,S.GC$)("."+ot,h).bind("click",function(b){i.hpi(!1),i.lQ()}),(0,S.GC$)("."+A,h).bind("click",function(b){i.hpi(!0),i.lQ()}),(0,S.GC$)("."+Bt,h).bind("click",function(b){i.api(!1),new c(i.qc(),i.Mf,i.cpi.fieldName,i.spi,function(Q){i.spi=Q,(0,S.GC$)("."+Rt)[0].value=Q,i.api(!0),i.wpi()})}),(0,S.GC$)("#"+Mt,h).bind("change",function(b){b=b.target.checked;var Q=(0,S.GC$)("."+Z,h);b&&Q.hasClass(Ct)&&(Q.removeClass(Ct),(0,S.GC$)("."+Rt,h)[0].disabled=!1),i.wpi()}),(0,S.GC$)("#"+xt,h).bind("change",function(b){b=b.target.checked;var Q=(0,S.GC$)("."+Z,h);b&&!Q.hasClass(Ct)&&(Q.addClass(Ct),(0,S.GC$)("."+Rt,h)[0].disabled=!0),i.wpi()}),(0,S.GC$)("."+Rt,h).bind("change",function(b){i.spi=b.target.value,i.wpi()}),i.bindMoveEvent((0,S.GC$)("."+J,i.Wc[0])[0])},St.prototype.KX=function(){var i=this.Wc[0];(0,S.GC$)("."+ot,i).unbind("click"),(0,S.GC$)("."+A,i).unbind("click"),(0,S.GC$)("."+Bt,i).unbind("click"),(0,S.GC$)("#"+Mt,i).unbind("change"),(0,S.GC$)("#"+xt,i).unbind("change"),(0,S.GC$)("."+Rt,i).unbind("change")},St.prototype.gpi=function(){var i,h,b,Q,it=(Q=this).cpi,It=Q.LJt,t=Q.dh,r=it.fieldName,u=(it=it.sortInfo,t.Z[r]===1),d=(r=t.Z[r],it&&it.sortValueFieldName&&it.sortByPivotReferences&&(b=It.rZt.HWt[4].getRange(),h=(d=It.getRange().content).row+b.row,d=d.col+b.col,b=It.getPivotInfo(h,d),h={},d=it.sortByPivotReferences.map(function(R){return{fieldName:t.getFieldNameBySourceName(R.fieldName),items:R.items}}),u?(m={fieldName:(it=b.rowInfos[0]).fieldName,items:[it.itemName]},it.isSubtotal&&(m.subtotal=!0),h.references=[m].concat(d)):(m={fieldName:(it=b.colInfos[0]).fieldName,items:[it.itemName]},it.isSubtotal&&(m.subtotal=!0),h.references=d.concat(m)),b=It.getPivotAreaRanges(h)[0])?(i=b.row,b.col):(i=(it=function(R,z,ct){ct=R.options.grandTotalPosition===3||R.options.grandTotalPosition===ct;var Tt,Ot,Pt=R.rZt.HWt[4].getRange();return R=R.getRange().content,ct?z?(Tt=R.row+Pt.row,Ot=R.col+Pt.col+Pt.colCount-1):(Ot=R.col+Pt.col,Tt=R.row+Pt.row+Pt.rowCount-1):(Tt=R.row+Pt.row,Ot=R.col+Pt.col),{resultRow:Tt,resultCol:Ot}}(It,u,r)).resultRow,it.resultCol)),m=U(new S.Range(i,d,1,1),w,w,w);(0,S.GC$)("."+Rt,Q.Wc[0]).val(m),Q.spi=m},St.prototype.ypi=function(){var i,h,b,Q,it=(b=this).cpi,It=b.dh,t=b.Mf,r={sortType:(r=it.isAsc)?0:1};if((Q=it.fieldName)!==(it=it.selectedFieldName)&&(r.sortValueFieldName=it),!(0,S.GC$)("#"+xt,b.Wc[0])[0].checked){if(!b.spi||(it=I(t,b.spi)).length===0||0<it.filter(function(u){return u.sheetName!==t.name()}).length||(i=b.LJt,it=it[0].ranges[0],!(i=i.getPivotInfo(it.row,it.col))||i.area!==4))return!1;(it=It.Z[Q])===1&&(h=i.colInfos),a(h=it===2?i.rowInfos:h,r),b.nrt=r}return r},St.prototype.wpi=function(){var i=this.Wc[0];(0,S.GC$)("."+nt,i)[0].innerHTML=this.Cpi()},St.prototype.Cpi=function(){var i,h,b,Q,it,It,t,r,u,d,m=this,R=_();if(!(d=m.ypi()))return m.nrt=w,R.Invalid_Sort_Range;if(Q=m.dh,i=(m=m.cpi).fieldName,h=(d==null?void 0:d.sortValueFieldName)||m.selectedFieldName||i,b=Q.Z[i],Q=Q.Z[h],it=m.isAsc,m=m.isDesc,!it&&!m)return R.Custom_Sort_Summary;if(m=(0,tt.NUr)(i),It=(0,tt.NUr)(h),i===h)return R.Sort_Summary_Pattern.replace(M,m).replace(y,it?R.Sort_Order_ASC:R.Sort_Order_DESC);if(t=R.Sort_Value_Summary_Pattern.replace(M,m).replace(s,It).replace(y,it?R.Sort_Order_ASC:R.Sort_Order_DESC),Q===3)if(d&&d.sortValueFieldName&&d.sortByPivotReferences&&0<d.sortByPivotReferences.length)for(r=d.sortByPivotReferences,t=R.Sort_More_Summary_Pattern.replace(M,m).replace(s,It).replace(y,it?R.Sort_Order_ASC:R.Sort_Order_DESC).replace(G,b===1?R.Sort_In_Column:R.Sort_In_Row),u=0;u<r.length;u++)t+=r[u].items[0],u!==r.length-1&&(t+=":");else(0,S.GC$)("#"+Mt)[0].checked&&(t=R.Sort_More_Summary_Pattern.replace(M,m).replace(s,It).replace(y,it?R.Sort_Order_ASC:R.Sort_Order_DESC).replace(G,b===1?R.Sort_In_Column:R.Sort_In_Row),t+=R.GrandTotal);return t},St.prototype.hpi=function(i){var h=this,b=(0,S.GC$)("."+nt,h.Wc[0])[0].innerText;i?(h.ypi(),h.hce(b,h.nrt)):h.hce(b)},N=St,Yt($,wt=vt.opi),$.prototype.$c=function(){var i,h=this;wt.prototype.$c.call(this),h.wpi(),(i=h.amr).xZi(At(At({},i.Spn()),{spaceCallback:function(b){b.classList.contains(bt)?h.Qmr(!0):b.click()},enterCallback:function(b){b.classList.contains(bt)?h.Qmr(!0):(b.classList.contains(ot)||(b=(b=h.Wc[0])==null?void 0:b.querySelector(".".concat(A)))!=null)&&b.click()}}))},$.prototype.eG=function(){this.dh=Ft,this.rYt=w,this.Vqt=w,this.upi=w,this.Xqt=w,this.nrt=w,this.Ti=Ft,this.Mf=Ft},$.prototype.Ipi=function(i){var h="";return i===this.upi&&(h="selected"),'<option value="'.concat(i,'" ').concat(h,">").concat((0,tt.NUr)(i),"</option>")},$.prototype.tKt=function(){for(var i,h,b,Q,it=v((Q=this).rYt),It="",t=0;t<Q.Xqt.length;t++)It+=Q.Ipi(Q.Xqt[t]);return i=(h=Q.dh.getSortInfo(Q.rYt))&&h.sortType===0,h=h&&h.sortType===1,i||h||(i=!0),b=_(),`
  508. <div class="`.concat(q,`">
  509. <div class="`).concat(J,`">
  510. <span class="`).concat(g,'">').concat(b.Sort_Field_Dialog_Title+" ("+(0,tt.NUr)(it)+")",`</span>
  511. <span class="`).concat(ot+" "+F,`">\xD7</span>
  512. </div>
  513. <div class="`).concat(P,`">
  514. <div class="`).concat(L,`">
  515. <span class="`).concat(j,'">').concat(b.Sort_Field_Dialog_Sort_Options,`</span>
  516. <span class="`).concat(E,`"></span>
  517. </div>
  518. <div class="`).concat(L,`">
  519. <div>
  520. <input type="radio" class="`).concat(K,'" tabindex="0" id="').concat(ie,'" ').concat(i?"checked":"",' name="').concat(kt,`">
  521. <label for="`).concat(ie,'">').concat(b.Sort_Field_Dialog_Ascending_Sort,`</label>
  522. <select id="`).concat(Qt,'" class="').concat(gt+(i?"":" "+Ct)," ").concat(K,'" ').concat(i?"":"disabled",' tabindex="0">').concat(It,`</select>
  523. </div>
  524. <div>
  525. <input type="radio" class="`).concat(K,'" tabindex="0" id="').concat(Xt,'" ').concat(h?"checked":"",' name="').concat(kt,`">
  526. <label for="`).concat(Xt,'">').concat(b.Sort_Field_Dialog_Descending_Sort,`</label>
  527. <select id="`).concat(dt,'" class="').concat(gt+(h?"":" "+Ct)," ").concat(K,'" ').concat(h?"":"disabled",' tabindex="0">').concat(It,`</select>
  528. </div>
  529. </div>
  530. <div class="`).concat(L,`">
  531. <span class="`).concat(j,'">').concat(b.Sort_Field_Dialog_Summary,`</span>
  532. <span class="`).concat(E,`"></span>
  533. </div>
  534. <div class="`).concat(L,`">
  535. <div class="`).concat(nt,`"></div>
  536. </div>
  537. <div class="`).concat(k,`">
  538. <span class= "`).concat(bt+" "+Y," ").concat(K,'" tabindex="0">').concat(b.Sort_Field_Dialog_More_Options,`</span>
  539. <div class="`).concat("gc-sort-confirm-close-dialog",`">
  540. <span class= "`).concat(A+" "+Y," ").concat(K,'" tabindex="0">').concat(b.Ok,`</span>
  541. <span class= "`).concat(ot+" "+Y," ").concat(K,'" tabindex="0">').concat(b.Cancel,`</span>
  542. </div>
  543. </div>
  544. </div>
  545. </div>`)},$.prototype.Lmr=function(i){var h;(h=this.qc())&&(h=h.querySelector(i?".".concat(i):"#".concat(ie)))&&h.focus()},$.prototype.aY=function(){var i=this,h=this.Wc[0];(0,S.GC$)("."+gt,h).bind("change",function(b){i.nrt&&(i.nrt=w),i.upi=b.target.value,i.wpi()}),(0,S.GC$)("#"+ie,h).bind("change",function(b){b=b.target.checked;var Q=(0,S.GC$)("#"+dt,h),it=(0,S.GC$)("#"+Qt,h);b&&(it.hasClass(Ct)&&(it.removeClass(Ct),it[0].disabled=!1),Q.hasClass(Ct)||(Q.addClass(Ct),Q[0].disabled=!0),i.nrt&&(i.nrt=w),i.upi=(0,S.GC$)("#"+Qt,h).val(),i.wpi())}),(0,S.GC$)("#"+Xt,h).bind("change",function(b){b=b.target.checked;var Q=(0,S.GC$)("#"+dt,h),it=(0,S.GC$)("#"+Qt,h);b&&(Q.hasClass(Ct)&&(Q.removeClass(Ct),Q[0].disabled=!1),it.hasClass(Ct)||(it.addClass(Ct),it[0].disabled=!0),i.nrt&&(i.nrt=w),i.upi=(0,S.GC$)("#"+dt,h).val(),i.wpi())}),(0,S.GC$)("."+bt,h).bind("click",function(b){i.Qmr()}),(0,S.GC$)("."+ot,h).bind("click",function(b){i.lQ()}),(0,S.GC$)("."+A,h).bind("click",function(b){i.hpi(),i.lQ()}),i.bindMoveEvent((0,S.GC$)("."+J,i.Wc[0])[0])},$.prototype.Qmr=function(i){var h,b=(h=this).Wc[0],Q=!!(0,S.GC$)("#"+ie,b)[0].checked,it=!!(0,S.GC$)("#"+Xt,b)[0].checked;h.api(!1),Q=new N(h.qc(),h.Mf,h.dh,{isAsc:Q,isDesc:it,fieldName:h.rYt,pivotName:h.Vqt,selectedFieldName:h.upi,sortInfo:h.nrt},function(It,t){t&&(h.nrt=t),h.api(!0),i&&h.Lmr(bt),h.Npi=It,(0,S.GC$)("."+nt,b)[0].innerHTML=It}),i&&Q.Lmr()},$.prototype.KX=function(){var i=this.Wc[0];(0,S.GC$)("."+gt,i).unbind("change"),(0,S.GC$)("#"+ie,i).unbind("change"),(0,S.GC$)("#"+Xt,i).unbind("change"),(0,S.GC$)("."+bt,i).unbind("click"),(0,S.GC$)("."+ot,i).unbind("click"),(0,S.GC$)("."+A,i).unbind("click")},$.prototype.wpi=function(){var i,h=(i=this).Wc[0];i.Npi=i.Cpi(),(0,S.GC$)("."+nt,h)[0].innerHTML=i.Npi},$.prototype.Cpi=function(){var i,h,b,Q,it,It=(it=this).dh,t=it.rYt,r=it.upi||t,u=It.Z[t],d=(It=It.Z[r],!(0,S.GC$)("#"+ie).length||(0,S.GC$)("#"+ie)[0].checked),m=!!(0,S.GC$)("#"+Xt).length&&(0,S.GC$)("#"+Xt)[0].checked,R=_();if(!d&&!m)return R.Custom_Sort_Summary;if(m=(0,tt.NUr)(t),i=(0,tt.NUr)(r),t===r)return R.Sort_Summary_Pattern.replace(M,m).replace(y,d?R.Sort_Order_ASC:R.Sort_Order_DESC);if(h=R.Sort_Value_Summary_Pattern.replace(M,m).replace(s,i).replace(y,d?R.Sort_Order_ASC:R.Sort_Order_DESC),b=(t=it.nrt)==null?void 0:t.sortByPivotReferences,It===3&&b&&0<b.length)for(h=R.Sort_More_Summary_Pattern.replace(M,m).replace(s,i).replace(y,d?R.Sort_Order_ASC:R.Sort_Order_DESC).replace(G,u===1?R.Sort_In_Column:R.Sort_In_Row),Q=0;Q<b.length;Q++)h+=b[Q].items[0],Q!==b.length-1&&(h+=":");return h},$.prototype.hpi=function(){var i,h,b=(h=this).dh,Q=h.rYt,it=h.Vqt,It=h.nrt,t=h.Wc[0],r=_();if(h.Npi===r.Invalid_Sort_Range)(i=b.z.filter(function(u){return u.Zc===it})[0].Ti)&&i.jT(10,r.Invalid_Sort_Range);else{if(!It){if(i=!!(0,S.GC$)("#"+ie,t)[0].checked,r=!!(0,S.GC$)("#"+Xt,t)[0].checked,!i&&!r)return;t=i?0:1,It=Q===(r=h.upi)?{sortType:t}:{sortType:t,sortValueFieldName:r}}b.wVt({cmd:"sortPivotField",sheetName:"",cmdOption:{sortInfo:It,fieldName:Q,pivotName:it}})}},o.SortFieldDialog=$,Yt(n,et=vt.opi),n.prototype.$c=function(){var i,h=this;et.prototype.$c.call(this),h.wpi(),(i=h.amr).xZi(At(At({},i.Spn()),{enterCallback:function(b){(b.classList.contains(bt)||b.classList.contains(ot)||(b=(b=h.Wc[0])==null?void 0:b.querySelector(".".concat(A)))!=null)&&b.click()}}))},n.prototype.eG=function(){this.LJt=w,this.lpi=w,this.Ti=Ft,this.Mf=Ft},n.prototype.tKt=function(){var i=this.LJt,h=this.lpi,b=_(),Q=h.rowInfos,it=h.colInfos,It=Q&&Q.length,t=it&&it.length,r=v(Q&&Q[It-1]&&Q[It-1].fieldName),u=v(it&&it[t-1]&&it[t-1].fieldName);if(r=(i=i.dh).getSortInfo(r),i=i.getSortInfo(u),r=(u=r||i)&&u.sortType===0,u=u&&u.sortType===1,r||u||(r=!0),u=It===0||Q&&0<Q.filter(function(d){return d.isGrandTotal}).length,It=t===0||it&&0<it.filter(function(d){return d.isGrandTotal}).length,t=(Q=this.fpi)?!!h.cornerFieldInfo:!(u||!It&&i),u&&It||!h.valueFieldName&&!Q)throw new Error(b.Invalid_Field_Sort_By);return it=u||It||Q,`
  546. <div class="`.concat("gc-pivot-sort-value-dialog-container",`">
  547. <div class="`).concat(J,`">
  548. <span class="`).concat(g,'">').concat(b.Sort_Value_Dialog_Title,`</span>
  549. <span class="`).concat(ot+" "+F,`">\xD7</span>
  550. </div>
  551. <div class="`).concat("gc-sort-value-dialog-body",`">
  552. <div class="`).concat(L,`">
  553. <div class="`).concat(L+" "+st,`">
  554. <div class="`).concat(L,`">
  555. <span class="`).concat(j,'">').concat(b.Sort_Field_Dialog_Sort_Options,`</span>
  556. <span class="`).concat(E,`"></span>
  557. </div>
  558. <div class="`).concat(L,`">
  559. <div>
  560. <input type="radio" id="`).concat(ie,'" ').concat(r?"checked":"",' name="').concat(kt,`">
  561. <label for="`).concat(ie,'">').concat(b.Sort_Value_Dialog_Asc,`</label>
  562. </div>
  563. <div>
  564. <input type="radio" id="`).concat(Xt,'" ').concat(r?"":"checked",' name="').concat(kt,`">
  565. <label for="`).concat(Xt,'">').concat(b.Sort_Value_Dialog_Desc,`</label>
  566. </div>
  567. </div>
  568. </div>
  569. <div class="`).concat(L+" "+st+(it?" "+Ct:""),`">
  570. <div class="`).concat(L,`">
  571. <span class="`).concat(j,'">').concat(b.Sort_Value_Dialog_Sort_Direction,`</span>
  572. <span class="`).concat(E,`"></span>
  573. </div>
  574. <div class="`).concat(L,`">
  575. <div>
  576. <input type="radio" id="`).concat(l,'" ').concat(t?"checked":"",' name="').concat(D,`">
  577. <label for="`).concat(l,'">').concat(b.Sort_Value_Dialog_Top_To_Bottom,`</label>
  578. </div>
  579. <div>
  580. <input type="radio" id="`).concat(T,'" ').concat(t?"":"checked",' name="').concat(D,`">
  581. <label for="`).concat(T,'">').concat(b.Sort_Value_Dialog_Left_To_Right,`</label>
  582. </div>
  583. </div>
  584. </div>
  585. </div>
  586. <div class="`).concat(L,`">
  587. <span class="`).concat(j,'">').concat(b.Sort_Field_Dialog_Summary,`</span>
  588. <span class="`).concat(E,`"></span>
  589. </div>
  590. <div class="`).concat(L,`">
  591. <div class="`).concat(nt,`"></div>
  592. </div>
  593. <div class="`).concat(k,`">
  594. <span class= "`).concat(A+" "+Y,'">').concat(b.Ok,`</span>
  595. <span class= "`).concat(ot+" "+Y,'">').concat(b.Cancel,`</span>
  596. </div>
  597. </div>
  598. </div>`)},n.prototype.aY=function(){var i=this,h=this.Wc[0];[ie,Xt,l,T].forEach(function(b){(0,S.GC$)("#"+b,h).bind("change",function(Q){Q.target.checked&&i.wpi()})}),(0,S.GC$)("."+ot,h).bind("click",function(b){i.lQ()}),(0,S.GC$)("."+A,h).bind("click",function(b){i.hpi(),i.lQ()}),i.bindMoveEvent((0,S.GC$)("."+J,i.Wc[0])[0])},n.prototype.KX=function(){var i=this.Wc[0];[ie,Xt,l,T].forEach(function(h){(0,S.GC$)("#"+h,i).unbind("change")}),(0,S.GC$)("."+ot,i).unbind("click"),(0,S.GC$)("."+A,i).unbind("click")},n.prototype.wpi=function(){var i=this.Wc[0];(0,S.GC$)("."+nt,i)[0].innerText=this.Cpi()},n.prototype.Cpi=function(){var i,h,b,Q,it,It,t=(It=this).LJt,r=It.lpi,u=(t=t.dh,r.valueFieldName),d=It.Wc[0],m=(0,S.GC$)("#"+ie,d)[0].checked,R=(d=(0,S.GC$)("#"+l,d)[0].checked,_());if(It.fpi)return R.Sort_Summary_Pattern.replace(M,R.Values).replace(y,m?R.Sort_Order_ASC:R.Sort_Order_DESC);if(It=r.rowInfos,r=r.colInfos,i=(d?It[It.length-1]:r[r.length-1]).fieldName,t=t.Z[i],!It||It.length===0||!r||r.length===0)return R.Sort_Value_Summary_Pattern.replace(M,i).replace(s,u).replace(y,m?R.Sort_Order_ASC:R.Sort_Order_DESC);if((d=(h=d?r:It)&&0<h.length)&&(r=h.findIndex(function(z){return z.fieldName===R.sigmaValue}))!==-1&&(u=h[r].itemName,h.splice(r,1)),b=R.Sort_More_Summary_Pattern.replace(M,i).replace(s,u).replace(y,m?R.Sort_Order_ASC:R.Sort_Order_DESC).replace(G,t===1?R.Sort_In_Column:R.Sort_In_Row),d)for(Q=0;Q<h.length;Q++){if((it=h[Q]).isGrandTotal){b+=R.GrandTotal;break}b+=it.itemName,Q!==h.length-1&&(b+=":")}return b},n.prototype.ypi=function(){var i=(h=this).lpi,h=h.Wc[0],b=!!(0,S.GC$)("#"+ie,h)[0].checked,Q=(h=(0,S.GC$)("#"+l,h)[0].checked,b={sortType:b?0:1,sortValueFieldName:i.valueFieldName},i.rowInfos);return i=i.colInfos,a(h?i:Q,b),b},n.prototype.hpi=function(){var i,h,b,Q=(b=this).LJt,it=b.lpi,It=Q.dh;Q=Q.Zc,b.fpi?b.Api():(i=b.ypi())&&(b=b.Wc[0],b=(0,S.GC$)("#"+l,b)[0].checked,h=it.rowInfos,it=it.colInfos,b=(b?h[h.length-1]:it[it.length-1]).fieldName,It.wVt({cmd:"sortPivotField",sheetName:"",cmdOption:{sortInfo:i,fieldName:b,pivotName:Q}}))},n.prototype.Api=function(){var i=(h=(b=this).LJt).dh,h=h.Zc,b=b.Wc[0],Q=!!(0,S.GC$)("#"+Xt,b)[0].checked;(b=i.Q.map(function(it){return it.Zc})).sort(function(it,It){return it=it.localeCompare(It),Q?-1*it:it}),i.wVt({cmd:"sortPivotValueField",sheetName:"",cmdOption:{sortedFieldNames:b,pivotName:h,sortType:Q?B.SortType.desc:B.SortType.asc}})},o.SortValueDialog=n},"./dist/plugins/pivot/pivot-ui/pivot-view-list-dialog.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt;function tt(_,v,Ft){return(_=mt.call(this,_,0)||this).views=v,_.currentViewName="",_.width=Ft,_}Yt=this&&this.__extends||(vt=function(_,v){return(vt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(Ft,w){Ft.__proto__=w}:function(Ft,w){for(var I in w)Object.prototype.hasOwnProperty.call(w,I)&&(Ft[I]=w[I])}))(_,v)},function(_,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function Ft(){this.constructor=_}vt(_,v),_.prototype=v===null?Object.create(v):(Ft.prototype=v.prototype,new Ft)}),Object.defineProperty(o,"__esModule",{value:!0}),o.PivotViewListDialog=void 0,At=ft("Core"),S=ft("Pivot"),at=ft("@spreadjs/js-sheets-common"),X=ft("./dist/plugins/pivot/pivot-util.js"),H="gc-panel-button-delete",f="gc-panel-view-name",B=at.Common.zf.j0,Yt(tt,mt=At.zc),tt.prototype.init=function(_){mt.prototype.Hc.call(this),this.open(_)},tt.prototype.open=function(_){var v,Ft="<ul>";(0,S.o)(this.views.all(),function(w){Ft+=`<li>
  599. <span class="`.concat(f,'">').concat((0,X.NUr)(B(w.name)),`</span>
  600. <input type="button" class="gc-panel-button `).concat(H,`" value="\xD7"/>
  601. </li>`)}),Ft+="</ul>",v=this.width||250,v=`
  602. <div class="gc-panel-viewList" style="width: `.concat(v,`px"">
  603. `).concat(Ft,`
  604. </div>
  605. `),this.WX(_.x,_.y).html(v),this.$c(),this.aY()},tt.prototype.WX=function(_,v){var Ft=this.Xc();return Ft.css(["left","top"],[_,v]),Ft},tt.prototype.$c=function(){mt.prototype.$c.call(this)},tt.prototype.close=function(){this.KX(),this.eG(),mt.prototype.close.call(this)},tt.prototype.eG=function(){this.Ti=null,this.views=null},tt.prototype.if=function(){var _,v,Ft,w,I=(0,At.GC$)(this.Wc.get(0).firstElementChild),U=(0,At.GC$)(this.Wc);I.length!==0&&(_=I.width(),v=parseInt(U.css("left"),10),!isNaN(v))&&!isNaN(_)&&(Ft=0,w=document.documentElement.clientWidth,(I=I[0].getBoundingClientRect()).left+_>w&&(Ft=I.left+_-w),v<0||0<Ft)&&U.css({left:(v=(v-=Ft)<0?0:v)+"px"})},tt.prototype.aY=function(){var _=this;(0,At.GC$)("."+H).bind("click",function(v){var Ft=v.target.previousElementSibling.textContent;v=v.target.parentElement,_.views.remove(Ft),v.remove()}),(0,At.GC$)("."+f).bind("click",function(v){v=v.target.textContent,(0,At.GC$)("#gc-panel-selected-view").val(v),_.close()})},tt.prototype.KX=function(){(0,At.GC$)("."+H).unbind("click"),(0,At.GC$)("."+f).unbind("click")},o.PivotViewListDialog=tt},"./dist/plugins/pivot/pivot-util.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt;function _(ot,j){ot.forEach(function(E){j===at.SubtotalsPosition.top?E.Spi=!0:j===at.SubtotalsPosition.bottom&&(E.Spi=!1)})}function v(ot){ot.forEach(function(j){j.Nwr=void 0})}function Ft(ot,j,E,A){Object.defineProperty(ot,j,{get:function(){var Y;return j==="calcItemAggregation"?(Y=E.dh.lw(),this._ps[j]=Y=Y?0:1):this._ps[j]},set:function(Y){var L,q=this._ps[j],J=E.dh;q!==Y?(E.DT({pivotTable:this,pn:j,old:q,value:Y,type:"options"}),this._ps[j]=Y,E.lFr("options",{optionName:j,value:Y}),j==="calcItemAggregation"&&J.lw(Y),j==="subTotalsPosition"&&(this._ps.subtotalsPosition=Y,J.Dpi=Y,_(J.B,Y),v(J.B.concat(J.R))),j==="subtotalsPosition"&&(this._ps.subTotalsPosition=Y,J.Dpi=Y,_(J.B,Y),v(J.B.concat(J.R)))):j!=="subTotalsPosition"&&j!=="subtotalsPosition"||(J.Dpi=Y,_(J.B,Y),v(J.B.concat(J.R))),j!=="missingCaption"||f(Y)||(L=(Y+"").toUpperCase())!=="TRUE"&&L!=="FALSE"||(this._ps.missingCaption="'"+Y),j==="allowMultipleFiltersPerField"&&(!!q==1&&!!Y==0&&E.Gqt(),J)&&J.DVt(!!Y),j!=="printDrill"&&j!=="itemPrintTitles"&&j!=="fieldPrintTitles"&&typeof A=="function"&&A()},enumerable:!0})}function w(ot){return-1<[X.PivotShowDataAs.percentOfTotal,X.PivotShowDataAs.percentOfRow,X.PivotShowDataAs.percentOfCol,X.PivotShowDataAs.percent,X.PivotShowDataAs.percentOfParentRow,X.PivotShowDataAs.percentOfParentCol,X.PivotShowDataAs.percentOfParent,X.PivotShowDataAs.percentDiff,X.PivotShowDataAs.percentOfRunningTotal].indexOf(ot)}function I(ot){for(var j=0,E=H;j<E.length;j++)if(!f(ot[E[j]]))return!1;return!0}function U(ot,j){return g(F(ot,j),j)||[]}function g(ot,j){var E,A,Y,L,q,J,P,bt,k,nt;if(!f(ot)){if(A=(E=Object.keys(ot)).length,j)for(P=0;P<A;P++)(q=ot[Y=E[P]])&&(J=ot[+(L=Y.split(o.CONNECTOR))[0]+1+o.CONNECTOR+L[1]+o.CONNECTOR+L[2]])&&(J.row=q.row,J.rowCount=q.rowCount+J.rowCount,ot[Y]=void 0);else for(P=0;P<A;P++)(q=ot[Y=E[P]])&&(J=ot[+(L=Y.split(o.CONNECTOR))[0]+1+o.CONNECTOR+L[1]+o.CONNECTOR+L[2]])&&(J.col=q.col,J.colCount=q.colCount+J.colCount,ot[Y]=void 0);for(nt in bt=[],ot)ot[nt]&&(k=ot[nt],bt.push(new At.Range(k.row,k.col,k.rowCount,k.colCount)));return bt}}function F(ot,j){var E,A,Y,L,q,J,P,bt,k,nt,gt,Z={};if(!(f(ot)||ot.length<1)){if(E=ot.length,Y=(A=ot[0]).row,L=A.col,q=A.rowCount,P=L+(J=A.colCount),bt=Y+q,j){for(k=1;k<E;k++)if(Y===(A=ot[k]).row&&A.col===P)J+=A.colCount,P+=A.colCount,q=Math.max(q,A.rowCount);else{for(nt=0;nt<q;nt++)Z[Y+nt+o.CONNECTOR+L+o.CONNECTOR+J]={row:Y,col:L,rowCount:1,colCount:J};q=0,q=Math.max(q,A.rowCount),Y=A.row,P=(L=A.col)+(J=A.colCount)}Z[Y+o.CONNECTOR+L+o.CONNECTOR+J]={row:Y,col:L,rowCount:q,colCount:J}}else{for(k=1;k<E;k++)if(L===(A=ot[k]).col&&A.row===bt)q+=A.rowCount,bt+=A.rowCount,J=Math.max(J,A.colCount);else{for(gt=0;gt<J;gt++)Z[L+gt+o.CONNECTOR+Y+o.CONNECTOR+q]={row:Y,col:L,rowCount:q,colCount:1};J=0,J=Math.max(J,A.colCount),Y=A.row,L=A.col,bt=Y+(q=A.rowCount)}Z[L+o.CONNECTOR+Y+o.CONNECTOR+q]={row:Y,col:L,rowCount:q,colCount:J}}return Z}}Object.defineProperty(o,"__esModule",{value:!0}),o.iJt=o.$Yt=o.fJt=o.kWt=o.b0=o.FZt=o.DUr=o.NUr=o.emr=o.imr=o.lcr=o.jCi=o.oCi=o.Ucr=o.getActualSubtotalPosition=o.writePivotDynamicFilter=o.PivotComparisonOperators=o.formatDateToString=o.R$=o.applyShowDataAsStyle=o.dz=o.cZt=o.nameSeparator=o.clearFieldsShowSubtotal=o.updateRowFieldsIsShowSubtotalTop=o.GC_EMPTY_VALUE=o.CONNECTOR=void 0,Yt=ft("@spreadjs/js-sheets-common"),At=ft("Core"),S=ft("./dist/plugins/pivot/pivot.ns.js"),at=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),X=ft("Pivot"),H=["backColor","foreColor","hAlign","vAlign","font","themeFont","formatter","borderLeft","borderTop","borderRight","borderBottom","locked","textIndent","wordWrap","showEllipsis","_showTip","shrinkToFit","backgroundImage","cellType","backgroundImageLayout","tabStop","textDecoration","imeMode","name","parentName","watermark","cellPadding","labelOptions","quotePrefix","diagonalDown","diagonalUp","isVerticalText","cellButtons","dropDowns","textOrientation"],f=Yt.Common.lt.ht,B=Yt.Common.CultureManager,vt=Yt.Common.ct,mt=Yt.Common.kh,ft=new Yt.Common.ResourceManager(S.SR,"PivotTables"),tt=ft.getResource.bind(ft),o.CONNECTOR="_",o.GC_EMPTY_VALUE="gc-empty-value",o.FZt=function(ot,j,E){return(ot=ot[j])&&0<ot.length?ot[E]:E},o.kWt=function(ot){return f(ot)||ot===""},o.b0=function(ot,j,E){var A,Y={_ps:{}};for(A in ot)mt(ot,A)&&(Ft(Y,A,j,E),Y[A]=ot[A]);return Y},o.updateRowFieldsIsShowSubtotalTop=_,o.clearFieldsShowSubtotal=v,o.nameSeparator="_",o.fJt=function ot(j,E){var A,Y=j.split(o.nameSeparator);return isNaN(parseInt(Y[Y.length-1],10))?j+=o.nameSeparator+"1":(A=Y[Y.length-1],Y.splice(Y.length-1,1,parseInt(A,10)+1+""),j=Y.join(o.nameSeparator)),E[j]?ot(j,E):j},o.$Yt=function(ot,j){var E,A,Y,L,q,J,P,bt,k=[];if(j)for(E=ot.pivotTables.all(),A=0;A<E.length;A++)L=(q=(Y=E[A]).getRange()).page,q=q.content,bt=L?L.union(q):q,J=j.row===-1?bt.row:bt.row-j.row,P=j.col===-1?bt.col:bt.col-j.col,j.containsRange(bt)&&(bt=[],L&&bt.push(L),bt.push(q),k.push({name:Y.Zc,sheetName:ot.name(),startPoint:[J,P],ranges:bt}));return k},o.iJt=function(ot,j){ot=ot.pivotTables.all();var E={};return(0,X.o)(ot,function(A){var Y,L;!A.Oy()&&(Y=(L=A.getRange()).page,L=L.content,Y&&Y.intersect(j.row,j.col,j.rowCount,j.colCount)&&(E[A.Zc]?E[A.Zc].push(j.getIntersect(Y,0,0)):E[A.Zc]=[j.getIntersect(Y,0,0)]),L.intersect(j.row,j.col,j.rowCount,j.colCount))&&(E[A.Zc]?E[A.Zc].push(j.getIntersect(L,0,0)):E[A.Zc]=[j.getIntersect(L,0,0)])}),E},o.cZt=I,o.dz=function(ot,j){if(f(ot)||f(j)||j===""||!ot[j])return j;for(var E=2;ot[j+E];)E++;return j+E},o.applyShowDataAsStyle=function(ot,j,E,A){var Y,L;j={dataOnly:!0,references:[{fieldName:tt().Values,items:[j]}]},(Y=(L=ot.getStyle(j))?(0,At.RF)(L):Y)&&!At.GC$.isEmptyObject(Y)||(Y=new At.Style),A?Y.formatter=A:w(E)?Y.formatter="0.00%":(delete Y.formatter,I(Y)&&(Y=null)),ot.setStyle(j,Y)},o.R$=function(ot,j,E){var A,Y;j={dataOnly:!0,references:[{fieldName:tt().Values,items:[j]}]},(A=(Y=ot.getStyle(j))?(0,At.RF)(Y):A)&&A.formatter==="0.00%"&&w(E)&&(delete A.formatter,ot.setStyle(j,A))},o.formatDateToString=function(ot){var j=B.Fe(B.culture()).DateTimeFormat,E=j.shortDatePattern;return ot.getHours()===0&&ot.getMinutes()===0&&ot.getSeconds()===0&&ot.getMilliseconds()===0||(E=j.defaultDatePattern),vt.Pe(ot,E)},o.PivotComparisonOperators={"-1":"none",0:"equal",4:"lessThan",3:"greaterThanOrEqual",1:"notEqual",2:"greaterThan",5:"lessThanOrEqual"},o.writePivotDynamicFilter=function(ot){var j,E=ot.type;if(!f(E))return(j={}).type=E&&E!=="null"?E:"null",f(ot.value)||(j.val=ot.value),f(ot.maxValue)||(j.maxVal=ot.maxValue),j},o.getActualSubtotalPosition=function(ot,j,E){return E&&ot===at.SubtotalsPosition.none?ot=j?at.SubtotalsPosition.top:at.SubtotalsPosition.bottom:E!==!1||ot!==at.SubtotalsPosition.top&&ot!==at.SubtotalsPosition.bottom||(ot=at.SubtotalsPosition.none),f(j)?ot:ot===at.SubtotalsPosition.top&&j||ot===at.SubtotalsPosition.bottom&&j?at.SubtotalsPosition.top:ot===at.SubtotalsPosition.bottom&&!j||ot===at.SubtotalsPosition.top&&!j?at.SubtotalsPosition.bottom:ot===at.SubtotalsPosition.none?at.SubtotalsPosition.none:void 0},o.Ucr=U,o.oCi=g,o.jCi=F,o.lcr=function(ot){var j,E,A,Y=ot.rZt.HWt[0].dataTable,L=ot.getRange().page,q=[];if(Y&&L){for(j=L.row;j<L.row+L.rowCount;j++)if(E=Y[j-L.row])for(A=L.col;A<L.col+L.colCount;A++)E[A-L.col]&&q.push(new At.Range(j,A,1,1))}return U(q,!0)},o.imr=function(ot,j){var E,A,Y,L;if(ot&&j){if(E=ot.hasTotalsRow(),!ot.hasHeadersRow()&&(Y=[],A=j[0])){for(L=0;L<A.length;L++)Y[L]=ot.getColumnName(L);j.unshift(Y)}E&&j.pop()}},o.emr=function(ot,j,E){var A,Y,L=ot.getValue(j,E);return ot=ot.getHost(),L instanceof Date&&ot?(A=ot.$f(),Y=ot.getActualStyle(j,E),A?A.format(L,Y.formatter,{},{row:j,col:E,sheet:ot}):void 0):L},o.NUr=function(ot){return typeof ot=="string"?At.Util.gr(ot," ","&nbsp;"):ot},o.DUr=function(ot){return typeof ot=="string"?At.Util.gr(ot,"\xA0"," "):ot}},"./dist/plugins/pivot/pivot.ns.js":function(Ie,o,ft){Object.defineProperty(o,"__esModule",{value:!0}),o.SR=void 0,ft=ft("./dist/plugins/pivot/pivot.res.en.js"),o.SR={en:ft}},"./dist/plugins/pivot/pivot.res.en.js":function(Ie,o,ft){var Yt,At;for(At in Object.defineProperty(o,"__esModule",{value:!0}),o.PivotPanel_ValueFilterOrLabel_NotEqual=o.PivotPanel_ValueFilterOrLabel_Equals=o.PivotPanel_LabelOrValue_ClearFilter=o.PivotPanel_Fields_MoveTo_Value=o.PivotPanel_Fields_MoveTo_ColLabel=o.PivotPanel_Fields_MoveTo_RowLabel=o.PivotPanel_Fields_MoveTo_ReportField=o.PivotPanel_DropDownList_ValueSet=o.PivotPanel_DropDownList_Set=o.PivotPanel_DropDownList_Remove=o.PivotPanel_DropDownList_Values=o.PivotPanel_DropDownList_Col=o.PivotPanel_DropDownList_Row=o.PivotPanel_DropDownList_ReportFilter=o.PivotPanel_DropDownList_End=o.PivotPanel_DropDownList_Beginning=o.PivotPanel_DropDownList_Down=o.PivotPanel_DropDownList_Up=o.PivotPanel_Update=o.EmptyPivotTable_PromptMessage2=o.EmptyPivotTable_PromptMessage1=o.PivotPanel_DeferUpdateText=o.PivotPanel_ValuesItemsTitle=o.PivotPanel_ColumnsItemsTitle=o.PivotPanel_RowsItemsTitle=o.PivotPanel_FiltersItemsTitle=o.PivotPanel_FieldAreaText=o.PivotPanel_SearchPlaceholder=o.PivotPanel_ReportText=o.PivotPanel_Title=o.Values=o.GrandTotal=o.RowLabels=o.MultipleItems=o.All=o.Total=o.ColumnLabels=o.SubtotalType_Prefix_10=o.SubtotalType_Prefix_9=o.SubtotalType_Prefix_8=o.SubtotalType_Prefix_7=o.SubtotalType_Prefix_6=o.SubtotalType_Prefix_5=o.SubtotalType_Prefix_4=o.SubtotalType_Prefix_3=o.SubtotalType_Prefix_2=o.SubtotalType_Prefix_1=o.SubtotalType_Prefix_0=o.NotExist=o.RepeatName=void 0,o.PivotPanel_ValueFilterOrLabel_LastYear=o.PivotPanel_ValueFilterOrLabel_ThisYear=o.PivotPanel_ValueFilterOrLabel_NextYear=o.PivotPanel_ValueFilterOrLabel_LastQuarter=o.PivotPanel_ValueFilterOrLabel_ThisQuarter=o.PivotPanel_ValueFilterOrLabel_NextQuarter=o.PivotPanel_ValueFilterOrLabel_LastMonth=o.PivotPanel_ValueFilterOrLabel_ThisMonth=o.PivotPanel_ValueFilterOrLabel_NextMonth=o.PivotPanel_ValueFilterOrLabel_LastWeek=o.PivotPanel_ValueFilterOrLabel_ThisWeek=o.PivotPanel_ValueFilterOrLabel_NextWeek=o.PivotPanel_ValueFilterOrLabel_Yesterday=o.PivotPanel_ValueFilterOrLabel_Today=o.PivotPanel_ValueFilterOrLabel_Tomorrow=o.PivotPanel_ValueFilterOrLabel_After=o.PivotPanel_ValueFilterOrLabel_Before=o.ValueFilterOrLabel_NotContain=o.ValueFilterOrLabel_Contain=o.ValueFilterOrLabel_NotEndWith=o.ValueFilterOrLabel_End=o.ValueFilterOrLabel_NotBegin=o.ValueFilterOrLabel_IsBeginWith=o.ValueFilterOrLabelSelect_NotBetween=o.ValueFilterOrLabelSelect_Between=o.ValueFilterOrLabelSelect_LessOrTo=o.ValueFilterOrLabelSelect_LessThan=o.ValueFilterOrLabelSelect_GreaterOrTo=o.ValueFilterOrLabelSelect_GreaterThan=o.ValueFilterOrLabel_NotBetween=o.ValueFilterOrLabel_Between=o.ValueFilterOrLabel_LessOrTo=o.ValueFilterOrLabel_LessThan=o.ValueFilterOrLabel_GreaterOrTo=o.ValueFilterOrLabel_GreaterThan=o.ValueFilterOrLabel_NotEqual=o.ValueFilterOrLabel_Equals=o.PivotPanel_ValueFilterOrLabel_NotContain=o.PivotPanel_ValueFilterOrLabel_Contain=o.PivotPanel_ValueFilterOrLabel_NotEndWith=o.PivotPanel_ValueFilterOrLabel_End=o.PivotPanel_ValueFilterOrLabel_NotBegin=o.PivotPanel_ValueFilterOrLabel_IsBeginWith=o.PivotPanel_ValueFilter_Top10=o.PivotPanel_ValueFilterOrLabel_NotBetween=o.PivotPanel_ValueFilterOrLabel_Between=o.PivotPanel_ValueFilterOrLabel_LessOrTo=o.PivotPanel_ValueFilterOrLabel_LessThan=o.PivotPanel_ValueFilterOrLabel_GreaterOrTo=o.PivotPanel_ValueFilterOrLabel_GreaterThan=void 0,o.Sort_Value_Dialog_Asc=o.Sort_Value_Dialog_Sort_Direction=o.Sort_Value_Dialog_Title=o.Sort_Field_More_Dialog_Values_In_Selected_Area=o.Sort_Field_More_Dialog_Sort_By=o.Sort_Field_More_Dialog_Title=o.Sort_Field_Dialog_More_Options=o.Sort_Field_Dialog_Descending_Sort=o.Sort_Field_Dialog_Ascending_Sort=o.Sort_Field_Dialog_Summary=o.Sort_Field_Dialog_Sort_Options=o.Sort_Field_Dialog_Title=o.TopTenShow=o.Top_Ten_Filter=o.Value_Title=o.Value_Show=o.Use_Series_Characters=o.Use_Single_Character=o.Label_Show=o.Label_Title=o.PivotPanel_Filter_Search=o.PivotPanel_Filter_NoSelectAll=o.PivotPanel_Filter_SelectAll=o.Select_Field=o.CustomFormats=o.Type=o.Sample=o.FormatCells=o.Number=o.LabelFormat=o.NumberFormat=o.Cancel=o.Ok=o.PivotPanel_Date_Filter=o.PivotPanel_Filter_Value=o.PivotPanel_Filter_Label=o.PivotPanel_Filter_Clear=o.PivotPanel_Sort_More=o.PivotPanel_Sort_Largest_Smallest=o.PivotPanel_Sort_Smallest_Largest=o.PivotPanel_Sort_Z_A=o.PivotPanel_Sort_A_Z=o.PivotPanel_ValueFilterOrLabel_Custom=o.PivotPanel_ValueFilterOrLabel_AllDates=o.PivotPanel_ValueFilterOrLabel_ParallelQuarterToDate=o.PivotPanel_ValueFilterOrLabel_ParallelMonthToDate=o.PivotPanel_ValueFilterOrLabel_ParallelYearToDate=o.PivotPanel_ValueFilterOrLabel_QuarterToDate=o.PivotPanel_ValueFilterOrLabel_MonthToDate=o.PivotPanel_ValueFilterOrLabel_YearToDate=void 0,o.SummarizeValue=o.CustomName=o.SourceName=o.ValueSetting=o.FieldSetting=o.WholeDays=o.DateShow=o.DateFilterTitle=o.IsNotBetween=o.IsBetween=o.IsAfterOrEqual=o.IsAfter=o.IsBeforeOrEqual=o.IsBefore=o.Dec=o.Nov=o.Oct=o.Sep=o.Aug=o.Jul=o.Jun=o.May=o.Apr=o.Mar=o.Feb=o.Jan=o.Q4=o.Q3=o.Q2=o.Q1=o.AndJoiner=o.ByJoiner=o.Top_Sum=o.Top_Percent=o.Top_Item=o.Bottom=o.Top=o.Invalid_Field_Sort_By=o.Invalid_Sort_Range=o.Sort_More_Summary_Pattern=o.Sort_Value_Summary_Pattern=o.Sort_Summary_Pattern=o.Sort_In_Column=o.Sort_In_Row=o.Sort_Order_DESC=o.Sort_Order_ASC=o.Custom_Sort_Summary=o.Sort_Value_Dialog_Left_To_Right=o.Sort_Value_Dialog_Top_To_Bottom=o.Sort_Value_Dialog_Desc=void 0,o.days=o.hours=o.minutes=o.seconds=o.groupBy=o.endingAt=o.startingAt=o.auto=o.grouping=o.baseItem=o.baseField=o.showValueAsDialog=o.index=o.rankLargestSmallest=o.rankSmallestLargest=o.percentRunningTotal=o.runningTotal=o.percentDifference=o.difference=o.percentParentTotal=o.percentParentColumnTotal=o.percentParentRowTotal=o.percentEllipsis=o.percentRowTotal=o.percentColumnTotal=o.percentGrandTotal=o.noCalculation=o.DateFormatError=o.sigmaValueTemp=o.sigmaValue=o.Varp=o.Var=o.StdDevp=o.StdDev=o.CountNumbers=o.Product=o.Min=o.Max=o.Average=o.Count=o.Sum=o.ChooseType=o.ShowValueAsField=o.SummarizeValueField=o.BaseItemPrevious=o.BaseItemNext=o.BaseItemForDialog=o.BaseFieldForDialog=o.CalculationForDialog=o.ShowValueAs=void 0,o.ALL_DATES_IN=o.TIMELINE_PLACE_HOLDER=o.showSubtotalTop=o.showNoData=o.Layout=o.AddSearchResult=o.search=o.SlicerNameInFormula=o.PivotTableErrorFormula=o.PivotTableMoveCalcItemFieldToReport=o.PivotTableCalcItemHasMultipleDataField=o.PivotTableHasSameItemName=o.PivotTableSubtotalType=o.PivotTableHasNumberOrDateGroup=o.PivotTableCalcItemHasTowCacheField=o.PivotTableForAccessibility=o.PivotTableErrorMessage_InvalidReference=o.PivotTableErrorMessage_InvalidGroup=o.PivotTableErrorMessage_InvalidChange=o.PivotTableErrorMessage_Overlap=o.PivotTableErrorMessage_EmptySourceFieldName=o.PivotTableErrorMessage_Protect=o.PivotTableErrorMessage_EmptyFieldName=o.PivotTableErrorMessage_DuplicatedFieldName=o.PivotTableErrorMessage_EditWhenDefer=o.PivotTableErrorMessage_ExistData=o.PivotTableErrorMessage_MakeChange=o.PivotTableErrorMessage_ShowDetail=o.getValueFilterItemText=o.getDateLabelFilterItemText=o.getStringLabelFilterItemText=o.deferLayoutUpdate=o.toolTipContent_NoValue=o.toolTipContent_Value=o.toolTipContent_Column=o.toolTipContent_Row=o.DefaultPivotTableViewName=o.EmptyValueFieldError=o.param_error=o.Group=o.Views=o.FieldAreaLimited=o.SourceDataOnlyOne=o.SourceNotIsTableNameOrFormula=o.SourceError=o.NoHaveSpread=o.numberOfDays=o.years=o.quarters=o.months=void 0,o.POSITIVE_INTEGER=o.ENTRY_NUMBER=o.VALUE_MUST_NUMBER=o.PivotTableErrorMessage_ExistTable=o.TIME_LEVEL_DAYS=o.TIME_LEVEL_MONTHS=o.TIME_LEVEL_QUARTERS=o.TIME_LEVEL_YEARS=o.AllDatesIn_December=o.AllDatesIn_November=o.AllDatesIn_October=o.AllDatesIn_September=o.AllDatesIn_August=o.AllDatesIn_July=o.AllDatesIn_June=o.AllDatesIn_May=o.AllDatesIn_April=o.AllDatesIn_March=o.AllDatesIn_February=o.AllDatesIn_January=o.AllDatesIn_Quarter4=o.AllDatesIn_Quarter3=o.AllDatesIn_Quarter2=o.AllDatesIn_Quarter1=o.DateNotBetween=o.DateOlderThanOrEqual=o.DateOlderThan=o.DateNewerThanOrEqual=o.DateNewerThan=o.DateNotEqual=o.QUARTER_MAP=o.INVALID_DATE_SELECTION=o.ALL_PERIODS=void 0,o.RepeatName="Repeat Name",o.NotExist="Not Exist",o.SubtotalType_Prefix_0="Average of ",o.SubtotalType_Prefix_1="Count of ",o.SubtotalType_Prefix_2="CountNums of ",o.SubtotalType_Prefix_3="Max of ",o.SubtotalType_Prefix_4="Min of ",o.SubtotalType_Prefix_5="Product of ",o.SubtotalType_Prefix_6="StdDev of ",o.SubtotalType_Prefix_7="StdDevp of ",o.SubtotalType_Prefix_8="Sum of ",o.SubtotalType_Prefix_9="Var of ",o.SubtotalType_Prefix_10="Varp of ",o.ColumnLabels="Column Labels",o.Total="{0} Total{1}",o.All="All",o.MultipleItems="Multiple Items",o.RowLabels="Row Labels",o.GrandTotal="Grand Total",o.Values="Values",o.PivotPanel_Title="PivotTable Fields",o.PivotPanel_ReportText="Choose fields to add to report",o.PivotPanel_SearchPlaceholder="Search",o.PivotPanel_FieldAreaText="Drag fields between areas below:",o.PivotPanel_FiltersItemsTitle="Filters",o.PivotPanel_RowsItemsTitle="Rows",o.PivotPanel_ColumnsItemsTitle="Columns",o.PivotPanel_ValuesItemsTitle="Values",o.PivotPanel_DeferUpdateText="Defer Layout Update",o.EmptyPivotTable_PromptMessage1="Click in this area to work with the PivotTable report",o.EmptyPivotTable_PromptMessage2="Turn on the PivotTable Field List to work with the PivotTable",o.PivotPanel_Update="Update",o.PivotPanel_DropDownList_Up="Move Up",o.PivotPanel_DropDownList_Down="Move Down",o.PivotPanel_DropDownList_Beginning="Move to Beginning",o.PivotPanel_DropDownList_End="Move to End",o.PivotPanel_DropDownList_ReportFilter="Move to Report Filter",o.PivotPanel_DropDownList_Row="Move to Row Labels",o.PivotPanel_DropDownList_Col="Move to Column Labels",o.PivotPanel_DropDownList_Values="Move to Values",o.PivotPanel_DropDownList_Remove="Remove Field",o.PivotPanel_DropDownList_Set="Field Settings...",o.PivotPanel_DropDownList_ValueSet="Value Field Settings...",o.PivotPanel_Fields_MoveTo_ReportField="Add to Report Filter",o.PivotPanel_Fields_MoveTo_RowLabel="Add to Row Labels",o.PivotPanel_Fields_MoveTo_ColLabel="Add to Column Labels",o.PivotPanel_Fields_MoveTo_Value="Add to Values",o.PivotPanel_LabelOrValue_ClearFilter="Clear Filter",o.PivotPanel_ValueFilterOrLabel_Equals="Equals...",o.PivotPanel_ValueFilterOrLabel_NotEqual="Does Not Equal...",o.PivotPanel_ValueFilterOrLabel_GreaterThan="Greater Than...",o.PivotPanel_ValueFilterOrLabel_GreaterOrTo="Greater Than Or Equal To...",o.PivotPanel_ValueFilterOrLabel_LessThan="Less Than...",o.PivotPanel_ValueFilterOrLabel_LessOrTo="Less Than Or Equal To...",o.PivotPanel_ValueFilterOrLabel_Between="Between...",o.PivotPanel_ValueFilterOrLabel_NotBetween="Not Between...",o.PivotPanel_ValueFilter_Top10="Top 10...",o.PivotPanel_ValueFilterOrLabel_IsBeginWith="Begins With...",o.PivotPanel_ValueFilterOrLabel_NotBegin="Does Not Begin With...",o.PivotPanel_ValueFilterOrLabel_End="Ends With...",o.PivotPanel_ValueFilterOrLabel_NotEndWith="Does Not End With...",o.PivotPanel_ValueFilterOrLabel_Contain="Contains...",o.PivotPanel_ValueFilterOrLabel_NotContain="Does Not Contain...",o.ValueFilterOrLabel_Equals="equals",o.ValueFilterOrLabel_NotEqual="does not equal",o.ValueFilterOrLabel_GreaterThan="greater than",o.ValueFilterOrLabel_GreaterOrTo="greater than or equal to",o.ValueFilterOrLabel_LessThan="less than",o.ValueFilterOrLabel_LessOrTo="less than or equal to",o.ValueFilterOrLabel_Between="between",o.ValueFilterOrLabel_NotBetween="not between",o.ValueFilterOrLabelSelect_GreaterThan="is greater than",o.ValueFilterOrLabelSelect_GreaterOrTo="is greater than or equal to",o.ValueFilterOrLabelSelect_LessThan="is less than",o.ValueFilterOrLabelSelect_LessOrTo="is less than or equal to",o.ValueFilterOrLabelSelect_Between="is between",o.ValueFilterOrLabelSelect_NotBetween="is not between",o.ValueFilterOrLabel_IsBeginWith="begins with",o.ValueFilterOrLabel_NotBegin="does not begin with",o.ValueFilterOrLabel_End="ends with",o.ValueFilterOrLabel_NotEndWith="does not end with",o.ValueFilterOrLabel_Contain="contains",o.ValueFilterOrLabel_NotContain="does not contain",o.PivotPanel_ValueFilterOrLabel_Before="Before...",o.PivotPanel_ValueFilterOrLabel_After="After...",o.PivotPanel_ValueFilterOrLabel_Tomorrow="Tomorrow",o.PivotPanel_ValueFilterOrLabel_Today="Today",o.PivotPanel_ValueFilterOrLabel_Yesterday="Yesterday",o.PivotPanel_ValueFilterOrLabel_NextWeek="Next Week",o.PivotPanel_ValueFilterOrLabel_ThisWeek="This Week",o.PivotPanel_ValueFilterOrLabel_LastWeek="Last Week",o.PivotPanel_ValueFilterOrLabel_NextMonth="Next Month",o.PivotPanel_ValueFilterOrLabel_ThisMonth="This Month",o.PivotPanel_ValueFilterOrLabel_LastMonth="Last Month",o.PivotPanel_ValueFilterOrLabel_NextQuarter="Next Quarter",o.PivotPanel_ValueFilterOrLabel_ThisQuarter="This Quarter",o.PivotPanel_ValueFilterOrLabel_LastQuarter="Last Quarter",o.PivotPanel_ValueFilterOrLabel_NextYear="Next Year",o.PivotPanel_ValueFilterOrLabel_ThisYear="This Year",o.PivotPanel_ValueFilterOrLabel_LastYear="Last Year",o.PivotPanel_ValueFilterOrLabel_YearToDate="Year to Date",o.PivotPanel_ValueFilterOrLabel_MonthToDate="Month to Date",o.PivotPanel_ValueFilterOrLabel_QuarterToDate="Quarter to Date",o.PivotPanel_ValueFilterOrLabel_ParallelYearToDate="Parallel Year to Date",o.PivotPanel_ValueFilterOrLabel_ParallelMonthToDate="Parallel Month to Date",o.PivotPanel_ValueFilterOrLabel_ParallelQuarterToDate="Parallel Quarter to Date",o.PivotPanel_ValueFilterOrLabel_AllDates="All Dates in Period",o.PivotPanel_ValueFilterOrLabel_Custom="Custom Filter...",o.PivotPanel_Sort_A_Z="Sort A to Z",o.PivotPanel_Sort_Z_A="Sort Z to A",o.PivotPanel_Sort_Smallest_Largest="Sort Smallest to Largest",o.PivotPanel_Sort_Largest_Smallest="Sort Largest to Smallest",o.PivotPanel_Sort_More="More Sort Options...",o.PivotPanel_Filter_Clear="Clear Filter From {0}",o.PivotPanel_Filter_Label="Label Filters",o.PivotPanel_Filter_Value="Value Filters",o.PivotPanel_Date_Filter="Date Filters",o.Ok="OK",o.Cancel="Cancel",o.NumberFormat="Number Format",o.LabelFormat="Label Format",o.Number="Number",o.FormatCells="Format Cells",o.Sample="Sample",o.Type="Type",o.CustomFormats=["General","0","0.00","#,##0","#,##0.00","#,##0;(#,##0)","#,##0;[Red](#,##0)","#,##0.00;(#,##0.00)","#,##0.00;[Red](#,##0.00)","$#,##0;($#,##0)","$#,##0;[Red]($#,##0)","$#,##0.00;($#,##0.00)","$#,##0.00;[Red]($#,##0.00)","0%","0.00%","0.00E+00","##0.0E+0","# ?/?","# ??/??","m/d/yyyy","d-mmm-yy","d-mmm","mmm-yy","h:mm AM/PM","h:mm:ss AM/PM","hh:mm","hh:mm:ss","m/d/yyyy hh:mm","mm:ss","mm:ss.0","@","[h]:mm:ss",'$ #,##0;$ (#,##0);$ "-";@',' #,##0; (#,##0); "-";@','$ #,##0.00;$ (#,##0.00);$ "-"??;@',' #,##0.00; (#,##0.00); "-"??;@',"hh:mm:ss","00000","# ???/???","000-00-0000","dddd, mmmm dd, yyyy","m/d;@","[<=9999999]###-####;(###) ###-####","# ?/8"],o.Select_Field="Select field",o.PivotPanel_Filter_SelectAll="Check All",o.PivotPanel_Filter_NoSelectAll="Uncheck All",o.PivotPanel_Filter_Search="search",o.Label_Title="Label Filter",o.Label_Show="Show items for which the label",o.Use_Single_Character="Use ? to represent any single character",o.Use_Series_Characters="Use * to represent any series characters",o.Value_Show="Show items for which",o.Value_Title="Value Filter",o.Top_Ten_Filter="Top 10 Filter ",o.TopTenShow="show",o.Sort_Field_Dialog_Title="Sort",o.Sort_Field_Dialog_Sort_Options="Sort options",o.Sort_Field_Dialog_Summary="Summary",o.Sort_Field_Dialog_Ascending_Sort="Ascending (A to Z) by:",o.Sort_Field_Dialog_Descending_Sort="Descending (Z to A) by:",o.Sort_Field_Dialog_More_Options="More Options...",o.Sort_Field_More_Dialog_Title="More Sort Options",o.Sort_Field_More_Dialog_Sort_By="Sort By",o.Sort_Field_More_Dialog_Values_In_Selected_Area="Values in selected {{AREA}}",o.Sort_Value_Dialog_Title="Sort By Value",o.Sort_Value_Dialog_Sort_Direction="Sort direction",o.Sort_Value_Dialog_Asc="Smallest to Largest",o.Sort_Value_Dialog_Desc="Largest to Smallest",o.Sort_Value_Dialog_Top_To_Bottom="Top to Bottom",o.Sort_Value_Dialog_Left_To_Right="Left to Right",o.Custom_Sort_Summary="Custom Sort",o.Sort_Order_ASC="ascending order",o.Sort_Order_DESC="descending order",o.Sort_In_Row="row",o.Sort_In_Column="column",o.Sort_Summary_Pattern="Sort {{FIELD_NAME}} in {{ORDER}}",o.Sort_Value_Summary_Pattern="Sort {{FIELD_NAME}} by {{SELECTED_FIELD_NAME}} in {{ORDER}}",o.Sort_More_Summary_Pattern=`Sort {{FIELD_NAME}} by {{SELECTED_FIELD_NAME}} in {{ORDER}} using values in this {{ROW_COLUMN}}:\r
  606. `,o.Invalid_Sort_Range="The Sort Reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank.",o.Invalid_Field_Sort_By="Cannot determine which PivotTable field to sort by.",o.Top="Top",o.Bottom="Bottom",o.Top_Item="Items",o.Top_Percent="Percent",o.Top_Sum="Sum",o.ByJoiner="by",o.AndJoiner="and",o.Q1="Quarter 1",o.Q2="Quarter 2",o.Q3="Quarter 3",o.Q4="Quarter 4",o.Jan="January",o.Feb="February",o.Mar="March",o.Apr="April",o.May="May",o.Jun="June",o.Jul="July",o.Aug="August",o.Sep="September",o.Oct="October",o.Nov="November",o.Dec="December",o.IsBefore="is before",o.IsBeforeOrEqual="is before or equal to",o.IsAfter="is after",o.IsAfterOrEqual="is after or equal to",o.IsBetween="is between",o.IsNotBetween="is not between",o.DateFilterTitle="Date Filter",o.DateShow="Show items for which the date",o.WholeDays="Whole Days",Yt=ft("./dist/plugins/pivot/lr.gcn.js"))Yt.hasOwnProperty(At)&&(o[At]=Yt[At]);o.FieldSetting="Field Settings",o.ValueSetting="Value Field Settings",o.SourceName="Source Name:",o.CustomName="Custom Name:",o.SummarizeValue="Summarize Values By",o.ShowValueAs="Show Value As",o.CalculationForDialog="Calculation: ",o.BaseFieldForDialog="Base Field: ",o.BaseItemForDialog="Base Item: ",o.BaseItemNext="(next)",o.BaseItemPrevious="(previous)",o.SummarizeValueField="Summarize values field by",o.ShowValueAsField="Show value as",o.ChooseType="Choose the type of calculation that you want to use to summarize data from the selected field",o.Sum="Sum",o.Count="Count",o.Average="Average",o.Max="Max",o.Min="Min",o.Product="Product",o.CountNumbers="Count Numbers",o.StdDev="StdDev",o.StdDevp="StdDevp",o.Var="Var",o.Varp="Varp",o.sigmaValue="\u2211 Values",o.sigmaValueTemp="Values",o.DateFormatError="This isn't a valid date",o.noCalculation="No Calculation",o.percentGrandTotal="% of Grand Total",o.percentColumnTotal="% of Column Total",o.percentRowTotal="% of Row Total",o.percentEllipsis="% Of ...",o.percentParentRowTotal="% of Parent Row Total",o.percentParentColumnTotal="% of Parent Column Total",o.percentParentTotal="% of Parent Total ...",o.difference="Difference From ...",o.percentDifference="% Difference From ...",o.runningTotal="Running Total In ...",o.percentRunningTotal="% Running Total In ...",o.rankSmallestLargest="Rank Smallest to Largest ...",o.rankLargestSmallest="Rank Largest to Smallest ...",o.index="Index",o.showValueAsDialog=["","","","","% Of ","","","% of Parent Total ","Difference From ","% Difference From ","Running Total In ","% Running Total In ","Rank Smallest to Largest ","Rank Largest to Smallest ",""],o.baseField="Base field:",o.baseItem="Base item:",o.grouping="Grouping",o.auto="Auto",o.startingAt="Starting at:",o.endingAt="Ending at:",o.groupBy="By:",o.seconds="Seconds",o.minutes="Minutes",o.hours="Hours",o.days="Days",o.months="Months",o.quarters="Quarters",o.years="Years",o.numberOfDays="Number of days",o.NoHaveSpread="workbook exception",o.SourceError="Source data exception, cannot create PivotTable report",o.SourceNotIsTableNameOrFormula="source data not is table name and formula",o.SourceDataOnlyOne="This command requires at least two rows of source data. You cannot use the command on a selection in only row",o.FieldAreaLimited="The field you are moving cannot be placed in that area of the report.",o.Views="Views",o.Group="Group",o.param_error="the param is null or undefine",o.EmptyValueFieldError="You need at least one field in the Values area in order to apply a value filter",o.DefaultPivotTableViewName="PivotView",o.toolTipContent_Row="Row: ",o.toolTipContent_Column="Column: ",o.toolTipContent_Value="Value: ",o.toolTipContent_NoValue="No value",o.deferLayoutUpdate="Defer Layout Update",o.getStringLabelFilterItemText=function(){return[o.ValueFilterOrLabel_Equals,o.ValueFilterOrLabel_NotEqual,o.ValueFilterOrLabel_IsBeginWith,o.ValueFilterOrLabel_NotBegin,o.ValueFilterOrLabel_End,o.ValueFilterOrLabel_NotEndWith,o.ValueFilterOrLabel_Contain,o.ValueFilterOrLabel_NotContain,o.ValueFilterOrLabelSelect_GreaterThan,o.ValueFilterOrLabelSelect_GreaterOrTo,o.ValueFilterOrLabelSelect_LessThan,o.ValueFilterOrLabelSelect_LessOrTo,o.ValueFilterOrLabelSelect_Between,o.ValueFilterOrLabelSelect_NotBetween]},o.getDateLabelFilterItemText=function(){return[o.ValueFilterOrLabel_Equals,o.ValueFilterOrLabel_NotEqual,o.IsBefore,o.IsBeforeOrEqual,o.IsAfter,o.IsAfterOrEqual,o.IsBetween,o.IsNotBetween]},o.getValueFilterItemText=function(){return[o.ValueFilterOrLabel_Equals,o.ValueFilterOrLabel_NotEqual,o.ValueFilterOrLabelSelect_GreaterThan,o.ValueFilterOrLabelSelect_GreaterOrTo,o.ValueFilterOrLabelSelect_LessThan,o.ValueFilterOrLabelSelect_LessOrTo,o.ValueFilterOrLabelSelect_Between,o.ValueFilterOrLabelSelect_NotBetween]},o.PivotTableErrorMessage_ShowDetail="Cannot show or hide detail for this selection",o.PivotTableErrorMessage_MakeChange="We can't make this change for the selected cells because it will affect a PivotTable. Use the field list to change the report. If you are trying to insert or delete cells, move the PivotTable and try again.",o.PivotTableErrorMessage_ExistData="There's already data in {}. Do you want to replace it?",o.PivotTableErrorMessage_EditWhenDefer="The PivotTable report cannot be edited with the Defer Layout Update check box selected. To edit the report, clear the Defer Layout Update check box at the bottom of the PivotTable Field List.",o.PivotTableErrorMessage_DuplicatedFieldName="PivotTable field name already exists.",o.PivotTableErrorMessage_EmptyFieldName="Cannot enter a null value as an item or field name in a PivotTable report.",o.PivotTableErrorMessage_Protect="That command cannot be performed while a protected sheet contains another PivotTable report based on the same source data. To remove protection from the sheet that has the other report, click the sheet tab, and then click Unprotect Sheet(Review tab, Changes group). Then try the command again.",o.PivotTableErrorMessage_EmptySourceFieldName="The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.",o.PivotTableErrorMessage_Overlap="A PivotTable report cannot overlap another PivotTable report.",o.PivotTableErrorMessage_InvalidChange="We can't change this part of the PivotTable.",o.PivotTableErrorMessage_InvalidGroup="Cannot group that selection.",o.PivotTableErrorMessage_InvalidReference="Reference isn't valid.",o.PivotTableForAccessibility=`PivotTable: \r
  607. PivotTable Name: `,o.PivotTableCalcItemHasTowCacheField="If one or more fields in the PivotTable have calculated items, no fields can be used in the data area two or more times, or in the data area and another area at the same time. If you are trying to add a field, remove the calculated items and add the field again. If you are trying to add a calculated item, change the PivotTable report so that no field is used more than once and then add the calculated item.",o.PivotTableHasNumberOrDateGroup="This PivotTable report field is grouped, You cannot add a calculated item to a grouped field. To ungroup the field, make sure it is in the row or column area, select one of the items of the grouped field, click the Ungroup button in the Group group on the Analyze tab, and then insert the calculated item. After inserted, you can group the items of the field again.",o.PivotTableSubtotalType="Averages, standard deviations, and variances are not supported when a PivotTable report has calculated items.",o.PivotTableHasSameItemName="Calculated item or field could not be created because another item or field of the same name exists.",o.PivotTableCalcItemHasMultipleDataField="Multiple data Fields of the same field are not supported when a PivotTable report has calculated items.",o.PivotTableMoveCalcItemFieldToReport="This field cannot be placed in the report filter because it contains calculated items.To place this field in the report filter,first delete the calculated items.",o.PivotTableErrorFormula="An item name cannot be found. Check that you've typed the name correctly and the item is present in the PivotTable report.",o.SlicerNameInFormula="Slicer",o.search="Search",o.AddSearchResult="Add current selection to filter",o.Layout="Layout",o.showNoData="Show items with no data",o.showSubtotalTop="Display subtotals at the top of each group",o.TIMELINE_PLACE_HOLDER="{TL}",o.ALL_DATES_IN="All dates in ",o.ALL_PERIODS="All Periods",o.INVALID_DATE_SELECTION="Invalid Date Selection!",o.QUARTER_MAP=["","Q1","Q2","Q3","Q4"],o.DateNotEqual="Not "+o.TIMELINE_PLACE_HOLDER,o.DateNewerThan="After "+o.TIMELINE_PLACE_HOLDER,o.DateNewerThanOrEqual="After or on "+o.TIMELINE_PLACE_HOLDER,o.DateOlderThan="Before "+o.TIMELINE_PLACE_HOLDER,o.DateOlderThanOrEqual="Before or on"+o.TIMELINE_PLACE_HOLDER,o.DateNotBetween="Not Between "+o.TIMELINE_PLACE_HOLDER,o.AllDatesIn_Quarter1=o.ALL_DATES_IN+o.QUARTER_MAP[1],o.AllDatesIn_Quarter2=o.ALL_DATES_IN+o.QUARTER_MAP[2],o.AllDatesIn_Quarter3=o.ALL_DATES_IN+o.QUARTER_MAP[3],o.AllDatesIn_Quarter4=o.ALL_DATES_IN+o.QUARTER_MAP[4],o.AllDatesIn_January=o.ALL_DATES_IN+o.Jan,o.AllDatesIn_February=o.ALL_DATES_IN+o.Feb,o.AllDatesIn_March=o.ALL_DATES_IN+o.Mar,o.AllDatesIn_April=o.ALL_DATES_IN+o.Apr,o.AllDatesIn_May=o.ALL_DATES_IN+o.May,o.AllDatesIn_June=o.ALL_DATES_IN+o.Jun,o.AllDatesIn_July=o.ALL_DATES_IN+o.Jul,o.AllDatesIn_August=o.ALL_DATES_IN+o.Aug,o.AllDatesIn_September=o.ALL_DATES_IN+o.Sep,o.AllDatesIn_October=o.ALL_DATES_IN+o.Oct,o.AllDatesIn_November=o.ALL_DATES_IN+o.Nov,o.AllDatesIn_December=o.ALL_DATES_IN+o.Dec,o.TIME_LEVEL_YEARS="YEARS",o.TIME_LEVEL_QUARTERS="QUARTERS",o.TIME_LEVEL_MONTHS="MONTHS",o.TIME_LEVEL_DAYS="DAYS",o.PivotTableErrorMessage_ExistTable="A PivotTable report cannot overlap a table.",o.VALUE_MUST_NUMBER="Value must be a number.",o.ENTRY_NUMBER="Your entry cannot be used, An integer or decimal number may be required.",o.POSITIVE_INTEGER="Number must be greater than zero."},"./dist/plugins/pivot/sheet-range-to-pivot-area.js":function(Ie,o,ft){var Yt,At,S,at,X,H,f,B,vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt;function gt(M,s){return{condition:M,checker:s}}function Z(M,s,y,G,K,c,N){var V=M.condition;return(0,M.checker)(function(O,pt,wt,et,ht,St){return typeof O=="boolean"||(O=(0,Yt.RF)(O)||{}).value!==void 0&&(O.value=function($,n,a,i,h,b){var Q,it,It,t;if($!==X){if(Q=function(r){return function(u,d,m,R,z,ct){var Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt=ut(d,z.row,z.col),Et=R===3;switch(u){case v:return d.getFieldsByArea(S.PivotTableFieldType.columnField).length;case _:return d.layoutType()===S.PivotTableLayoutType.compact?1:d.getFieldsByArea(S.PivotTableFieldType.rowField).length;case w:return m.rowCount;case Ft:return m.colCount;case U:if(Lt){if(Et&&d.layoutType()===S.PivotTableLayoutType.compact||!(Ot=Et?Lt.rowInfos:Lt.colInfos))return 1;for(Pt=Ot.length-1;Ot[Pt]&&Ot[Pt].itemName===X;)Pt--;if(Jt=Ot[Pt],e=(Et?d.rZt.HWt[3]:d.rZt.HWt[2]).YWt,Jt&&($t=e[e=(e=Jt.fieldName)===at().sigmaValue?at().Values:e][Jt.itemName].ranges)){for(e=ct.row,p=ct.col,Jt.isBlankRow&&(e-=d.options.subtotalsPosition===S.SubtotalsPosition.bottom?2:1),W=C=$t.indexOf(Et?e:p),x=1;$t[C-1]!==X&&$t[C-1]===$t[C]-1;)x++,C--;for(;$t[W+1]!==X&&$t[W+1]===$t[W]+1;)x++,W++;return x}}break;case F:return Lt!=null&&Lt.rowInfos?Lt.rowInfos.length-1:0;case g:return Lt!=null&&Lt.colInfos?Lt.colInfos.length-(!d.options.showHeaders&&d.dh.getSigmaValuePosition().display?1:0):0;case ot:if(Lt&&(yt=!1,Ot=Et?Lt.rowInfos:Lt.colInfos)){for(_t=0;_t<Ot.length;_t++)if(((Tt=Ot[_t])==null?void 0:Tt.isSubtotal)===!0){yt=!0;break}if(yt)return Et?ct.row:ct.col}break;default:return+u}}(r,n,a,i,h,b)},typeof $!="object")return Q($);switch(it=$.value1,It=$.operator,t=$.value2,It){case 6:return Q(it)-Q(t);case 5:return Q(it)+Q(t);case 8:return Q(it)/Q(t);case 7:return Q(it)*Q(t);default:return Q(it)}}}(O.value,ht,et,St,wt,pt)),O}(V,s,y,G,K,N),s,c,K,N)}function ut(M,s,y){return M.getPivotInfoImp(s,y)}function Rt(M){var s,y,G,K,c,N,V;return M?(s=M.type,y=M.labelOnly,G=M.fieldName,V=M.references,K=M.dataOnly,c=M.grandRow,N=M.grandCol,M=M.offset,V=V?V.map(function(O){var pt;return"".concat(O.fieldName,":").concat((pt=O.items)==null?void 0:pt.join(","),":").concat(O.subtotal)}).join("|"):"",M=M?"".concat(M.row,",").concat(M.col,",").concat(M.rowCount,",").concat(M.colCount):"","".concat(s,":").concat(y,":").concat(G,":").concat(V,":").concat(K,":").concat(c,":").concat(N,":").concat(M)):"undefined"}function Ct(M,s,y){var G,K=M.rowInfos,c=M.colInfos,N=k.none;if(K&&!y)for(G=0;G<K.length;G++)(K[G].isSubtotal||K[G].isGrandTotal)&&(N+=k.row);if(c&&!s)for(G=0;G<c.length;G++)(c[G].isSubtotal||c[G].isGrandTotal)&&(N+=k.col);return N}function Bt(M,s,y){var G,K,c,N;if(M&&s){if((G=M.length)!==(N=s.length))return 1;for(K=G-2;-1<K;K--)if(M[K].itemName!==s[K].itemName)return 1;return c=M[G-1],N=s[N-1],y!==G&&c.fieldName===N.fieldName&&c.fieldName===at().sigmaValue&&c.itemName!==N.itemName}}function kt(M,s,y,G,K,c,N,V){var O,pt,wt=N.QWt;if(y>K.row+K.rowCount-1||G>K.col+K.colCount-1)return 1;if(M&&s){if(V){if(N.QWt===3){if((y=N.zWt)&&(G=y[M.relativeRow],K=y[s.relativeRow],G)&&K&&G.YAt!==K.YAt)return 1}else if(Bt(M.rowInfos,s.rowInfos,N.ZWt.length))return 1}else if(Bt(M.colInfos,s.colInfos,N.ZWt.length))return 1}if(wt===4&&c){if(V&&c===k.col&&Ct(s,!0)||!V&&c===k.row&&Ct(s,void 0,!0))return 1}else if(Ct(s))return 1;if(wt===3&&!c&&!V||wt===2&&!c&&V)return 1;if(c){if(wt===3&&V){if(O=N.zWt[s.relativeRow],pt=N.zWt[s.relativeRow-1],O.path!==pt.path)return 1}else if(wt!==2||V){if(wt===4&&(c&k.row&&V||c&k.col&&!V))return 1}else if(O=N.WWt[s.relativeColumn],pt=N.WWt[s.relativeColumn-1],O.path!==pt.path)return 1}}function ie(M,s,y){var G;switch(s){case 1:G=q;break;case 2:G=J;break;case 3:G=P;break;case 4:G=bt;break;default:return}return function(K,c,N,V){var O,pt=[],wt=K.rZt.HWt[N].getRange(),et=(O=K.getRange().content).row,ht=O.col;return(0,At.o)(c,function(St){var $=St.row,n=St.col,a=St.rowCount,i=St.colCount;$={row:$-wt.row-et,col:n-wt.col-ht,rowCount:a,colCount:i},(n=function(h,b,Q,it,It,t){for(var r,u,d=ut(It,Q.row,Q.col),m=0;m<h.length;m++)if(r=(u=h[m]).conditions,u=u.pivotArea,r.every(function(R){return Z(R,b,Q,it,It,d,t)}))return Mt(u,b,Q,it,d,It,t);return H}(V,$,St,wt,K,N))!==H&&pt.push(n)}),pt}(y,M,s,G)}function Xt(M,s){return s.Oy()||(0,At.ht)(M)?H:M===0?s.getRange().page:((M=s.rZt.HWt[M].getRange()).row+=s.eZt.row,M.col+=s.eZt.col,M)}function Qt(M){return M===at().sigmaValue?at().Values:M}function dt(M,s){var y=s.rowCount-1;s=s.colCount-1,M.rowCount!==1&&M.row+M.rowCount-1==y&&(M.rowCount=f),M.colCount!==1&&M.col+M.colCount-1==s&&(M.colCount=f),M.row===y&&(M.row=f),M.col===s&&(M.col=f)}function xt(M,s,y,G,K){var c;(y=(0,Yt.RF)(y)||{}).offset=X,(c=y.references)!=null&&c.forEach(function(N){N.xqt=!0}),(c=s.getPivotAreaRanges(y))&&c[0]&&(M.row=G.row-c[0].row,M.col=G.col-c[0].col,dt(M,c[0]))}function Mt(M,s,y,G,K,c,N){var V,O=(0,Yt.RF)(M)||{};if(M.fieldName===B){if(!(V=function(pt,wt,et){var ht;switch(et){case 1:return(ht=pt.cornerFieldInfo).fieldName||H;case 2:if(ht=pt.colHeadFieldInfo)return ht.fieldName;ht=pt.activeColFieldInfo;break;case 3:ht=pt.activeRowFieldInfo}return ht?ht.name:H}(K,0,N)))return H;O.fieldName=Qt(V)}return M.references===vt&&(O.references=function(pt,wt){for(var et=[],ht=pt.row,St=at().Values,$=function(a){var i,h,b=ut(wt,ht,a);(h=b.colInfos)?(0,At.o)(h,function(Q,it){var It;a===pt.col?(It={fieldName:Qt(Q.fieldName),items:[Q.itemName]},Q.isSubtotal&&Q.collapseIndex===X&&(It.subtotal=!0),et[it]=It):it!==h.length-1||et[it].items.includes(Q.itemName)||et[it].items.push(Q.itemName)}):(i=wt.rZt.HWt[2].WWt)&&(i=i[b.relativeColumn])&&i.path===""&&i.valueFieldName&&((b=et.find(function(Q){return Q.fieldName===St}))||et.push(b={fieldName:St,items:[]}),b.items.push(i.valueFieldName))},n=pt.col;n<pt.col+pt.colCount;n++)$(n);return et}(y,c)),V=M.grandRow===!0&&M.grandCol===!0,M.references!==mt&&M.references!==mt+vt||function(pt,wt,et,ht,St,$){if((pt=pt(wt,et)).length===0&&!ht&&function(n){return n.some(function(a){return a.isBlankRow})}(St.rowInfos))return H;$.references=pt}(M.references===mt?st:l,y,c,V,K,O)!==H?(M.references===tt&&(O.references=[{fieldName:at().Values}]),O.references&&O.references.length===0&&delete O.references,M.grandRow===!0&&M.labelOnly&&(V=c.rZt.HWt[3].ZWt.length,s.colCount!==V)&&(O.offset={row:0,col:s.col,rowCount:1,colCount:s.colCount}),M.grandCol===!0&&M.labelOnly&&function(pt,wt,et){var ht,St,$,n=(St=(pt=pt.rZt.HWt[2]).getRange()).rowCount-1,a=0;if($=pt.WWt){for(ht=$.length-1;0<=ht;ht--)if($[ht]&&$[ht].isGrandTotal!==!0){a=ht;break}}pt=St.colCount-a,wt.rowCount===n&&wt.colCount===pt||(et.offset={row:wt.row-1,col:wt.col-a-1,rowCount:wt.rowCount,colCount:wt.colCount})}(c,s,O),M.offset===I&&(K={row:s.row,col:s.col,rowCount:s.rowCount,colCount:s.colCount},N===2?(V=c.rZt.HWt[2].ZWt.length,K.row===0?(K.col-=V,dt(K,new Yt.Range(0,0,1,G.colCount-V))):xt(K,c,O,y)):N===1?dt(K,new Yt.Range(0,0,G.rowCount-1,G.colCount)):N===3&&xt(K,c,O,y),O.offset=K),O):H}function st(M,s){for(var y,G,K,c,N,V,O,pt=[],wt=M.col,et=s.layoutType()===S.PivotTableLayoutType.tabular,ht=M.row;ht<M.row+M.rowCount;ht++)if(y=ut(s,ht,wt).rowInfos)for(G=0,K=y.length;G<K;G++){if((c=y[G]).isBlankRow===!0)return[];ht===M.row&&c.itemName!==X?(N={fieldName:Qt(c.fieldName),items:[c.itemName]},O=void 0,(V=s.zRt(N.fieldName))&&(O=V.Spi),!c.isSubtotal||c.collapseIndex!==X||O&&!et||(N.subtotal=!0),pt[G]=N):G===y.length-1&&pt[G]&&!pt[G].items.includes(c.itemName)&&pt[G].items.push(c.itemName)}return pt}function l(M,s){for(var y,G,K,c,N,V,O,pt,wt,et=[],ht=[],St=M.row,$=M.col,n=s.layoutType()===S.PivotTableLayoutType.tabular,a=M.row;a<M.row+M.rowCount;a++)if(y=ut(s,a,$).rowInfos)for(K=G=0,c=y.length;K<c;K++){if((N=y[K]).isBlankRow===!0)return[];a===M.row?(0,At.ht)(N.fieldName)||(0,At.ht)(N.itemName)||(V={fieldName:Qt(N.fieldName),items:[N.itemName]},pt=void 0,(O=s.zRt(V.fieldName))&&(pt=O.Spi),!N.isSubtotal||N.collapseIndex!==X||pt&&!n||(V.subtotal=!0),et[G]&&(G+=1),et[G]=V):(G!==y.length-1||(0,At.ht)(N.itemName)||(et[G].items?et[G].items.includes(N.itemName)||et[G].items.push(N.itemName):et[G].items=[N.itemName]),G+=1)}for(wt=function(i){var h,b;(b=ut(s,St,i).colInfos)&&(h=0,At.o)(b,function(Q){var it;i===M.col?Q.fieldName&&Q.itemName&&(it={fieldName:Qt(Q.fieldName),items:[Q.itemName]},Q.isSubtotal&&Q.collapseIndex===X&&(it.subtotal=!0),ht[h]&&(h+=1),ht[h]=it):(h!==b.length-1||(0,At.ht)(Q.itemName)||(ht[h].items?ht[h].items.push(Q.itemName):ht[h].items=[Q.itemName]),h+=1)})},a=M.col;a<M.col+M.colCount;a++)wt(a);return et.concat(ht)}function T(M,s){var y;if(M===X)return!0;switch(y=M.value,M.operator){case 1:return y<s;case 2:return y<=s;case 3:return s<y;case 4:return s<=y;default:return s===y}}function D(M,s,y){var G=M.rowInfos,K=(M=M.colInfos,!1);return s&&G&&0<G.length&&(0,At.o)(G,function(c){c.isGrandTotal&&(K=!0)}),y&&M&&0<M.length&&(0,At.o)(M,function(c){c.isGrandTotal&&(K=!0)}),K}Object.defineProperty(o,"__esModule",{value:!0}),o.rangeToAreas=void 0,Yt=ft("Core"),E=ft("@spreadjs/js-sheets-common"),At=ft("Pivot"),S=ft("./dist/plugins/pivot/pivot-core/pivot-core-interface.js"),ft=ft("./dist/plugins/pivot/pivot.ns.js"),E=new E.Common.ResourceManager(ft.SR,"PivotTables"),at=E.getResource.bind(E),X=void 0,H=null,f=1/0,B="__FieldName__",vt="__ColInfo__",mt="__RowInfo__",tt="__Values__",_="__RowFieldCount__",v="__ColFieldCount__",Ft="__FullCol__",I="__Offset__",U="__FullItem__",g="__SameRow__",F="__SameCol__",ot="__Subtotal__",q=[{conditions:[gt({value:{value1:w="__FullRow__",operator:6,value2:1}},ft=function(M,s,y,G,K){return T(M,s.row)}),gt({value:1},E=function(M,s,y,G,K){return T(M,s.rowCount)}),gt({value:1},A=function(M,s,y,G,K){return T(M,s.colCount)})],pivotArea:{type:S.PivotAreaType.button,labelOnly:!0,fieldName:B}},{conditions:[gt({value:0},ft),gt({value:0},j=function(M,s,y,G,K){return T(M,s.col)}),gt({value:{value1:w,operator:6,value2:1}},E),gt({value:Ft},A)],pivotArea:{type:S.PivotAreaType.corner,labelOnly:!0}},{conditions:[],pivotArea:{type:S.PivotAreaType.corner,labelOnly:!0,offset:I}}],J=[{conditions:[gt({value:0},ft),gt({value:v,operator:2},j),gt({value:1},E),gt({value:{value1:Ft,operator:6,value2:v}},A),gt(!0,nt=function(M,s,y,G,K){return M?y.value===H:y.value!==H})],pivotArea:{type:S.PivotAreaType.topRight}},{conditions:[gt({value:0},ft),gt({value:v,operator:2},j),gt({value:1},E),gt(!0,nt)],pivotArea:{type:S.PivotAreaType.topRight,offset:I}},{conditions:[gt({value:1},A),gt(!0,L=function(M,s,y,G,K){return M&&D(y,!1,!0)})],pivotArea:{labelOnly:!0,grandCol:!0}},{conditions:[gt({value:0},ft),gt({value:1},E),gt({value:1},A),gt(!(Y=function(M,s,y,G,K){return M&&D(y,!0,!1)}),nt),gt(!(nt=function(M,s,y,G,K){return M!==!1||(K===2||K===3)&&0<((M=G.getFieldsByArea(K===2?S.PivotTableFieldType.columnField:S.PivotTableFieldType.rowField))==null?void 0:M.length)}),nt)],pivotArea:{type:S.PivotAreaType.button,labelOnly:!0,fieldName:B}},{conditions:[gt({value:ot},j),gt({value:v},E)],pivotArea:{labelOnly:!0,references:vt}},{conditions:[gt({value:ot},j)],pivotArea:{labelOnly:!0,references:vt,offset:I}},{conditions:[gt({value:U,operator:2},A)],pivotArea:{labelOnly:!0,references:vt}},{conditions:[],pivotArea:{labelOnly:!0,references:vt,offset:I}}],P=[{conditions:[gt({value:1},E),gt(!0,Y)],pivotArea:{labelOnly:!0,grandRow:!0}},{conditions:[gt({value:ot},ft),gt({value:_},A)],pivotArea:{labelOnly:!0,references:mt}},{conditions:[gt({value:ot},ft)],pivotArea:{labelOnly:!0,references:mt,offset:I}},{conditions:[gt({value:U,operator:2},E)],pivotArea:{labelOnly:!0,references:mt}},{conditions:[],pivotArea:{labelOnly:!0,references:mt,offset:I}}],bt=[{conditions:[gt({value:0},ft),gt({value:0},j),gt({value:1},E),gt({value:1},A),gt(!0,function(M,s,y,G,K){return M&&!(0<((M=y.rowInfos)==null?void 0:M.length)||0<((M=y.colInfos)==null?void 0:M.length))})],pivotArea:{dataOnly:!0,references:tt}},{conditions:[gt(!0,Y),gt(!0,L)],pivotArea:{grandRow:!0,grandCol:!0,references:mt+vt}},{conditions:[gt({value:1},E),gt(!0,Y)],pivotArea:{grandRow:!0,references:mt+vt}},{conditions:[gt({value:1},A),gt(!0,L)],pivotArea:{grandCol:!0,references:mt+vt}},{conditions:[],pivotArea:{references:mt+vt}}],o.rangeToAreas=function(M,s){var y,G,K,c,N,V,O,pt,wt;if(M&&s){for(y=s.row,K=s.col,G=s.rowCount,V=s.colCount,O=ut(M,y,K),y=ut(M,y+G-1,K+V-1),G=O.area,K=y.area,c=function(et,ht){return ht===0?[0]:ht===1?[1]:ht===3?et===1?[1,3]:[3]:ht===2?et===1?[1,2]:[2]:ht===4?et===1?[1,2,3,4]:et===2?[2,4]:et===3?[3,4]:et===4?[4]:void 0:void 0}(G,K),N=[],c.indexOf(0)!==-1&&(V=Xt(0,M),O=s.getIntersect(V,0,0),N=function(et,ht){for(var St,$,n=[],a=ht.row;a<ht.row+ht.rowCount;a++)for(St=ht.col;St<ht.col+ht.colCount;St++)($=ut(et,a,St)).relativeColumn%3==1?n.push({labelOnly:!0,references:[{fieldName:$.pageFieldInfo.fieldName}]}):$.relativeColumn%3==0&&n.push({labelOnly:!0,type:S.PivotAreaType.button,fieldName:$.pageFieldInfo.fieldName});return n}(M,O)),pt=function(et){var ht,St,$,n,a;c.indexOf(et)!==-1&&(ht=Xt(et,M),N=et===4&&s.containsRange(ht)?N.concat(function(i){switch(i){case 1:return{dataOnly:!1,labelOnly:!0,type:S.PivotAreaType.corner};case 4:return{}}}(et)):(St=[],($=s.getIntersect(ht,0,0))&&function(i,h,b,Q,it,It){var t,r,u,d,m,R,z,ct,Tt,Ot;for((Ot=[]).push({startRow:h,startCol:b});0<Ot.length;){if(R=Ct(m=ut(Q,u=t=(z=Ot.pop()).startRow,d=r=z.startCol)),ct=void 0,(z=It.QWt)===1||z===2&&m.relativeRow===0)(z===1&&!m.cornerFieldInfo||z===2&&!m.colHeadFieldInfo)&&(d=i.col+i.colCount-1,z===1)&&t===i.row&&(u=i.row+i.rowCount-(i.rowCount===1?1:2));else{for(Tt=r+1;Tt<r+i.colCount;Tt++){if(kt(ct=m,m=ut(Q,u,Tt),u,Tt,i,R,It,!1)){d=Tt-1;break}Tt===r+i.colCount-1&&(d=Tt)}for(Tt=t+1;Tt<t+i.rowCount;Tt++){if(kt(ct=m||ct,m=ut(Q,Tt,d),Tt,d,i,R,It,!0)){u=Tt-1;break}Tt===t+i.rowCount-1&&(u=Tt)}}it.push(new Yt.Range(t,r,u-t+1,d-r+1)),u===i.row+i.rowCount-1&&d===i.col+i.colCount-1||(d===i.col+i.colCount-1?Ot.push({startRow:u+1,startCol:i.col}):Ot.push({startRow:t,startCol:d+1}))}}($,$.row,$.col,M,St,M.rZt.HWt[et]),$=ie(St,et,M),et===4&&(s.row<=ht.row&&s.rowCount>=ht.rowCount&&(n=M.getFieldsByArea(S.PivotTableFieldType.rowField).reduce(function(i,h){return i[h.fieldName]=!0,i},{}),$=$.map(function(i){var h,b,Q,it;if(i.references){for(h=[],b=0,Q=i.references;b<Q.length;b++)it=Q[b],n[it.fieldName]||h.push(it);i.references=h}return i})),s.col<=ht.col&&s.colCount>=ht.colCount&&(a=M.getFieldsByArea(S.PivotTableFieldType.columnField).reduce(function(i,h){return i[h.fieldName]=!0,i},{}),$=$.map(function(i){var h,b,Q,it;if(i.references){for(h=[],b=0,Q=i.references;b<Q.length;b++)it=Q[b],a[it.fieldName]||h.push(it);i.references=h}return i})),$.forEach(function(i){var h;((h=i.references)==null?void 0:h.length)===0&&delete i.references}),$=function(i){for(var h,b,Q=new Set,it=[],It=0,t=i;It<t.length;It++)b=Rt(h=t[It]),Q.has(b)||(Q.add(b),it.push(h));return it}($)),N.concat($)))},wt=1;wt<5;wt++)pt(wt);return N}},(nt=k=k||{})[nt.none=0]="none",nt[nt.row=1]="row",nt[nt.col=2]="col"},"./node_modules_local/@spreadjs/js-pivot/dist/gc.pivot.js":function(Ie,o,ft){var Yt,At;(function(){var S,at,X;S={"./pivot-entry.ts":function(H,f,B){var vt,mt,tt=this&&this.__createBinding||(Object.create?function(v,Ft,w,I){I===void 0&&(I=w);var U=Object.getOwnPropertyDescriptor(Ft,w);U&&("get"in U?Ft.__esModule:!U.writable&&!U.configurable)||(U={enumerable:!0,get:function(){return Ft[w]}}),Object.defineProperty(v,I,U)}:function(v,Ft,w,I){v[I=I===void 0?w:I]=Ft[w]}),_=this&&this.__exportStar||function(v,Ft){for(var w in v)w==="default"||Object.prototype.hasOwnProperty.call(Ft,w)||tt(Ft,v,w)};Object.defineProperty(f,"__esModule",{value:!0}),f.mXt=f.SR=void 0,vt=B("./src/pivotEngine.res.en.ts"),f.SR={en:vt.resource},_(B("./src/pivot-interface.ts"),f),_(B("./src/pivot-util.ts"),f),_(B("./src/pivot-condition.ts"),f),_(B("./src/pivot-cache.ts"),f),_(B("./src/data-analyzer.ts"),f),_(B("./src/pivot-engine.ts"),f),_(B("./src/pivot-calc-engine.ts"),f),mt=B("./src/pivot-sort.ts"),Object.defineProperty(f,"mXt",{enumerable:!0,get:function(){return mt.mXt}})},"./src/data-analyzer.ts":function(H,f,B){var vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y,L,q,J,P,bt,k,nt,gt,Z,ut,Rt,Ct;function Bt(n){return!(0,_.ht)(n)&&w.Common.ct.W0(n)?w.Common.ct.o0(n):n}function kt(n,a,i){if((0,_.ht)(n)&&(0,_.ht)(a))return U;if((0,_.ht)(n))return a;if((0,_.ht)(a)&&i!==4||n instanceof v.CalcError)return n;if(a instanceof v.CalcError)return a;switch(i){case 0:return n+a;case 1:return n-a;case 2:var h;return n===0||a===0?0:0*(h=n*a)!=0?v.Errors.Number:h;case 3:return a===0?v.Errors.DivideByZero:n/a;case 5:return ot(n,a);case 6:return F(n,a);case 4:return j(n)}}function ie(n){return!(0,_.ht)(n)&&E(+n)}function Xt(n,a,i,h){var b,Q,it,It,t=[],r=[],u=[],d=0;for(a!==""&&(d=(a=a.split(f.Separator)).length,t=t.concat(a)),b=0,Q=Object.keys(i);b<Q.length;b++)it=Q[b],r.push({fieldInfo:it===""?t:t.concat(it.split(f.Separator)),calcIndex:i[it]});return It=n.bXt,h.forEach(function(m,R){u[R]=It[m]}),function(m,R,z){for(var ct=m.wXt,Tt=[],Ot=function($t){var e={fieldInfos:[],calcIndex:$t.calcIndex};$t.fieldInfo.forEach(function(p,C){var W=ct.getField(z[C]);e.fieldInfos.push({fieldName:z[C],fieldItem:W.getFieldsItemList()[p]})}),Tt.push(e)},Pt=0,Jt=R;Pt<Jt.length;Pt++)Ot(Jt[Pt]);return Tt}(n,r,u=u.splice(n.gXt,d).concat(u.splice(0,n.gXt)))}function Qt(n,a){this.yXt={},this.CXt={},this.IXt={},this.CZt={},this.AXt={},this.NXt={},this.TXt={},this.MXt=!1,this.wY=[],this.DU=n,this.wXt=a}function dt(n,a,i,h,b){var Q,it;this.xXt={},this.sx={},Q=this,it=[],(0,_.o)(n,function(It,t){var r=It.index,u=It.displayName,d=It.isDim,m=It.isGroupField,R=It.getGroupItem,z=It.databaseField;It=It.dataFieldIndex,d&&(it.push({index:r,fieldName:u,isGroupField:m,getGroupItem:R,databaseField:z,dataFieldIndex:It}),Q.xXt[u]=t,Q.sx[u]=t)}),Q.DXt=it,Q.SXt=Q.kXt(a,i),Q.jXt=Q.OXt(Q.SXt),Q.PXt=Q.kXt(h,i),Q.FXt=Q.kXt(b,i,!0),Q._Xt={},Q.LXt={},Q.tx=[],Q.EXt=[]}function xt(n,a,i,h,b,Q,it,It,t,r,u,d,m){var R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x;if(!(n.YAt>=It||n.oYt.length===0)){if(R=a.wXt,ct=(z=n.oYt)[0].rYt,Tt=i[n.YAt].sourceName,Ot={},Pt=a.gXt,t[ct])for(Jt=void 0,n.YAt<Pt&&(Jt=a.RXt.columnNodeInfo),$t=0,e=st(R,Tt,it,d,b,Pt);$t<e.length;$t++)p=e[$t],Q.itemKeys&&(0,_.ht)(Q.itemKeys[p])&&(0,_.ht)(Ot[p])&&(it.push({pathStr:p,dimName:ct}),Ot[p]=1,Mt(a,i,h,b,it,It,n.YAt<a.gXt,Jt,r,u,d,m),it.pop());for(C=0,W=z;C<W.length;C++)x=W[C],(0,_.ht)(Ot[x.pathStr])&&(it.push({pathStr:x.pathStr,dimName:x.rYt}),xt(x,a,i,h,b,x.YAt===a.gXt?a.RXt.columnNodeInfo:Q.itemKeys[x.pathStr],it,It,t,r,u,d,m),it.pop())}}function Mt(n,a,i,h,b,Q,it,It,t,r,u,d){var m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p=b.length,C=n.wXt;if(p<Q){if(Pt=a[p].sourceName,m=a[p].displayName,Jt=n.gXt,it===p<n.gXt)for(R=0,z=st(C,Pt,b,u,h,Jt);R<z.length;R++)ct=z[R],b.push({pathStr:ct,dimName:m}),Mt(n,a,i,h,b,Q,it,It,t,r,u,d),b.pop();else if(p=It&&It.itemKeys,!(0,_.ht)(p))for(Tt=0,Ot=Object.keys(p);Tt<Ot.length;Tt++)ct=Ot[Tt],b.push({pathStr:ct,dimName:m}),Mt(n,a,i,h,b,Q,it,It.itemKeys[ct],t,r,u,d),b.pop()}else C=n.Nkt,Pt=n.yZt,Jt=(0,f.GXt)(),p=n.nv(),$t=Q-n.gXt,e=n.RXt,C.addChildItem(b,Jt,p,n,d,a,i,r.rootPosition,n.gXt,!1,"",!1,0,C.UZt,t,!1,e.rowNodeInfo),Pt.addChildItem(N(b,n.gXt),Jt,p,n,d,a,i,r.headerPosition,$t,!0,"",!1,0,Pt.UZt,t,!1,e.columnNodeInfo)}function st(n,a,i,h,b,Q){for(var it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut=(Et=n.getField(a)).y1||a,Kt=(Wt=i.length)<Q?0:Q,oe=b[a],ae=Wt-1;Kt<=ae;ae--)if(Ut===((it=n.getField(h[ae])).y1||h[ae])){if(It=i[ae].pathStr,t=it._by,r=Et._by,u={3:tt.DateGroupType.days,4:tt.DateGroupType.months,5:tt.DateGroupType.quarters},!(d=void 0,_.ht)(r)&&!(0,_.ht)(t)&&u[r]&&u[t])d=l(t,r,It);else if((0,_.ht)(r)&&(0,_.ht)(t))d=s(n,a,h[ae],It,b[a]);else if(It===0)d=[0];else if(it.DH().length-1===It)d=[Et.DH().length-1];else{for(m=Et.DH(),R=Et.M(),z=[],ct=0,Tt=m;ct<Tt.length;ct++)Ot=Tt[ct],z.push(R[Ot]);z.pop(),z.shift(),d=z}if(oe.isAll)return d;for(Pt={},Jt=[],$t=0,e=oe.items;$t<e.length;$t++)Pt[Ot=e[$t]]=!0;for(p=0,C=d;p<C.length;p++)Pt[W=C[p]]&&Jt.push(W);return Jt}if(oe.isAll){for(m=Et.DH(),R=Et.M(),d=[],x=0,yt=m;x<yt.length;x++)Ot=yt[x],d.push(R[Ot]);return d}if(Q=Object.keys(oe.items),Et.cC()){for(R=[],_t=0,Lt=Q;_t<Lt.length;_t++)Ot=Lt[_t],R.push(Et.AQt[Ot]);return R}return Q}function l(n,a,i){var h,b,Q,it,It;if(a<n){if(n!==tt.DateGroupType.quarters)return M(i);if(h=function(t){var r,u,d=[],m=[0,1,4,7,10,13,14];for((0,_.ht)(m[t])||(r=m[t],u=m[t+1]);r<u;r++)d.push(r);return d}(i),a!==tt.DateGroupType.days)return h;for(b=[],Q=0,it=h;Q<it.length;Q++)It=it[Q],b=b.concat(M(It));return b}return n===tt.DateGroupType.days?(It=T(i),a===tt.DateGroupType.quarters?D(It[0]):It):D(i)}function T(n){for(var a=Y.length,i=0;i<a;i++)if(Y[i]<=n&&Y[i+1]>n)return[i]}function D(n){return n===0?[0]:n===13?[5]:[Math.floor((n-1)/3)+1]}function M(n){var a,i,h=[];for((0,_.ht)(Y[n])||(a=Y[n],i=Y[n+1]);a<i;a++)h.push(a);return h}function s(n,a,i,h,b){a=n.getField(a),n=n.getField(i);var Q,it,It,t,r,u,d=[];if(a.cC())i=n.DH()[+h],it=a.VXt,It=a.AQt,Q=it&&It&&It[it[i]],(0,_.ht)(Q)||d.push(Q);else for(It=n.N[n.cx[+h]],t=a.P,r=0,u=It;r<u.length;r++)Q=t[u[r]],d.push(Q);return d}function y(n,a,i,h,b,Q,it,It,t,r){var u,d,m;for(n.YAt===a.gXt&&G(n,a,i,h,b,a.RXt.columnNodeInfo.itemKeys,Q,it,It,t,!1,r),u=0,d=n.oYt;u<d.length;u++)m=d[u],Q.push({pathStr:m.pathStr,dimName:m.rYt}),y(m,a,i,h,b,Q,it,It,t,r),Q.pop()}function G(n,a,i,h,b,Q,it,It,t,r,u,d){var m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et;if((Et=it.length)<It)if(W=Object.keys(Q),u)for(m=i[Et],R=0,z=W;R<z.length;R++)ct=z[R],it.push({pathStr:ct,dimName:m.displayName}),G(null,a,i,h,b,Q[ct].itemKeys,it,It,t,r,u,d),it.pop();else{for(Tt={},Ot=(Et=n.oYt)[0].rYt,Pt=Et[0].kYt,Jt=0,$t=Et;Jt<$t.length;Jt++)Tt[(e=$t[Jt]).pathStr]=1,Pt||(it.push({pathStr:e.pathStr,dimName:Ot}),G(e,a,i,h,b,Q[e.pathStr].itemKeys,it,It,t,r,u,d),it.pop());for(p=0,C=W;p<C.length;p++)ct=C[p],(0,_.ht)(Tt[ct])&&(it.push({pathStr:ct,dimName:Ot}),G(n,a,i,h,b,Q[ct].itemKeys,it,It,t,r,!0,d),it.pop())}else Et=a.Nkt,W=a.yZt,x=(0,f.GXt)(),yt=a.nv(),_t=It-a.gXt,Lt=a.RXt,Et.addChildItem(it,x,yt,a,d,i,h,r.rootPosition,a.gXt,!1,"",!1,0,Et.UZt,t,!1,Lt.rowNodeInfo),W.addChildItem(N(it,a.gXt),x,yt,a,d,i,h,r.headerPosition,_t,!0,"",!1,0,W.UZt,t,!1,Lt.columnNodeInfo)}function K(n){var a,i,h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut=n.subtotalManager,Kt=n.currentNode,oe=n.queryItems,ae=n.filedShowSubtotalTopInfo,te=n.positionInfo,re=n.contextList,Gt=n.rowDeep,ee=n.pathInfo,jt=n.cacheName,de=n.itemsMap,le=n.measure,se=n.level,ce=n.parentField,he=Ut.UXt(),ve=Kt&&Kt.oYt||[],me=(Kt=Ut.wXt,!0);if(!(se>=Ut.fieldNameOrders.length)){if(i=Ut.originOrders[se],Q=(Jt=Ut.QXt)[i],(h=Kt.getField(Q)).cC()){if(a=h.y1,Jt=Ut.originOrders.indexOf(Jt[a]),Ut.originOrders.indexOf(i)>Jt&&0<=Jt)return;for(it=(It=Kt.getField(a)).ty,t=0;t<ve.length;)b=ve[t],ce[a]=h.DH()[b.pathStr],ee.push({pathStr:b.pathStr,dimName:i}),n.currentNode=b,n.level=se+1,K(n),delete ce[a],ee.pop(),t++;for(r=0,u=it;r<u.length;r++)d=u[r],m=h.AQt[h.VXt[d]],(0,_.ht)(m)||(de[Q].isAll||de[Q].items[m])&&(ce[a]=d,ee.push({pathStr:m,dimName:i}),c(he,se+1,oe,ae,Ut,ee,jt,te,re,Gt,de,{fieldName:a,calcItem:d,calcLevel:It.WXt[It.M()[d]]},le,ce),ee.pop())}else for(it=h.ty,t=0;t<ve.length;)if((b=ve[t]).zXt&&!me)t+=1;else{if(it&&0<it.length&&me){for(R=0,z=it;R<z.length;R++)d=z[R],ct=h.M()[d],!de[Q].isAll&&!de[Q].items[ct]||ce[Q]&&ce[Q].indexOf(d)<0||(ee.push({pathStr:ct,dimName:i}),c(he,b.YAt,oe,ae,Ut,ee,jt,te,re,Gt,de,{fieldName:Q,calcItem:d,calcLevel:h.WXt[ct]},le,ce),ee.pop());me=!1}ee.push({pathStr:b.pathStr,dimName:i}),n.currentNode=b,n.level=se+1,K(n),ee.pop(),t++}if(!ve.length){for(Tt=0,Ot=it;Tt<Ot.length;Tt++)d=Ot[Tt],Pt=h.M()[d],(de[Q].isAll||de[Q].items[Pt])&&(ee.push({pathStr:Pt,dimName:i}),c(he,se+1,oe,ae,Ut,ee,jt,te,re,Gt,de,{fieldName:Q,calcItem:d,calcLevel:h.WXt[Pt]},le,ce),ee.pop());if(ct=[],de[Q].isAll)for(Jt=h.DH(),$t=h.M(),e=0,p=Jt;e<p.length;e++)C=p[e],ct.push($t[C]);else ct=ct.concat(Object.keys(de[Q].items));for(W=0,x=ct;W<x.length;W++){if(Pt=x[W],ee.push({pathStr:Pt,dimName:i}),n.currentNode=null,n.level=se+1,h.cC()&&(a=h.y1,yt=h.cx[Pt],m=h.AQt[yt],!(0,_.ht)(m)))for(ce[a]=[],_t=h.VXt,Lt=0,Et=Object.keys(_t);Lt<Et.length;Lt++)_t[Wt=Et[Lt]]===yt&&ce[a].push(Wt);K(n),delete ce[a],ee.pop()}}delete ce[a]}}function c(n,a,i,h,b,Q,it,It,t,r,u,d,m,R){var z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve=b.wXt,me=b.QXt;if(a<i.length)if((oe=i[a]).isDim){if(z=oe.sourceName,ct=oe.displayName,Ot=Tt=void 0,Jt=(Pt=ve.getField(z)).DH(),$t=!1,Pt.cC()){for(Tt=Pt.y1,e=ve.getField(Tt),p=0,C=Q;p<C.length;p++)if(me[(W=C[p]).dimName]===Tt){Ot=e.D[W.pathStr],$t=!0;break}Jt=$t?(R[Tt]=Ot,[Pt.VXt[Ot]]):Pt.DH()}else if((0,_.ht)(R[z])){for(x=void 0,yt=0,_t=Q;yt<_t.length;yt++)if(W=_t[yt],(x=ve.getField(b.QXt[W.dimName])).cC()&&x.y1===z){Jt=mt([],x.N[x.cx[W.pathStr]],!0);break}}else Jt=[R[z]];for(Lt=void 0,Et=0,Wt=Jt;Et<Wt.length;Et++)Ut=Wt[Et],Kt=Pt.M()[Ut],(u[z].isAll||u[z].items[Kt])&&(Pt.WXt[Kt]&&Pt.WXt[Kt]>d.calcLevel&&(Lt={fieldName:z,calcItem:Ut,calcLevel:Pt.WXt[Kt]}),Q.push({pathStr:Kt,dimName:ct}),c(n,a+1,i,h,b,Q,it,It,t,r,u,Lt||d,m,R),Lt=void 0,Q.pop());delete R[Tt]}else c(n,a+1,i,h,b,Q,it,It,t,r,u,d,m,R);else if(oe=b.ZXt(),ae=Q.length-r,te=b.nv(),re=function(Ce){for(var Pe,Ne={},Fe=0,ye=Ce;Fe<ye.length;Fe++)Ne[(Pe=ye[Fe]).dimName]=Pe.pathStr;return Ne}(Q),Kt=(0,Ft.getPathStr)(re,b.fieldNameOrders),Gt=void 0,jt=(ee=V(b,re,d,m,te)).value,O((Gt=(0,f.YXt)(0)).calc,jt),Gt.calcResult=ee.calcResult,(0,_.ht)(b.pathPool[Kt])||(te=b.pathPool[Kt],(0,_.ht)(b.wY[te][it])))for(n.addChildItem(Q,Gt,te,b,it,i,h,It.rootPosition,r,!1,"",!1,0,n.UZt,t,!0),oe.addChildItem(N(Q,r),Gt,te,b,it,i,h,It.headerPosition,ae,!0,"",!1,0,oe.UZt,t,!0),b.pathPool[Kt]=te,b.wY[te][it]=Gt,ce=0,he=m.subTotalTypes;ce<he.length;ce++)se=he[ce],pt(b,re,tt.SubtotalType[se],m.cacheName);else for(function(Ce,Pe,Ne){var Fe=(Re=Ce.calc).count,ye=Re.sum,De=Re.product,Ve=Re.max,Le=Re.min,fe=Re.sumx2,Re=Re.len;Fe=kt(Fe,Pe.count,0),ye=kt(ye,Pe.sum,0),De=kt(De,Pe.product,2),Ve=kt(Ve,Pe.max,5),Le=kt(Le,Pe.min,6),fe=kt(fe,Pe.sumx2,0),Re=kt(Re,Pe.len,0),Ce.calc={count:Fe,sum:ye,max:Ve,min:Le,sumx2:fe,product:De,len:Re},Ce.calcResult=(0,f.BXt)(Ce.calc,Ne)}(b.wY[te][it],Gt.calc,m.subTotalTypes),de=0,le=m.subTotalTypes;de<le.length;de++)se=le[de],pt(b,re,tt.SubtotalType[se],m.cacheName)}function N(n,a){return a=(n=mt([],n,!0)).splice(0,a),n.push.apply(n,a),n}function V(n,a,i,h,b){for(var Q,it,It,t=n.wXt,r=i.fieldName,u=(i=i.calcItem,{}),d={},m=(It=t.HXt).calcService,R=It.calcSource,z=t.zRt(r).sh[i].calcExpression,ct=0,Tt=h.subTotalTypes;ct<Tt.length;ct++){Q=Tt[ct];try{it=tt.SubtotalType[Q],R.setCalcInfo(it,n,a,h.cacheName,z,b),(0,_.ht)(z)?d[it]=U:d[it]=m.MX.evaluateExpression(z,R.getEvaluatorContext({row:0,col:0},!1),!1,!0,!1),isNaN(+d[it])&&(d[it]=0)}catch{d[it]=v.Errors.Reference}finally{u[it]=d[it]}}return{calcResult:u,value:d}}function O(n,a){n&&(n.count=a.countNums,n.len=a.count,n.max=a.max,n.min=a.min,n.product=a.product,n.sum=a.sum,n.sumx2=a.sum2)}function pt(n,a,i,h){var b=n.wXt,Q=n.fieldNameOrders;a=(0,Ft.getPathStr)(a,Q),(Q=b.JXt[a])&&(b=(a=b.HXt).calcService,(a=a.calcSource).setCalcInfo(i,n,Q.pathInfo,h,Q.expression),b=(0,_.ht)(Q.expression)?null:b.MX.evaluateExpression(Q.expression,a.getEvaluatorContext({row:0,col:0},!1),!1,!0,!1),isNaN(+b)&&(b=0),(a=n.wY[Q.calcResultIndex])&&a[h]&&(n.wY[Q.calcResultIndex][h].calcResult[i]=b,O(n.wY[Q.calcResultIndex][h].calc,((a={})[i]=b,a))),pt(n,Q.pathInfo,i,h))}function wt(n){for(var a,i,h,b,Q={},it=0,It=n;it<It.length;it++)if((i=It[it]).isALL)Q[i.sourceName]={isAll:i.isALL,items:null};else{for(a={},h=0,b=i.items;h<b.length;h++)a[b[h]]=1;Q[i.sourceName]={isAll:i.isALL,items:a}}return Q}function et(n,a,i,h,b,Q){return a=n.r$t(a,h,b),n=n.r$t(i,h,b),Q===tt.SortType.desc?n-a:a-n}function ht(n,a){this.NQt={},this.XXt=n,this.lp=a,this.NQt={}}function St(){}function $(n,a,i,h,b,Q,it,It){this.QZt=0,this.$Xt=0,this._Xt={},this.oYt=[],this.lYt=a,this.nodeName=n,this.rYt=it,this.zZt=b,this.SYt=Q,this.zXt=It,h||(this.HZt=i.nv())}vt=this&&this.__assign||function(){return(vt=Object.assign||function(n){for(var a,i,h=1,b=arguments.length;h<b;h++)for(i in a=arguments[h])Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i]);return n}).apply(this,arguments)},mt=this&&this.__spreadArray||function(n,a,i){if(i||arguments.length===2)for(var h,b=0,Q=a.length;b<Q;b++)!h&&b in a||((h=h||Array.prototype.slice.call(a,0,b))[b]=a[b]);return n.concat(h||Array.prototype.slice.call(a))},Object.defineProperty(f,"__esModule",{value:!0}),f.QueryNode=f.DataAnalyzer=f.PivotSlicerCache=f.PivotQueryList=f.PivotSubtotalManager=f.BXt=f.t$t=f.YXt=f.GXt=f.i$t=f.ErrorsMap=f.EmptyValue=f.Separator=void 0,tt=B("./src/pivot-interface.ts"),_=B("./src/pivot-util.ts"),v=B("CalcEngine"),Ft=B("./src/pivot-cache.ts"),w=B("Common"),B=B("./pivot-entry.ts"),B=new w.Common.ResourceManager(B.SR),I=B.getResource.bind(B),U=null,g=void 0,F=Math.min,ot=Math.max,j=Math.sqrt,E=isNaN,f.Separator="-&-",f.EmptyValue=v.Errors.Null,A="gc-empty-value",Y=[0,1,32,61,92,122,153,183,214,245,275,306,336,367,368],f.ErrorsMap={100:v.Errors.Calc,7:v.Errors.DivideByZero,29:v.Errors.Name,42:v.Errors.NotAvailable,0:v.Errors.Null,36:v.Errors.Number,23:v.Errors.Reference,99:v.Errors.Spill,15:v.Errors.Value},f.i$t=function(n,a){var i,h,b,Q,it,It,t=a.calc;!(0,_.ht)(n)&&(0,_.jh)(n)?(i=t.count,h=t.sum,b=t.max,Q=t.min,it=t.sumx2,It=t.product,t=t.len,i=kt(i,1,0),h=kt(h,n,0),b=kt(b,n,5),Q=kt(Q,n,6),it=kt(it,kt(n,n,2),0),It=kt(It,n,2),t=kt(t,n===I().blank?g:1,0),a.calc={count:i,sum:h,max:b,min:Q,sumx2:it,product:It,len:t}):a.calc.len=kt(a.calc.len,n===I().blank?g:1,0)},f.GXt=function(){return{calc:{len:U,count:U,sum:U,max:U,min:U,sumx2:U,product:U}}},f.YXt=function(n){return(0,_.ht)(n)?{calc:{sum:null}}:(0,_.jh)(n)?{calc:{len:1,count:1,sum:n,max:n,min:n,sumx2:n*n,product:n}}:n instanceof v.CalcError?{calc:{len:1,count:g,sum:n,max:n,min:n,sumx2:n,product:n}}:n===I().blank?{calc:{len:g,count:g,sum:g,max:g,min:g,sumx2:g,product:g}}:{calc:{len:1,count:0,sum:0,max:0,min:0,sumx2:0,product:0}}},f.t$t=function(n){switch(n){case tt.SubtotalType.average:return function(a){var i=a.sum;return a=a.count,i instanceof v.CalcError?i:kt(i,a,3)};case tt.SubtotalType.count:return function(a){return a.len};case tt.SubtotalType.countNums:return function(a){return a.count};case tt.SubtotalType.max:return function(a){return a.max};case tt.SubtotalType.min:return function(a){return a.min};case tt.SubtotalType.product:return function(a){return a.product};case tt.SubtotalType.stdDev:return function(a){var i=a.count,h=a.sumx2;return a=a.sum,(0,_.ht)(i)||i===0?null:(h=kt(kt(i,h,2),kt(a,a,2),1),a=kt(i,kt(i,1,1),2),i=kt(0,kt(h,a,3),5),kt(i,null,4))};case tt.SubtotalType.stdDevp:return function(a){var i=a.count,h=a.sumx2;if(a=a.sum,h=kt(kt(i,h,2),kt(a,a,2),1),a=kt(i,i,2),!(0,_.ht)(h)||!(0,_.ht)(a))return i=kt(0,kt(h,a,3),5),kt(i,null,4)};case tt.SubtotalType.sum:return function(a){return a&&a.sum};case tt.SubtotalType.varr:return function(a){var i=a.count,h=a.sumx2;return a=a.sum,(0,_.ht)(i)||i===0?null:(h=kt(kt(i,h,2),kt(a,a,2),1),a=kt(i,kt(i,1,1),2),kt(0,kt(h,a,3),5))};case tt.SubtotalType.varp:return function(a){var i=a.count,h=a.sumx2;return a=a.sum,(0,_.ht)(i)||i===0?null:(h=kt(kt(i,h,2),kt(a,a,2),1),a=kt(i,i,2),kt(0,kt(h,a,3),5))}}},L=function(n,a,i,h,b,Q){var it,It,t=n.showDataAs,r=Q.baseMinorPath,u=Q.baseMajorPath,d=Q.percentOfBasePath,m=Q.baseIndex;switch(t){case tt.PivotShowDataAs.normal:return{baseIndex:-1};case tt.PivotShowDataAs.percentOfTotal:return{baseIndex:i.n$t};case tt.PivotShowDataAs.percentOfRow:return a.zEt?{baseIndex:i.n$t}:{baseIndex:i.JZt(a.zZt,!1)};case tt.PivotShowDataAs.percentOfCol:return a.zEt?{baseIndex:i.n$t}:{baseIndex:i.JZt(a.SYt,!0)};case tt.PivotShowDataAs.percent:case tt.PivotShowDataAs.difference:case tt.PivotShowDataAs.percentDiff:return{baseMinorPath:r,baseMajorPath:u};case tt.PivotShowDataAs.percentOfParentRow:return{parentPath:b,minorPath:a.SYt};case tt.PivotShowDataAs.percentOfParentCol:return{baseIndex:a.YAt>h?a.e$t:a.HZt};case tt.PivotShowDataAs.percentOfParent:return-1<n.baseRootLevel?{percentOfBasePath:d,minorPath:a.SYt}:{baseIndex:m,percentOfBasePath:d};case tt.PivotShowDataAs.runTotal:case tt.PivotShowDataAs.percentOfRunningTotal:case tt.PivotShowDataAs.rankAscending:case tt.PivotShowDataAs.rankDescending:return{baseMinorPath:r,baseMajorPath:u};case tt.PivotShowDataAs.index:return It=it=void 0,a.zEt?(it=i.n$t,It=i.n$t):(it=i.JZt(a.zZt,!1),It=i.JZt(a.SYt,!0),(0,_.ht)(it)&&(it=i.n$t),(0,_.ht)(It)&&(It=i.n$t)),{rowTotalIndex:it,colTotalIndex:It}}},q=function(n,a,i,h,b,Q,it){b=b.indexInfo;var It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p=n.CZt[it];if(b&&(It=b.baseIndex,t=b.parentPath,r=b.minorPath,u=b.rowTotalIndex,d=b.colTotalIndex,m=b.baseMinorPath,R=b.baseMajorPath,z=b.percentOfBasePath,ct=!1,p))switch(Ot=Tt=void 0,p.showDataAs){case tt.PivotShowDataAs.normal:return n.r$t(i,a,h);case tt.PivotShowDataAs.percentOfTotal:return Tt=n.r$t(i,a,h),Ot=n.r$t(n.n$t,a,h),E(+Tt)?Tt:E(+Ot)?Ot:Ot===0?v.Errors.DivideByZero:Tt/Ot;case tt.PivotShowDataAs.percentOfRow:case tt.PivotShowDataAs.percentOfCol:return Tt=n.r$t(i,a,h),Ot=n.r$t(It,a,h),(0,_.ht)(Tt)&&(Tt=0),(0,_.ht)(Ot)||Ot===0?v.Errors.DivideByZero:E(+Tt)?Tt:E(+Ot)?Ot:Tt/Ot;case tt.PivotShowDataAs.percentOfParentCol:return Tt=n.r$t(i,a,h),Ot=n.r$t(It,a,h),E(+Tt)?v.Errors.Value:E(+Ot)?Ot:Ot===0?v.Errors.DivideByZero:Tt/Ot;case tt.PivotShowDataAs.percent:return(0,_.ht)(n.bXt[n.CZt[it].baseFieldName])?v.Errors.NotAvailable:(Jt=Pt=!(e=void 0),p.baseRootLevel>Q?A:($t=n.WZt(m))?$t.level===0&&p.isHeaderOfPercentOrDiff?A:(e=$t.indexList[R],ie(Tt=n.r$t(i,a,h))?Tt:(ct=(0,_.ht)(Tt),e===i?ct?A:1:(ct&&(Pt=!1),(0,_.ht)(e)?f.EmptyValue:!p.isNextOrPrevious&&n.o$t(e,a)?v.Errors.NotAvailable:ie(Ot=n.r$t(e,a,h))?Ot:((0,_.ht)(Ot)&&(Jt=!1),Pt?Jt?Ot===0?v.Errors.DivideByZero:Tt/Ot:A:f.EmptyValue)))):v.Errors.NotAvailable);case tt.PivotShowDataAs.percentOfParentRow:return $t=n.WZt(r).indexList[t],Tt=n.r$t(i,a,h)||0,Ot=n.r$t($t,a,h),ie(Tt)||ie(Ot)?v.Errors.Value:(0,_.ht)(Ot)?A:Ot===0?v.Errors.DivideByZero:Tt/Ot;case tt.PivotShowDataAs.percentOfParent:if((0,_.ht)(n.bXt[n.CZt[it].baseFieldName]))return v.Errors.NotAvailable;if(-1<p.baseRootLevel){if(!(e=n.WZt(r)))return v.Errors.NotAvailable;if(Pt=e.indexList[z],ie(Tt=n.r$t(i,a,h)))return Tt;if(p.baseRootLevel+1>=Q)return(0,_.ht)(Tt)?A:1;if(ie(Ot=n.r$t(Pt,a,h)))return v.Errors.Value;if((0,_.ht)(Ot))return A}else if(Tt=n.r$t(i,a,h),Ot=n.r$t(It,a,h),(0,_.ht)(It))return E(+Ot)?A:v.Errors.Value;return Ot===0?v.Errors.DivideByZero:Tt/Ot;case tt.PivotShowDataAs.difference:return(0,_.ht)(n.bXt[n.CZt[it].baseFieldName])?v.Errors.NotAvailable:(Jt=void 0,p.baseRootLevel>Q?A:($t=n.WZt(m))?$t.level===0&&p.isHeaderOfPercentOrDiff?A:(Jt=$t.indexList[R],(Tt=n.r$t(i,a,h))instanceof v.CalcError?Tt:(0,_.ht)(Jt)||n.o$t(Jt,a)&&!p.isNextOrPrevious?v.Errors.NotAvailable:(Ot=n.r$t(Jt,a,h))instanceof v.CalcError?Ot:(Tt=0*Tt!=0?0:Tt)-(Ot=0*Ot!=0?0:Ot)):v.Errors.NotAvailable);case tt.PivotShowDataAs.percentDiff:return(0,_.ht)(n.bXt[n.CZt[it].baseFieldName])?v.Errors.NotAvailable:(e=void 0,p.baseRootLevel>Q?A:(Pt=n.WZt(m))?Pt.level===0&&p.isHeaderOfPercentOrDiff||(e=Pt.indexList[R])===i?A:ie(Tt=n.r$t(i,a,h))?Tt:(0,_.ht)(Tt)?f.EmptyValue:(0,_.ht)(e)||!p.isNextOrPrevious&&n.o$t(e,a)?v.Errors.NotAvailable:ie(Ot=n.r$t(e,a,h))?Ot:(0,_.ht)(Ot)?A:Ot===0?v.Errors.DivideByZero:(Tt-Ot)/Ot:v.Errors.NotAvailable);case tt.PivotShowDataAs.runTotal:if((0,_.ht)(n.bXt[n.CZt[it].baseFieldName]))return v.Errors.NotAvailable;if(Tt=n.r$t(i,a,h),-1<p.baseRootLevel){if(Q<p.baseRootLevel+1)return A}else if(n.WZt(r).level>p.baseHeaderLevel+1)return Tt;return(0,_.ht)(Tt)&&(Tt=0),Ot=n.a$t(it,R,m),E(+Ot)||(E(+Tt)?Ot=Tt:Ot+=Tt,n.s$t(it,R,m,Ot)),Ot;case tt.PivotShowDataAs.percentOfRunningTotal:return(0,_.ht)(n.bXt[n.CZt[it].baseFieldName])?v.Errors.NotAvailable:-1<p.baseRootLevel&&Q<p.baseRootLevel+1?A:(Tt=n.r$t(i,a,h),(0,_.ht)(Tt)&&(Tt=0),Ot=n.a$t(it,R,m),E(+Ot)?Ot:(E(+Tt)?Ot=Tt:Ot+=Tt,n.s$t(it,R,m,Ot),($t=n.u$t(it,R,m))===0||E(+$t)?(n.s$t(it,R,m,v.Errors.DivideByZero),v.Errors.DivideByZero):Ot/$t));case tt.PivotShowDataAs.rankAscending:return(0,_.ht)(n.bXt[n.CZt[it].baseFieldName])?v.Errors.NotAvailable:!(-1<p.baseRootLevel&&Q<p.baseRootLevel+1)&&(Jt=n.r$t(i,a,h),Pt=n.c$t(it,R,m))?Pt[Jt]:A;case tt.PivotShowDataAs.rankDescending:return(0,_.ht)(n.bXt[n.CZt[it].baseFieldName])?v.Errors.NotAvailable:!(-1<p.baseRootLevel&&Q<p.baseRootLevel+1)&&(e=n.r$t(i,a,h),$t=n.c$t(it,R,m))?$t[e]:A;case tt.PivotShowDataAs.index:return Tt=n.r$t(i,a,h),Pt=n.r$t(n.n$t,a,h),Jt=n.r$t(u,a,h),$t=n.r$t(d,a,h),Tt===0?0:E(+Tt)?Tt:E(+Pt)?Pt:E(+Jt)?Jt:E(+$t)?$t:(e=Jt*$t)==0?v.Errors.DivideByZero:Tt*Pt/e}},f.BXt=function(n,a){var i={};return(0,_.o)(a,function(h){i[tt.SubtotalType[h]]=(0,f.t$t)(h)(n)}),i},J=function(n){return n===tt.PivotShowDataAs.percentOfRunningTotal||n===tt.PivotShowDataAs.rankAscending||n===tt.PivotShowDataAs.rankDescending},P=function(n,a,i,h,b){var Q,it=n.oYt,It=n.nodeName,t=b=b===void 0?"":b;if(i||(t!==""&&(t+=f.Separator),t+=It),(0,_.o)(it,function(r){P(r,a,!1,h,t)}),a[t]=n.HZt,!n.kYt&&h.MXt&&n.UZt)for(Q in n.UZt)J(h.CZt[Q].showDataAs)&&h.l$t(Q,t,n.UZt[Q].baseMinorPath)},bt=function(n,a,i){var h,b,Q,it=[];if(n.YAt<a&&0<n.oYt.length)for(h=0,b=n.oYt;h<b.length;h++)Q=b[h],Q=bt(Q,a,i).slice(0),it.push.apply(it,Q);else if(n.YAt===a)return P(n,n={},!0,i),[n];return it},k=function(n,a,i,h,b){var Q,it,It,t,r,u,d,m,R,z,ct,Tt=n.f$t;for(Q in Tt)if(Tt.hasOwnProperty(Q))for(m in It=(it=n.CZt[Q]).cacheName,t=it.subtotalText,r=it.showDataAs,u=Tt[Q],d=h?i:u)d.hasOwnProperty(m)&&(z=a[Q].baseMajorPath,R=h?u[m]||m:u[m],ct=i[m],(0,_.ht)(ct)||(r===tt.PivotShowDataAs.percentOfRunningTotal?n.h$t(Q,R,z,ct,It,t):n.v$t(Q,R,z,ct,It,t)))},nt=function(n,a,i,h,b,Q,it,It,t){i=bt(a,i,n);var r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le,se,ce,he,ve,me,Ce,Pe=n.MXt;if(i&&i.length===1){if(t)for(r=Xt(n,a.zZt,i[0],It),u=0,d=h;u<d.length;u++)for(R=0,z=(m=d[u]).subTotalTypes;R<z.length;R++)for(ct=z[R],Tt=0,Ot=r;Tt<Ot.length;Tt++)Jt={fieldInfos:(Pt=Ot[Tt]).fieldInfos,valueInfo:{sourceName:m.cacheName,subtotalType:ct}},$t=it.tQt(Jt),e=n.d$t(Pt.calcIndex),(0,_.ht)($t)||(a.p$t(ct,e[m.cacheName].calc,$t),a.p$t(ct,e[m.cacheName].calcResult,$t));n.m$t(a.zZt,{indexList:i[0],level:a.YAt,visible:a.jft,collapse:a.b$t,baseSubtotalInfo:a.UZt,parentPath:b}),Pe&&k(n,a.UZt,i[0],!1)}else{for(p={},x=[],yt={},(0,_.o)(h,function(Ne){x.push(Ne.cacheName),yt[Ne.cacheName]=Ne.isCalculatedField}),_t=0,Lt=i;_t<Lt.length;_t++)for(Wt in Et=Lt[_t])if(Et.hasOwnProperty(Wt))for(p[Wt]||(p[Wt]={}),Ut=0,Kt=x;Ut<Kt.length;Ut++)oe=Kt[Ut],C=(C=(ae=(ae=n.d$t(p[Wt]))||{})[oe])||{},(W=n.d$t(Et[Wt])&&n.d$t(Et[Wt])[oe])&&W.calc&&(C.calc?yt[oe]?(Q.g$t(it,ae,oe),C.calc=ae[oe].calc):(re=C.calc,te=W.calc,C.calc={count:kt(re.count,te.count,0),sum:kt(re.sum,te.sum,0),max:kt(re.max,te.max,5),min:kt(re.min,te.min,6),sumx2:kt(re.sumx2,te.sumx2,0),product:kt(re.product,te.product,2),len:kt(re.len,te.len,0)}):C.calc=W.calc),re=n.nv(),p[Wt]=re,ae[oe]=C,n.w$t(re,a.zZt,ae);if(t)for(r=Xt(n,a.zZt,p,It),Gt=0,ee=h;Gt<ee.length;Gt++)for(de=(jt=ee[Gt]).subTotalTypes,oe=jt.cacheName,le=0,se=de;le<se.length;le++)for(ct=se[le],ce=0,he=r;ce<he.length;ce++)Jt={fieldInfos:(Pt=he[ce]).fieldInfos,valueInfo:{sourceName:oe,subtotalType:ct}},$t=it.tQt(Jt),e=n.d$t(Pt.calcIndex),(0,_.ht)($t)||a.p$t(ct,e[oe].calc,$t);for(Wt in p)if(p.hasOwnProperty(Wt))for(ve=0,me=h;ve<me.length;ve++)de=(Ce=me[ve]).subTotalTypes,oe=Ce.cacheName,(Ce=(n.d$t(p[Wt])||{})[oe]).collapse=n.o$t(n.yXt[Wt],oe),Ce.calcResult=(0,f.BXt)(Ce.calc,de),Ce.hasEffectChild=!0;Pe&&k(n,a.UZt,p,!0,a.zEt),i=a.jft,t=a.b$t,n.m$t(a.zZt,{indexList:p,level:a.YAt,visible:i,collapse:t,baseSubtotalInfo:a.UZt,parentPath:b})}},Qt.prototype.getFieldCalcItem=function(n,a,i,h,b,Q){var it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt=(_t=this).fieldNameOrders;if(!_t.checkCalcInfo(n,i))throw new Error;for(t={},r=0,u=_t.wXt,x=Object.keys(i),R=[],z=_t.QXt,ct=m=0,Tt=x;ct<Tt.length;ct++)t[Ot=Tt[ct]]=i[Ot],It=i[Ot],it=u.getField(z[Ot]),(0,_.ht)(n[z[Ot]])?it.cC()&&(Pt=it.y1,R.push({groupName:Ot,originName:Pt})):It=it.y$t(n[z[Ot]]),it.WXt[It]&&(r++,_t.fieldLabelItems[z[Ot]])&&!_t.fieldLabelItems[z[Ot]][It]&&it.WXt[It]>m&&(d=it.sh[n[z[Ot]]].calcExpression,m=it.WXt[It]),t[Ot]=It;for(Jt=0,$t=R;Jt<$t.length;Jt++)e=(p=$t[Jt]).groupName,p=p.originName,C=u.getField(p),it=u.getField(e),W=(0,_.ht)(t[z[p]])?n[p]:C.DH()[t[z[p]]],t[e]=it.AQt[it.VXt[W]];return d?(yt=(x=u.HXt).calcService,(x=x.calcSource).setCalcInfo(h,_t,t,b,d,Q),(0,_.ht)(d)?U:yt.MX.evaluateExpression(d,x.getEvaluatorContext({row:0,col:0},!1),!1,!0,!1)):(yt=_t.getCalcValueImp(t,h,b))!==void 0?yt:0<r&&(0,Ft.getPathStr)(i,Lt)!==(0,Ft.getPathStr)(t,Lt)?void _t.wXt.setUntreatedNodeInfo(t,i,_t.fieldNameOrders,a,Q):0},Qt.prototype.checkCalcInfo=function(n,a){for(var i,h,b,Q,it=(n=Object.keys(n),this.QXt),It=Object.keys(a),t=this.wXt,r={},u=0,d=It;u<d.length;u++)i=d[u],(i=t.getField(it[i]))&&!(0,_.ht)(i.y1)&&(r[i.y1]=!0);for(h=0,b=n;h<b.length;h++)if(Q=b[h],(0,_.ht)(a[it[Q]])&&(0,_.ht)(r[Q]))return!1;return!0},Qt.prototype.getCalcValueImp=function(n,a,i){var h,b,Q,it,It,t,r,u,d=(u=this).fieldNameOrders;return n=(0,Ft.getPathStr)(n,d),d=u.pathPool[n],(0,_.ht)(d)?(r=u.LXt,h=u.EXt,d=r[n],(0,_.ht)(d)?void 0:(n=(r=h[d].subtotal[i].calc).count,b=r.sum,Q=r.max,it=r.min,It=r.sumx2,t=r.product,r=r.len,h[d].subtotal[i].calcResult=(0,f.BXt)({count:n,sum:b,max:Q,min:it,sumx2:It,product:t,len:r},[tt.SubtotalType[a]]),h[d].subtotal[i].calcResult[a])):(n=u.wY[d]&&u.wY[d][i])&&n.calcResult[a]},Qt.prototype.buildCalcItemInfo=function(n,a,i,h,b){var Q,it,It,t,r,u,d,m,R,z,ct,Tt;for(function(Ot,Pt){var Jt;(0,_.ht)(Pt)||Pt.length<1||(Jt=Ot.wY,(0,_.o)(Pt,function($t){for(var e,p,C,W,x,yt,_t,Lt,Et=$t.cacheName,Wt=$t.subTotalTypes,Ut=($t.isCalculatedField,0),Kt=Jt;Ut<Kt.length;Ut++)p=(Lt=(e=Kt[Ut])[Et].calc).count,C=Lt.sum,W=Lt.max,x=Lt.min,yt=Lt.sumx2,_t=Lt.product,Lt=Lt.len,e[Et].calcResult=(0,f.BXt)({count:p,sum:C,max:W,min:x,sumx2:yt,product:_t,len:Lt},Wt)}))}(Tt=this,a),Tt.pathPool=vt({},n._Xt),Tt.LXt=n.LXt,Tt.EXt=n.EXt,Q=Tt.C$t||{},it=[],t=It=0,r=b;t<r.length;t++)it[r[t]]=i[It],It++;for(Tt.fieldNameOrders=it,Tt.originOrders=mt([],i,!0),Tt.wXt.JXt={},Tt.fieldLabelItems={},Tt.QXt={},u=0,d=h;u<d.length;u++)if(m=d[u],Tt.QXt[m.displayName]=m.sourceName,Tt.QXt[m.sourceName]=m.displayName,Q[m.sourceName]=!m.isHeader,!m.isALL){for(R={},z=0,ct=m.items;z<ct.length;z++)R[ct[z]]=!0;Tt.fieldLabelItems[m.sourceName]=R}Tt.C$t=Q},Qt.prototype.destroyCalcItemInfo=function(){var n=this;n.pathPool=null,n.LXt=null,n.EXt=null,n.fieldNameOrders=null,n.originOrders=null,n.fieldLabelItems=null,n.wXt.JXt=null},Qt.prototype.sf=function(n,a){return n=this.bXt[n]||n,a&&a[n]||this.wXt.zRt(n).sf()},Qt.prototype.I$t=function(n,a,i){for(var h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C=!1,W=[],x={},yt=0,_t=n;yt<_t.length;yt++)Q=-1,it=(ct=_t[yt]).showDataAs,It=ct.baseFieldItemType,t=ct.baseFieldName,r=ct.baseFieldItem,u=ct.baseFieldItemShared,d=ct.fieldName,m=ct.cacheName,Tt=ct.subtotalType,C=!(b=void 0),R=i.indexOf(t),z=a.indexOf(t),t&&(b=-1<z,Q=i.concat(a).indexOf(t)+1),h=this.A$t(ct),ct=tt.SubtotalType[Tt],Tt=it===tt.PivotShowDataAs.percentOfParent,Ot=it===tt.PivotShowDataAs.rankAscending||it===tt.PivotShowDataAs.rankDescending,Jt=(Pt=it===tt.PivotShowDataAs.runTotal||it===tt.PivotShowDataAs.percentOfRunningTotal)||Ot,$t=this.N$t(it,It),e=it===tt.PivotShowDataAs.difference||it===tt.PivotShowDataAs.percentDiff||it===tt.PivotShowDataAs.percent,p=Math.pow(2,0),W.push(p={showDataAsIndex:p,needBuildBasePath:h,showDataAs:it,baseFieldItemType:It,isNextOrPrevious:$t,baseFieldName:t,baseFieldItem:r,baseFieldItemShared:u,isDifferenceOrPercent:e,isRankShowDataAs:Ot,cacheName:m,isHeaderOfPercentOrDiff:b,subtotalText:ct,baseRootLevel:R,baseHeaderLevel:z,fieldName:d,needBuildPercentOfPath:Tt,actualBaseLevel:Q,needBuildRunningTotalOrRankPath:Jt}),this.CZt[d]=p,Pt&&(this.AXt[d]={}),Ot&&(this.MXt=!0,this.f$t||(this.f$t={}),this.f$t[d]={},this.TXt[d]={},x[m]||(x[m]=[]),x[m].push(d)),$t&&((0,_.ht)(this.T$t)&&(this.T$t=[]),this.T$t.push(d)),it===tt.PivotShowDataAs.percentOfRunningTotal&&(this.f$t||(this.f$t={}),this.f$t[d]={},this.NXt[d]={},this.MXt=!0,x[m]||(x[m]=[]),x[m].push(d));return this.M$t={},this.x$t=x,this.D$t=C,W},Qt.prototype.N$t=function(n,a){return(n===tt.PivotShowDataAs.difference||n===tt.PivotShowDataAs.percentDiff||n===tt.PivotShowDataAs.percent)&&a!==tt.PivotShowDataAsBaseItemType.item},Qt.prototype.l$t=function(n,a,i){this.f$t[n][a]=i},Qt.prototype.a$t=function(n,a,i){return(n=this.AXt[n])[a=a+"||"+i]||(n[a]={val:0}),n[a].val||0},Qt.prototype.u$t=function(n,a,i){return this.NXt[n][a+"||"+i].cursor},Qt.prototype.h$t=function(n,a,i,h,b,Q){this.o$t(h,b)||(h=this.r$t(h,b,Q),this.NXt[n][b=a+"||"+i]||(this.NXt[n][b]={cursor:0}),this.NXt[n][b].cursor+=h)},Qt.prototype.s$t=function(n,a,i,h){this.AXt[n][a+"||"+i].val=h},Qt.prototype.c$t=function(n,a,i){return a=a+"||"+i,(i=this.TXt[n])[a]||(i[a]=0),i[a]},Qt.prototype.v$t=function(n,a,i,h,b,Q){this.o$t(h,b)||(h=this.r$t(h,b,Q),this.TXt[n][b=a+"||"+i]||(this.TXt[n][b]={}),this.TXt[n][b][h]=1)},Qt.prototype.S$t=function(){var n,a,i,h;for(n in this.TXt)if(this.TXt.hasOwnProperty(n))for(h in a=this.TXt[n],i=this.CZt[n].showDataAs===tt.PivotShowDataAs.rankAscending?1:-1,a)a.hasOwnProperty(h)&&(a[h]=(0,_.k$t)(a[h],i))},Qt.prototype.A$t=function(n){var a=n.showDataAs,i=(n=n.baseFieldItemType,!1);return a!==tt.PivotShowDataAs.percent&&a!==tt.PivotShowDataAs.difference&&a!==tt.PivotShowDataAs.percentDiff?i:n===tt.PivotShowDataAsBaseItemType.item},Qt.prototype.j$t=function(n){this.Nkt=n,this.n$t=n.HZt,n.e$t=n.HZt},Qt.prototype.UXt=function(){return this.Nkt},Qt.prototype.O$t=function(n){this.yZt=n,this.P$t=n.HZt,n.e$t=n.HZt},Qt.prototype.m$t=function(n,a){this.IXt[n]=a},Qt.prototype.F$t=function(n,a,i){var h,b,Q;if((Q=this).RXt={columnNodeInfo:null,rowNodeInfo:null},!(0,_.ht)(a)&&0<Object.keys(a).length||i)Q.RXt.columnNodeInfo={},Q.RXt.rowNodeInfo={};else if(!(0,_.ht)(n)&&0<n.length){for(h=0,b=n;h<b.length;h++)if(b[h].showDataAs!==tt.PivotShowDataAs.normal)return Q.RXt.columnNodeInfo={},void(Q.RXt.rowNodeInfo={})}},Qt.prototype.WZt=function(n){return this.IXt[n]},Qt.prototype.ZXt=function(){return this.yZt},Qt.prototype.nv=function(){var n=this.DU;return this.DU=n+1,n},Qt.prototype._$t=function(n){return this.D$t[n]},Qt.prototype.d$t=function(n){return this.wY[n]},Qt.prototype.r$t=function(n,a,i){return(n=this.d$t(n)&&this.d$t(n)[a].calcResult)&&(0,_.ht)(n[i])&&n instanceof v.CalcError?n:n&&n[i]},Qt.prototype.o$t=function(n,a){return this.d$t(n)&&this.d$t(n)[a].collapse},Qt.prototype.vZt=function(n,a,i,h,b,Q){return this.CZt[Q]?q(this,a,n,i,h,b,Q):this.r$t(n,a,i)},Qt.prototype.JZt=function(n,a){return(a?this.CXt:this.yXt)[n]},Qt.prototype.L$t=function(n,a,i,h){h?this.w$t(n,a,i):this.E$t(n,a,i)},Qt.prototype.E$t=function(n,a,i){this.wY[n]=i,this.yXt[a]=n},Qt.prototype.B$t=function(n,a){this.wY[n]=a},Qt.prototype.w$t=function(n,a,i){this.wY[n]=i,this.CXt[a]=n},Qt.prototype.L0=function(){var n=this;n.wY=U,n.DU=0,n.yXt=U,n.CXt=U,n.Nkt=U,n.yZt=U,n.CZt=U,n.wXt=U,n.D$t=!1,n.R$t=U,n.bXt=U,n.AXt=U,n.NXt=U,n.TXt=U,n.M$t=U,n.T$t=U,n.x$t=U,n.G$t=U,n.V$t=U,n.f$t=U},gt=Qt,f.PivotSubtotalManager=gt,dt.prototype.kXt=function(n,a,i){var h,b={},Q=[];for(h in(0,_.o)(n,function(it,It){var t=it.cacheName,r=it.index,u=it.subTotalType;it=it.cacheFieldType,function(d,m){return!(!(m=m.getField(d))||(0,_.ht)(m.D5))}(t,a)&&(u=tt.SubtotalType.sum),b[r]?b[r].subTotalTypes.push(u):(b[r]={cacheName:t,index:r,subTotalTypes:[u],isCalculatedField:i,cacheFieldType:it},a.Pq[t]&&!(0,_.isEmptyObject)(a.Pq[t].P)&&a.Pq[t].D&&0<a.Pq[t].D.length&&(b[r].itemsKeyList=a.Pq[t].D))}),b)b.hasOwnProperty(h)&&Q.push(b[h]);return Q},dt.prototype.OXt=function(n){for(var a={},i=0,h=n.length;i<h;i++)a[n[i].cacheName]=i;return a},dt.prototype.L0=function(){var n=this;n._Xt=U,n.SXt=U,n.jXt=U,n.PXt=U,n.FXt=U,n.tx=U,n.DXt=U,n.xXt=U,n.sx=U},dt.prototype.U$t=function(n,a,i,h,b){for(var Q,it,It,t,r={},u=0,d=this.PXt;u<d.length;u++)Q=(t=d[u]).cacheName,it=t.index,It=t.itemsKeyList,t=t.cacheFieldType,r[Q]||(t=b?null:this.alr(t,It?It[n[it]]:n[it]),r[Q]=b?(0,f.GXt)():(0,f.YXt)(t));return i=[i],h?this.EXt.push({path:a,indexes:i,subtotal:r})-1:this.tx.push({path:a,indexes:i,subtotal:r})-1},dt.prototype.alr=function(n,a){return n===tt.PivotDataType.date?Bt(new Date(a)):a},dt.prototype.addItem=function(n,a,i,h){for(var b,Q,it,It,t,r,u,d=this.DXt,m=(h=h&&h.Q$t||{},[]),R=[],z=i?this.LXt:this._Xt,ct=0,Tt=d;ct<Tt.length;ct++)b=(t=Tt[ct]).fieldName,Q=t.index,it=t.isGroupField,It=t.getGroupItem,r=t.databaseField,t=t.dataFieldIndex,r=r===!1?n[t]:n[Q],it&&(r=It(r)),m.push(b+"&"+r),R.push(r);u=z[d=m.join(f.Separator)],h=!!h[a],(0,_.ht)(u)?z[d]=this.U$t(n,R,a,i,h):this.dRt(u,n,a,i,h)},dt.prototype.dRt=function(n,a,i,h,b){var Q,it,It,t,r,u,d;if((d=(h?this.EXt:this.tx)[n]).indexes.push(i),h=this.PXt,!b)for(Q=0,it=h;Q<it.length;Q++)It=(u=it[Q]).cacheName,t=u.index,r=u.itemsKeyList,u=u.cacheFieldType,u=this.alr(u,r?r[a[t]]:a[t]),(0,f.i$t)(u,d.subtotal[It])},dt.prototype.W$t=function(n){for(var a,i=this.sx,h=[],b=0,Q=n.length;b<Q;b++)a=n[b],(0,_.ht)(i[a])||h.push(i[a]);return h},dt.prototype.z$t=function(n,a){var i=this;return n.map(function(h){return{pathStr:a[h],dimName:i.DXt[h].fieldName}})},dt.prototype.out=function(n,a,i,h,b,Q,it,It,t,r,u,d,m,R,z){var ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de,le=this,se=new gt(this.tx.length,n),ce=n.Z$t&&!n.Z$t.isEmpty(),he=new Ct("","",se,!1,"","",""),ve=new Ct("","",se,!1,"","","");if(se.j$t(he),se.O$t(ve),se.F$t(r,m,ce),se.collapseItems=it,ct=se.I$t(r,i,h),Tt=h.length,se.gXt=Tt,ve.YAt=0,he.YAt=0,he.zEt=!0,he.jft=!1,ve.jft=!1,ve.zEt=!0,r&&0<r.length&&he.Y$t(se,ct,Tt,"",{},0),Ot=this.W$t(a),Pt=this.W$t(i.concat(h)),W=Q.valuePositionInfo,Jt=Q.insertBlankLineAfterEachItem,$t=Q.grandTotalPosition,e=Q.subTotalsPosition,p=Q.valueFieldLength,Q=U,Q=W.positionIndex,C=W.positionType,W=W.display,yt=x=-1,(1<(_t=this.SXt.length)||_t===1&&1<this.SXt[0].subTotalTypes.length)&&W&&(C===tt.DataPosition.col&&(yt=Q)===0&&(ve.eYt=!0),C===tt.DataPosition.row)&&(x=Q)===0&&(he.eYt=!0),this.H$t(he,ve,Ot,Pt,b,R,x,yt,se,Tt,ct,it),_t=le.PXt.concat(le.FXt),se.wXt.hasCalcItem(b)&&(se.buildCalcItemInfo(this,_t,a,b,Ot),function(me,Ce,Pe,Ne,Fe,ye,De,Ve){for(var Le,fe={subtotalManager:me,queryItems:Ce,positionInfo:Ne,contextList:Fe,rowDeep:ye,pathInfo:[],cacheName:null,filedShowSubtotalTopInfo:Pe,itemsMap:Ve,measure:null,currentNode:me.UXt(),level:0,parentField:{}},Re=0,Ke=De;Re<Ke.length;Re++)Le=Ke[Re],fe.cacheName=Le.cacheName,fe.measure=Le,fe.level=0,K(fe)}(se,b,R,{rootPosition:x,headerPosition:yt},ct,Tt,_t,wt(b)),se.destroyCalcItemInfo()),0<_t.length&&(m&&0<Object.keys(m).length&&this.J$t(se,b,R,wt(b),m,ct,{rootPosition:x,headerPosition:yt},Pt.length,_t),function(me){var Ce,Pe;if(!(0,_.ht)(me)){for(Ce=0,Pe=me;Ce<Pe.length;Ce++)if(Pe[Ce].showDataAs!==tt.PivotShowDataAs.normal)return 1}}(r)||ce)&&function(me,Ce,Pe,Ne,Fe,ye,De,Ve){var Le,fe,Re,Ke,lo=me.Nkt;if((Ke=me.gXt)!==0&&De-Ke!=0)for(Le=[],fe=0,Re=Ve;fe<Re.length;fe++)y(lo,me,Ce,Pe,Ne,Le,De,Fe,ye,Re[fe].cacheName)}(se,b,R,wt(b),ct,{rootPosition:x,headerPosition:yt},Pt.length,_t),Lt=this.jXt,Ut={},Kt={},oe={},(Wt=!(Et={}),_.o)(b,function(me){var Ce,Pe,Ne=me.displayName,Fe=me.sourceName,ye=me.valueFilter;me=me.sortInfo,ye&&(Ce=ye.conditionBySourceName,Pe=ye.condition,ye=It[ye.conditionByName],Et[Ne]={valueFieldName:Ce,condition:Pe,subTotalType:ye},Wt=!0),me&&me.sortValueFieldName&&(Ut[Ne]={subtotalText:me.sortValueSubtotalText,cacheName:me.cacheName,sortByPivotReferences:me.sortByPivotReferences,sortByHeader:me.sortByHeader,sortType:me.sortType}),oe[Kt[Ne]=Fe]=Ne}),b=U,se.R$t=Ut,se.bXt=Kt,se.G$t=u,se.V$t=d,ae={},Wt)for(re=te=void 0,Gt=0,ee=t;Gt<ee.length;Gt++)jt=ee[Gt],jt=Et[re=oe[jt]],de=this.SXt[Lt[jt&&jt.valueFieldName]],(0,_.ht)(de)||(-1<(te=i.indexOf(re))?ve:(te=h.indexOf(re),he)).q$t(de,re,jt,ae,te,se);return he.K$t(_t,ae,se,!1,Tt,"",le,n,ce?{}:U),ve.K$t(_t,ae,se,!0,i.length,"",le,n,ce?{}:U,a),se.S$t(),se.filedShowSubtotalInfo=z,ve.X$t(i.length,{},{insertBlankLineAfterEachItem:Jt,grandTotalPosition:$t,subTotalsPosition:e,valueFieldLength:p,valuePosition:yt},!0,it,se),i.length===0&&(ve.KZt=0,ve.vYt=yt!==-1?p:1,ve.wYt=0,ve.yYt=yt!==-1?p:1,ve.XZt=yt!==-1?p:1,ve.$Zt=yt!==-1?p:1),ve.qZt=i.length,he.X$t(Ot.length-i.length,{},{insertBlankLineAfterEachItem:Jt,grandTotalPosition:$t,subTotalsPosition:e,valueFieldLength:p,valuePosition:x},!1,it,se),Ot.length-i.length==0&&(he.KZt=0,he.vYt=x!==-1?p:0,he.wYt=x!==-1?p:1,he.yYt=x!==-1?p:0,he.XZt=x!==-1?p:0,he.$Zt=x!==-1?p:1,p===0)&&(he.$Zt=0,he.wYt=0),se},dt.prototype.H$t=function(n,a,i,h,b,Q,it,It,t,r,u,d){var m,R=this,z=this.SXt.length,ct=this.tx,Tt=Math.max(h.length-r,0),Ot=t.RXt;0<z?(m=this.PXt.concat(this.FXt),(0,_.o)(ct,function(Pt,Jt){for(var $t,e,p,C,W=0,x=m;W<x.length;W++)$t=x[W].cacheName,e=Pt.path,p=Pt.subtotal[$t],C=R.z$t(h,e),a.addChildItem(C,p,Jt,t,$t,b,Q,It,Tt,!0,"",!1,0,a.UZt,u,!1,Ot.columnNodeInfo),n.addChildItem(R.z$t(i,e),p,Jt,t,$t,b,Q,it,r,!1,"",!1,0,n.UZt,u,!1,Ot.rowNodeInfo)})):(0,_.o)(ct,function(Pt,Jt){Pt=Pt.path,a.addChildItem(R.z$t(h,Pt),null,Jt,t,void 0,b,Q,It,Tt,!0,"",!1,0),n.addChildItem(R.z$t(i,Pt),null,Jt,t,void 0,b,Q,it,r,!1,"",!1,0)})},dt.prototype.J$t=function(n,a,i,h,b,Q,it,It,t){for(var r,u,d,m=n.Nkt,R=n.RXt,z=0<n.gXt?R.rowNodeInfo:R.columnNodeInfo,ct=[],Tt=[],Ot=0,Pt=a;Ot<Pt.length;Ot++)r=Pt[Ot],Tt.push(r.sourceName);for(u=0,d=t;u<d.length;u++)xt(m,n,a,i,h,z,ct,It,b,Q,it,Tt,d[u].cacheName)},dt.prototype.$$t=function(n,a){for(var i,h,b=0,Q=(h=this.tx).length;b<Q;b++)i=h[b].subtotal,this.tti(n,i,a)},dt.prototype.tti=function(n,a,i){for(var h=0,b=i.length;h<b;h++)this.g$t(n,a,i[h].cacheName)},dt.prototype.g$t=function(n,a,i){var h,b,Q=(b=n.HXt).calcService;if((b=b.calcSource).setMeasureNode(a),n=(n=n.zRt(i))==null?void 0:n._expression)try{h=Q.MX.evaluateExpression(n,b.getEvaluatorContext({row:0,col:0},!1),!1,!0,!1)}catch{h=v.Errors.Reference}a[i]={calc:{sum:h},calcResult:h}},Z=dt,f.PivotQueryList=Z,ht.prototype.dU=function(n){var a=this.NQt;(0,_.ht)(a[n])&&(a[n]=1)},ht.prototype.destroy=function(){this.NQt=null},ut=ht,f.PivotSlicerCache=ut,St.prototype.Lh=function(n,a,i){var h=!0,b=[],Q=[];return(0,_.o)(a,function(it){var It,t,r=!it.isALL;h&&r&&(h=!1),r&&(Array.isArray(it.items[0])?(It=[],(0,_.o)(it.items,function(u){It=It.concat(u)}),b.push(It)):(r=n.zRt(it.sourceName))&&(t=r.getIndexesList(it.items),b.push(t),i)&&(it.isDim?Q.push(r.getFilterIndexesList()):Q.push(t)))}),a=(0,_.amt)(b),Q=(0,_.amt)(Q),{isALL:h,indexes:a,filterIndexes:Q}},St.prototype.nti=function(n,a,i,h){var b,Q,it,It,t,r,u,d,m,R,z,ct,Tt=a.isALL,Ot=a.indexes;if(a=a.filterIndexes,function(Pt,Jt){for(var $t,e=[],p=Pt.Pq,C=0,W=Jt.length;C<W;C++)($t=p[Jt[C].sourceName])&&(0,_.ht)($t.P)&&e.push($t.Zc);Pt.dot(e)}(n,i),function(Pt,Jt){(0,_.o)(Jt,function($t){var e,p,C=p=Pt.Pq[$t.sourceName];p.qXt===!1&&($t.databaseField=!1,$t.dataFieldIndex=p.l,C=Pt.KXt(p.l)),p.cx&&($t.isGroupField=!0,e=(0,_.isEmptyObject)(C.P),$t.getGroupItem=function(W){return W=e?W:C.D[W],p.AQt[p.S(W)]})})}(n,i),b=(Q=n.eti(h)).normalFieldsInfos,Q=Q.calcFieldsInfos,it=[],It=new Z(i,h,n,b,Q),(0,_.o)(h,function(Pt){Pt=Pt.index,it.indexOf(Pt)===-1&&it.push(Pt)}),r=(t=n.oQt).length,Tt)for(u=0;u<r;u++)It.addItem(t[u],u,!1,n);else{for(d=0,m=Ot;d<m.length;d++)R=m[d],It.addItem(t[R],R,!1,n);if(a&&0<a.length)for(z=0,ct=a;z<ct.length;z++)R=ct[z],It.addItem(t[R],R,!0,n)}return 0<Q.length&&It.$$t(n,Q),It},St.prototype.TQt=function(n,a,i){var h,b,Q,it,It,t,r,u,d,m,R,z,ct=a.isALL,Tt=(a=a.indexes,n.getField(i)),Ot=(R=n.oQt).length,Pt=Tt.lp;if((z=Tt.cC())&&(b=this.rti(Tt.Zc,n),Pt=n.getField(Tt.y1).lp),Q=new ut(i,Pt),ct)for(it=0;it<Ot;it++)h=z?Tt.AQt[b[it+""]]:R[it][Pt],Q.dU(h);else for(It=0,t=a;It<t.length;It++)r=t[It],h=z?Tt.AQt[b[r+""]]:R[r][Pt],Q.dU(h);if(0<(ct=n.getCalcItems(i)).length)for(u=0,d=ct;u<d.length;u++)m=d[u],r=Tt.P[m.calcItemName],Q.dU(r);return Q},St.prototype.rti=function(n,a){var i,h,b,Q,it,It,t={},r=(It=a.getField(n)).A;if(!(0,_.ht)(r))for(i=0,h=Object.keys(r);i<h.length;i++)for(Q=0,it=r[b=h[i]];Q<it.length;Q++)t[it[Q]+""]=It.N?It.cx[+b]:b;return t},f.DataAnalyzer=St,Rt=function(n){for(var a=[],i=[],h=n.length,b=U,Q=U,it=0,It=h-1;it<h;it++,It--)i[it]=b,b=n[it].b$t?b:it,a[It]=Q,Q=n[It].b$t?Q:It;return{preMap:i,nextMap:a}},$.prototype.oti=function(n,a){return this.YAt+1<=n?((n=this.zZt)!==""&&(n+=f.Separator),n+a||""):this.zZt},$.prototype.ati=function(n,a){return this.YAt+1>n?((n=this.SYt)!==""&&(n+=f.Separator),n+a||""):this.SYt},$.prototype.sti=function(n,a,i,h,b,Q){var it=this.nodeName;return(0,_.ht)(b.baseFieldName)||this.rYt!==b.baseFieldName||(it=Q?this.rYt:b.baseFieldItemShared),Q=h&&h.baseMajorPath?h.baseMajorPath:"",this.YAt<=i?(Q!==""&&(Q+=f.Separator),Q+it||""):Q},$.prototype.uti=function(n,a,i,h,b){var Q,it,It,t=this.YAt,r=this.rYt;return h&&(It=h.childMajorPath||"",it=h.baseMajorPath||""),t<=i?(It&&It!==""?It+=f.Separator:It="",this.rYt!==b.baseFieldName&&(r=this.nodeName),h=t>b.baseRootLevel?(Q=It+r,It+this.rYt):Q=It+r,{currentMajorPath:Q,childMajorPath:h}):{currentMajorPath:it,childMajorPath:It}},$.prototype.cti=function(n,a){return a=a&&a.baseMajorPathList?[].concat(a.baseMajorPathList):[],this.YAt<=n&&this.nodeName!==""&&a.push(this.nodeName),a},$.prototype.lti=function(n,a,i){return!(0,_.ht)(a)&&n.length>=i&&(n[i]=a),n.join(f.Separator)},$.prototype.fti=function(n,a,i){return!(0,_.ht)(a)&&n.length>=i&&(n[i]=a),n.join(f.Separator)},$.prototype.hti=function(n,a,i){var h;return-1<a.baseRootLevel?(h=a.baseRootLevel+1,this.YAt<=h?this.zZt:n.percentOfBasePath):(h=a.baseHeaderLevel+1,{baseIndex:this.YAt<=h+i?this.HZt:n.baseIndex,percentOfBasePath:this.YAt<=h?this.zZt:n.percentOfBasePath})},$.prototype.vti=function(n,a,i,h,b,Q){var it=this.nodeName;return(0,_.ht)(b.baseFieldName)||this.rYt!==b.baseFieldName||(it=Q?this.rYt:b.baseFieldItemShared),Q=h&&h.baseMinorPath?h.baseMinorPath:"",this.YAt>i?(Q!==""&&(Q+=f.Separator),Q+it||""):Q},$.prototype.dti=function(n,a,i,h,b){var Q,it,It,t=this.YAt,r=this.rYt;return h&&(It=h.childMinorPath||"",it=h.baseMinorPath||""),i<t?(It&&It!==""?It+=f.Separator:It="",this.rYt!==b.baseFieldName&&(r=this.nodeName),h=t>b.baseHeaderLevel?(Q=It+r,It+this.rYt):Q=It+r,{currentMinorPath:Q,childMinorPath:h}):{currentMinorPath:it,childMinorPath:It}},$.prototype.pti=function(n,a){return a=a&&a.baseMinorPathList?[].concat(a.baseMinorPathList):[],this.YAt>n&&this.nodeName!==""&&a.push(this.nodeName),a},$.prototype.Tpi=function(n,a){for(var i,h,b=n.wXt,Q="",it=a.length,It=0;It<it;It++)i=(h=a[It]).fieldName,h=h.items[0]+"",Q+=b.getField(i).M()[h],It!==it-1&&(Q+=f.Separator);return Q},$.prototype.addChildItem=function(n,a,i,h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt){var Ot,Pt,Jt,$t,e,p,C;0<n.length?(e=n[0],n=n.slice(1),Ot=e.pathStr,e=e.dimName,Pt=n.length===0,Jt=u,p=it[e],($t=void 0,_.ht)(this._Xt[Ot])&&((C=this.lYt)!==""&&(C+=f.Separator),this._Xt[Ot]=this.mti(Ot,C+Ot,h,Pt,t,Ot,r,e,ct,p)),($t=this.oYt[this._Xt[Ot]]).pathStr=Ot,$t.e$t=this.HZt,Tt&&$t.YAt<=t&&((0,_.ht)(Tt.fieldName)&&(Tt.fieldName=$t.rYt,Tt.level=$t.YAt),Tt.itemKeys=Tt.itemKeys||{},C=Tt.itemKeys,(0,_.ht)(C[Ot])&&(C[Ot]={}),Tt=C[Ot]),$t.YAt===It&&($t.eYt=!0),$t.jft=d,$t.b$t=$t.bti(h.collapseItems,d),Pt?($t.kYt=!0,$t.HZt=i,a&&b!==void 0&&(e=h.d$t($t.HZt),(0,_.ht)(e)&&(e={}),(0,_.ht)(e[b]))&&(e[b]={calc:vt({},a.calc),calcResult:a.calcResult},h.B$t($t.HZt,e)),$t.gti=i,z&&0<z.length&&(p=void 0,p=$t.YAt<t||$t.YAt===t&&(!$t.oYt||$t.oYt.length<1)?this.zZt:u,this.wti(h,t,z,r),$t.wti(h,t,z,r),r?$t.yti(h,z,t,p,R,this.QZt):$t.Y$t(h,z,t,p,R,this.QZt))):(this.wti(h,t,z,r),$t.wti(h,t,z,r),r||this.YAt<t&&(Jt=this.zZt),!r&&z?(this.Y$t(h,z,t,u,R,m),$t.Y$t(h,z,t,Jt,R,this.QZt)):z&&r&&(this.yti(h,z,t,u,R,m),$t.yti(h,z,t,Jt,R,this.QZt)),$t.addChildItem(n,a,i,h,b,Q,it,It,t,r,Jt,$t.YAt!==t&&$t.bti(h.collapseItems,d),this.QZt,$t.UZt,z,ct,Tt))):(this.kYt=!0,a&&b!==void 0&&(C=h.d$t(i),(0,_.ht)(C)&&(C={}),this.gti=i,C[b]={calc:a.calc,calcResult:a.calcResult},h.L$t(i,this.zZt,C,r)),this.gti=i,this.HZt=i),z&&0<z.length&&(r?this.yti(h,z,t,u,R,m):this.Y$t(h,z,t,u,R,m))},$.prototype.wti=function(n,a,i,h){i&&i.length&&this.YAt<=a&&(h?n.CXt[this.zZt]=this.HZt:n.yXt[this.zZt]=this.HZt)},$.prototype.Y$t=function(n,a,i,h,b,Q){var it,It,t,r,u,d,m,R,z,ct;if(!this.UZt)for(this.UZt={},it=0,It=a;it<It.length;it++)r=(t=It[it]).fieldName,R=t.needBuildBasePath,z=t.needBuildPercentOfPath,ct=t.needBuildRunningTotalOrRankPath,u=t.isNextOrPrevious,this.UZt[r]||(this.UZt[r]={}),d=this.UZt[r],m=b?b[r]:{},R&&(d.baseMajorPath=this.sti(n,r,i,m,t),d.baseMinorPath=this.vti(n,r,i,m,t),(0,_.ht)(t.baseFieldName)||this.rYt!==t.baseFieldName||t.baseFieldItemShared!==this.nodeName?this.QZt=this.QZt|Q:this.QZt=this.QZt|t.showDataAsIndex),u&&(d.baseMajorPathList=this.cti(i,m),d.baseMinorPathList=this.pti(i,m)),z&&(-1<t.baseRootLevel?d.percentOfBasePath=this.hti(m,t,i):(z=(R=this.hti(m,t,i)).percentOfBasePath,R=R.baseIndex,d.baseIndex=R,d.percentOfBasePath=z)),ct&&(t.showDataAs===tt.PivotShowDataAs.rankAscending||t.showDataAs===tt.PivotShowDataAs.rankDescending?(z=(R=this.uti(n,r,i,m,t)).currentMajorPath,ct=R.childMajorPath,d.baseMajorPath=z,d.childMajorPath=ct,z=(R=this.dti(n,r,i,m,t)).currentMinorPath,ct=R.childMinorPath,d.baseMinorPath=z,d.childMinorPath=ct):(d.baseMinorPath=this.vti(n,r,i,m,t,!0),d.baseMajorPath=this.sti(n,r,i,m,t,!0))),u||(d.indexInfo=L(t,this,n,i,h,d))},$.prototype.bti=function(n,a){return!!a||(a=this,!!(n&&n[a.rYt]&&n[a.rYt][a.nodeName]))},$.prototype.yti=function(n,a,i,h,b,Q){var it,It,t,r,u,d,m,R,z,ct;if(!this.UZt)for(this.UZt={},it=0,It=a;it<It.length;it++)r=(t=It[it]).fieldName,ct=t.needBuildRunningTotalOrRankPath,u=t.needBuildPercentOfPath,d=t.isNextOrPrevious,R=t.needBuildBasePath,this.UZt[r]||(this.UZt[r]={}),z=this.UZt[r],m=b?b[r]:{},R&&(z.baseMajorPath=this.sti(n,r,i,m,t),z.baseMinorPath=this.vti(n,r,i,m,t),(0,_.ht)(t.baseFieldName)||this.rYt!==t.baseFieldName||t.baseFieldItemShared!==this.nodeName?this.QZt=this.QZt|Q:this.QZt=this.QZt|t.showDataAsIndex),ct&&(this.UZt[r].baseMajorPath=this.sti(n,r,i,m,t,!0),this.UZt[r].baseMinorPath=this.vti(n,r,i,m,t,!0)),d&&(this.UZt[r].baseMajorPathList=this.cti(i,m),this.UZt[r].baseMinorPathList=this.pti(i,m)),u&&(-1<t.baseRootLevel?this.UZt[r].percentOfBasePath=this.hti(m,t,i):(z=(R=this.hti(m,t,i)).percentOfBasePath,ct=R.baseIndex,this.UZt[r].baseIndex=ct,this.UZt[r].percentOfBasePath=z)),d||(this.UZt[r].indexInfo=L(t,this,n,i,h,this.UZt[r]))},$.prototype.X$t=function(n,a,i,h,b,Q,it,It,t,r,u,d){var m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt=this,ee=i.valuePosition,jt=i.valueFieldLength;if(ee===-1&&(jt=1),Gt.Mpi(Q,h),m=i.subTotalsPosition,R=this.Iti(Q,h,it,It,t,r,u,d||0),it=Q.filedShowSubtotalInfo[Gt.rYt],0<Gt.oYt.length){for(x=W=C=p=e=$t=Jt=Pt=Ot=Tt=ct=z=0,yt=Gt.oYt,It=Gt.Spi,_t=(t=Rt(Gt.oYt)).preMap,Lt=t.nextMap,Et=yt.length-1;0<=Et;Et--)Wt=yt[_t[Et]],Ut=yt[Lt[Et]],Wt=Gt.oYt[Et].X$t(n,a,i,h,b,Q,Wt,Ut,Gt.oYt[Et-1]||null,Gt.oYt[Et+1]||null,R,this.QZt),(0,_.ht)(Wt)||(Ut=Wt.volume,Kt=Wt.subtotalVolume,oe=Wt.blankRowVolume,ae=Wt.topBlankRowVolume,te=Wt.titleRowCount,re=Wt.topSubtotalVolume,z+=Ut,Tt+=oe,Ot+=ae,Pt+=te,e+=Wt.tabularSubtotalVolume,p+=Wt.tabularTitleRowCount,$t+=re,ct+=Kt,Jt+=Wt.specialSubtotalVolume,C+=Wt.specialTopBlankVolume,W+=Wt.showSubtotalVolume,x+=Wt.tabularShowSubtotalVolume,Wt=U);Gt.YAt===n?(Gt.vYt=0,Gt.yYt=0,Gt.AYt=0,Gt.IYt=0,Gt.jwr=0,Gt.Dwr=0,Gt.eYt?(Gt.KZt=jt,Gt.zEt?(Gt.AYt=0,Gt.IYt=0):(Gt.AYt=1,Gt.IYt=1),Gt.wYt=1):(Gt.zEt?Gt.KZt=0:Gt.KZt=1,Gt.wYt=0,Gt.XZt=0,Gt.$Zt=0)):Gt.eYt?(Gt.yYt=jt,Gt.KZt=z*jt,Gt.vYt=(ct+1)*jt,Gt.XZt=(e+1)*jt,Gt.Dwr=x*jt,Gt.jwr=W*jt,Gt.AYt=(Tt===0?1:Tt)*jt+(Gt.zEt?0:1),Gt.IYt=(Ot===0?1:Ot)*jt,it===!1?(Gt.vYt=ct*jt,Gt.yYt=0,Gt.XZt=e*jt,Gt.AYt=(Tt===0?1:Tt)*jt):it&&(Gt.Dwr=(x+1)*jt,Gt.jwr=(W+1)*jt,Gt.IYt=(Ot===0?1:Ot)*jt+(Gt.zEt?0:1)),Gt.$Zt=p*jt,Gt.wYt=(Pt+1)*jt+(Gt.zEt?0:1)):ee>Gt.YAt?(Gt.KZt=z,Gt.kpi=Jt,Gt.jpi=C,Gt.$Zt=p,Gt.yYt=$t+jt,Gt.vYt=ct+jt,Gt.XZt=e+jt,Gt.Dwr=x,Gt.jwr=W,Gt.AYt=Tt+(Gt.zEt?0:1),it===!1?(Gt.vYt=ct,Gt.yYt=$t,Gt.XZt=x,Gt.AYt=Tt):it&&(Gt.Dwr=x+jt,Gt.jwr=W+jt),Gt.IYt=Ot,Gt.wYt=Pt+(Gt.zEt?0:1)):(Gt.KZt=z,Gt.AYt=Tt+(Gt.zEt?0:1),Gt.vYt=ct+1,Gt.kpi=Jt,Gt.jpi=C,Gt.XZt=e+1,Gt.jwr=W,Gt.Dwr=x,it===!1?(Gt.vYt=ct,Gt.XZt=e,Tt&&(Gt.AYt=Tt)):it&&(Gt.Dwr=x+1,It||(Gt.jwr=W+1)),Gt.zEt||(m!==1||It?m===2&&It&&(Gt.vYt=ct,Gt.YAt!==n-1)&&(Gt.AYt=Tt):(Gt.kpi=Jt+1,2<=n-Gt.YAt&&(Gt.jpi=C+1))),Gt.$Zt=p,Gt.wYt=Pt+(Gt.zEt?0:1),Gt.YAt===n-1?Gt.IYt=Ot+(Gt.zEt?0:1):Gt.IYt=Ot,ee===-1&&Gt.zEt?Gt.yYt=$t+1:Gt.yYt=0)}else Gt.zEt?Gt.KZt=0:ee===n?(Gt.KZt=jt,Gt.wYt=1):Gt.KZt=jt===0?0:1,Gt.vYt=0,Gt.kpi=0,Gt.jpi=0,Gt.AYt=Gt.eYt?1:0,Gt.IYt=Gt.eYt?1:0,Gt.XZt=0,Gt.wYt=Gt.wYt||0,Gt.$Zt=0,Gt.yYt=0,Gt.jwr=0,Gt.Dwr=0;return b&&b[Gt.rYt]&&b[Gt.rYt][this.nodeName]&&(Gt.KZt=0,Gt.vYt=0,Gt.AYt=ee<n&&Gt.YAt<=ee?jt:1,Gt.IYt=ee<n&&Gt.YAt<=ee?jt:1,Gt.$Zt=Gt.YAt<=ee?jt:1,Gt.wYt=Gt.YAt<=ee?jt+1:1,Gt.yYt=0,Gt.XZt=0,Gt.kpi=0,Gt.jpi=0,Gt.jwr=0,Gt.Dwr=0),{volume:Gt.KZt||0,subtotalVolume:Gt.vYt,blankRowVolume:Gt.AYt,topBlankRowVolume:Gt.IYt||0,titleRowCount:Gt.wYt||0,topSubtotalVolume:Gt.yYt||0,tabularSubtotalVolume:Gt.XZt||0,tabularTitleRowCount:Gt.$Zt||0,specialSubtotalVolume:Gt.kpi||0,specialTopBlankVolume:Gt.jpi||0,showSubtotalVolume:Gt.jwr||0,tabularShowSubtotalVolume:Gt.Dwr||0}},$.prototype.mti=function(n,a,i,h,b,Q,it,It,t,r){return(n=new $(n,a,i,h,this.oti(b,Q),this.ati(b,Q),It,t)).YAt=this.YAt+1,n.Spi=!!r,this.oYt.push(n)-1},$.prototype.p$t=function(n,a,i){switch(n){case tt.SubtotalType.sum:a.sum=i;break;case tt.SubtotalType.count:a.len=i;break;case tt.SubtotalType.countNums:a.count=i;break;case tt.SubtotalType.min:a.min=i;break;case tt.SubtotalType.max:a.max=i}},$.prototype.K$t=function(n,a,i,h,b,Q,it,It,t,r){var u=this,d=this,m=i.d$t(d.HZt);return d.Ati||(m=m||{},(0,_.o)(n,function(R){var z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et,Wt,Ut,Kt,oe,ae,te,re,Gt,ee,jt,de=R.cacheName,le=R.subTotalTypes,se=(R=R.isCalculatedField,d.Nti(de,d.lYt,i,h).calc),ce={};if(t)for(z=0,ct=le;z<ct.length;z++){for(Tt=ct[z],Ot=[],Pt=0,Jt=Object.keys(t);Pt<Jt.length;Pt++)$t=Jt[Pt],Ot.push({fieldName:$t,fieldItem:t[$t]});e=It.tQt({fieldInfos:Ot,valueInfo:{sourceName:de,subtotalType:Tt}}),(0,_.ht)(e)||(ce[Tt]=e,d.p$t(Tt,se,e))}if(p=se.count,C=se.sum,W=se.max,x=se.min,yt=se.sumx2,_t=se.product,Lt=se.len,0<d.oYt.length){if(Et=!1,R){for(Wt=i.bXt[d.oYt[0].rYt],Ut=d.oYt.length-1;-1<Ut;Ut--)(Kt=d.oYt[Ut]).Tti=Ut,Kt.kYt&&a[Kt.gti]===1?d.oYt.splice(Ut,1):(t&&(t[Wt]=It.getField(Wt).DH()[+Kt.pathStr]),Kt.K$t(n,a,i,h,b,d.lYt,it,It,t,r));it.g$t(It,m,de),Et=!!d.kYt,C=m[de].calc.sum}else for(Wt=i.bXt[d.oYt[0].rYt],Ut=d.oYt.length-1;-1<Ut;Ut--)(Kt=d.oYt[Ut]).Tti=Ut,Kt.kYt&&a[Kt.gti]===1?d.oYt.splice(Ut,1):(t&&(t[Wt]=It.getField(Wt).DH()[+Kt.pathStr]),oe=(ae=Kt.K$t(n,a,i,h,b,d.lYt,it,It,t,r)[de]).calc,ae=ae.hasEffectChild,Et=Et||ae,!oe||Kt.zXt&&!It.aggregateCalcItem()||(p=kt(p,oe.count,0),C=kt(C,oe.sum,0),_t=kt(_t,oe.product,2),W=kt(W,oe.max,5),x=kt(x,oe.min,6),yt=kt(yt,oe.sumx2,0),Lt=kt(Lt,oe.len,0)));if(t&&delete t[Wt],h||u.xti(i,de,b,d.oYt),te=(0,f.BXt)({count:p,sum:C,max:W,min:x,sumx2:yt,product:_t,len:Lt},le),0<Object.keys(ce).length)for(re=0,Gt=Object.keys(ce);re<Gt.length;re++){switch($t=Gt[re],d.p$t(+$t,se,e=ce[$t]),+$t){case tt.SubtotalType.sum:C=e;break;case tt.SubtotalType.count:Lt=e;break;case tt.SubtotalType.countNums:p=e;break;case tt.SubtotalType.min:x=e;break;case tt.SubtotalType.max:W=e}te[tt.SubtotalType[+$t]]=e}m[de]={collapse:u.jft,hasEffectChild:Et,calcResult:te,calc:{count:p,sum:C,max:W,min:x,sumx2:yt,product:_t,len:Lt}}}else{if(m[de]=m[de]||{},m[de].collapse=u.jft,te=(0,f.BXt)({count:p,sum:C,max:W,min:x,sumx2:yt,product:_t,len:Lt},le),0<Object.keys(ce).length)for(ee=0,jt=Object.keys(ce);ee<jt.length;ee++)$t=jt[ee],te[tt.SubtotalType[+$t]]=ce[$t];m[de].calcResult=te,m[de].hasEffectChild=!!d.kYt}i.L$t(d.HZt,d.lYt,m,h)}),h&&this.YAt<=b&&nt(i,d,b,n,Q,it,It,r,!!t),d.Ati=!0),m},$.prototype.xti=function(n,a,i,h){0<h.length&&this.Dti(n,a,h)},$.prototype.Iti=function(n,a,i,h,b,Q,it,It){var t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t;if(n){if(t=n.T$t){for(r={},u=0,d=t;u<d.length;u++)m=d[u],Jt=($t=n.CZt[m]).baseFieldItemType,R=$t.baseHeaderLevel,z=$t.baseRootLevel,Pt=$t.actualBaseLevel,Jt!==tt.PivotShowDataAsBaseItemType.item&&(Jt=Jt===tt.PivotShowDataAsBaseItemType.next,Tt=ct=void 0,Ot=a?R:Pt,a&&R+1===this.YAt||!a&&Pt===this.YAt?(Jt?(ct=h&&h.nodeName,Tt=Q&&Q.nodeName,h?this.QZt=this.QZt|It:(this.QZt=this.QZt|$t.showDataAsIndex,this.$Xt=this.$Xt|$t.showDataAsIndex)):(ct=i&&i.nodeName,Tt=b&&b.nodeName,i?this.QZt=this.QZt|It:(this.QZt=this.QZt|$t.showDataAsIndex,this.$Xt=this.$Xt|$t.showDataAsIndex)),r[m]=ct):Ot<this.YAt&&it&&(ct=it[m],r=it,this.QZt=this.QZt|It),Pt=ct,(0,_.ht)(Tt)||(Pt=Tt),Jt=this.lti(this.UZt[m].baseMajorPathList||[],Pt,a?R:z),$t=this.fti(this.UZt[m].baseMinorPathList||[],Pt,a?z:R),this.UZt[m].baseMajorPath=Jt,this.UZt[m].baseMinorPath=$t,delete this.UZt[m].baseMajorPathList,delete this.UZt[m].baseMajorPathList,this.UZt[m].indexInfo={baseMajorPath:Jt,baseMinorPath:$t});return r}return it}},$.prototype.Sti=function(n,a,i){var h,b,Q,it,It,t,r,u,d,m;if(m=n.M$t[a])for(h=0,b=m;h<b.length;h++)for(Q=b[h],it=n.CZt[Q].subtotalText,It=0,t=i;It<t.length;It++)u=(d=(r=t[It]).UZt[Q]).baseMinorPath,d=d.baseMajorPath,n.v$t(Q,d,u,r.HZt,a,it)},$.prototype.Dti=function(n,a,i){var h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt;if(i.length!==0&&(h=i[0].kYt,b=n.x$t[a])){for(Q=0,it=b;Q<it.length;Q++)if(It=it[Q],r=(t=n.CZt[It]).subtotalText,u=t.baseHeaderLevel,d=t.showDataAs,(h||!(-1<u))&&!(i[0].YAt<n.gXt))for(m=0,R=i;m<R.length;m++)ct=(Tt=(z=R[m]).UZt[It]).baseMajorPath,Tt=Tt.baseMinorPath,d===tt.PivotShowDataAs.percentOfRunningTotal?n.h$t(It,ct,Tt,z.HZt,a,r):n.v$t(It,ct,Tt,z.HZt,a,r)}},$.prototype.Mpi=function(n,a){var i,h,b,Q,it,It,t,r,u,d,m;if((m=this)._Xt&&m.oYt.length!==0){if(i=[],t=m.oYt[0].rYt,h=n.R$t[t],b=n.G$t,Q=n.V$t,it=n.bXt[t]||t,It=n.sf(t,b),t=Q[it],h)return m.Mti(h,n,a,t);if(It){for(r=0,u=m.oYt;r<u.length;r++)i[It[(d=u[r]).nodeName]]=d;return t===tt.SortType.desc&&i.reverse(),m.oYt=i.filter(function(R){return R}),!(m._Xt=i=null)}return!1}},$.prototype.Mti=function(n,a,i,h){var b,Q,it,It,t,r,u,d=this;if(!(u=n.subtotalText)||(b=n.cacheName,!a.wXt.getField(b)))return!1;if(it=!1,(Q=n.sortByPivotReferences)&&n.sortByHeader===i){It=h===tt.SortType.asc;try{t=d.Tpi(a,Q),i||(r=a.WZt(t).indexList),d.oYt.sort(function(m,R){var z,ct=i?(z=a.WZt(m.zZt).indexList[t],a.WZt(R.zZt).indexList[t]):(z=r[m.zZt],r[R.zZt]);return z===g&&ct===g?et(a,m.HZt,R.HZt,b,u,h):z===g?It?-1:1:ct===g?It?1:-1:et(a,z,ct,b,u,h)}),it=!0}catch{}}return it||d.oYt.sort(function(m,R){return et(a,m.HZt,R.HZt,b,u,h)}),!(d._Xt=null)},$.prototype.q$t=function(n,a,i,h,b,Q){var it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e=this,p=null,C=!1,W=n.cacheName,x=0,yt=0,_t=[],Lt=0,Et=-1/0,Wt=1/0,Ut=0,Kt=1;if(0<e.oYt.length)if(e.oYt[0].rYt===a&&(p=(it=i).condition,It=it.subTotalType,C=p.sn===tt.PivotConditionType.top10),C){for(t=[],u=[],(0,_.o)(e.oYt,function(oe,ae){var te=(oe=oe.q$t(n,a,i,h,b,Q)).calc;oe=oe.indexList,u.push({calc:te,indexList:oe}),oe=(0,f.BXt)(te,[It])[tt.SubtotalType[It]],t.push({index:ae,value:oe})}),r=p.evaluate(t),d=e.oYt.length-1;-1<d;d--)if(r[d])x+=(m=u[d].calc).count,Lt=kt(Lt,m.sum,0),Kt=kt(Kt,m.product,2),Et=kt(Et,m.max,5),Wt=kt(Wt,m.min,6),Ut=kt(Ut,m.sumx2,0),yt+=m.len;else{for(R=0,z=u[d].indexList;R<z.length;R++)ct=z[R],h[ct]=1;e.oYt.splice(d,1)}u=U}else for(d=e.oYt.length-1;-1<d;d--)if((Ot=e.oYt[d]).kYt&&h[Ot.gti]===1)e.oYt.splice(d,1);else if(m=(Tt=Ot.q$t(n,a,i,h,b,Q)).calc,Tt=Tt.indexList,Ot.oYt.length!==0||Ot.kYt){if(!(e.YAt<b)&&Tt&&m){if(Ot=!0,p&&(Pt=(0,f.BXt)(m,[It])[tt.SubtotalType[It]],Ot=it.condition.evaluate(Pt)),Ot)x+=m.count,Lt=kt(Lt,m.sum,0),Kt=kt(Kt,m.product,2),Et=kt(Et,m.max,5),Wt=kt(Wt,m.min,6),Ut=kt(Ut,m.sumx2,0),yt+=m.len,_t=_t.concat(Tt);else{for(Jt=0,$t=Tt;Jt<$t.length;Jt++)ct=$t[Jt],h[ct]=1;e.oYt.splice(d,1)}m=Tt=U}}else e.oYt.splice(d,1);else if(e.kYt)return C=Q.d$t(e.HZt)[W].calc,W=!0,p&&(Pt=(0,f.BXt)(C,[It])[tt.SubtotalType[It]],W=it.condition.evaluate(Pt)),W?{calc:C,indexList:[e.gti]}:(h[e.gti]=1,U);return{calc:{count:x,sum:Lt,product:Kt,max:Et,min:Wt,sumx2:Ut,len:yt},indexList:_t}},$.prototype.Nti=function(n,a,i,h){var b,Q,it,It,t;return(t=(t=i.d$t(this.HZt))||{})[n]&&this.kYt||(It=it=Q=b=U,t[n]={calc:{count:b,sum:Q,max:it,min:it,sumx2:It,product:b,len:Q}}),i.L$t(this.HZt,a,t,h),t[n]},$.prototype.kti=function(n,a,i){var h=U;return(a=a[n.rYt])?{valueFieldName:a.conditionBySourceName,condition:a.condition,subTotalType:i[a.conditionByName]}:h},$.prototype.jti=function(){var n={};(0,_.o)(this.oYt,function(a,i){n[a.nodeName]=i}),this._Xt=n},Ct=$,f.QueryNode=Ct},"./src/overwrite-list.ts":function(H,f,B){var vt;function mt(){this.Oti=[],this.Pti=[]}Object.defineProperty(f,"__esModule",{value:!0}),f.OverwriteList=void 0,vt=B("./pivot-entry.ts"),mt.prototype.setOverwriteNode=function(tt,_){var v,Ft=this;typeof _=="number"&&(v=Ft.getOverwriteNode(tt),(0,vt.ht)(v)?(Ft.Oti.push((0,vt.RF)(tt)),Ft.Pti.push(_)):(tt=Ft.Oti.indexOf(v),Ft.Pti[tt]=_))},mt.prototype.getOverwriteValue=function(tt){var _,v=this,Ft=tt.fieldInfos,w=tt.valueInfo;return(0,vt.o)(v.Oti,function(I,U){if(v.Fti(Ft,I.fieldInfos)&&v._ti(w,I.valueInfo))return _=v.Pti[U],!0}),_},mt.prototype.getOverwriteNode=function(tt){var _,v=this,Ft=tt.fieldInfos,w=tt.valueInfo;return(0,vt.o)(v.Oti,function(I){if(v.Fti(Ft,I.fieldInfos)&&v._ti(w,I.valueInfo))return _=I,!0}),_},mt.prototype.removeOverwriteNode=function(tt){var _;tt=(_=this).getOverwriteNode(tt),(0,vt.ht)(tt)||(tt=_.Oti.indexOf(tt),_.Oti.splice(tt,1),_.Pti.splice(tt,1))},mt.prototype.getOverwriteList=function(){for(var tt,_=[],v=this.Oti,Ft=0;Ft<v.length;Ft++)tt=(0,vt.RF)(v[Ft]),_.push({fieldInfos:tt.fieldInfos,valueInfo:tt.valueInfo,value:this.Pti[Ft]});return _},mt.prototype.toJSON=function(){return this.isEmpty()?null:this.getOverwriteList()},mt.prototype.fromJSON=function(tt){var _=this;_.reset(),tt&&0<tt.length&&(0,vt.o)(tt,function(v){var Ft=v.fieldInfos,w=v.valueInfo;v=v.value,_.setOverwriteNode({fieldInfos:Ft,valueInfo:w},v)})},mt.prototype.isEmpty=function(){return!this.Pti||this.Pti.length===0},mt.prototype.reset=function(){this.Oti=[],this.Pti=[]},mt.prototype.dispose=function(){this.Oti=null,this.Pti=null},mt.prototype.Lti=function(tt){return tt&&tt.sort(function(_,v){return _.fieldName===v.fieldName?_.fieldItem>v.fieldItem?1:-1:_.fieldName>v.fieldName?1:-1})},mt.prototype.Fti=function(tt,_){var v,Ft,w,I=this.Lti(tt),U=this.Lti(_);if(!I||!U||I.length!==U.length)return!1;for(v=0;v<I.length;v++)if(Ft=I[v],w=U[v],Ft.fieldName!==w.fieldName||Ft.fieldItem!==w.fieldItem)return!1;return!0},mt.prototype._ti=function(tt,_){return tt&&_&&tt.sourceName===_.sourceName&&tt.subtotalType===_.subtotalType},f.OverwriteList=mt},"./src/pivot-cache.ts":function(H,f,B){var vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j,E,A,Y;function L(l,T){var D;switch(l){case"b":D=T?"1":"0";break;case"d":ot.test(T)||(T+=" 00:00:00"),D=(0,v.kQt)(new Date(T));break;case"e":D=T._calcError;break;default:D=T}return(0,v.xmlEncode)(D)}function q(l){var T=this;T.W5=l.dataType,T.Zc=function(D){return D instanceof Date?(0,v.formatDateToString)(D):isNaN(D)?D:""+D}(l.name),T.k={},T.W5!==_.PivotDataType.number&&(T.P={}),T.ty=[],T.Eti={},T.sh={},T.D=[],T.lp=l.index,T.WXt={},T.Bti={}}function J(l,T,D){var M=[];for(M.push({n_:"s",v:"&lt;"+l});l-1+D<=T;)M.push({n_:"s",v:l+v.NUMBER_GROUP_SEPARATOR+(l-1+D)}),l+=D;return M.push({n_:"s",v:l+v.NUMBER_GROUP_SEPARATOR+(l-1+D)}),M.push({n_:"s",v:"&gt;"+(l+=D)}),M}function P(l,T,D,M){var s,y;for(D&&D[0]===mt.LESS+(0,v.formatDateToString)(l)?(D[0]="&lt;"+(0,v.formatDateToString)(l),M.autoStart="0"):D.unshift("&lt;"+(0,v.formatDateToString)(l)),D&&D[D.length-1]===mt.MORE+(0,v.formatDateToString)(T)?(D[D.length-1]="&gt;"+(0,v.formatDateToString)(T),M.autoEnd="0"):D.push("&gt;"+(0,v.formatDateToString)(T)),s=[],y=0;y<D.length;y++)s.push({n_:"s",v:D[y]});return s}function bt(l,T,D,M){(0,v.ht)(M[T.Zc+D])&&(l=l.push({cacheName:T.Zc,index:T.lp,dataFieldIndex:T.l,subTotalType:D,cacheFieldType:T.W5})-1,M[T.Zc+D]=l)}function k(l,T,D,M){var s,y;(s=(y=this).assignId)!=null&&s.call(y),y.oQt=D?new Array(D.length):[],y.Zc=l,y.Rti=T,y.Pq={},y.Gti=0,y.EYt=M,y.Vti=0,y.lw=!0,T&&D&&(s=T.map(function(G){return y.Uti(G)}),y.uut(s,D)),y.SMt()}function nt(l,T){var D,M,s,y,G,K,c,N;if(l){for(D=0,M=l;D<M.length;D++)s=M[D],y=Mt((0,v.xmlDecode)(s.name)),(0,v.ht)(y)||!T[y]||(0,v.ht)(s.lp)||(T[y].lp=s.lp);for(G=[],K=0,c=Object.keys(T);K<c.length;K++)N=c[K],G.push(T[N]);G.sort(function(V,O){return V.lp-O.lp}),G.forEach(function(V,O){V.lp=O})}}function gt(l,T){var D,M,s,y,G,K=l.Pq;for(D in T)if(T.hasOwnProperty(D)&&K[D]&&(M=K[D])&&(0,v.ht)(M.P))for(M.k={},M.P={},M.D=[],s=l.oQt,y=M.lp,G=0;G<s.length;G++)s[G][y]=M.aQt(s[G][y],G,!1)}function Z(l){switch(l){case"b":return _.PivotDataType.boolean;case"d":return _.PivotDataType.date;case"e":return _.PivotDataType.errorValue;case"m":return _.PivotDataType.noValue;case"n":return _.PivotDataType.number;case"s":return _.PivotDataType.string;default:return}}function ut(l){switch(l){case _.PivotDataType.boolean:return"b";case _.PivotDataType.date:return"d";case _.PivotDataType.errorValue:return"e";case _.PivotDataType.noValue:return"m";case _.PivotDataType.number:return"n";case _.PivotDataType.string:return"s";default:return"n"}}function Rt(l,T){var D=typeof l;return l===void 0?"m":D=="boolean"?"b":D=="number"?"n":D=="string"?T!=="d"||isNaN(Date.parse(l))?"s":"d":"e"}function Ct(l,T,D,M){var s=this;s.T=l,s.gd=T,s.groupItemsIndexMap={},s.groupItemsKeyIndexes={},M==="number"?((0,v.ht)(l)||(0,v.ht)(D)?s.Qti=T:s.Qti=l+Math.ceil((T-l)/D)*D,function(y,G,K,c){var N,V,O;for(y.groupItemsKeyList=[],y.groupItemsKeyList.push(mt.LESS+K),N=K;N<c;)y.groupItemsKeyList.push(N+"-"+(N+G-1)),N+=G;for(y.groupItemsKeyList.push(mt.MORE+c),V=0;V<y.groupItemsKeyList.length;V++)O=y.groupItemsKeyList[V],y.groupItemsIndexMap[O]=[],y.groupItemsKeyIndexes[O]=V}(s,D,l,s.Qti)):function(y,G,K,c){var N,V,O,pt,wt,et,ht=(et=j().dateResource).HOUR_GROUP_ITEMS.slice(),St=et.MINUTE_GROUP_ITEMS.slice(),$=et.SECOND_GROUP_ITEMS.slice();switch(G){case _.DateGroupType.seconds:y.groupItemsKeyList=$;break;case _.DateGroupType.minutes:y.groupItemsKeyList=St;break;case _.DateGroupType.hours:y.groupItemsKeyList=ht;break;case _.DateGroupType.days:y.groupItemsKeyList=(0,v.Wti)();break;case _.DateGroupType.months:y.groupItemsKeyList=(0,v.zti)();break;case _.DateGroupType.quarters:y.groupItemsKeyList=(0,v.Zti)();break;case _.DateGroupType.years:if(K&&c){for(N=[],V=K.getFullYear(),O=c.getFullYear(),pt=V;pt<=O;pt++)N.push((0,mt.Yti)(pt));y.groupItemsKeyList=N}break;default:y.groupItemsKeyList=[]}for(K&&y.groupItemsKeyList.unshift(mt.LESS+(0,v.formatDateToString)(K)),c&&y.groupItemsKeyList.push(mt.MORE+(0,v.formatDateToString)(c)),pt=0;pt<y.groupItemsKeyList.length;pt++)wt=y.groupItemsKeyList[pt],y.groupItemsIndexMap[wt]=[],y.groupItemsKeyIndexes[wt]=pt}(s,D,l,T),s._by=D,s.type=M,s.name=this.getName(D)}function Bt(l,T){for(var D,M="",s=0,y=T;s<y.length;s++)M&&(M+="-&-"),M=(M=M+(D=y[s])+"&")+l[D];return M}function kt(l,T,D,M){var s,y,G,K,c;if(!(D-T<=0||M<=0)){for(s=l.k,y=l.D,G=l.P,(0,v.ht)(T)&&(T=l.T||function(N){for(var V=+N[0],O=1,pt=N.length;O<pt;O++)V=Math.min(V,+N[O]);return V}(l.D),l.rki=!0),(0,v.ht)(D)&&(D=l.gd||function(N){for(var V=+N[0],O=1,pt=N.length;O<pt;O++)V=Math.max(V,+N[O]);return V}(l.D),l.oki=!0),l.T=T,l.gd=D,l._by=M,l.y1=l.Zc,K=new Y(T,D,M,"number"),l.Qti=K.Qti,c=0;c<y.length;c++)K.insertIndexToIndexMap(y[c],s[(0,v.isEmptyObject)(G)?""+y[c]:G[""+y[c]]]);l.cx=K.groupItemsKeyList,l.A=K.groupItemsIndexMap,l.AQt=K.groupItemsKeyIndexes,l.uQt()}}function ie(l){for(var T=l[0],D=1,M=l.length;D<M;D++)T=T<l[D]?T:l[D];return new Date(T)}function Xt(l){for(var T=l[0],D=1,M=l.length;D<M;D++)T=T>l[D]?T:l[D];return new Date(T)}function Qt(l,T,D,M,s){return(0,v.ht)(s)?(s=1,l.zRt(T)?l.zRt(T+s)?void 0:M?T+s:"".concat(T+s," (").concat(D,")"):M?T:"".concat(T," (").concat(D,")")):Qt(l,T,D,M,s+1)}function dt(l){switch(l){case"seconds":return _.DateGroupType.seconds;case"minutes":return _.DateGroupType.minutes;case"hours":return _.DateGroupType.hours;case"days":return _.DateGroupType.days;case"months":return _.DateGroupType.months;case"quarters":return _.DateGroupType.quarters;case"years":return _.DateGroupType.years}}function xt(l){switch(l){case _.DateGroupType.seconds:return"seconds";case _.DateGroupType.minutes:return"minutes";case _.DateGroupType.hours:return"hours";case _.DateGroupType.days:return"days";case _.DateGroupType.months:return"months";case _.DateGroupType.quarters:return"quarters";case _.DateGroupType.years:return"years"}}function Mt(l){return(0,v.ht)(l)||l.match(/_x00[0-1][0-9A-Fa-f]_/)===g?l:l.replace(/(_x005[fF])?_x00([0-1][0-9A-Fa-f])_/g,function(T,D,M){var s=0;return M&&(s=parseInt(M,16)),D?"_x00"+M+"_":String.fromCharCode(s)}).replace(/(\r)+\n/g,`\r
  608. `)}function st(l,T){if(l==="s"||l==="string")return Mt(T);var D;if(l==="n"||l==="number")return D=parseFloat(T),isNaN(D)?F:D;if(l==="d"||l==="date")return Mt(T);if(l==="b"||l==="boolean"){if(T==="1"||T==="t")return!0;if(T==="0"||T==="f")return!1}return l==="e"||l==="errorValue"?function(M){var s=g;switch(M){case"#DIV/0!":s=7;break;case"#N/A":s=42;break;case"#NAME?":s=29;break;case"#NULL!":s=0;break;case"#NUM!":s=36;break;case"#REF!":s=23;break;case"#VALUE!":s=15;break;case"#SPILL!":s=99}return s!==g?{_error:M,_code:s}:g}(T):l==="m"||l==="noValue"?null:l==="x"?parseInt(T,10):T}vt=this&&this.__spreadArray||function(l,T,D){if(D||arguments.length===2)for(var M,s=0,y=T.length;s<y;s++)!M&&s in T||((M=M||Array.prototype.slice.call(T,0,s))[s]=T[s]);return l.concat(M||Array.prototype.slice.call(T))},Object.defineProperty(f,"__esModule",{value:!0}),f.io=f.getPathStr=f.PivotCache=f.PivotCacheField=void 0,mt=B("./pivot-entry.ts"),tt=B("Common"),_=B("./src/pivot-interface.ts"),v=B("./src/pivot-util.ts"),Ft=B("CalcEngine"),w=B("./src/pivot-sort.ts"),I=B("./src/pivot-calc-engine.ts"),U=B("./src/overwrite-list.ts"),g=null,F=void 0,ot=/(\d{1,2}):(\d{1,2})(:\d{1,2})?/,B=new tt.Common.ResourceManager(mt.SR),j=B.getResource.bind(B),tt.Common.CultureManager,E=tt.Common.kh,q.prototype.addCalcItem=function(l,T){var D,M,s;(s=(M=(D=this).D).indexOf(l))<0&&(s=M.push(l)-1),D.k[s]=[],D.P[l]=s,D.WXt[s]=T,D.uQt()},q.prototype.hasCalcItem=function(){return!!this.ty.length},q.prototype.cC=function(){return!!this.y1},q.prototype.up=function(){return this.ty.concat()},q.prototype.removeCalcItem=function(l){var T,D,M,s,y,G,K,c,N,V,O,pt,wt;if(!((wt=(pt=(O=this).D).indexOf(l))<0)){for(pt.splice(wt,1),delete(T=O.k)[wt],D=0,M=Object.keys(T);D<M.length;D++)wt<(y=+(s=M[D]))&&(T[y-1]=T[s]);for(delete(G=O.WXt)[wt],c=0,N=Object.keys(G);c<N.length;c++)wt<(K=+N[c])&&(G[K-1]=G[K],delete G[K]);for(delete(V=O.P)[l];wt<pt.length;wt++)V[pt[wt]]--;O.uQt()}},q.prototype.y$t=function(l){return this.P[l]},q.prototype.Hti=function(l){return this.W5!==_.PivotDataType.date||(0,v.ht)(l)?l:(0,v.kQt)(l)+""},q.prototype.Jti=function(l,T){var D=this;if(D.W5!==_.PivotDataType.number)return D.aQt(l,T);D.qti(l,T)},q.prototype.Kti=function(l){return(0,v.ht)(l)||l===j().blank},q.prototype.Xti=function(l,T){var D,M,s,y,G,K=(y=this).W5,c=y.D,N=(G=y.P)&&0<G.length,V=j().blank;if(c&&0<c.length){for(y=y.Kti(c[0]),M=0;M<c.length;M++)typeof(s=N?G[c[M]]:c[M])=="number"?(l.containsNumber=!0,isFinite(s)&&Math.floor(s)===s||(D=!1),(0,v.ht)(l.minValue)?l.minValue=s:l.minValue=Math.min(s,l.minValue),(0,v.ht)(l.maxValue)?l.maxValue=s:l.maxValue=Math.max(s,l.maxValue)):K===_.PivotDataType.date?typeof s!="string"||isNaN(Date.parse(s))?(0,v.ht)(s)||s===V||(l.containsNonDate=!0):(l.containsDate=!0,(0,v.ht)(l.minDate)?l.minDate=s:l.minDate=Date.parse(s)<Date.parse(l.minDate)?s:l.minDate,(0,v.ht)(l.maxDate)?l.maxDate=s:l.maxDate=Date.parse(s)>Date.parse(l.minDate)?s:l.maxDate):typeof s=="string"&&s!==V&&(l.containsString=!0),!(0,v.ht)(s)&&s!==V||(l.containsBlank=!0);l.containsNumber===!0&&D!==!1&&(l.containsInteger=!0),(K!==_.PivotDataType.string||y)&&(0,v.ht)(l.containsString)&&(l.containsString=!1),K===_.PivotDataType.date&&(0,v.ht)(l.containsNonDate)&&(l.containsNonDate=!1)}},q.prototype.$ti=function(l,T){var D=T.containsString,M=T.containsNumber,s=T.containsDate,y=T.containsBlank,G=T.containsError;1<[D,M,s,T=T.containsBool].filter(Boolean).length&&(l.containsMixedTypes="1"),D&&l.containsMixedTypes||this.W5===_.PivotDataType.string||y||G||(l.containsSemiMixedTypes="0"),T&&(l.containsSemiMixedTypes="1")},q.prototype.tii=function(l){var T,D,M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St,$,n,a,i=(n=this).W5,h=n.D,b=(a=n.P)&&0<a.length,Q=j().blank,it={};if(h&&0<h.length){for(wt=pt=O=V=N=c=K=G=y=s=M=D=T=void 0,n=n.Kti(h[0]),et=0,ht=h;et<ht.length;et++)St=ht[et],($=typeof(St=b?a[St]:St))=="number"?(K=!0,isFinite(St)&&Math.floor(St)===St||(c=!1),N=(0,v.ht)(N)?St:Math.min(St,N),V=(0,v.ht)(V)?St:Math.max(St,V)):i===_.PivotDataType.date?$!="string"||isNaN(Date.parse(St))?(0,v.ht)(St)||St===Q||(M=!0):(s=!0,y=(0,v.ht)(y)||Date.parse(St)<Date.parse(y)?St:y,G=(0,v.ht)(G)||Date.parse(St)>Date.parse(G)?St:G):$=="string"&&St!==Q?D=!0:St instanceof Ft.CalcError?O=!0:$=="boolean"&&(pt=!0),!(0,v.ht)(St)&&St!==Q||(T=!0),$=="string"&&255<St.length&&(wt=!0);K===!0&&c!==!1&&(c=!0),(i!==_.PivotDataType.string||n)&&(0,v.ht)(D)&&(D=!1),i===_.PivotDataType.date&&(0,v.ht)(M)&&(M=!1),l.count=h.length+"",s&&(l.containsDate="1"),M===!1&&(l.containsNonDate="0"),D!==!1||O||pt||(l.containsString="0"),O&&(D=!0),T&&(l.containsBlank="1"),wt&&(l.longText="1"),K&&!s&&(l.containsNumber="1"),c&&!s&&(l.containsInteger="1"),s?(l.minDate=(0,v.kQt)(new Date(y)),l.maxDate=(0,v.kQt)(new Date(G))):(K||c)&&(l.minValue=N,l.maxValue=V),it={containsString:D,containsNumber:K,containsDate:s,containsBlank:T,containsError:O,containsBool:pt}}return it},q.prototype.iii=function(l){var T=l.containsString,D=l.containsNumber,M=l.containsDate,s=l.containsBlank,y=0;T&&y++,D&&y++,M&&y++,1<y&&(l.containsMixedTypes=!0),l.containsString&&l.containsMixedTypes?l.containsSemiMixedTypes=!0:this.W5===_.PivotDataType.string||s||(l.containsSemiMixedTypes=!1)},q.prototype.qti=function(l,T){var D=this,M=D.k,s=D.Hti(l),y=D.D;(0,v.ht)(D.gd)&&(D.gd=l),(0,v.ht)(D.T)&&(D.T=l),D.gd=D.gd<l?l:D.gd,D.T=D.T>l?l:D.T,M[s]||(M[s]=[],y.push(s)),M[s].push(T)},q.prototype.aQt=function(l,T,D){var M,s,y=(s=this).k,G=s.P,K=s.D,c=s.Bti;if(D=l=D&&s.W5===2?(0,v.nii)(l):l,(0,v.ht)(l))D=j().blank;else if(s.W5===2){if(typeof D=="object")try{s.gd=s.gd<l?l:s.gd,s.T=s.T>l?l:s.T,D=(0,v.formatDateToString)(l)}catch{D=l}}else D=s.Hti(l);return s=G[D=(0,v.ht)(D)?j().blank:D],(0,v.ht)(s)&&(s=c[(D+"").toLowerCase()]),(0,v.ht)(s)?(M=K.push(D)-1,G[D]=M,c[(D+"").toLowerCase()]=M):M=s,(0,v.ht)(y[M])&&(y[M]=[]),y[M].push(T),M},q.prototype.eii=function(l,T){var D=this.k;D[l]||(D[l]=[]),D[l].push(T)},q.prototype.rii=function(){for(var l,T,D,M,s=(D=this.D)[M=0],y=D.length;M<y&&(!s||isNaN(Date.parse(s)));)s=D[++M];for(l=(0,mt.parseStringToDate)(s),T=(0,mt.parseStringToDate)(s);M<y;M++)l=(s=(0,mt.parseStringToDate)(D[M]+""))<l?s:l,T=T<s?s:T;this.T=l,this.gd=T},q.prototype.oii=function(){for(var l,T,D,M,s=(D=this.D)[M=0],y=D.length-1;M<y&&((0,v.ht)(s)||isNaN(+s));)s=D[++M];for(T=l=s;M<D.length;M++)l=(s=D[M])<l?s:l,T=T<s?s:T;this.T=l,this.gd=T},q.prototype.getFieldsItemList=function(){return this.DH().concat()},q.prototype.getIndexesList=function(l){for(var T,D=this.aii(),M=[],s=0,y=l;s<y.length;s++)T=y[s],(0,v.ht)(D[T])||(M=M.concat(D[T]));return M},q.prototype.getFilterIndexesList=function(){for(var l,T=this.aii(),D=[],M=0,s=Object.keys(T);M<s.length;M++)l=s[M],(0,v.ht)(T[l])||(D=D.concat(T[l]));return D},q.prototype.DH=function(){return[].concat(this.cx||this.D)},q.prototype.aii=function(){return this.A||this.k},q.prototype.M=function(){return this.AQt||this.P},q.prototype.S=function(l){var T=this,D=T.W5;return T.VXt?T.VXt[l]:D===_.PivotDataType.number?(0,v.getNumberGroupItemKey)(T,l):D===_.PivotDataType.date?(0,v.getDateGroupItemKey)(T,l):void 0},q.prototype.sii=function(l,T){var D,M;(M=this).N=l,D=M.VXt={},(0,v.o)(Object.keys(l),function(s){(0,v.o)(l[s],function(y){D[y]=s})}),(0,v.o)(T,function(s){(0,v.ht)(D[s])&&(D[s]=s)})},q.prototype.uii=function(){var l=this;delete l._by,delete l.y1,delete l.cx,delete l.A,delete l.AQt,delete l.qXt,delete l.l,delete l.nZt,delete l.grouped},q.prototype.uQt=function(){var l,T,D,M,s={},y=(D=this).W5,G=D.DH(),K=D.M();if((M=1e3<G.length&&!D.needSort?G.concat():(0,w.mXt)(G.concat(),{sortType:_.SortType.asc,isDate:y===_.PivotDataType.date,isNumberGroup:y===_.PivotDataType.number&&!(0,v.ht)(D.cx),by:D._by},"en"))&&0<M.length){for(l=0,T=M.length;l<T;l++)s[K[M[l]]]=l;D.sQt=s}else D.sQt=g},q.prototype.tsr=function(){var l,T,D,M,s={},y=(D=this).W5,G=D.DH(),K=D.M();if((M=(0,w.mXt)(G.concat(),{sortType:_.SortType.asc,isDate:y===_.PivotDataType.date,isNumberGroup:y===_.PivotDataType.number&&!(0,v.ht)(D.cx),by:D._by},"en"))&&0<M.length){for(l=0,T=M.length;l<T;l++)s[K[M[l]]]=l;return s}return null},q.prototype.dispose=function(){var l=this;l.k=g,l.D=g,l.sQt=g,l.P=g,l.cx=g,l.A=g,l.AQt=g,l.VXt=g,l.Hti=g,l.cii=g,l.cft=g,l.Xnn=g,l.N=g,l.nZt=g,l.lii=g},q.prototype.fromJson=function(l,T){var D,M,s,y,G=this;if((0,v.ht)(l.name)||(G.Zc=l.name),(0,v.ht)(G.W5)&&!(0,v.ht)(T)&&(G.W5=Z(T.type)),(D=l.entities)&&0<D.length)for(G.P||(G.P={}),G.D=[],M=j().blank,s=void 0,y=0;y<D.length;y++)D[y].isUnusedItem||(s=D[y].value,(0,v.ht)(s)&&(s=M),typeof(s=typeof(s=G.W5!==2||isNaN(Date.parse(s))?s:(0,v.formatDateToString)(new Date(s)))!="object"||(0,v.ht)(s._error)&&(0,v.ht)(s._calcError)?s:mt.ErrorsMap[s._code]||mt.ErrorsMap[0])=="string"&&(s=(0,v.xmlDecode)(s)),G.D.push(s),G.P[s]=y)},q.prototype.yh=function(l,T){var D,M,s,y,G=this;if((0,v.ht)(l.name)||(G.Zc=Mt((0,v.xmlDecode)(l.name))),(0,v.ht)(G.W5)&&!(0,v.ht)(T)&&(G.W5=Z(T.n_)),(D=(T=(0,v.xr)(l,"sharedItems"))&&T.c_)&&0<D.length)for(G.P||(G.P={}),G.D=[],M=j().blank,s=void 0,y=0;y<D.length;y++)D[y].u||(s=st(D[y].n_,D[y].v),(0,v.ht)(s)&&(s=M),typeof(s=typeof(s=G.W5!==2||isNaN(Date.parse(s))?s:(0,v.formatDateToString)(new Date(s)))!="object"||(0,v.ht)(s._error)&&(0,v.ht)(s._calcError)?s:mt.ErrorsMap[s._code]||mt.ErrorsMap[0])=="string"&&(s=(0,v.xmlDecode)(s)),G.D.push(s),G.P[s]=y)},q.prototype.toJson=function(l){var T,D,M,s,y,G,K,c,N,V,O,pt=this,wt=(0,v.ht)(pt.cft)?{}:pt.cft,et=j().blank;if((0,v.ht)(pt.Zc)||(wt.name=pt.Zc),(0,v.ht)(pt.lp)||(wt.lp=pt.lp),(0,v.ht)(pt.D5)||(wt.formula=pt.D5,wt.databaseField=!1),pt.qXt===!1&&(wt.databaseField=!1),pt.hasCalcItem()&&pt.W5===_.PivotDataType.date&&(wt.containsMixedTypes=!0,wt.containsString=!0),wt.databaseField!==!1&&(pt.Xti(wt,l),pt.iii(wt)),(0,v.isEmptyObject)(pt.P))wt.entities=[];else if(D=wt.entities=[],(O=pt.D)&&0<O.length){for(M=ut(pt.W5),y=!(s={}),G=0,K=O;G<K.length;G++)(N=Rt(c=V=K[G],M))==="e"?c=(c==null?void 0:c.toJSON)&&c.toJSON()||c._error:(N==="s"&&255<V.length&&(wt.longText=!0),y=!0),(T=s[V=(c+"").toLowerCase()])!=null&&T[N]||((0,v.ht)(c)||c===et?D.push({type:"m"}):D.push({type:N,value:c,isCalculatedItem:!!pt.sh[c]}),s[V]||(s[V]={}),s[V][N]=!0);y||(wt.entities=[])}return l=(O=l&&l.getField(pt.y1))&&O.lp,(pt.cx||pt.grouped)&&((0,v.ht)(pt.T)?(0,v.isEmptyObject)(pt.N)||(wt.fieldGroup={base:l},function(ht,St,$){var n,a,i,h=ht.N,b=$.fieldGroup.groupItems=[],Q={},it=$.fieldGroup.discreteGroup=[];for(n in h)h.hasOwnProperty(n)&&(b.push({type:"s",value:n}),Q[n]=b.length-1);for(a=0;a<St.D.length;a++)i=St.D[a],it.push(Q[ht.VXt[i]])}(pt,O,wt)):typeof pt.T=="number"?(wt.fieldGroup={startNum:pt.T,endNum:pt.gd,autoStart:pt.rki===!0,autoEnd:pt.oki===!0,groupInterval:pt._by,base:l,hasRangeGroup:!0},wt.fieldGroup.groupItems=function(ht,St,$){var n=[];for(n.push({type:"s",value:"&lt;"+ht});ht-1+$<=St;)n.push({type:"s",value:ht+v.NUMBER_GROUP_SEPARATOR+(ht-1+$)}),ht+=$;return n.push({type:"s",value:ht+v.NUMBER_GROUP_SEPARATOR+(ht-1+$)}),n.push({type:"s",value:"&gt;"+(ht+=$)}),n}(pt.T,pt.gd,pt._by)):(pt.T instanceof Date||pt.W5===_.PivotDataType.date&&pt.grouped)&&(pt.grouped?wt.fieldGroup={par:l===F?pt.lp:l}:wt.fieldGroup={startDate:pt.T&&new Date(pt.T).toUTCString(),endDate:pt.gd&&new Date(pt.gd).toUTCString(),autoStart:pt.rki===!0,autoEnd:pt.oki===!0,groupBy:xt(pt._by),base:l,hasRangeGroup:!0},pt.cx)&&(O=pt.cx.concat(),O=function(ht,St,$,n){var a,i;for($&&$[0]===mt.LESS+(0,v.formatDateToString)(ht)?($[0]="&lt;"+(0,v.formatDateToString)(ht),n.autoStart=!1):$.unshift("&lt;"+(0,v.formatDateToString)(ht)),$&&$[$.length-1]===mt.MORE+(0,v.formatDateToString)(St)?($[$.length-1]="&gt;"+(0,v.formatDateToString)(St),n.autoEnd=!1):$.push("&gt;"+(0,v.formatDateToString)(St)),a=[],i=0;i<$.length;i++)a.push({type:"s",value:$[i]});return a}(pt.T,pt.gd,O,wt.fieldGroup),wt.fieldGroup.groupItems=O)),wt},q.prototype.wh=function(l){var T,D,M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St=this,$=(0,v.ht)(St.Xnn)?{n_:"cacheField",c_:[]}:St.Xnn,n=j().blank,a={n_:"sharedItems"};if((0,v.ht)(St.lp)||($.lp=St.lp),(0,v.ht)(St.Zc)||($.name=(0,v.xmlEncode)(St.Zc)),(0,v.ht)(St.D5)||(St.jUr?$.formula=(0,v.xmlEncode)(l.HXt.calcService.unparse(l.HXt.getCalcSource(),St.jUr,0,0)):$.formula=(0,v.xmlEncode)(St.D5),$.databaseField="0"),St.qXt===!1&&($.databaseField="0"),St.hasCalcItem()&&St.W5===_.PivotDataType.date&&(a.containsMixedTypes=1,a.containsString=1),$.databaseField!=="0"&&(ht=St.tii(a),St.$ti(a,ht)),T=[],$.databaseField!=="0"&&!(0,v.isEmptyObject)(St.P)&&(D=St.D)&&0<D.length){for(M=ut(St.W5),y=!(s={}),G=0;G<D.length;G++)(c=Rt(K=D[G],M))==="e"?K=K&&K.toJSON&&K.toJSON()||K._error:y=!0,(V=s[N=(K+"").toLowerCase()])!=null&&V[c]||((0,v.ht)(K)||K===n?T.push({n_:"m"}):(V={n_:c,v:L(c,K)},St.sh[K]&&(V.f=1),T.push(V)),s[N]||(s[N]={}),s[N][c]=!0);y||(T=[])}return 0<T.length&&(a.c_=T,a.count=T.length,$.c_.push(a)),a=(ht=l&&l.getField(St.y1))&&ht.lp,(St.cx||St.grouped)&&(l={n_:"fieldGroup",base:a,c_:[]},(0,v.ht)(St.T)?(0,v.isEmptyObject)(St.N)||(et=(ht=function(i,h){var b,Q,it,It=i.N,t=[],r={},u=[];for(b in It)It.hasOwnProperty(b)&&(u.push({n_:"s",v:b}),r[b]=u.length-1);for(Q=0;Q<h.D.length;Q++)it=h.D[Q],t.push({n_:"x",v:r[i.VXt[it]]});return{discreteGroup:u,discretePrs:t}}(St,ht)).discretePrs,ht=ht.discreteGroup,l.c_.push({n_:"groupItems",count:ht.length,c_:ht}),l.c_.push({n_:"discretePr",count:et.length,c_:et})):typeof St.T=="number"?(pt={n_:"rangePr",groupInterval:St._by+"",startNum:St.T+"",endNum:St.gd+"",autoStart:St.rki===!0?"1":"0",autoEnd:St.oki===!0?"1":"0"},wt={n_:"groupItems",c_:O=J(St.T,St.gd,St._by),count:O.length},l.c_.push(pt),l.c_.push(wt)):(St.T instanceof Date||St.W5===_.PivotDataType.date&&St.grouped)&&(St.grouped&&(l.par=a===F?St.lp:a),pt={n_:"rangePr",groupBy:xt(St._by),startDate:(0,v.kQt)(St.T),endDate:(0,v.kQt)(St.gd),autoStart:St.rki===!0?"1":"0",autoEnd:St.oki===!0?"1":"0"},St.cx)&&(O=St.cx.concat(),wt={n_:"groupItems",c_:O=P(St.T,St.gd,O,pt),count:O.length},l.c_.push(pt),l.c_.push(wt)),(0,mt.Pr)(l,["rangePr","discretePr","groupItems"]),$.c_.push(l)),(0,mt.Pr)($,["sharedItems","fieldGroup"]),$},q.prototype.sf=function(){return this.sQt},A=q,f.PivotCacheField=A,k.prototype.hasCalcItem=function(l){for(var T,D=0,M=l;D<M.length;D++)if((T=M[D]).isDim&&0<(T=(T=this.getField(T.sourceName)).cC()?this.getField(T.y1):T).ty.length)return!0;return!1},k.prototype.aggregateCalcItem=function(l){if((0,v.ht)(l))return this.lw;this.lw=!!l},k.prototype.setUntreatedNodeInfo=function(l,T,D,M,s){var y=this;l=Bt(l,D),y.JXt||(y.JXt={}),y.JXt[l]={calcResultIndex:s,expression:M,pathInfo:T}},k.prototype.getPivotCalcService=function(){return this.HXt},k.prototype.SMt=function(){var l=this;l.HXt=new I.PivotCalcService,l.POt=new I.PivotCalcSource(l.HXt),l.POt.setPivotCache(l),l.HXt.fii(l.POt)},k.prototype.getDataRefer=function(){return this.EYt},k.prototype.getHeaderList=function(){var l,T,D,M=this.Pq,s=[];for(D in M)E(M,D)&&(T={name:(l=M[D]).Zc,dataType:l.W5,index:l.lp},(0,v.ht)(l.D5)||(T.fieldType=_.PivotSourceFieldType.isCalcField),(0,v.ht)(l.y1)||(T.fieldType=_.PivotSourceFieldType.isGroupField),s[l.lp]=T);return vt([],s,!0)},k.prototype.hii=function(){var l,T,D,M,s=this;if((0,v.ht)(s.Rti)){for(M in D=void 0,l=[],T=s.Pq)E(T,M)&&(l[(D=T[M]).lp]={name:D.Zc,dataType:D.W5,index:D.lp});s.Rti=l}},k.prototype.dx=function(l,T){for(var D,M,s,y,G,K,c,N,V,O,pt,wt,et,ht=[],St=[],$=(et=this).getHeaderList(),n=et.oQt,a=[],i=et.Pq,h=[],b=[],Q=j().blank,it=0,It=$;it<It.length;it++)(G=i[(K=It[it]).name]).cC()&&K.name!==G.y1||!(0,v.ht)(G.D5)?St.push(K.index):a.push(K.name),h.push(G.D),(G=G.P)&&0<Object.keys(G).length?b.push(1):b.push(0);if(ht.push(a),a=[],T)for(c=0,N=n;c<N.length;c++){for(s=(M=(K=N[c]).slice(0)).length,V=D=0;V<s;V++)-1<St.indexOf(V)||(b[V]?((y=h[V][M[V]])===Q&&(y=null),a[D]=y):a[D]=M[V]===Q?null:M[V],D++);ht.push(a),a=[]}else for(O=0,pt=l;O<pt.length;O++){for(wt=pt[O],s=(M=vt([],n[wt],!0)).length,V=D=0;V<s;V++)-1<St.indexOf(V)||(b[V]?((y=h[V][M[V]])===Q&&(y=null),a[D]=y):a[D]=M[V]===Q?null:M[V],D++);ht.push(a),a=[]}return ht},k.prototype.KIr=function(l,T){var D,M,s,y,G,K,c,N,V,O=this,pt=l.ZVt,wt=l.WVt(),et=l.getCalcItems(),ht=[];if(T)pt=T.groupInfos,ht=T.calcFields,et=T.calcItems;else for(D=0;D<wt.length;D++)wt[D]&&ht.push({name:wt[D].Zc,formula:wt[D].D5});if(et.sort(function(St,$){return St.priority-$.priority}),O.Vti=0,O.Z$t&&l.Z$t.dispose(),O.Z$t=g,O.SMt(),(0,v.ht)(pt)||O.vii(pt),0<ht.length)for(D=0;D<ht.length;D++)O.addCalcField(ht[D].name,ht[D].formula);for(s={},y=0,G=et;y<G.length;y++)K=G[y],(M=O.getField(K.sourceName))&&M.W5===_.PivotDataType.number&&(s[K.sourceName]=!0);0<Object.keys(s).length&&gt(O,s);try{for(c=0,N=et;c<N.length;c++)V=N[c],O.dii(V.sourceName,V.calcItemName,V.formula,O.pii())}catch{}},k.prototype.ln=function(l,T){var D,M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St=(et=this).ZVt,$=et.WVt();for((ht=et.getCalcItems()).sort(function(n,a){return n.priority-a.priority}),D=[],M=0;M<$.length;M++)$[M]&&D.push({name:$[M].Zc,formula:$[M].D5});if(y=et.HXt,s=et.EYt,et.dispose(),et.HXt=y,et.EYt=s,et.oQt=[],et.Rti=l,et.Gti=0,et.Vti=0,et.Z$t&&et.Z$t.dispose(),et.Z$t=g,l&&T&&(y=l.map(function(n){return et.Uti(n)}),et.uut(y,T)),et.SMt(),(0,v.ht)(St)||et.vii(St),0<D.length)for(M=0;M<D.length;M++)et.addCalcField(D[M].name,D[M].formula);for(K={},c=0,N=ht;c<N.length;c++)V=N[c],(G=et.getField(V.sourceName))&&G.W5===_.PivotDataType.number&&(K[V.sourceName]=!0);0<Object.keys(K).length&&gt(et,K);try{for(O=0,pt=ht;O<pt.length;O++)wt=pt[O],et.dii(wt.sourceName,wt.calcItemName,wt.formula,et.pii())}catch{}},k.prototype.vii=function(l){var T;for(T in l)E(l,T)&&this.dy(l[T])},k.prototype.mii=function(l){return this.EYt===l},k.prototype.getName=function(){return this.Zc},k.prototype.getAllFieldsNames=function(){var l,T=[],D=this.Pq;for(l in D)D.hasOwnProperty(l)&&(T[D[l].lp]=D[l].Zc);return T},k.prototype.uut=function(l,T){var D,M=this,s=j().blank,y=T.length||0;(0,v.o)(l,function(G,K){var c,N;if(G.W5===_.PivotDataType.number||G.W5===_.PivotDataType.date){for(c=G.W5===_.PivotDataType.number?function(V){return typeof V=="number"}:function(V){return V instanceof Date},N=0;(!T[N]||(0,v.ht)(T[N][K])||!c(T[N][K]))&&N<y;)N++;G.T=T[N][K],G.gd=T[N][K]}}),(0,v.o)(T,function(G,K){(0,v.o)(l,function(c,N){D=G[N],!(0,v.ht)(D)&&D!==""||(G[N]=s),D=c.Jti(D,K),(0,v.ht)(D)||(G[N]=D)}),M.oQt[K]=G}),(0,v.o)(l,function(G){G.W5!==_.PivotDataType.string&&G.W5!==_.PivotDataType.date||G.uQt()}),this.bii()},k.prototype.gii=function(l,T){var D,M,s=this;(T=T.pivotCacheRecords)&&0<T.length&&(D=T[0],M=j().blank,(0,v.o)(T,function(y,G){var K=[];(0,v.o)(l,function(c,N){var V,O=y[N]&&y[N].value;(0,v.ht)(O)&&(O=M),V=D[N]&&D[N].type||Z(c.W5),typeof O!="object"||(0,v.ht)(O._error)||(O=mt.ErrorsMap[O._code]||mt.ErrorsMap[0]),V==="x"?c.eii(O,G):V==="m"||(0,v.ht)(V)?((0,v.ht)(O)||(c.W5=_.PivotDataType.string),O=c.aQt(O,G,!0)):V!=="n"?O=c.aQt(O,G,!0):c.qti(O,G),K[N]=O}),s.oQt.push(K)}),(0,v.o)(l,function(y){y.W5===_.PivotDataType.date&&y.rii(),y.W5===_.PivotDataType.number&&(0,v.ht)(y.T)&&y.oii(),y.W5!==_.PivotDataType.string&&y.W5!==_.PivotDataType.date&&(y.W5!==_.PivotDataType.number||(0,v.ht)(y.P))||y.uQt()}))},k.prototype.wii=function(l,T){var D,M,s=this;(T=T&&T.c_)&&0<T.length&&(D=T[0],M=j().blank,(0,v.o)(T,function(y,G){var K=[];(0,v.o)(l,function(c,N){var V,O=st((O=y.c_&&y.c_[N])&&O.n_,O&&O.v);(0,v.ht)(O)&&(O=M),V=D.c_[N]&&D.c_[N].n_||Z(c.W5),typeof O!="object"||(0,v.ht)(O._error)||(O=mt.ErrorsMap[O._code]||mt.ErrorsMap[0]),V==="x"?c.eii(O,G):V==="m"||(0,v.ht)(V)?((0,v.ht)(O)||(c.W5=_.PivotDataType.string),O=c.aQt(O,G,!0)):V!=="n"?O=c.aQt(O,G,!0):c.qti(O,G),K[N]=O}),s.oQt.push(K)}),(0,v.o)(l,function(y){y.W5===_.PivotDataType.date&&y.rii(),y.W5===_.PivotDataType.number&&(0,v.ht)(y.T)&&y.oii(),y.W5!==_.PivotDataType.string&&y.W5!==_.PivotDataType.date&&(y.W5!==_.PivotDataType.number||(0,v.ht)(y.P))||y.uQt()}))},k.prototype.bii=function(){var l,T,D,M,s,y,G,K,c,N,V,O,pt=(O=this).oQt,wt=O.Q$t={},et=j().blank;if(!(0,v.ht)(pt)){for(l=pt.length,s=O.Pq,y=[],G=0,K=O.Rti;G<K.length;G++)c=K[G],(0,v.ht)(c)||(0,v.ht)(s[c.name])||((c=s[c.name]).P&&0<Object.keys(c.P).length?y[c.lp]=(0,v.ht)(c.P[et])?-1:c.P[et]:y[c.lp]=et);for(N=0;N<l;N++)if(T=pt[N]){for(D=T.length,M=!0,V=0;V<D;V++)if(T[V]!==y[V]){M=!1;break}M&&(wt[N]=1)}}},k.prototype.getField=function(l){return this.Pq[l]},k.prototype.Uti=function(l){var T,D=this;return l=new A(l),(0,v.ht)(l.lp)&&(l.lp=D.Gti),T=l.Zc,(0,v.ht)(D.Pq[T])&&D.Gti++,D.Pq[T]=l},k.prototype.zRt=function(l){return this.Pq[l]},k.prototype.yii=function(){var l,T=[],D=this.Pq;for(l in D)D.hasOwnProperty(l)&&T.push(D[l]);return T},k.prototype.Cii=function(l,T){var D=this.Pq[l];return T.reduce(function(M,s){return M.concat(D.k[s]||[])},[])},k.prototype.Iii=function(l){var T=this;return l=l.map(function(D){var M=D.sourceName;return D=D.items,(M=T.zRt(M))?M.getIndexesList(D):[]}),this.Aii((0,v.amt)(l))},k.prototype.Aii=function(l){for(var T,D=[],M=0,s=l;M<s.length;M++)T=s[M],D.push(this.oQt[T]);return D},k.prototype.addField=function(l){var T,D=this;l&&!(0,v.ht)(l.Zc)&&(T=l.Zc,(0,v.ht)(D.Pq[T])?((0,v.ht)(l.lp)&&(l.lp=D.Gti),(0,v.ht)(D.Pq[T])&&D.Gti++):l.lp=D.Pq[T].lp,D.Pq[T]=l)},k.prototype.removeField=function(l){var T,D,M=this;if(l&&!(0,v.ht)(l.Zc)&&!(0,v.ht)(M.Pq[l.Zc])){if((0,v.ht)(l.lp)||M.Nii(l.lp),delete M.Pq[l.Zc],-1<(D=(T=M.Rti).findIndex(function(s){return s.name===l.Zc})))for(T.splice(D,1);D<T.length;D++)T[D]&&(T[D].index=D);M.Gti--}},k.prototype.removeCalcField=function(l){(l=this.getField(l))&&!(0,v.ht)(l.D5)&&this.removeField(l)},k.prototype.Nii=function(l){var T,D,M=this.Pq;for(T in M)M.hasOwnProperty(T)&&(D=M[T])&&!(0,v.ht)(D.lp)&&D.lp>l&&D.lp--},k.prototype.dispose=function(){var l,T=this;for(l in T.oQt=g,T.HXt=g,T.POt=g,T.Pq)T.Pq.hasOwnProperty(l)&&(T.Pq[l].dispose(),delete T.Pq[l]);T.Rti=g,T.EYt=g,T.cft=g,T.Xnn=g,T.ZVt=g,T.Z$t=g},k.prototype.Tii=function(l){for(var T,D=[],M=0;M<l.length;M++)D.push(this.Pq[l[M].fieldName].k[l[M].item]);return T=(0,v.amt)(D),this.Aii(T)},k.prototype.bVt=function(l){for(var T,D=[],M=0;M<l.length;M++)(T=this.zRt(l[M].sourceName))&&D.push(T.getIndexesList(l[M].items));return(0,v.amt)(D)},k.prototype.xii=function(l){return!!this.Pq[l]},k.prototype.KXt=function(l){var T,D=this.Pq;for(T in D)if(D.hasOwnProperty(T)&&D[T].lp===l)return D[T]},k.prototype.Dii=function(l){this.Pq[l.Zc]=l},k.prototype.dy=function(l){var T,D,M,s,y,G=this;return(0,v.ht)(G.ZVt)&&(G.ZVt={}),D=G.ZVt,y=(0,mt.RF)(l),T=G.getField(l.originFieldName),!(0,v.ht)(T)&&(D[l.originFieldName]=y,(D=l.textGroup)?(M=D.groupItems,s=new A({dataType:T.W5,name:D.fieldName,index:T.lp}),function(K,c){var N,V={};for((0,v.o)(Object.keys(K),function(O){for(var pt=0;pt<K[O].length;pt++)V[K[O][pt]]=1}),N=0;N<c.length;N++)(0,v.ht)(V[c[N]])&&(K[c[N]]=[c[N]])}(M,T.D),s.cx=[],s.A={},s.AQt={},(0,v.o)(Object.keys(M),function(K,c){s.cx.push(K),s.AQt[K]=c,s.A[c]=[],(0,v.o)(M[K],function(N){s.A[c]=(0,v.F)(s.A[c],T.k[T.P[N]])})}),s.sii(M,T.D),s.N=M,s.y1=T.Zc,s.qXt=!1,s.l=T.lp,delete s.lp,s.uQt(),G.addField(s)):T.W5!==_.PivotDataType.number||(0,v.ht)(l.numberGroup)?T.W5===_.PivotDataType.date&&function(K,c,N,V){var O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t;if(N){for(N.sort(function(r,u){return r.by-u.by}),O=[],pt=V?1:0,ht=0;ht<N.length;ht++){if(St=N[ht].start,$=N[ht].end,n=N[ht].by,(0,v.ht)(St)&&(St=(0,v.ht)(wt)?wt=c.T||ie(c.D):wt),($=(0,v.ht)($)?(0,v.ht)(et)?et=c.gd||Xt(c.D):et:$)<=St)return;O.push(new Y(St,$,n,"date"))}for(a=c.k,i=c.D,h=c.P,b=0,Q=c.D.length;b<Q;b++)for(it=0;it<O.length;it++)O[it].insertIndexToIndexMap(c.D[b],a[h[i[b]]]);for(V?(c.cx=O[0].groupItemsKeyList,c.A=O[0].groupItemsIndexMap,c.AQt=O[0].groupItemsKeyIndexes,c.T=O[0].T,c.gd=O[0].gd,N[0].start===F&&(c.rki=!0),N[0].end===F&&(c.oki=!0),c._by=O[0]._by,c.y1=c.Zc,c.uQt()):c.grouped=!0,c.nZt=[];pt<O.length;pt++)(t=new A({dataType:c.W5,name:Qt(K,(It=O[pt]).name,c.Zc,V)})).cx=It.groupItemsKeyList,t.A=It.groupItemsIndexMap,t.AQt=It.groupItemsKeyIndexes,t.T=It.T,t.gd=It.gd,N[pt].start===F&&(t.rki=!0),N[pt].end===F&&(t.oki=!0),t._by=It._by,t.y1=c.Zc,t.qXt=!1,t.l=c.lp,t.uQt(),c.nZt.push(t.Zc),K.addField(t)}}(G,T,l.dateGroups,l.groupSourceField):(y=l.numberGroup,kt(T,y.start,y.end,y.by)),!0)},k.prototype.zVt=function(l,T,D){var M,s,y,G,K,c,N,V=this;if(!(0,v.ht)(D)){if(l=V.EDe(l).Zc,M=D.textGroup,s=D.numberGroup,y=D.dateGroups,M&&M.fieldName===l||s&&D.originFieldName===l)return!0;if(y){if(((G=V.zRt(l))==null?void 0:G.y1)===T)return!0;if(0<((M=G==null?void 0:G.nZt)==null?void 0:M.length)){for(K=0,c=G.nZt;K<c.length;K++)if(N=c[K],((G=V.zRt(N))==null?void 0:G.y1)===T)return!0}}}return!1},k.prototype.YVt=function(l){var T,D,M,s,y,G,K,c,N,V=(N=this).ZVt;if(!(0,v.ht)(V)){for(T in V)if(E(V,T)&&(D=V[T],N.zVt(l,T,D))){delete V[T];break}}if(M=[],(s=N.EDe(l)).N)M.push(s.Zc),N.removeField(s);else if(typeof s.T=="number")s.uii(),s.uQt();else if(s.T instanceof Date||s.W5===_.PivotDataType.date){for(K=(y=(s=(G=0,v.ht)(s.nZt)?N.zRt(s.y1):s).nZt).length;G<K;G++)c=N.getField(y[G]),N.removeField(c);delete V[s.Zc],M=M.concat(y),s.uii(),s.uQt()}return M},k.prototype.EDe=function(l){var T,D,M,s,y;if((y=(s=this).zRt(l)).N&&y.y1)return y;for(T=0,D=s.yii();T<D.length;T++)if((M=D[T]).N&&M.y1===l)return M;return s.getField(l)},k.prototype.xVt=function(l){l=(s=this).getField(l);var T,D,M,s,y=[];if(!(0,v.ht)(l)&&((0,v.ht)(l.y1)||(l=s.getField(l.y1)),!(0,v.ht)(l))&&!(0,v.ht)(l.nZt)&&0<l.nZt.length)for(y.push(l),D=0,M=(T=l.nZt).length;D<M;D++)y.push(s.getField(T[D]));return y},k.prototype.WVt=function(){var l,T=this.Pq,D=[];for(l in T)T.hasOwnProperty(l)&&!(0,v.ht)(T[l].D5)&&D.push(T[l]);return D},k.prototype.addCalcField=function(l,T,D){var M,s,y=this;(l=new A({dataType:_.PivotDataType.number,name:l})).D5=T,l.qXt=!1,M=y.HXt,s=y.POt,D=M.parseFormulaToCalcRelatedFieldNames(T,D),l.lii=D.names,l.jUr=D.exprs,l._expression=M.calcService.parse(s,T,0,0),y.addField(l)},k.prototype.checkFieldNameAndItems=function(l,T){var D,M,s,y,G,K,c,N,V,O,pt,wt,et=Object.keys(l),ht={};if(!(0,v.ht)(T)){for(s=0,y=T;s<y.length;s++)ht[y[s]]=!0;for(G=0,K=et;G<K.length;G++)if(!ht[c=K[G]])return!1}for(N=0,V=et;N<V.length;N++){if(c=V[N],M=this.getField(c),(0,v.ht)(M))return!1;for(D=M.P,O=0,pt=l[c];O<pt.length;O++)if(wt=pt[O],(0,v.ht)(D[wt]))return!1}return!0},k.prototype.setSortInfo=function(l,T){l=this.getField(l),(0,v.ht)(l)||((0,v.ht)(T)?l.needSort=null:(l.needSort=T,l.uQt()))},k.prototype.addCalcItem=function(l,T,D,M){var s,y=(s=this).HXt.parseFormulaToCalcRelatedFieldItemMap(D);return!!s.checkFieldNameAndItems(y,M)&&this.dii(l,T,D,s.pii())},k.prototype.dii=function(l,T,D,M){var s,y,G=(y=this).HXt,K=y.POt;if(l=y.getField(l),(0,v.ht)(D)||(s=G.calcService.parse(K,D,0,0)),l.sh[T]={calcItemFormula:D,calcExpression:s},l.ty.indexOf(T)<0)return l.ty.push(T),l.addCalcItem(T,(0,v.ht)(M)?y.pii():M),!0},k.prototype.getCalcItems=function(l){for(var T,D,M,s,y,G,K,c,N=this,V=[],O=0,pt=N=(0,v.ht)(l)?N.yii():[N.getField(l)];O<pt.length;O++)for(D=(T=pt[O]).ty,M=T.sh,s=T.WXt,y=T.M(),G=0,K=D;G<K.length;G++)c=K[G],V.push({sourceName:T.Zc,formula:M[c].calcItemFormula,calcItemName:c,priority:s[y[c]]});return V},k.prototype.updateCalcItem=function(l,T,D,M,s){var y,G,K,c=(K=this).HXt,N=K.POt,V=K.getField(l);if((0,v.ht)(V)||V.ty.indexOf(T)<0)return!1;if(y=!1,D!==V.sh[T].calcItemFormula){if(G=c.parseFormulaToCalcRelatedFieldItemMap(D),!K.checkFieldNameAndItems(G,s))return!1;s=c.calcService.parse(N,D,0,0),V.Eti[T]=G,V.sh[T]={calcItemFormula:D,calcExpression:s},y=!0}return(0,v.ht)(M)?y:K.updateCalcItemPriority(l,T,M)||y},k.prototype.updateCalcItemPriority=function(l,T,D){var M,s,y,G,K,c,N,V,O,pt,wt,et;if(l=(et=this).getField(l),(0,v.ht)(l)||l.ty.indexOf(T)<0||(M=l.WXt[l.M()[T]],D<1?D=1:D>et.Vti&&(D=et.Vti),D===M))return!1;for(l=et.yii(),s=D<M?1:-1,y=Math.min(D,M),G=Math.max(D,M),K=0,c=l;K<c.length;K++)if((N=c[K]).hasCalcItem())for(V=N.WXt,O=0,pt=Object.keys(V);O<pt.length;O++)V[wt=pt[O]]===M?V[wt]=D:V[wt]>=y&&V[wt]<=G&&(V[wt]+=s);return!0},k.prototype.removeCalcItem=function(l,T){var D,M,s,y,G,K=[],c=(G=this).getField(l);if(l=[T],c)for(M=l=(D=0,v.ht)(T)?vt([],c.ty,!0):l;D<M.length;D++)y=M[D],(s=c.D.indexOf(y))<0||(s=c.WXt[s],c.removeCalcItem(y),K.push({formula:c.sh[y].calcItemFormula,calcItemName:y}),delete c.Eti[y],delete c.sh[y],0<=(y=c.ty.indexOf(y))&&c.ty.splice(y,1),(0,v.ht)(s))||G.Sii(s);return K},k.prototype.Sii=function(l){for(var T,D,M,s,y,G=0,K=(y=this).yii();G<K.length;G++)if(T=K[G].WXt)for(D=0,M=Object.keys(T);D<M.length;D++)T[s=M[D]]>l&&T[s]--;y.Vti--},k.prototype.pii=function(){return this.Vti+=1,this.Vti},k.prototype.eti=function(l){for(var T,D,M,s,y,G=this,K={},c={},N=[],V=[],O={normalFieldsInfos:s=[],calcFieldsInfos:y=[]},pt=0,wt=l.length;pt<wt;pt++)T=G.getField(l[pt].cacheName),(0,v.ht)(T.D5)?bt(s,T,l[pt].subTotalType,K):G.kii(T.Zc,N,V);for(D=0,M=N.length;D<M;D++)bt(s,G.getField(N[D]),_.SubtotalType.sum,K);for(D=0,M=V.length;D<M;D++)bt(y,G.getField(V[D]),_.SubtotalType.sum,c);return O},k.prototype.jii=function(l){for(var T,D=[],M=0,s=l.length;M<s;M++)T=this.getField(l[M].cacheName),(0,v.ht)(T.D5)||D.push(T);return D},k.prototype.kii=function(l,T,D){for(var M,s,y,G,K=0,c=(G=(l=(y=this).getField(l)).lii).length;K<c;K++)M=(0,mt.Oii)(G[K]),s=y.getField(M),(0,v.ht)(s.D5)?T.push(M):y.kii(M,T,D);D.push(l.Zc)},k.prototype.dot=function(l){var T=this.Pq,D=[];(0,v.o)(l,function(M){(M=T[M])&&((0,v.ht)(M.P)||Object.keys(M.P).length===0)&&(M.k={},M.P={},M.D=[],M.cC()||D.push(M))}),l=this.oQt,(0,v.o)(l,function(M,s){(0,v.o)(D,function(y){var G=y.lp;M[G]=y.aQt(M[G],s,!1)})}),(0,v.o)(D,function(M){M.uQt()})},k.prototype.Pii=function(l){var T=!1;return(l=function(D){return(D=D.n_)==="s"?_.PivotDataType.string:D==="n"?_.PivotDataType.number:D==="d"?_.PivotDataType.date:D==="b"?_.PivotDataType.boolean:D==="e"?_.PivotDataType.errorValue:D==="m"?_.PivotDataType.noValue:void 0}(l))!==_.PivotDataType.noValue&&l!==_.PivotDataType.errorValue?l:(T=l===_.PivotDataType.errorValue||T)?_.PivotDataType.errorValue:_.PivotDataType.noValue},k.prototype.pJt=function(l){for(var T,D=!1,M=0;M<l.length;M++){if((T=Z(l[M].type))!==_.PivotDataType.noValue&&T!==_.PivotDataType.errorValue)return T;T===_.PivotDataType.errorValue&&(D=!0)}return D?_.PivotDataType.errorValue:_.PivotDataType.noValue},k.prototype.fromJson=function(l,T,D){var M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt;if((Pt=this).cft=(0,mt.RF)(T),(0,v.ht)(T.name)?Pt.Zc=l:Pt.Zc=T.name,(0,v.ht)(l)||(Pt.FVt=+l),(0,v.ht)(T.pivotCacheId)||(Pt.yQt=+T.pivotCacheId),(0,v.ht)(T.uuid)||Pt.UKn(T.uuid),(0,v.ht)(T.recordCount)||(Pt.recordCount=T.recordCount),T.refreshOnLoad&&(Pt.tNe=!!T.refreshOnLoad),(0,v.ht)(T.sourceType)||(Pt.sourceType=T.sourceType,(Pt.EYt="",v.ht)(T.sheet)||(Pt.EYt=T.sheet,Pt.sheet=T.sheet,(0,v.ht)(T.ref))||(Pt.EYt="=".concat((0,mt.qTe)(T.sheet),"!").concat(T.ref),Pt.ref=T.ref),(0,v.ht)(T.sourceName))||(Pt.EYt=T.sourceName,Pt.sourceName=T.sourceName),s=[],y=[],G=[],K=[],(M=(0,mt.RF)(T.fields))&&0<M.length)for(c=0;c<M.length;c++){if(V=(N=M[c]).fieldGroup,N.lp=c,V){if(!(0,v.ht)(V.base)&&((0,v.ht)(N.entities)||N.entities.length===0)&&!(0,v.ht)(V.startDate)){if((0,v.ht)(M[V.base])||(0,v.ht)(M[V.base].fieldGroup)||!(0,v.ht)(M[V.base].fieldGroup.Fii)||(M[V.base].fieldGroup.Fii=[]),(0,v.ht)((O=M[V.base])==null?void 0:O.fieldGroup)){y.push(N);continue}M[V.base].fieldGroup.Fii.push(N),K.push(M[V.base].name);continue}if(y.push(N),!(0,v.ht)(V.discreteGroup))continue}if((0,v.ht)(N.formula)){if(O=N.entities,(pt={}).name=N.name,pt.index=c,O&&0<O.length)pt.dataType=Pt.pJt(O);else if(T.Rti)for(wt=0,et=T.Rti;wt<et.length;wt++)(ht=et[wt]).name===pt.name&&(pt.dataType=ht.dataType);(St=Pt.Uti(pt)).fromJson(N,T.pivotCacheRecords&&T.pivotCacheRecords[0]&&T.pivotCacheRecords[0][c]),s.push(St)}else G.push(N)}for(Pt.gii(s,T),$=0,n=T.calculatedItems||[];$<n.length;$++)i=(a=n[$]).pivotArea,!(0,v.ht)(i.outline)&&(a=a.formula,i=i.references[0],i=(St=T.fields[i.field]).entities[i.indexes[0]]&&St.entities[i.indexes[0]].value)&&Pt.addCalcItem(St.name,i,a);if(0<y.length){for(h=0,b=y=Pt.Q_e(y,K);h<b.length;h++)if((V=(N=b[h]).fieldGroup)&&(Q=(0,v.ht)(V.base)?N:M[V.base]))if((it={}).originFieldName=Q.name,(0,v.ht)(V.groupInterval))if((0,v.ht)(V.groupBy)&&(0,v.ht)(V.Fii)){if((0,v.ht)(V.parent)){if(m=V.discreteGroup,R=V.groupItems,m&&0<m.length&&R&&0<R.length)for(it.textGroup={fieldName:N.name,groupItems:{}},z=it.textGroup.groupItems,ct=0;ct<m.length;ct++)Tt=!(0,v.ht)(m[ct])&&R[m[ct]]&&R[m[ct]].value,(0,v.ht)(Tt)||((0,v.ht)(z[Tt])&&(z[Tt]=[]),z[Tt].push(Q.entities[ct]&&Q.entities[ct].value));Pt.dy(it)}}else{if((it.groupSourceField=!(It=[]),v.ht)(V.groupBy)||(It.push({start:V.autoStart===!0?F:new Date(V.startDate),end:V.autoEnd===!0?F:new Date(V.endDate),by:dt(V.groupBy)}),it.groupSourceField=!0),(t=V.Fii)&&0<t.length)for(r=0,u=t;r<u.length;r++)d=u[r].fieldGroup,It.push({start:V.autoStart===!0?F:new Date(d.startDate),end:V.autoEnd===!0?F:new Date(d.endDate),by:dt(d.groupBy)});it.dateGroups=It,Pt.dy(it)}else it.numberGroup={start:V.autoStart===!0?F:V.startNum,end:V.autoEnd===!0?F:V.endNum,by:V.groupInterval},Pt.dy(it)}if(0<G.length)for(c=0;c<G.length;c++)Pt.addCalcField((Ot=G[c]).name,Ot.formula);(0,v.ht)(T.overwriteList)||((0,v.ht)(Pt.Z$t)&&(Pt.Z$t=new U.OverwriteList),Pt.Z$t.fromJSON(T.overwriteList)),nt(M,Pt.Pq),Pt.hii(),Pt.bii()},k.prototype.yh=function(l,T,D){var M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St,$,n,a,i,h,b,Q,it,It,t,r,u,d,m,R,z,ct,Tt,Ot,Pt,Jt,$t,e,p,C,W,x,yt,_t,Lt,Et=((Lt=this).Xnn=l).lossless;if((0,v.ht)(l.name)?(0,v.ht)(Et&&Et.cacheName)?Lt.Zc=T:Lt.Zc=l.lossless.cacheName:Lt.Zc=l.name,(0,v.ht)(T)||(Lt.FVt=+T),T=(T=(T=(T=(0,v.xr)(l,"extLst"))&&(0,v.xr)(T,"ext"))&&(0,v.xr)(T,"pivotCacheDefinition"))&&T.pivotCacheId,(0,v.ht)(T)||(Lt.yQt=+T),(0,v.ht)(Et&&Et.overwriteList)||((0,v.ht)(Lt.Z$t)&&(Lt.Z$t=new U.OverwriteList),Lt.Z$t.fromJSON(Et.overwriteList)),(0,v.ht)(l.recordCount)||(Lt.recordCount=+l.recordCount),l.refreshOnLoad&&(Lt.tNe=!!l.refreshOnLoad),T=(0,v.xr)(l,"cacheSource"),(0,v.ht)(T)||(Lt.sourceType=T.type,M=(T=(Et="",v.xr)(T,"worksheetSource"))&&T.sheet,(0,v.ht)(M)||(M=(0,v.xmlDecode)(M),Lt.sheet=Et=M,(0,v.ht)(T.ref))||(Et="=".concat((0,mt.qTe)(M),"!").concat(T.ref),Lt.ref=T.ref),M=T&&T.name,(0,v.ht)(M)||(M=(0,v.xmlDecode)(M),Lt.sourceName=Et=M),Lt.EYt=Et),s=(0,v.xr)(l,"cacheFields"),G=[],K=[],c=[],N=[],(y=(0,mt.RF)(s.c_))&&0<y.length)for(V=0;V<y.length;V++){if(O=y[V],pt=(0,v.xr)(O,"fieldGroup"),O.lp=V,wt=(0,v.xr)(O,"sharedItems"),pt){if(n=+pt.base,et=(0,v.xr)(pt,"rangePr"),ht=(0,v.xr)(pt,"discretePr"),!(0,v.ht)(pt.base)&&((0,v.ht)(wt)||wt.c_&&wt.c_.length===0)&&!(0,v.ht)(et&&et.startDate)){if(St=(0,v.xr)(y[n],"fieldGroup"),(0,v.ht)(y[n])||!(0,v.ht)(St)&&(0,v.ht)(St.Fii)&&(St.Fii=[]),(0,v.ht)(St)){K.push(O);continue}N.push(y[n].name),St.Fii.push(O);continue}if(K.push(O),!(0,v.ht)(ht))continue}if((0,v.ht)(O.formula)){if(($={}).name=O.name,$.index=V,n=wt&&wt.c_&&0<wt.c_.length,(0,v.ht)(n)){if(l.lossless&&l.lossless.Rti)for(a=0,i=l.lossless.Rti;a<i.length;a++)(h=i[a]).name===$.name&&($.dataType=h.dataType)}else $.dataType=Lt.Pii(wt.c_[0]);$.name=Mt((0,v.xmlDecode)($.name)),(b=Lt.Uti($)).yh(O,D&&D.c_&&D.c_[0]&&D.c_[0].c_[V]),G.push(b)}else c.push(O)}for(Lt.wii(G,D),it=(T=(Q=0,v.xr)(l,"calculatedItems"))&&T.c_||[];Q<it.length;Q++)It=it[Q],u=(0,v.xr)(It,"pivotArea"),!(0,v.ht)(u.outline)&&(It=(0,v.xmlDecode)(It.formula),u=(0,v.xr)(u,"references").c_[0],t=(0,v.xr)(u,"x"),b=s.c_[+u.field],t=(u=(r=(0,v.xr)(b,"sharedItems").c_)[+t.v])&&u.v)&&Lt.addCalcItem(b.name,t,It);if(0<K.length){for(d=0,m=K=Lt.Q_e(K,N);d<m.length;d++)if(O=m[d],(pt=(0,v.xr)(O,"fieldGroup"))&&(R=(0,v.ht)(pt.base)?O:y[+pt.base]))if((z={}).originFieldName=R.name,et=(0,v.xr)(pt,"rangePr"),(0,v.ht)(et&&et.groupInterval))if((0,v.ht)(et==null?void 0:et.groupBy)&&(0,v.ht)(pt.Fii)){if((0,v.ht)(pt.par)&&(Jt=(ht=(0,v.xr)(pt,"discretePr"))&&ht.c_,e=($t=(0,v.xr)(pt,"groupItems"))&&$t.c_,!(0,v.ht)(Jt))){if(Jt&&0<Jt.length&&e&&0<e.length)for(z.textGroup={fieldName:O.name,groupItems:{}},p=z.textGroup.groupItems,C=0;C<Jt.length;C++)W=!(0,v.ht)(Jt[C])&&e[+Jt[C].v]&&e[+Jt[C].v].v,(0,v.ht)(W)||((0,v.ht)(p[W])&&(p[W]=[]),r=(0,v.xr)(R,"sharedItems"),p[W].push(r.c_[C]&&r.c_[C].v));Lt.dy(z)}}else{if((z.groupSourceField=!(ct=[]),v.ht)(et==null?void 0:et.groupBy)||(ct.push({start:et.autoStart==="1"?F:new Date(Date.parse(et.startDate)),end:et.autoEnd==="1"?F:new Date(Date.parse(et.endDate)),by:dt(et.groupBy)}),z.groupSourceField=!0),($t=pt.Fii)&&0<$t.length)for(Tt=0,Ot=$t;Tt<Ot.length;Tt++)Pt=Ot[Tt],Pt=(0,v.xr)(Pt,"fieldGroup"),(Pt=(0,v.xr)(Pt,"rangePr"))&&ct.push({start:(et==null?void 0:et.autoStart)==="1"?F:new Date(Date.parse(Pt.startDate)),end:(et==null?void 0:et.autoEnd)==="1"?F:new Date(Date.parse(Pt.endDate)),by:dt(Pt.groupBy)});z.dateGroups=ct,Lt.dy(z)}else z.numberGroup={start:et.autoStart==="1"?F:parseFloat(et.startNum),end:et.autoEnd==="1"?F:parseFloat(et.endNum),by:parseFloat(et.groupInterval)},Lt.dy(z)}if(0<c.length)for(x=0,yt=c;x<yt.length;x++)Lt.addCalcField(Mt((0,v.xmlDecode)((_t=yt[x]).name)),Mt((0,v.xmlDecode)(_t.formula)));nt(y,Lt.Pq),Lt.hii(),Lt.bii()},k.prototype.Q_e=function(l,T){for(var D,M,s,y,G,K,c=[],N={},V=(T=T.filter(function(pt,wt,et){return et.indexOf(pt)===wt}),0),O=T;V<O.length;V++)N[O[V]]=!0;if(l&&l.length)if(T&&T.length)for(D=0,M=T;D<M.length;D++)for(s=M[D],y=0,G=l;y<G.length;y++)(K=G[y]).name===s&&c.push(K),N[K.name]||(N[K.name]=!0,c.push(K));else c=l;return c},k.prototype.toJson=function(l,T){var D,M,s,y,G,K,c,N,V,O,pt,wt=this,et=(0,v.ht)(wt.cft)?{}:wt.cft;if((0,v.ht)(wt.FVt)||(et.cacheId=wt.FVt),(0,v.ht)(wt.yQt)?et.pivotCacheId=wt.FVt:et.pivotCacheId=wt.yQt,!(0,v.ht)(T)&&T.isServer&&(et.uuid=wt.jKe()),(0,v.ht)(wt.Zc)||(et.name=wt.Zc),wt.tNe&&(et.refreshOnLoad=1),(0,v.ht)(wt.recordCount)||(et.recordCount=wt.oQt&&wt.oQt.length),(0,v.ht)(wt.EYt)||(et.EYt=wt.EYt),(0,v.ht)(wt.sourceType)||(et.sourceType=wt.sourceType,(0,v.ht)(wt.sheet)||(et.sheet=wt.sheet),(0,v.ht)(wt.ref)||(et.ref=wt.ref),(0,v.ht)(wt.sourceName))||(et.sourceName=wt.sourceName),et.calcItemCount=wt.Vti||0,0<wt.Vti&&(et.calculatedItems=wt._ii()),wt.Pq&&!(0,v.isEmptyObject)(wt.Pq)){for(M in D=[],l)l.hasOwnProperty(M)&&D.push(M);for(G in wt.dot(D),gt(wt,l),s=et.fields=[],y={},wt.Pq)wt.Pq.hasOwnProperty(G)&&s.push(wt.Pq[G].toJson(wt));for(s.sort(function(ht,St){return ht.lp-St.lp}),K=[],c=0;c<s.length;c++)s[c].entities&&0<s[c].entities.length?K.push("x"):(0,v.ht)(s[c].type)?K.push("n"):K.push(s[c].type),(0,v.ht)(s[c].formula)||(y[c]=!0);for(N=[],V=j().blank,c=0;c<wt.oQt.length;c++){for(O=[],pt=0;pt<wt.oQt[c].length;pt++)y[pt]!==!0&&(wt.oQt[c][pt]===V?O.push({type:"n",value:wt.oQt[c][pt]}):O.push({type:K[pt],value:wt.oQt[c][pt]}));N.push(O)}et.pivotCacheRecords=N,et.Rti=wt.Rti}return wt.Z$t&&!wt.Z$t.isEmpty()&&(et.overwriteList=wt.Z$t.toJSON()),et},k.prototype.Lii=function(l,T){return{n_:"pivotArea",outline:"0",c_:[{n_:"references",count:"1",c_:[{n_:"reference",field:l+"",count:"1",c_:[{n_:"x",v:T+""}]}]}]}},k.prototype.Eii=function(){for(var l,T,D,M,s,y,G,K=[],c=0,N=(G=this).yii();c<N.length;c++)if((T=(l=N[c]).ty)&&0<T.length)for(D=0,M=T;D<M.length;D++)s=M[D],y=G.Lii(l.lp,l.P[s]),K[l.WXt[l.P[s]]-1]={n_:"calculatedItem",formula:(0,v.xmlEncode)(l.sh[s].calcItemFormula),c_:[y]};return K},k.prototype.wh=function(l){var T,D,M,s,y,G,K,c,N,V,O,pt,wt,et,ht,St,$,n=($=(St=this).oQt)&&$.length||0,a=(0,v.ht)(St.Xnn)?{}:St.Xnn;if((0,v.ht)(a.pivotCacheDefinition)&&(a.pivotCacheDefinition={n_:"pivotCacheDefinition",r_:[13,14,8,16,15],"r:id":"rId1"}),T=a.pivotCacheDefinition,(0,v.ht)(St.FVt)||(a.cacheId=St.FVt+""),(0,v.ht)(St.recordCount)||(T.recordCount=n+""),(0,v.ht)(T.createdVersion)&&(T.createdVersion="7"),(0,v.ht)(T.refreshedVersion)&&(T.refreshedVersion="7"),St.tNe&&(T.refreshOnLoad="1"),T.c_=[{n_:"extLst",c_:[{n_:"ext",r_:[53,1],c_:[{n_:"pivotCacheDefinition",pivotCacheId:St.yQt+""}]}]}],D={n_:"cacheSource",type:St.sourceType},St.sourceType==="worksheet"&&(M={n_:"worksheetSource"},(0,v.ht)(St.sourceName)||(M.name=(0,v.xmlEncode)(St.sourceName)),(0,v.ht)(St.ref)||(M.ref=(0,v.xmlEncode)(St.ref)),(0,v.ht)(St.sheet)||(M.sheet=(0,v.xmlEncode)(St.sheet)),D.c_=[M]),T.c_.push(D),0<St.Vti&&(M=St.Eii(),T.c_.push({n_:"calculatedItems",count:M.length+"",c_:M})),St.Pq&&!(0,v.isEmptyObject)(St.Pq)){for(y in s=[],l)l.hasOwnProperty(y)&&s.push(y);for(c in St.dot(s),G=[],K={},St.Pq)St.Pq.hasOwnProperty(c)&&G.push(St.Pq[c].wh(St));for(G.sort(function(i,h){return i.lp-h.lp}),G.forEach(function(i){delete i.lp}),T.c_.push({n_:"cacheFields",count:G.length+"",c_:G}),(0,mt.Pr)(T,["cacheSource","cacheFields","calculatedItems","extLst"]),N=[],V=0;V<G.length;V++)(O=(O=(0,v.xr)(G[V],"sharedItems"))&&O.c_)&&0<O.length?N.push("x"):(0,v.ht)(G[V].type)?N.push("n"):N.push(G[V].type),(0,v.ht)(G[V].formula)||(K[V]=!0);for(pt=[],wt=j().blank,V=0;V<n;V++){for(et=[],ht=0;ht<$[V].length;ht++)K[ht]!==!0&&(St.oQt[V][ht]===wt?et.push({n_:"n",v:St.oQt[V][ht]}):et.push({n_:N[ht],v:St.oQt[V][ht]}));pt.push({n_:"r",c_:et})}a.pivotCacheRecords={n_:"pivotCacheRecords",r_:[13,14,8,16,15],count:n,c_:pt}}return T.lossless={cacheName:St.Zc},T.lossless.Rti=St.Rti,St.Z$t&&!St.Z$t.isEmpty()&&(T.lossless.overwriteList=St.Z$t.toJSON()),a},k.prototype._ii=function(){for(var l,T,D,M,s,y,G,K=[],c=0,N=(G=this).yii();c<N.length;c++)if((T=(l=N[c]).ty)&&0<T.length)for(D=0,M=T;D<M.length;D++)s=M[D],(y={formula:l.sh[s].calcItemFormula,pivotArea:null}).pivotArea=G.Bii(l.lp,l.P[s]),K[l.WXt[l.P[s]]-1]=y;return K},k.prototype.Bii=function(l,T){var D={};return D.references=[{field:l,indexes:[T]}],D.outline=!0,D},k.prototype.$Vt=function(l,T){var D=this;(0,v.ht)(D.Z$t)&&(D.Z$t=new U.OverwriteList),D.Z$t.setOverwriteNode(l,T)},k.prototype.tQt=function(l){return this.Z$t&&this.Z$t.getOverwriteValue(l)},k.prototype.nQt=function(l){this.Z$t&&this.Z$t.removeOverwriteNode(l)},k.prototype.eQt=function(){return this.Z$t&&this.Z$t.getOverwriteList()},k.prototype.rQt=function(){this.Z$t&&this.Z$t.reset()},f.PivotCache=k,Ct.prototype.getName=function(l){var T=j().dateResource;switch(l){case _.DateGroupType.seconds:return T.Seconds;case _.DateGroupType.minutes:return T.Minutes;case _.DateGroupType.hours:return T.Hours;case _.DateGroupType.days:return T.Days;case _.DateGroupType.months:return T.Months;case _.DateGroupType.quarters:return T.Quarters;case _.DateGroupType.years:return T.Years}},Ct.prototype.insertIndexToIndexMap=function(l,T){var D=(y=this).groupItemsKeyList,M=y.groupItemsIndexMap,s=y.groupItemsKeyIndexes,y=(y.type==="number"?v.getNumberGroupItemKey:v.getDateGroupItemKey)(y,l);(0,v.ht)(M[y])&&(M[y]=[],D.push(y),s[y]=D.length-1),M[y]=(0,v.F)(M[y],T)},Y=Ct,f.getPathStr=Bt,f.io=Mt},"./src/pivot-calc-engine.ts":function(H,f,B){var vt,mt,tt,_,v,Ft,w,I;function U(E){return w.call(this,E)||this}function g(E){return(E=I.call(this,E)||this).resolvers=[new mt.DefaultTokenResolver(5e3)],E}function F(E,A,Y){var L,q,J,P,bt;if(E.type===8&&Y)throw new Error;if(E.type===14)A.push(E.value);else if(E.value instanceof mt.Expression)F(E.value,A,Y);else if(Array.isArray(E.value))for(L=0,q=E.value;L<q.length;L++)(J=q[L])instanceof mt.Expression&&F(J,A,Y);else if(Array.isArray(E.arguments))for(P=0,bt=E.arguments;P<bt.length;P++)(J=bt[P])instanceof mt.Expression&&F(J,A,Y)}function ot(E,A){var Y,L,q,J,P,bt,k,nt,gt,Z;if(E.type===8)throw new Error;if(E.type===15)for(Y={},L=E.value,q=0,J=Object.keys(L);q<J.length;q++)P=J[q],Y.field=P,Y.item=L[P],A.push(Y);else if(E.value instanceof mt.Expression)F(E.value,A);else if(Array.isArray(E.value))for(bt=0,k=E.value;bt<k.length;bt++)(nt=k[bt])instanceof mt.Expression&&F(nt,A);else if(Array.isArray(E.arguments))for(gt=0,Z=E.arguments;gt<Z.length;gt++)(nt=Z[gt])instanceof mt.Expression&&F(nt,A)}function j(){this.calcService=new mt.CalcService}vt=this&&this.__extends||(Ft=function(E,A){return(Ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(Y,L){Y.__proto__=L}:function(Y,L){for(var q in L)Object.prototype.hasOwnProperty.call(L,q)&&(Y[q]=L[q])}))(E,A)},function(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function Y(){this.constructor=E}Ft(E,A),E.prototype=A===null?Object.create(A):(Y.prototype=A.prototype,new Y)}),Object.defineProperty(f,"__esModule",{value:!0}),f.PivotCalcService=f.PivotCalcSource=void 0,mt=B("CalcEngine"),tt=B("./src/pivot-util.ts"),_=B("./src/pivot-interface.ts"),vt(U,w=mt.TokenResolver),U.prototype.setPivotCache=function(E){this.pivotCache=E},U.prototype.resolveToken=function(E,A,Y,L,q){for(var J,P,bt,k,nt=this.pivotCache.Pq,gt="";L<Y.length&&(J=Y[L])._type===0;L++)gt+=J.Awt;return 0<gt.length&&(bt=function(Z,ut){var Rt,Ct,Bt,kt,ie,Xt,Qt,dt,xt,Mt={},st=(ut=ut.trim()).length,l=Ct=Rt=0,T=/^('|")([\d\D]*)\1$/g;for(ut=ut.replace(/'{2,2}/g,"'");l<st;){if((Ct=ut.indexOf("[",l))<0)return;if(Bt=ut.slice(Rt,Ct),T.lastIndex=0,kt=Z[Bt=T.test(Bt)?Bt.slice(1,Bt.length-1):Bt],l=Ct+1,!(0,tt.ht)(kt)){for(;(0,tt.ht)(Mt[Bt]);){if(ie=ut.indexOf("]",l),Xt=ut.slice(Ct+1,ie),Qt=kt.W5,dt=Xt,xt=kt.D,(0,tt.ht)(Xt)||Xt.length<=0||ie<0)return;T.lastIndex=0,T.test(Xt)&&(dt=Xt.slice(1,Xt.length-1),Qt!==_.PivotDataType.number||isNaN(+dt)||(0<=xt.indexOf(dt)?Mt[Bt]=dt:0<=xt.indexOf(+dt)&&(Mt[Bt]=+dt))),0<=xt.indexOf(dt)&&(Mt[Bt]=dt),l=ie+1}Rt=l}}return Mt}(nt,gt),!(0,tt.ht)(bt))&&0<Object.keys(bt).length?((P=new mt.Expression(15)).value=bt,{expr:P,index:L}):nt[gt]?((P=new mt.Expression(14)).value=gt,{expr:P,index:L}):(k=(bt=gt).length-1,nt[bt=bt.charAt(0)==="'"&&bt.charAt(k)==="'"?bt.substring(1,k):bt]?((P=new mt.Expression(14)).value=bt,{expr:P,index:L}):void 0)},U.prototype.unparse=function(E,A,Y,L){return Y.type===14&&(Y.value.indexOf(" ")?(L.push("'"),L.push(Y.value),L.push("'")):L.push(Y.value),!0)},v=U,vt(g,I=mt.CalcSource),g.prototype.setPivotCache=function(E){this.pivotCache=E;var A=new v(6e3);A.setPivotCache(E),this.resolvers.unshift(A)},g.prototype.getResolver=function(){return this.resolvers},g.prototype.getField=function(E){var A=this.measureNode;if(!(0,tt.ht)(A))return A[E]&&A[E].calc&&A[E].calc.sum},g.prototype.setContext=function(E){this.DJ=E},g.prototype.getFieldItem=function(){var E,A=(E=this).expression,Y=E.calcType,L=E.cacheName,q=E.pathInfo,J=E.resultIndex;return E.subtotalManager.getFieldCalcItem(arguments[0],A,q,Y,L,J)},g.prototype.setCalcInfo=function(E,A,Y,L,q,J){var P=this;P.calcType=E,P.subtotalManager=A,P.pathInfo=Y,P.cacheName=L,P.expression=q,P.resultIndex=J},g.prototype.setMeasureNode=function(E){this.measureNode=E},f.PivotCalcSource=g,j.prototype.fii=function(E){this.calcSource=E},j.prototype.getCalcSource=function(){return this.calcSource},j.prototype.parseFormulaToCalcRelatedFieldNames=function(E,A){var Y,L,q,J,P,bt=(k=this).calcService,k=k.calcSource;for((k=bt.getParserContext(k)).useR1C1=bt.useR1C1,k.row=0,k.column=0,bt=bt.j3t,E=E.split(""),E=bt.parseToTokens(k,E,!0),L=[],J=(Y=bt.eDt(k,E,!(q=0))).length;q<J;q++)F(Y[q],L,A);return bt=bt.buildExpressionTree(k,E,!1),P=!1,bt.forEachNodes(function(nt){nt.type===8&&(nt.value="#NAME?",P=!0)}),{names:L,exprs:P?bt:void 0}},j.prototype.parseFormulaToCalcRelatedFieldItemMap=function(E){var A,Y,L,q,J,P;if((0,tt.ht)(E))return{};for(Y=(A=this).calcService,A=A.calcSource,(A=Y.getParserContext(A)).useR1C1=Y.useR1C1,A.row=0,A.column=0,Y=Y.j3t,E=E.split(""),E=Y.parseToTokens(A,E,!0),q=[],P=(L=Y.eDt(A,E,!(J=0))).length;J<P;J++)ot(L[J],q);return function(bt){var k,nt,gt,Z,ut={};if(!(0,tt.ht)(bt))for(k=0,nt=bt;k<nt.length;k++)gt=(Z=nt[k]).field,Z=Z.item,(0,tt.ht)(gt)||(ut[gt]?ut[gt].push(Z):ut[gt]=[Z]);return ut}(q)},j.prototype.getResolvers=function(){return this.calcSource.getResolver()},j.prototype.getGlobalSourceModel=function(E){return this.calcService.getGlobalSourceModel(E)},f.PivotCalcService=j},"./src/pivot-condition.ts":function(H,f,B){var vt,mt,tt;function _(q,J,P){switch(q){case vt.PivotValueFilterOperator.equalsTo:return function(bt){return J===+bt};case vt.PivotValueFilterOperator.notEqualsTo:return function(bt){return J!==+bt};case vt.PivotValueFilterOperator.greaterThan:return function(bt){return J<+bt};case vt.PivotValueFilterOperator.greaterThanOrEqualsTo:return function(bt){return J<=+bt};case vt.PivotValueFilterOperator.lessThan:return function(bt){return+bt<J};case vt.PivotValueFilterOperator.lessThanOrEqualsTo:return function(bt){return+bt<=J};case vt.PivotValueFilterOperator.between:return function(bt){return J<=+bt&&+bt<=P};case vt.PivotValueFilterOperator.notBetween:return function(bt){return+bt<J||P<+bt}}}function v(q,J,P){var bt;this.sn=vt.PivotConditionType.value,(bt=this).LVt=q,J=isNaN(+J)?NaN:+J,(0,mt.ht)(P)?(bt.iX=tt,bt.eX=J):(P=isNaN(+P)?NaN:+P,bt.eX=Math.min(J,P),bt.iX=Math.max(J,P)),bt.evaluate=_(q,bt.eX,bt.iX)}function Ft(q){var J,P,bt,k,nt,gt,Z,ut=this.LVt,Rt=this._type,Ct=this.GVt,Bt=q==null?void 0:q.length,kt=ut===vt.PivotTop10FilterOperator.top,ie={};if(Bt){if(q.sort(function(Xt,Qt){return Xt.value-Qt.value}),ut=void 0,J=0,Rt===vt.PivotTop10FilterType.count)if(q.length<=Ct)J=Bt;else if(J=1,kt)for(P=q[q.length-1].value,bt=q.length-2;0<=bt;bt--){if(P!==q[bt].value){if(Ct<=J)break;P=q[bt].value}J++}else for(P=q[0].value,bt=1;bt<=q.length;bt++){if(P!==q[bt].value){if(Ct<=J)break;P=q[bt].value}J++}else if(Rt===vt.PivotTop10FilterType.sum||Rt===vt.PivotTop10FilterType.percent){for(k=Bt-1,nt=q[kt?Bt-1:0].value,gt=0,Z=function(){var Xt,Qt;if(Rt===vt.PivotTop10FilterType.sum)return function(){return nt<Ct};for(Xt=0;Xt<=k;Xt++)gt+=q[Xt].value;return Qt=Ct/100,function(){return nt/gt<Qt}}();Z()&&J+1<Bt;)J++,nt+=q[kt?k-J:J].value;J++}ut=kt?q.slice(-1*J):q.slice(0,J),(0,mt.o)(ut,function(Xt){ie[Xt.index]=!0})}return ie}function w(q,J,P){this.sn=vt.PivotConditionType.top10;var bt=this;bt.LVt=q,bt._type=J,bt.GVt=P,bt.evaluate=Ft}function I(q,J,P){switch(q){case vt.PivotCaptionFilterOperator.equalsTo:return function(bt){return(0,mt.Rii)(J,bt)};case vt.PivotCaptionFilterOperator.notEqualsTo:return function(bt){return!(0,mt.Rii)(J,bt)};case vt.PivotCaptionFilterOperator.beginsWith:return function(bt){return(0,mt.Gii)(J,bt)};case vt.PivotCaptionFilterOperator.doesNotBeginWith:return function(bt){return!(0,mt.Gii)(J,bt)};case vt.PivotCaptionFilterOperator.endsWith:return function(bt){return(0,mt.Vii)(J,bt)};case vt.PivotCaptionFilterOperator.doesNotEndWith:return function(bt){return!(0,mt.Vii)(J,bt)};case vt.PivotCaptionFilterOperator.contains:return function(bt){return(0,mt.Uii)(J,bt)};case vt.PivotCaptionFilterOperator.doesNotContain:return function(bt){return!(0,mt.Uii)(J,bt)};case vt.PivotCaptionFilterOperator.greaterThan:return function(bt){return 0<(bt+"").localeCompare(J,"kn",{numeric:!0})};case vt.PivotCaptionFilterOperator.greaterThanOrEqualsTo:return function(bt){return 0<=(bt+"").localeCompare(J,"kn",{numeric:!0})};case vt.PivotCaptionFilterOperator.lessThan:return function(bt){return(bt+"").localeCompare(J,"kn",{numeric:!0})<0};case vt.PivotCaptionFilterOperator.lessThanOrEqualsTo:return function(bt){return(bt+"").localeCompare(J,"kn",{numeric:!0})<=0};case vt.PivotCaptionFilterOperator.between:return function(bt){return 0<=(bt+"").localeCompare(J,"kn",{numeric:!0})&&(bt+"").localeCompare(P,"kn",{numeric:!0})<=0};case vt.PivotCaptionFilterOperator.notBetween:return function(bt){return(bt+"").localeCompare(J,"kn",{numeric:!0})<0||0<(bt+"").localeCompare(P,"kn",{numeric:!0})}}}function U(q,J,P){this.sn=vt.PivotConditionType.caption;var bt=this;this.LVt=q,bt.eX=(0,mt.ht)(J)?J:J+"",bt.iX=(0,mt.ht)(P)?P:P+"",bt.evaluate=I(q,bt.eX,bt.iX)}function g(q,J){var P=(0,mt.ht)(J)?new Date:new Date(J);return q?(0,mt.DQt)(P).getTime():P.getTime?P.getTime():J}function F(q,J){return J=(0,mt.ht)(J)?new Date:new Date(J),q?(0,mt.DQt)(J):J}function ot(q){if(q%100==0){if(q%400==0)return 1}else if(q%4==0)return 1}function j(q,J){var P=(q=new Date(q.valueOf())).getFullYear(),bt=q.getMonth(),k=q.getDate();return ot(P)&&bt===1&&k===29&&!ot(J)?q.setFullYear(J,1,28):!ot(P)&&bt===1&&k===28&&ot(J)?q.setFullYear(J,1,29):q.setFullYear(J),q}function E(q,J,P){var bt=(q=new Date(q.valueOf())).getMonth(),k=q.getDate(),nt=[0,2,4,6,7,9,11],gt=[3,5,8,10],Z=ot(J)?29:28;return-1<nt.indexOf(bt)&&k===31?-1<gt.indexOf(P)?q.setMonth(P,30):P===1?q.setMonth(P,Z):q.setMonth(P):-1<gt.indexOf(bt)&&k===30?-1<nt.indexOf(P)?q.setMonth(P,31):P===1?q.setMonth(P,Z):q.setMonth(P):bt===1&&k===Z?-1<nt.indexOf(P)?q.setMonth(P,31):-1<gt.indexOf(P)?q.setMonth(P,30):q.setMonth(P):(bt=new Date(J,P+1,0).getDate())<k?q.setMonth(P,bt):q.setMonth(P),q}function A(q,J,P,bt){return E(new Date(q.valueOf()),J,3*P+bt)}function Y(q,J,P,bt,k,nt,gt){var Z,ut;if(q<=vt.PivotDateFilterOperator.notBetween)switch(q){case vt.PivotDateFilterOperator.equalsTo:return function(Rt){return g(bt,J)===g(bt,Rt)};case vt.PivotDateFilterOperator.notEqualsTo:return function(Rt){return g(bt,J)!==g(bt,Rt)};case vt.PivotDateFilterOperator.before:return function(Rt){return g(bt,J)>g(bt,Rt)};case vt.PivotDateFilterOperator.beforeEqualsTo:return function(Rt){return g(bt,J)>=g(bt,Rt)};case vt.PivotDateFilterOperator.after:return function(Rt){return g(bt,J)<g(bt,Rt)};case vt.PivotDateFilterOperator.afterEqualsTo:return function(Rt){return g(bt,J)<=g(bt,Rt)};case vt.PivotDateFilterOperator.Between:return function(Rt){return function(Ct,Bt,kt,ie){return g(ie,Ct)>=g(ie,Bt)&&g(ie,Ct)<=g(ie,kt)}(Rt,J,P,bt)};case vt.PivotDateFilterOperator.notBetween:return function(Rt){return g(bt,Rt)<g(bt,J)||g(bt,Rt)>g(bt,P)}}if(8<=q&&q<=23)switch(bt=!0,q){case vt.PivotDateFilterOperator.today:return function(Rt){return g(bt)===g(bt,Rt)};case vt.PivotDateFilterOperator.yesterday:return function(Rt){return g(bt)-mt.PRE_DAY===g(bt,Rt)};case vt.PivotDateFilterOperator.tomorrow:return function(Rt){return g(bt)+mt.PRE_DAY===g(bt,Rt)};case vt.PivotDateFilterOperator.last7Days:return function(Rt){var Ct=g(bt);return Rt=g(bt,Rt),Ct-7*mt.PRE_DAY<=Rt&&Rt<Ct};case vt.PivotDateFilterOperator.thisMonth:return function(Rt){var Ct=new Date;return Ct.getFullYear()===Rt.getFullYear()&&Ct.getMonth()===Rt.getMonth()};case vt.PivotDateFilterOperator.lastMonth:return function(Rt){var Ct=(Bt=new Date).getMonth()-1,Bt=Bt.getFullYear();return Ct<0&&(Ct=11,Bt--),Rt.getFullYear()===Bt&&Rt.getMonth()===Ct};case vt.PivotDateFilterOperator.nextMonth:return function(Rt){var Ct=(Bt=new Date).getMonth()+1,Bt=Bt.getFullYear();return 11<Ct&&(Ct=0,Bt++),Rt.getFullYear()===Bt&&Rt.getMonth()===Ct};case vt.PivotDateFilterOperator.thisWeek:return function(Rt){var Ct=(0,mt.DQt)(new Date),Bt=(0,mt.DQt)(new Date);return Ct.setDate(Ct.getDate()-Ct.getDay()),Bt.setDate(Bt.getDate()-Bt.getDay()+6),Ct<=Rt&&Rt<=Bt};case vt.PivotDateFilterOperator.lastWeek:return function(Rt){var Ct=(0,mt.DQt)(new Date),Bt=(0,mt.DQt)(new Date);return Ct.setDate(Ct.getDate()-Ct.getDay()-7),Bt.setDate(Bt.getDate()-Bt.getDay()),Ct<=Rt&&Rt<=Bt};case vt.PivotDateFilterOperator.nextWeek:return function(Rt){var Ct=(0,mt.DQt)(new Date),Bt=(0,mt.DQt)(new Date);return Ct.setDate(Ct.getDate()-Ct.getDay()+7),Bt.setDate(Bt.getDate()-Bt.getDay()+14),Ct<=Rt&&Rt<=Bt};case vt.PivotDateFilterOperator.nextQuarter:return function(Rt){var Ct,Bt,kt=new Date,ie=(Bt=(kt=(0,mt.DQt)(kt)).getMonth())%3;return kt.setDate(1),kt.setMonth(Bt-ie+3),(Ct=(0,mt.DQt)(new Date)).setMonth(Bt-ie+5),Ct.getMonth()===2||Ct.getMonth()===11?Ct.setDate(32):Ct.setDate(31),Rt>=(0,mt.DQt)(kt)&&Rt<(0,mt.DQt)(Ct)};case vt.PivotDateFilterOperator.thisQuarter:return function(Rt){var Ct,Bt,kt=new Date,ie=(Bt=(Ct=(0,mt.DQt)(kt)).getMonth())%3;return Ct.setDate(1),Ct.setMonth(Bt-ie),(kt=(0,mt.DQt)(kt)).setMonth(Bt-ie+2),kt.getMonth()===2||kt.getMonth()===11?kt.setDate(32):kt.setDate(31),Rt>=(0,mt.DQt)(Ct)&&Rt<(0,mt.DQt)(kt)};case vt.PivotDateFilterOperator.lastQuarter:return function(Rt){var Ct,Bt,kt=new Date,ie=(Bt=(Ct=(0,mt.DQt)(kt)).getMonth())%3;return Ct.setDate(1),Ct.setMonth(Bt-ie-3),(kt=(0,mt.DQt)(kt)).setMonth(Bt-ie-1),kt.getMonth()===2||kt.getMonth()===11?kt.setDate(32):kt.setDate(31),Rt>=(0,mt.DQt)(Ct)&&Rt<(0,mt.DQt)(kt)};case vt.PivotDateFilterOperator.nextYear:return function(Rt){return(0,mt.DQt)(new Date).getFullYear()+1===Rt.getFullYear()};case vt.PivotDateFilterOperator.thisYear:return function(Rt){return(0,mt.DQt)(new Date).getFullYear()===Rt.getFullYear()};case vt.PivotDateFilterOperator.lastYear:return function(Rt){return(0,mt.DQt)(new Date).getFullYear()-1===Rt.getFullYear()}}return q>=vt.PivotDateFilterOperator.Q1&&q<=vt.PivotDateFilterOperator.Q4?function(Rt){return q-vt.PivotDateFilterOperator.Q1===Math.floor(Rt.getMonth()/3)}:q>=vt.PivotDateFilterOperator.M1&&q<=vt.PivotDateFilterOperator.M12?function(Rt){return q-vt.PivotDateFilterOperator.M1===Rt.getMonth()}:q===vt.PivotDateFilterOperator.yearToDate?function(Rt){var Ct=new Date,Bt=new Date;return Ct.setMonth(0,1),Ct.setHours(0,0,0,0),Bt.setHours(23,59,59),Ct<=Rt&&Rt<=Bt}:q===vt.PivotDateFilterOperator.dateToDate?(Z=F(bt,J),ut=k?F(bt):F(bt,P),nt?gt===vt.PivotAdvancedDateFilterBy.year?function(Rt){return function(Ct,Bt,kt){for(var ie,Xt=Bt.getFullYear(),Qt=kt.getFullYear(),dt=Xt;dt<=Qt;dt++)if(Bt<=(ie=j(Ct,dt))&&ie<=kt)return!0;return!1}(F(bt,Rt),Z,ut)}:gt===vt.PivotAdvancedDateFilterBy.quarter?function(Rt){return function(Ct,Bt,kt){for(var ie,Xt,Qt=Bt.getFullYear(),dt=Math.floor(Bt.getMonth()/3),xt=kt.getFullYear(),Mt=Math.floor(kt.getMonth()/3),st=Ct.getMonth()%3,l=Qt;l<=xt;l++)for(ie=j(Ct,l),l!==xt&&(Mt=3),Xt=dt=l!==Qt?0:dt;Xt<=Mt;Xt++)if(Bt<=(ie=A(ie,l,Xt,st))&&ie<=kt)return!0;return!1}(F(bt,Rt),Z,ut)}:gt===vt.PivotAdvancedDateFilterBy.month?function(Rt){return function(Ct,Bt,kt){for(var ie,Xt,Qt=Bt.getFullYear(),dt=Bt.getMonth(),xt=kt.getFullYear(),Mt=kt.getMonth(),st=Qt;st<=xt;st++)for(ie=j(Ct,st),st!==xt&&(Mt=11),Xt=dt=st!==Qt?0:dt;Xt<=Mt;Xt++)if(Bt<=(ie=E(ie,st,Xt))&&ie<=kt)return!0;return!1}(F(bt,Rt),Z,ut)}:void 0:function(Rt){return g(bt,Rt)>=g(bt,Z)&&g(bt,Rt)<=g(bt,ut)}):void 0}function L(q,J,P,bt,k,nt,gt){this.sn=vt.PivotConditionType.date;var Z=this;Z.LVt=q,Z.eX=P,Z.iX=bt,Z.xQt=J,Z.BVt=k,Z._by=gt,Z.EVt=nt,Z.evaluate=Y(q,Z.eX,Z.iX,J,k,nt,gt)}Object.defineProperty(f,"__esModule",{value:!0}),f.PivotFilterDateCondition=f.Qii=f.SQt=f.PivotFilterCaptionCondition=f.PivotFilterTop10Condition=f.PivotFilterValueCondition=void 0,vt=B("./src/pivot-interface.ts"),mt=B("./src/pivot-util.ts"),tt=void 0,v.prototype.getConditionType=function(){return this.sn},v.prototype.toJSON=function(){var q=(J=this).LVt,J=J.LVt===vt.PivotValueFilterOperator.between||vt.PivotValueFilterOperator.notBetween?[J.eX,J.iX]:[J.eX];return{conType:vt.PivotConditionType.value,val:J,operator:q}},v.prototype.fromJSON=function(q){var J,P=q.val;q=q.operator,(J=this).LVt=q,P instanceof Array?(J.eX=P[0],J.iX=P[1]):(J.eX=P,J.iX=tt),J.evaluate=_(J.LVt,J.eX,J.iX)},f.PivotFilterValueCondition=v,w.prototype.getConditionType=function(){return this.sn},w.prototype.toJSON=function(){var q=(P=this).LVt,J=P.GVt,P=P._type;return{conType:vt.PivotConditionType.top10,val:J,type:P,operator:q}},w.prototype.fromJSON=function(q){var J,P=q.val,bt=q.operator;q=q.type,(J=this).LVt=bt,J._type=q,J.GVt=P},f.PivotFilterTop10Condition=w,U.prototype.getConditionType=function(){return this.sn},U.prototype.toJSON=function(){var q=(J=this).LVt,J=(0,mt.ht)(J.iX)?[J.eX]:[J.eX,J.iX];return{conType:vt.PivotConditionType.caption,val:J,operator:q}},U.prototype.fromJSON=function(q){var J,P=q.val;q=q.operator,(J=this).LVt=q,J.eX=P[0],J.iX=P[1],J.evaluate=I(J.LVt,J.eX,J.iX)},f.PivotFilterCaptionCondition=U,f.SQt=g,f.Qii=F,L.prototype.getConditionType=function(){return this.sn},L.prototype.toJSON=function(){var q=this,J=q.LVt,P=q.xQt,bt=(0,mt.ht)(q.iX)?[q.eX]:[q.eX,q.iX];return{conType:vt.PivotConditionType.date,val:bt,operator:J,isWholeDay:P,isDynamicEndDate:q.BVt,isParallel:q.EVt,by:q._by}},L.prototype.fromJSON=function(q){var J,P=q.val,bt=q.operator,k=q.isWholeDay,nt=q.isDynamicEndDate,gt=q.isParallel;q=q.by,(J=this).LVt=bt,J.xQt=k,J.BVt=nt,J._by=q,J.EVt=gt,P instanceof Array?(J.eX=P[0],J.iX=P[1]):(J.eX=P,J.iX=tt),J.evaluate=Y(J.LVt,J.eX,J.iX,k,J.BVt,J.EVt,J._by)},f.PivotFilterDateCondition=L},"./src/pivot-engine.ts":function(H,f,B){var vt,mt,tt;function _(){var w=this;w.cut={},w.resetDataAnalyzer(),w.Wii=1,w.zii=1e8}function v(w,I,U){for(var g,F={},ot=0,j=Object.keys(I);ot<j.length;ot++)F[(g=I[j[ot]]).FVt]=g;for(;F[w]&&F[w]!==U;)w++;return w}function Ft(w,I){return w!=="external"||!(0,tt.ht)(I)}Object.defineProperty(f,"__esModule",{value:!0}),f.PivotEngine=void 0,vt=B("./src/pivot-cache.ts"),mt=B("./src/data-analyzer.ts"),tt=B("./src/pivot-util.ts"),_.prototype.hasPivotCache=function(w){return!!this.cut[w]},_.prototype.addPivotCache=function(w){var I,U=this;return U.cut[w.getName()]=w,I=(0,tt.ht)(w.FVt)?v(U.Wii,U.cut,w):v(w.FVt,U.cut,w),U.Wii=I+1,w.FVt=I,(0,tt.ht)(w.yQt)?(w.yQt=U.zii,U.zii++):w.yQt>=U.zii&&(U.zii=w.yQt+1),w},_.prototype.getPivotCacheByName=function(w){return this.cut[w]},_.prototype.getPivotCacheByCacheId=function(w){var I,U=this.cut;for(I in U)if(U.hasOwnProperty(I)&&U[I].FVt===w)return U[I]},_.prototype.getPivotCacheByPivotCacheId=function(w){var I,U=this.cut;for(I in U)if(U.hasOwnProperty(I)&&U[I].yQt===w)return U[I]},_.prototype.gJt=function(w){var I,U=this;for(I in U.cut)if(U.cut.hasOwnProperty(I)&&U.cut[I].mii(w))return U.cut[I];return null},_.prototype.dispose=function(){var w,I=this;for(w in I.cut)I.cut.hasOwnProperty(w)&&I.cut[w].dispose();I.cut={},I.Zii=null},_.prototype.reset=function(){this.cut={}},_.prototype.update=function(){},_.prototype.queryItem=function(w,I,U){for(var g,F=this.getPivotCacheByName(w),ot=!1,j=0,E=I;j<E.length;j++)if(g=E[j],(g=(g=F.getField(g.sourceName)).cC()?F.getField(g.y1):g).ty&&0<g.ty.length){ot=!0;break}return this.Zii.nti(F,this.Zii.Lh(F,I,ot),I,U)},_.prototype.TQt=function(w,I,U){return w=this.getPivotCacheByName(w),this.Zii.TQt(w,this.Zii.Lh(w,I),U)},_.prototype.getCalcFields=function(w){return(w=this.getPivotCacheByName(w))?w.WVt():[]},_.prototype.addGroup=function(w,I){return!!(w=this.getPivotCacheByName(w))&&w.dy(I)},_.prototype.fromJson=function(w){var I,U,g;for(I in this.resetDataAnalyzer(),w)w.hasOwnProperty(I)&&Ft((U=w[I]).sourceType,U.pivotCacheRecords)&&(U=new vt.PivotCache,g=w[I].cacheId+"",U.fromJson(g,w[I],this),this.addPivotCache(U))},_.prototype.toJson=function(w,I,U){for(var g,F,ot=this.cut,j={},E=U==null?void 0:U.isServer,A=0,Y=I;A<Y.length;A++)F=ot[g=Y[A]],(0,tt.ht)(F)||(j[E?F.jKe():F.FVt]=F.toJson(w[g],U));return j},_.prototype.yh=function(w,I,U){var g;Ft((g=(0,tt.xr)(w,"cacheSource"))==null?void 0:g.type,U)&&(this.resetDataAnalyzer(),(g=new vt.PivotCache).yh(w,I,U),this.addPivotCache(g))},_.prototype.wh=function(w,I){for(var U,g,F=this.cut,ot={},j=0,E=I;j<E.length;j++)g=F[U=E[j]],(0,tt.ht)(g)||(ot[g.Zc]=g.wh(w[U]));return ot},_.prototype.resetDataAnalyzer=function(){this.Zii=new mt.DataAnalyzer},f.PivotEngine=_},"./src/pivot-interface.ts":function(H,f){var B;Object.defineProperty(f,"__esModule",{value:!0}),f.SortType=f.PivotShowDataAs=f.DateGroupType=f.DataPosition=f.PivotTop10FilterOperator=f.PivotTop10FilterType=f.PivotAdvancedDateFilterBy=f.PivotDateFilterOperator=f.PivotCaptionFilterOperator=f.PivotValueFilterOperator=f.PivotConditionType=f.PivotDataType=f.SubtotalType=f.PivotSourceFieldType=f.PivotShowDataAsBaseItemType=void 0,(B=f.PivotShowDataAsBaseItemType||(f.PivotShowDataAsBaseItemType={}))[B.item=0]="item",B[B.next=1]="next",B[B.previous=2]="previous",(B=f.PivotSourceFieldType||(f.PivotSourceFieldType={}))[B.isCalcField=0]="isCalcField",B[B.isGroupField=1]="isGroupField",(B=f.SubtotalType||(f.SubtotalType={}))[B.average=0]="average",B[B.count=1]="count",B[B.countNums=2]="countNums",B[B.max=3]="max",B[B.min=4]="min",B[B.product=5]="product",B[B.stdDev=6]="stdDev",B[B.stdDevp=7]="stdDevp",B[B.sum=8]="sum",B[B.varr=9]="varr",B[B.varp=10]="varp",(B=f.PivotDataType||(f.PivotDataType={}))[B.number=0]="number",B[B.string=1]="string",B[B.date=2]="date",B[B.boolean=3]="boolean",B[B.errorValue=4]="errorValue",B[B.noValue=5]="noValue",(B=f.PivotConditionType||(f.PivotConditionType={}))[B.caption=0]="caption",B[B.date=1]="date",B[B.value=2]="value",B[B.top10=3]="top10",(B=f.PivotValueFilterOperator||(f.PivotValueFilterOperator={}))[B.equalsTo=0]="equalsTo",B[B.notEqualsTo=1]="notEqualsTo",B[B.greaterThan=2]="greaterThan",B[B.greaterThanOrEqualsTo=3]="greaterThanOrEqualsTo",B[B.lessThan=4]="lessThan",B[B.lessThanOrEqualsTo=5]="lessThanOrEqualsTo",B[B.between=6]="between",B[B.notBetween=7]="notBetween",(B=f.PivotCaptionFilterOperator||(f.PivotCaptionFilterOperator={}))[B.equalsTo=0]="equalsTo",B[B.notEqualsTo=1]="notEqualsTo",B[B.beginsWith=2]="beginsWith",B[B.doesNotBeginWith=3]="doesNotBeginWith",B[B.endsWith=4]="endsWith",B[B.doesNotEndWith=5]="doesNotEndWith",B[B.contains=6]="contains",B[B.doesNotContain=7]="doesNotContain",B[B.greaterThan=8]="greaterThan",B[B.greaterThanOrEqualsTo=9]="greaterThanOrEqualsTo",B[B.lessThan=10]="lessThan",B[B.lessThanOrEqualsTo=11]="lessThanOrEqualsTo",B[B.between=12]="between",B[B.notBetween=13]="notBetween",(B=f.PivotDateFilterOperator||(f.PivotDateFilterOperator={}))[B.equalsTo=0]="equalsTo",B[B.notEqualsTo=1]="notEqualsTo",B[B.before=2]="before",B[B.beforeEqualsTo=3]="beforeEqualsTo",B[B.after=4]="after",B[B.afterEqualsTo=5]="afterEqualsTo",B[B.Between=6]="Between",B[B.notBetween=7]="notBetween",B[B.today=8]="today",B[B.yesterday=9]="yesterday",B[B.tomorrow=10]="tomorrow",B[B.last7Days=11]="last7Days",B[B.thisMonth=12]="thisMonth",B[B.lastMonth=13]="lastMonth",B[B.nextMonth=14]="nextMonth",B[B.thisWeek=15]="thisWeek",B[B.lastWeek=16]="lastWeek",B[B.nextWeek=17]="nextWeek",B[B.nextQuarter=18]="nextQuarter",B[B.thisQuarter=19]="thisQuarter",B[B.lastQuarter=20]="lastQuarter",B[B.nextYear=21]="nextYear",B[B.thisYear=22]="thisYear",B[B.lastYear=23]="lastYear",B[B.Q1=24]="Q1",B[B.Q2=25]="Q2",B[B.Q3=26]="Q3",B[B.Q4=27]="Q4",B[B.M1=28]="M1",B[B.M2=29]="M2",B[B.M3=30]="M3",B[B.M4=31]="M4",B[B.M5=32]="M5",B[B.M6=33]="M6",B[B.M7=34]="M7",B[B.M8=35]="M8",B[B.M9=36]="M9",B[B.M10=37]="M10",B[B.M11=38]="M11",B[B.M12=39]="M12",B[B.yearToDate=40]="yearToDate",B[B.dateToDate=41]="dateToDate",(B=f.PivotAdvancedDateFilterBy||(f.PivotAdvancedDateFilterBy={}))[B.month=1]="month",B[B.quarter=2]="quarter",B[B.year=3]="year",(B=f.PivotTop10FilterType||(f.PivotTop10FilterType={}))[B.count=0]="count",B[B.percent=1]="percent",B[B.sum=2]="sum",(B=f.PivotTop10FilterOperator||(f.PivotTop10FilterOperator={}))[B.top=1]="top",B[B.bottom=-1]="bottom",(B=f.DataPosition||(f.DataPosition={}))[B.row=0]="row",B[B.col=1]="col",B[B.none=2]="none",(B=f.DateGroupType||(f.DateGroupType={}))[B.seconds=0]="seconds",B[B.minutes=1]="minutes",B[B.hours=2]="hours",B[B.days=3]="days",B[B.months=4]="months",B[B.quarters=5]="quarters",B[B.years=6]="years",(B=f.PivotShowDataAs||(f.PivotShowDataAs={}))[B.normal=0]="normal",B[B.percentOfTotal=1]="percentOfTotal",B[B.percentOfRow=2]="percentOfRow",B[B.percentOfCol=3]="percentOfCol",B[B.percent=4]="percent",B[B.percentOfParentRow=5]="percentOfParentRow",B[B.percentOfParentCol=6]="percentOfParentCol",B[B.percentOfParent=7]="percentOfParent",B[B.difference=8]="difference",B[B.percentDiff=9]="percentDiff",B[B.runTotal=10]="runTotal",B[B.percentOfRunningTotal=11]="percentOfRunningTotal",B[B.rankAscending=12]="rankAscending",B[B.rankDescending=13]="rankDescending",B[B.index=14]="index",(B=f.SortType||(f.SortType={}))[B.asc=0]="asc",B[B.desc=1]="desc",B[B.custom=2]="custom"},"./src/pivot-sort.ts":function(H,f,B){var vt,mt,tt,_,v;function Ft(w){var I,U,g,F=[],ot=(g=v().dateResource).HOUR_GROUP_ITEMS.slice(),j=g.MINUTE_GROUP_ITEMS.slice(),E=g.SECOND_GROUP_ITEMS.slice();switch(w){case mt.DateGroupType.quarters:for(I=0;I<tt.quartersGroupItemsKey.length;I++)F.push(g[tt.quartersGroupItemsKey[I]]);break;case mt.DateGroupType.months:for(I=0;I<tt.monthsGroupItemsKey.length;I++)F.push(g[tt.monthsGroupItemsKey[I]]);break;case mt.DateGroupType.days:for(I=0;I<tt.monthsGroupItemsKey.length;I++)for(U=1;U<=tt.dayCountPerMonth[I];U++)F.push((0,_.Yii)(g[tt.monthsGroupItemsKey[I]],U));break;case mt.DateGroupType.hours:for(I=0;I<ot.length;I++)F.push(ot[I]);break;case mt.DateGroupType.minutes:for(I=0;I<j.length;I++)F.push(j[I]);break;case mt.DateGroupType.seconds:for(I=0;I<E.length;I++)F.push(E[I])}return F}Object.defineProperty(f,"__esModule",{value:!0}),f.mXt=f.Hii=f.Jii=f.qii=f.Kii=f.Xii=f.$ii=f.tni=void 0,vt=B("Common"),mt=B("./src/pivot-interface.ts"),tt=B("./src/pivot-util.ts"),_=B("./pivot-entry.ts"),B=new vt.Common.ResourceManager(_.SR),v=B.getResource.bind(B),f.tni=function(w,I){var U,g;return w===I?0:(U=+w,(g=+I)&&U?g<U?1:-1:(""+w).localeCompare(I+""))},f.$ii=function(w,I){return I<=w?1:-1},f.Xii=function(w,I){return w.getMonth()>=I.getMonth()?1:-1},f.Kii=function(w,I){return Math.floor(w.getMonth()/3)>=Math.floor(I.getMonth()/3)?1:-1},f.qii=function(w,I){return I<=w?1:-1},f.Jii=function(w,I){for(var U,g,F=v().blank,ot=I===mt.DateGroupType.years?(w.sort(f.tni),w):Ft(I).concat([]),j=0,E=!1,A=0;A<w.length;A++)w[A]&&w[A]!==F?-1<w[A].indexOf(tt.LESS)?(U=w[A],j++):-1<w[A].indexOf(tt.MORE)&&(g=w[A],j++):E=!0;return I===mt.DateGroupType.years&&(ot=ot.splice(j)),U&&ot.unshift(U),g&&ot.push(g),E&&ot.unshift(F),ot},f.Hii=function(w){for(var I,U=[],g={},F=[],ot=0,j=w.length;ot<j;ot++)I=void 0,-1<w[ot].indexOf(tt.LESS)?I=tt.LESS:-1<w[ot].indexOf(tt.MORE)?I=tt.MORE:-1<w[ot].indexOf(tt.NUMBER_GROUP_SEPARATOR)&&(I=tt.NUMBER_GROUP_SEPARATOR),I=I?w[ot].split(I)[1]:w[ot],U.push(I),g[I]=ot;for(U.sort(f.tni),ot=0,j=U.length;ot<j;ot++)F.push(w[g[U[ot]]]);return F},f.mXt=function(w,I,U){var g,F,ot,j;if(I.isDate)(0,tt.ht)(I.by)?w.sort(function(E,A){return new Date(E)>new Date(A)?1:-1}):w=(0,f.Jii)(w,I.by);else if(I.isNumberGroup)w=(0,f.Hii)(w);else{for(g=[],F=[],ot=[],j=0;j<w.length;j++)w[j]===v().blank?ot.push(w[j]):typeof w[j]=="number"?g.push(w[j]):typeof w[j]=="string"?F.push(w[j]):typeof w[j]=="object"&&F.push(w[j]._error||w[j]+"");1<g.length&&g.sort(function(E,A){return E-A}),1<F.length&&F.sort(function(E,A){return(0,_.ini)(E,A,U)}),w=g.concat(F,ot)}return w}},"./src/pivot-util.ts":function(H,f,B){var vt,mt,tt,_,v,Ft,w,I,U,g,F,ot,j;function E(){}function A(dt,xt,Mt,st,l){return(dt=F.jJ(dt.toLowerCase()))?F.qT(dt=Mt+dt+st).test(xt.toLowerCase()):l()}function Y(dt,xt){for(var Mt=dt.length,st=0;st<Mt&&!xt(dt[st],st);st++);}function L(dt){return dt==null}function q(dt){return typeof dt=="string"}function J(dt){return dt<10?"0"+dt:dt+""}function P(dt){var xt;try{xt=dt.getFullYear()+"-"+J(dt.getMonth()+1)+"-"+J(dt.getDate())+"T"+J(dt.getHours())+":"+J(dt.getMinutes())+":"+J(dt.getSeconds())}catch{}return xt}function bt(dt,xt){return xt.slice(0,dt.length).toLowerCase()===dt.toLowerCase()}function k(dt,xt){return xt.slice(-dt.length).toLowerCase()===dt.toLowerCase()}function nt(dt,xt){return xt===""||0<=dt.toLowerCase().indexOf(xt.toLowerCase())}function gt(dt,xt){return dt.toLowerCase()===xt.toLowerCase()}function Z(dt){return(0,f.getSR)().dateResource[f.monthsGroupItemsKey[dt.getMonth()]]}function ut(dt){var xt;return dt+((xt=I.Fe(I.culture()).TimelineDateSuffix)&&xt.year||"")}function Rt(dt,xt){var Mt;return(Mt=I.Fe(I.culture()).TimelineDateSuffix)&&Mt.date?dt+xt+Mt.date:xt+"-"+dt}function Ct(dt,xt){switch(dt){case _.DateGroupType.seconds:return function(Mt){return(0,f.getSR)().dateResource.SECOND_GROUP_ITEMS[Mt.getSeconds()]}(xt);case _.DateGroupType.minutes:return function(Mt){return(0,f.getSR)().dateResource.MINUTE_GROUP_ITEMS[Mt.getMinutes()]}(xt);case _.DateGroupType.hours:return function(Mt){return(0,f.getSR)().dateResource.HOUR_GROUP_ITEMS[Mt.getHours()]}(xt);case _.DateGroupType.days:return Rt(Z(xt),xt.getDate());case _.DateGroupType.months:return Z(xt);case _.DateGroupType.quarters:return function(Mt){return(0,f.getSR)().dateResource[f.quartersGroupItemsKey[Math.floor(Mt.getMonth()/3)]]}(xt);case _.DateGroupType.years:return ut(xt.getFullYear());default:return P(xt)}}function Bt(dt){var xt=I.Fe(I.culture()).DateTimeFormat,Mt=xt.shortDatePattern;return dt.getHours()===0&&dt.getMinutes()===0&&dt.getSeconds()===0&&dt.getMilliseconds()===0||(Mt=xt.defaultDatePattern),U.Pe(dt,Mt)}function kt(dt){return!L(dt)&&dt!==""&&typeof dt=="string"&&(dt=new Ft().parse(dt))instanceof Date?dt:void 0}function ie(dt){return function(xt,Mt){return String.fromCharCode(parseInt(Mt,dt))}}function Xt(dt,xt,Mt){var st,l,T,D;if(!dt||!dt.c_)return w;for(Mt=Mt?+Mt:0,l=0,T=(st=dt.c_).length;l<T;l++)if((D=st[l])&&D.n_===xt){if(Mt===0)return D;Mt--}}function Qt(dt,xt){var Mt,st,l,T,D;if(!dt||!dt.c_)return w;for(st=[],l=0,T=(Mt=dt.c_).length;l<T;l++)(D=Mt[l])&&D.n_===xt&&st.push(D);return st}vt=this&&this.__spreadArray||function(dt,xt,Mt){if(Mt||arguments.length===2)for(var st,l=0,T=xt.length;l<T;l++)!st&&l in xt||((st=st||Array.prototype.slice.call(xt,0,l))[l]=xt[l]);return dt.concat(st||Array.prototype.slice.call(xt))},Object.defineProperty(f,"__esModule",{value:!0}),f.Pr=f.xr=f.o1=f.xmlDecode=f.xmlEncode=f.parseStringToDate=f.ini=f.RF=f.k$t=f.isEmptyObject=f.getDateGroupItemKey=f.formatDateToString=f.getNumberGroupItemKey=f.nii=f.Oii=f.Zti=f.Wti=f.Yii=f.Yti=f.zti=f.isString=f.DQt=f.PRE_DAY=f.Rii=f.nni=f.Uii=f.eni=f.Vii=f.rni=f.Gii=f.oni=f.ani=f.kQt=f.jh=f.OMt=f.ht=f.sni=f.o=f.Mii=f.amt=f.F=f.uni=f.XFileConstants=f.NUMBER_GROUP_SEPARATOR=f.MORE=f.LESS=f.quartersGroupItemsKey=f.dayCountPerMonth=f.monthsGroupItemsKey=f.getSR=void 0,f.uniqueArray=f.qTe=void 0,mt=B("Common"),tt=B("CalcEngine"),_=B("./src/pivot-interface.ts"),B=B("./pivot-entry.ts"),B=new mt.Common.ResourceManager(B.SR,"PivotEngine"),v=/_x00[0-1][0-9A-Fa-f]_/,f.getSR=B.getResource.bind(B),Ft=mt.Formatter&&mt.Formatter.GeneralFormatter,w=void 0,f.monthsGroupItemsKey=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],f.dayCountPerMonth=[31,29,31,30,31,30,31,31,30,31,30,31],f.quartersGroupItemsKey=["Qtr1","Qtr2","Qtr3","Qtr4"],I=mt.Common.CultureManager,U=mt.Common.ct,f.LESS="<",f.MORE=">",f.NUMBER_GROUP_SEPARATOR="-",g="string",f.XFileConstants={cni:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",ss:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ku:"http://schemas.openxmlformats.org/markup-compatibility/2006",ns:"xr",Ns:"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"},E.qT=function(dt){var xt;return(xt=(xt=E.kUt[dt])||(E.kUt[dt]=new RegExp(dt,"g"))).lastIndex=0,xt},E.jJ=function(dt,xt,Mt){var st,l,T,D,M;if(E._Ut[dt])return E.EUt[dt];if(E.qT("[~?*]+").test(dt)){for(st=[],l=dt.split(""),D={".":!(T=void 0),"+":!0,$:!0,"^":!0,"[":!0,"]":!0,"(":!0,")":!0,"{":!0,"}":!0,"|":!0,"/":!0},M=0;M<l.length;M++)(T=l[M])==="~"&&M<l.length-1?((T=l[++M])==="*"||T==="?"?st.push("\\"):xt&&st.push("~"),st.push(T)):T==="?"?st.push("."):T==="*"?(st.push("[\\s\\S]"),st.push(Mt?"+":"*")):(D[T]&&st.push("\\"),st.push(T));return st.join("")}return null},E.tbt=function(dt,xt,Mt){return(dt=E.jJ(dt,xt,Mt))&&"^"+dt+"$"},E.D9t=function(dt){return dt.replace(/([\~\!\@\#\$\%\^\&\*\(\)\-\_\+\=\[\]\{\}\|\\\;\:\'\"\,\.\/\<\>\?])/,"\\$1")},E.kUt={},E._Ut={},E.EUt={},F=E,f.uni=F,f.F=function(dt,xt){return dt&&xt?(dt.splice.apply(dt,vt([dt.length,xt.length],xt,!1)),dt.sort(function(Mt,st){return Mt-st}),dt):dt||xt||[]},f.amt=function(dt){var xt,Mt,st,l,T,D;if(!dt||dt.length===0)return[];for(xt=dt[0],Mt=dt.length,st={},Y(xt,function(M){st[M]=1}),l=function(M){var s={},y=!0;if(Y(dt[M],function(G){st[G]&&(y=!(s[G]=1))}),st=s,y)return{value:[]}},T=1;T<Mt;T++)if(typeof(D=l(T))=="object")return D.value;return Object.keys(st)},f.Mii=function(dt,xt){for(var Mt=!1,st=0,l=dt.length;st<l;st++)xt===dt[st]&&(Mt=!0);return Mt},f.o=Y,f.sni=function(dt){for(var xt=[],Mt=0;Mt<dt.length;Mt++)xt=xt.concat(dt[Mt]);return xt},f.ht=L,f.OMt=q,f.jh=function(dt){return!L(dt)&&(dt=q(dt)?parseFloat(dt):dt)==dt&&isFinite(dt)},f.kQt=P,f.ani=function(dt){return dt.getUTCFullYear()+"/"+J(dt.getUTCMonth()+1)+"/"+J(dt.getUTCDate())},f.oni=bt,f.Gii=function(dt,xt){return A(dt,xt,"^","",function(){return bt(dt,xt)})},f.rni=k,f.Vii=function(dt,xt){return A(dt,xt,"","$",function(){return k(dt,xt)})},f.eni=nt,f.Uii=function(dt,xt){return A(dt,xt,"","",function(){return nt(xt,L(dt)?"":dt)})},f.nni=gt,f.Rii=function(dt,xt){return A(dt,xt,"","",function(){return gt(xt,L(dt)?"":dt)})},f.PRE_DAY=864e5,f.DQt=function(dt){var xt,Mt,st;return dt&&dt instanceof Date?(xt=dt.getFullYear(),Mt=dt.getMonth(),st=dt.getDate(),new Date(xt,Mt,st)):dt},f.isString=function(dt){return typeof dt=="string"},f.zti=function(){for(var dt=[],xt=(0,f.getSR)().dateResource,Mt=0,st=f.monthsGroupItemsKey.length;Mt<st;Mt++)dt.push(xt[f.monthsGroupItemsKey[Mt]]);return dt},f.Yti=ut,f.Yii=Rt,f.Wti=function(){for(var dt,xt,Mt=[],st=(0,f.getSR)().dateResource,l=0,T=f.monthsGroupItemsKey.length;l<T;l++)for(dt=0,xt=f.dayCountPerMonth[l];dt<xt;dt++)Mt.push(Rt(st[f.monthsGroupItemsKey[l]],dt+1));return Mt},f.Zti=function(){for(var dt=[],xt=(0,f.getSR)().dateResource,Mt=0,st=f.quartersGroupItemsKey.length;Mt<st;Mt++)dt.push(xt[f.quartersGroupItemsKey[Mt]]);return dt},f.Oii=function(dt){return dt&&dt[0]===dt[dt.length-1]&&dt[0]==="'"?dt.substring(1,dt.length-1):dt},f.nii=function(dt){var xt;return typeof dt=="number"?dt:(xt=Date.parse(dt),isNaN(xt)?(xt=new Date(dt),isNaN(xt)?dt:xt):new Date(dt))},f.getNumberGroupItemKey=function(dt,xt){var Mt,st;return L(xt)||xt===(0,f.getSR)().blank?(0,f.getSR)().blank:(Mt=dt.T,st=dt.Qti,dt=dt._by,xt<Mt?f.LESS+Mt:st<=xt?f.MORE+st:(st=Mt+Math.floor((xt-Mt)/dt)*dt)+"-"+(st+dt-1))},f.formatDateToString=Bt,f.getDateGroupItemKey=function(dt,xt){if(L(xt)||xt===(0,f.getSR)().blank)return(0,f.getSR)().blank;var Mt,st=dt.T,l=dt.gd;if(dt=dt._by,typeof xt=="string"&&kt(xt))Mt=kt(xt);else{if(!Date.parse(xt))return w;Mt=new Date(xt)}return Mt<st?"<"+Bt(st):l<Mt?">"+Bt(l):Ct(dt,Mt)},f.isEmptyObject=function(dt){if(dt&&typeof dt=="object"){for(var xt in dt)if(dt.hasOwnProperty(xt))return!1}return!0},f.k$t=function(dt,xt){var Mt,st,l,T,D;if(!dt)return dt;for(st in Mt=[],dt)dt.hasOwnProperty(st)&&Mt.push(+st);for(Mt.sort(function(M,s){return(M-s)*xt}),l={},T=0,D=Mt.length;T<D;T++)l[Mt[T]]=T+1;return l},f.RF=function dt(xt){var Mt,st,l=Array.isArray(xt),T=Object.prototype.toString.call(xt)==="[object Object]";if(l){for(Mt=[],st=0;st<xt.length;st++)Mt[st]=dt(xt[st]);return Mt}if(T){for(st in Mt=void 0,xt)L(xt[st])||((Mt=Mt===w?{}:Mt)[st]=dt(xt[st]));return Mt}return xt},f.ini=function(dt,xt,Mt){var st,l;try{st=(l=mt.Common.CultureManager.getCultureInfo()).localeCompare&&!Mt?l.localeCompare(dt,xt):dt.localeCompare(xt,Mt||"en")}catch{st=dt.localeCompare(xt)}return st},f.parseStringToDate=kt,f.xmlEncode=function(dt,xt){return L(dt)?dt:(xt=xt||/(&)|(<)|(>)|(")|(')/g,function(Mt){var st,l,T,D;if(L(Mt)||Mt==="")return Mt;for(Mt.match(v)!==null&&(Mt=Mt.replace(/(_x00[0-1][0-9A-Fa-f]_)/g,function(M){return"_x005F"+M})),st=[],l=0;l<Mt.length;l++)T=Mt.charCodeAt(l),D=Mt[l],st.push(T===10?"_x000a_":T===13?"_x000d_":D);return st.join("")}(""+(dt=typeof dt===g?dt.replace(xt,function(Mt){switch(Mt){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&apos;"}}):dt)))},ot=/&#(\d+);/g,j=/&#x([0-9A-F]+);/gi,f.xmlDecode=function(dt,xt){var Mt;return L(dt)?dt:typeof dt!==g||dt.indexOf("&")===-1?""+dt:(Mt=/(&amp;)|(&gt;)|(&lt;)|(&quot;)|(&apos;)/g,(dt=dt.indexOf("&#")!==-1?dt.replace(ot,ie(10)).replace(j,ie(16)):dt).replace(Mt,function(st){switch(st){case"&amp;":return"&";case"&gt;":return">";case"&lt;":return"<";case"&quot;":return'"';case"&apos;":return"'"}}))},f.o1=function(dt,xt){for(var Mt,st,l,T=0,D=(l=xt.split("&")).length;T<D;T++){if(Mt=(st=l[T].split("."))[0],st=st[1],!dt)return;dt=Xt(dt,Mt,st)}return dt},f.xr=Xt,f.Pr=function(dt,xt){var Mt,st,l,T;if(dt&&dt.c_){for(Mt=[],st=0,l=xt.length;st<l;st++)(T=Qt(dt,xt[st]))&&0<T.length&&(Mt=Mt.concat(T));dt.c_=Mt}},f.qTe=function(dt){return tt.Cmt(dt.split(""),!1)?dt:"'"+dt.replace(/'/g,"''")+"'"},f.uniqueArray=function(dt){return dt.filter(function(xt,Mt,st){return st.indexOf(xt)===Mt})}},"./src/pivotEngine.res.en.ts":function(H,f){Object.defineProperty(f,"__esModule",{value:!0}),f.resource=void 0,f.resource={dateResource:{Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr",May:"May",Jun:"Jun",Jul:"Jul",Aug:"Aug",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Dec",Qtr1:"Qtr1",Qtr2:"Qtr2",Qtr3:"Qtr3",Qtr4:"Qtr4",Seconds:"Seconds",Minutes:"Minutes",Hours:"Hours",Days:"Days",Months:"Months",Quarters:"Quarters",Years:"Years",SECOND_GROUP_ITEMS:[":00",":01",":02",":03",":04",":05",":06",":07",":08",":09",":10",":11",":12",":13",":14",":15",":16",":17",":18",":19",":20",":21",":22",":23",":24",":25",":26",":27",":28",":29",":30",":31",":32",":33",":34",":35",":36",":37",":38",":39",":40",":41",":42",":43",":44",":45",":46",":47",":48",":49",":50",":51",":52",":53",":54",":55",":56",":57",":58",":59"],MINUTE_GROUP_ITEMS:[":00",":01",":02",":03",":04",":05",":06",":07",":08",":09",":10",":11",":12",":13",":14",":15",":16",":17",":18",":19",":20",":21",":22",":23",":24",":25",":26",":27",":28",":29",":30",":31",":32",":33",":34",":35",":36",":37",":38",":39",":40",":41",":42",":43",":44",":45",":46",":47",":48",":49",":50",":51",":52",":53",":54",":55",":56",":57",":58",":59"],HOUR_GROUP_ITEMS:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]},Exp_NoItemParseError:"An item name cannot be found. Check that you've typed the name correctly and the item is present in the PivotTable report.",Exp_UnsupportedCalcItemType:"References, names, and arrays are not supported in PivotTable formulas.",blank:"(blank)"}},CalcEngine:function(H){H.exports=ft("@spreadjs/js-calc")},Common:function(H){H.exports=ft("@spreadjs/js-sheets-common")}},at={},X=function H(f){var B;return(B=at[f])!==void 0||(B=at[f]={exports:{}},S[f].call(B.exports,B,B.exports,H)),B.exports}("./pivot-entry.ts"),(Yt={}).Pivot=X})(),At=Yt||{},typeof Ie.exports=="object"?Ie.exports=At.Pivot:(o=(function(){return At.Pivot}).apply(o,[]))!==void 0&&(Ie.exports=o)},Pivot:function(Ie){Ie.exports=Ue.Pivot},"@spreadjs/js-sheets-common":function(Ie){Ie.exports=Ue.Spread},"@spreadjs/js-calc":function(Ie){Ie.exports=Ue.Spread.CalcEngine},Core:function(Ie){Ie.exports=Ue.Spread.Sheets},SheetsCalc:function(Ie){Ie.exports=Ue.Spread.Sheets.CalcEngine},CellTypes:function(Ie){Ie.exports=Ue.Spread.Sheets.CellTypes},ConditionalFormatting:function(Ie){Ie.exports=Ue.Spread.Sheets.ConditionalFormatting},FormulaTextBox:function(Ie){Ie.exports=Ue.Spread.Sheets.FormulaTextBox},Shapes:function(Ie){Ie.exports=Ue.Spread.Sheets.Shapes},Slicers:function(Ie){Ie.exports=Ue.Spread.Sheets.Slicers},Tables:function(Ie){Ie.exports=Ue.Spread.Sheets.Tables}},Go={},jo=function Ie(o){var ft;return(ft=Go[o])!==void 0||(ft=Go[o]={exports:{}},Qo[o].call(ft.exports,ft,ft.exports,Ie)),ft.exports}("./dist/plugins/pivot/pivot-all-entry.js"),((Ue=Ue===void 0?{}:Ue).Spread=Ue.Spread||{}).Pivot=jo,Ue.Spread.Common.CultureManager.reloadResources&&Ue.Spread.Common.CultureManager.reloadResources("PivotTables");