UNPKG

@grapecity-software/data-manager

Version:

SpreadJS data manager module

12 lines 514 kB
/*! * * SpreadJS Library 18.2.0 * * Copyright(c) GrapeCity Software inc. All rights reserved. * * Licensed under the SpreadJS Commercial License. * info.xa@grapecity.com * https://www.grapecity.com.cn/developer/spreadjs * */ !function(t){var n;"object"==typeof module&&"object"==typeof module.exports?(n=require("@grapecity-software/spread-common"),require("@grapecity-software/spread-calc-engine"),module.exports=t(n)):"function"==typeof define&&define.amd?define(["@grapecity-software/spread-common","@grapecity-software/spread-calc-engine"],t):"object"==typeof exports?(n=require("@grapecity-software/spread-common"),require("@grapecity-software/spread-calc-engine"),exports.Spread=t(n)):t(GC)}((function(t){!function(){var n,i={"./node_modules_local/@spreadjs/js-data-manager/dist/gc.data.js":function(t,n,i){var r;!function(){var t,n={"./dist/src/calculation/calc-array-ex.js":function(t,n,i){"use strict";var r,e,o=this&&this.qKr||(u=function(t,n){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},u(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}u(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),u;Object.defineProperty(n,"__esModule",{value:!0}),n.CalcArrayEx=void 0,e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n.prototype.toArray=function(t,n,i,e,o,u,s){var f,c,a,h,l,v,d,p,w,b,m;if(void 0===n&&(n=!0),c=this,a=0,h=0,l=[],p=r.Convert.CalcConvertedError,a=c.getRowCount())for(w=0;w<a;w++)for(n||(d=[],l.push(d)),b=(null===(f=c.array[w])||void 0===f?void 0:f.length)||0,h=Math.max(h,b),m=0;m<b;m++){if(v=c.getValue(w,m),c.referenceInTwoDimension&&(0,r.LE)(v)&&(v=v.getValueByIndex(0)),i&&(0,r.BJ)(v))return(l=[v]).isError=!0,l;if(v=(0,r.Nbt)(v,t,!1,u),e&&v===p)return(l=[v]).isConvertError=!0,l;n?l.push(v):d.push(v)}return l.rowCount=a,l.colCount=h,l.rangeCount=1,l},n.prototype.getValue=function(t,n){var i,e=this.array,o=t;return"number"!=typeof n&&(o=(i=t).row,n=i.column),o<0||n<0||o>=e.length||!e[o]||n>=e[o].length?r.errors.Value:this.array[o][n]},n}((r=i("CalcEngine")).CalcArray),n.CalcArrayEx=e},"./dist/src/calculation/calcSource.js":function(t,n,i){"use strict";var r,e,o,u,s,f=this&&this.qKr||(c=function(t,n){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},c(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}c(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),c;Object.defineProperty(n,"__esModule",{value:!0}),n.DataManagerCalcSource=n.DataManagerReference=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/calc-array-ex.js"),u=function(){function t(){this.row=[],this.field=[]}return t.prototype.parseRowIndex=function(t,n,i){var r=n.num;return n.relative||(-1===n.num?r=t-1:r--),i*n.relative+r},t.prototype.getValueImp=function(t){var n,i,r,u,s,f,c,a=this.table.length();if(this.field.vEt&&this.field.vEt[this.rowString])return this.field.vEt[this.rowString];if(n=[],0===this.row.length)for(i=0;i<a;i++)n.push(this.field.getValue(i));for(r=0;r<this.row.length;r++)if(2===(u=this.row[r]).length)for(s=this.parseRowIndex(a,u[0],t),f=this.parseRowIndex(a,u[1],t),c=s;c<=f;c++)n.push(this.field.getValue(c));else if(u.type)if("key"===u.type)i=this.table.mEt(u.value),n=n.concat(this.field.getValues(i));else for(c="odd"===u.type?1:0;c<a;c+=2)n.push(this.field.getValue(c));else i=this.parseRowIndex(a,u,t),n.push(this.field.getValue(i));if(1===n.length)n=n[0];else if(0===n.length)return null;return(0,e.isArray)(n)&&(n=(0,e.isArray)(n[0])?new o.CalcArrayEx(n):new o.CalcArrayEx([n])),this.gEt||(this.field.vEt=this.field.vEt||{},this.field.vEt[this.rowString]=n),n},t.prototype.getValuesImp=function(t,n,i,r,u,s){var f=this.field.getValues(t,n,i,r,u,s);return(0,e.isArray)(f[0])?new o.CalcArrayEx(f):new o.CalcArrayEx([f])},t.prototype.getValue=function(t,n,i,r,o,u){return this.pEt(),(0,e.isArray)(t)?this.getValuesImp(t,n,i,r,o,u):this.getValueImp(t)},t.prototype.pEt=function(){this.field=this.table.rRt(this.Pq)},t}(),n.DataManagerReference=u,s=function(t){function n(n,i){var r=t.call(this,n)||this;return r.nM=i,r.MEt={},r}return f(n,t),n.prototype.yEt=function(){return this.$Jr},n.prototype.wEt=function(t,n){2===arguments.length?this.MEt[t]=n:1===arguments.length&&delete this.MEt[t]},n.prototype.pe=function(t,n,i,r,e,o,u){this.DJ=t,this.ak=n,this.pwn=i,this.GOt=r,this.uye=e,this.sye=o,this.R6t=u},n.prototype.getField=function(t){var n=this.DJ,i=this.ak,r=this.pwn,e=this.uye,o=this.sye,u=this.R6t;return t.getValue(n,i,r,e,o,u)},n.prototype.getValue=function(){var t=this.GOt;return t&&"number"==typeof this.DJ?this.nM._getValueByField(t,this.DJ):null},n}(r.CalcSource),n.DataManagerCalcSource=s},"./dist/src/calculation/functions/aggregationFunctions/dataModel.js":function(t,n,i){"use strict";var r,e,o,u,s,f,c;function a(t,n,i,e,s,c,a,v){var d,p,w,b,m,j,y,g,_,O,C,S,M,N,F,T=l(t,e);if(s>T.length)return r.Errors.Value;if(c>(d=l(n,e)).length)return r.Errors.Value;for(p=l(i,e),e===u.FieldHeaders.NoButGenerate&&(T.forEach((function(t,n){return t.itn=(0,r.sR)().Aggregate_RowField+" ".concat(n+1)})),d.forEach((function(t,n){return t.itn=(0,r.sR)().Aggregate_ColumnField+" ".concat(n+1)})),p.forEach((function(t,n){return t.itn=(0,r.sR)().Aggregate_Value+" ".concat(n+1)}))),h(w=T.map((function(t){return t})),d),h(w,p),b=new Map(w.map((function(t,n){return[t._getName(),"c".concat(n+1)]}))),m=w.map((function(t,n){return"c".concat(n+1)})),j=w[0].jit,y=[],g=function(t){var n={};m.forEach((function(i,r){return n[i]=w[r].Sl(t)})),y.push(n)},_=0;_<j;_++)g(_);return O=T.map((function(t){return b.get(t._getName())})),C=d.map((function(t){return b.get(t._getName())})),S=p.map((function(t){return b.get(t._getName())})),(M=new o.DataManager).addTable("t1",{data:y}).fetchSync(),N={tableName:"t1",rowColumns:O,colColumns:C,valueColumns:S,rowTotalDepth:s,colTotalDepth:c,rowSortOrder:a,colSortOrder:v},F=(new f).generate(N),r.Convert.BJ(F)?F:(M.generateTreeData(F),{dataSource:M,tableName:"t1",rowFields:T,colFields:d,valueFields:p,fieldNameToColumnNames:b,treeData:F})}function h(t,n){n.forEach((function(n){t.findIndex((function(t){return t._getName()===n._getName()}))<0&&t.push(n)}))}function l(t,n){var i,r,e,o;if(s(t))return[];for(i=[],r=u.FieldHeaders.YesAndDoNotShow===n||u.FieldHeaders.YesAndShow===n,e=function(n){var e={lp:c++,zkr:r?1:0,Bwt:n,rT:t,_getName:v,jit:r?t.rowCount-1:t.rowCount,Sl:function(t){return this.rT[this.zkr+t][this.Bwt]},Vkr:function(){var t,n=[];for(t=0;t<this.jit;t++)n.push(this.Sl(t));return n}};r&&(e.itn=e.Sl(-1)),i.findIndex((function(t){return t._getName()===e._getName()}))<0&&i.push(e)},o=0;o<t.colCount;o++)e(o);return i}function v(){return"c"+this.lp.toString(36)}Object.defineProperty(n,"__esModule",{value:!0}),n.Ykr=n.TreeDataContextGenerator=void 0,r=i("CalcEngine"),e=i("Common"),o=i("./dist/src/dataManager.js"),u=i("./dist/src/calculation/functions/aggregationFunctions/interface.js"),s=e.Common.lt.ht,f=function(){function t(){}return t.prototype.generate=function(t){var n,i,e=this;return this.Zkr=t,this.s_i={},this.Mur={},this.Wkr={},this.Qkr=1,this.Jkr()?r.Errors.Value:(n=function(t){return e.Mur[t]},i={verticalExpansionTrees:this.Kkr(),horizontalExpansionTrees:this.Xkr(),crossCells:[],cellNodeGetter:n},this.qkr(i.crossCells),this.$kr(),i)},t.prototype.Jkr=function(){if(s(this.Zkr))return!0;var t=this.Zkr,n=t.rowColumns,i=t.colColumns,r=t.colTotalDepth,e=t.rowTotalDepth;return!!(e&&n&&e>n.length)||!!(r&&i&&r>i.length)},t.prototype.Kkr=function(){var t=this.Zkr,n=t.tableName,i=t.rowColumns;return this.tDr(n,i,"V")},t.prototype.Xkr=function(){var t=this.Zkr,n=t.tableName,i=t.colColumns;return this.tDr(n,i,"H")},t.prototype.tDr=function(t,n,i){var r,e=this,o=[];return n&&(r=null,n.forEach((function(n,u){var s={templateCell:{dataColumn:{tableName:t,columnName:n},dataSetting:{type:"Group"},expansionDirection:i,sorts:[{asc:n}]},children:[],leftParent:"V"===i?r:null,upParent:"H"===i?r:null,data:{groups:[]},indexOfLeftParentChildren:r?0:-1,indexOfUpParentChildren:-1};e.s_i["".concat(i,"-").concat(u)]=s,r?r.children.push(s):o.push({root:s}),r=s}))),o},t.prototype.qkr=function(t){var n,i,r=this.Zkr.valueColumns||[];if(0!==r.length){if(n=this.Zkr.rowColumns||[],i=this.Zkr.colColumns||[],n.length>0&&i.length>0)return this.nDr(t),this.eDr(),void this.iDr();n.length>0?this.eDr():i.length>0&&this.iDr()}},t.prototype.nDr=function(t){var n,i=this,r=this.Zkr,e=r.tableName,o=r.valueColumns,u=r.rowColumns,s=r.colColumns,f=function(n){var r,u=c.s_i["V-".concat(n)],f=function(n){var r=c.s_i["H-".concat(n)];o.forEach((function(n){i.rDr(e,n,u,r,t)}))};for(r=s.length-1;r>=0;r--)f(r)},c=this;for(n=u.length-1;n>=0;n--)f(n)},t.prototype.eDr=function(){var t,n=this,i=this.Zkr,r=i.tableName,e=i.valueColumns,o=i.rowColumns,u=function(t){e.forEach((function(i){n.rDr(r,i,n.s_i["V-".concat(t)],null)}))};for(t=o.length-1;t>=0;t--)u(t)},t.prototype.iDr=function(){var t,n=this,i=this.Zkr,r=i.tableName,e=i.valueColumns,o=i.colColumns,u=function(t){e.forEach((function(i){n.rDr(r,i,null,n.s_i["H-".concat(t)])}))};for(t=o.length-1;t>=0;t--)u(t)},t.prototype.rDr=function(t,n,i,r,e){var o=this,u={templateCell:{dataColumn:{tableName:t,columnName:n},dataSetting:{type:"List"},expansionDirection:"No"},children:[],leftParent:i,upParent:r,data:{groups:[]},indexOfLeftParentChildren:-1,indexOfUpParentChildren:-1},s=function(t){var n=o.oDr();o.s_i[t]=u,o.Mur[n]=u,o.Wkr[t]=n};i&&(i.children.push(u),u.indexOfLeftParentChildren=i.children.length-1,r||s("V-".concat(i.templateCell.dataColumn.columnName,"-VALUE-").concat(n))),r&&(r.children.push(u),u.indexOfUpParentChildren=r.children.length-1,i||s("H-".concat(r.templateCell.dataColumn.columnName,"-VALUE-").concat(n))),i&&r&&e&&e.push(u)},t.prototype.oDr=function(){return"A".concat(this.Qkr++)},t.prototype.$kr=function(){var t=this.Zkr,n=t.rowSortOrder,i=t.rowColumns,r=t.colSortOrder,e=t.colColumns;this.aDr(n,i,"V"),this.aDr(r,e,"H")},t.prototype.aDr=function(t,n,i){var r,e,o,u,s=this;if(t&&n&&0!==n.length){if(r=function(t){},"number"==typeof t)return(e=Math.abs(t))>n.length?void r(t):void(e<=n.length&&t<0&&((o=this.s_i["".concat(i,"-").concat(e-1)]).templateCell.sorts=[{desc:o.templateCell.dataColumn.columnName}]));if(Array.isArray(t)){if(-1!==(u=t.findIndex((function(t){return Math.abs(t)>n.length}))))return void r(t[u]);t.forEach((function(t){if(t<0){var n=s.s_i["".concat(i,"-").concat(Math.abs(t)-1)];n.templateCell.sorts=[{desc:n.templateCell.dataColumn.columnName}]}}))}}},t}(),n.TreeDataContextGenerator=f,n.Ykr=a,c=0},"./dist/src/calculation/functions/aggregationFunctions/index.js":function(t,n,i){"use strict";var r,e,o,u,s,f,c,a;function h(t,n,i,e,c,h,v,p,b,m,j,y,g){var _,O,C,S,M,N,F,T,R,I,x,E;if(f(n)&&f(i)&&f(e))return r.Errors.Value;if(O=n&&r.Convert.iV(n,0,!1),C=i&&r.Convert.iV(i,0,!1),S=e&&r.Convert.iV(e,0,!1),j=j&&r.Convert.iV(j,0,!0),M=(O||C||S).rowCount,N=(C||S||O).rowCount,F=(S||O||C).rowCount,M!==N||M!==F)return r.Errors.Value;if(y&&(g&&1!==y&&0!==y||!g&&(y<0||y>4)))return r.Errors.Value;if(T=h,f(h)&&(T=d(S)),j){if(M!==j.length+1||T!==o.FieldHeaders.YesAndShow&&T!==o.FieldHeaders.YesAndDoNotShow||j.unshift(1),M!==j.length)return r.Errors.Value;_=l(O,C,S,T,j),O=_.rows,C=_.cols,S=_.valueArray}if(f(v)&&!f(n)&&(v=O.colCount>=2&&p&&Math.abs(p)>O.colCount&&!y?O.colCount:1),f(b)&&!f(i)&&(b=C.colCount>=2&&p&&Math.abs(p)>O.colCount&&!y?C.colCount:1),p&&(p=r.Convert.iV(p,0,!0)).length>1&&p.some((function(t){return 0===t||Math.abs(t)>O.colCount})))return r.Errors.Value;if(m&&(m=r.Convert.iV(m,0,!0)).length>1&&m.some((function(t){return 0===t||Math.abs(t)>C.colCount})))return r.Errors.Value;if(0===p||0===m)return r.Errors.Value;if(R=(0,u.Ykr)(O,C,S,T,Math.abs(v),Math.abs(b),p,m),a(R))return R;if(I=e?w(c,R.valueFields,t):[],a(I))return I;if(I.headers&&!I.uDr&&f(h)&&T===o.FieldHeaders.YesAndDoNotShow&&(T=o.FieldHeaders.YesAndShow),p&&1===p.length){if(x=Math.abs(p[0]),E=S.colCount,I.uDr?E=1:1===E&&I.valueFieldRepeat&&(E=I.valueFieldRepeat),x>O.colCount&&x<=O.colCount+E)R.sDr=x-O.colCount,p[0]<0&&(R.sDr=-R.sDr);else{if(!(x>0&&x<=O.colCount))return r.Errors.Value;p=p[0]}R.wwn=p}if(m&&1===m.length){if(x=Math.abs(m[0]),E=S.colCount,I.uDr?1===E&&I.valueFieldRepeat&&(E=I.valueFieldRepeat):E=1,x>C.colCount&&x<=C.colCount+E)R.cDr=x-C.colCount,m[0]<0&&(R.cDr=-R.cDr);else{if(!(x>0&&x<=C.colCount))return r.Errors.Value;m=m[0]}R.fDr=m}return g?new s.lDr(R,I,T,v,y).GY():new s.hDr(R,I,T,v,b,y).GY()}function l(t,n,i,r,e){var u,s=t&&[],f=n&&[],c=i&&[];function a(r){s&&s.push(t[r]),f&&f.push(n[r]),c&&c.push(i[r])}for(s&&(s.colCount=t.colCount),f&&(f.colCount=n.colCount),c&&(c.colCount=i.colCount),(r===o.FieldHeaders.YesAndDoNotShow||r===o.FieldHeaders.YesAndShow||e[0])&&a(0),u=1;u<e.length;u++)e[u]&&a(u);return s&&(s.rowCount=s.length),f&&(f.rowCount=f.length),c&&(c.rowCount=c.length),{rows:s,cols:f,valueArray:c}}function v(t,n,i,r,e,o,u,s,f){return h(t,n,null,i,r,e,o,u,null,null,s,f,!0)}function d(t){var n,i,r;return f(t)||(n=t.rowCount)<2?o.FieldHeaders.No:(i=t[0][0],r=t[1][0],"string"==typeof i&&c(r)?o.FieldHeaders.YesAndDoNotShow:o.FieldHeaders.No)}function p(t){return new r.CalcArray(t.map((function(t){return[t]})))}function w(t,n,i){var e,o,u,s,f,c,a,h,l,v,d,b;if(i.N_t=!1,(0,r.isLambdaFunction)(t))return 1===(e=t).parameters.length?n.map((function(t){return function(t){return(0,r.Hkr)(i,e,[p(t)],!0,!0)}})):n.map((function(t){return function(t,n){return(0,r.Hkr)(i,e,[p(t),p(n)],!0,!0)}}));if((0,r.isFunction)(t))return(o=i.source&&i.source.Lbt&&i.source.Lbt.MX)?((u=(0,r.YJ)(t,null,0,0)).ywr=!0,"PERCENTOF"===t.name?n.map((function(t){return function(t,n){return u.arguments=[p(t),p(n)],o.evaluate(u,i,!1,!1)}})):n.map((function(t){return function(t){return u.arguments=[p(t)],o.evaluate(u,i,!1,!1)}}))):r.Errors.Calc;if(t.array){if(s=t.getRowCount(),f=t.getColumnCount(),1===s&&1===f)return w(t.getValue(0,0),n,i);if((0,r.isFunction)(t.getValue(0,1))){if(s>2)return r.Errors.Value;if(c={func:[]},1!==n.length&&n.length!==f)return r.Errors.Value;for(a=0;a<f;a++)c[a]=w(t.getValue(0,a),n,i)[0];for(1===n.length&&(c.valueFieldRepeat=f),h=s>1,c.headers=[],l=0,v=void 0,a=0;a<f;a++)h?c.headers[a]=t.getValue(1,a):(d=t.getValue(0,a),(0,r.isLambdaFunction)(d)?1===++l?(c.headers[a]="CUSTOM",v=a):l>0&&(c.headers[a]="CUSTOM"+l,2===l&&(c.headers[v]="CUSTOM1")):c.headers[a]=d.name);return c}if((0,r.isFunction)(t.getValue(1,0))){if(f>2)return r.Errors.Value;if(c={func:[]},1!==n.length&&n.length!==s)return r.Errors.Value;for(b=0;b<s;b++)c[b]=w(t.getValue(b,0),n,i)[0];for(1===n.length&&(c.valueFieldRepeat=s),c.uDr=s>1,h=f>1,c.headers=[],l=0,v=void 0,b=0;b<s;b++)h?c.headers[b]=t.getValue(b,1):(d=t.getValue(b,0),c.headers[b]=(0,r.isLambdaFunction)(d)?"CUSTOM":d.name,(0,r.isLambdaFunction)(d)?1===++l?(c.headers[b]="CUSTOM",v=b):l>0&&(c.headers[b]="CUSTOM"+l,2===l&&(c.headers[v]="CUSTOM1")):c.headers[b]=d.name);return c}}return r.Errors.Name}function b(){r.Functions.F6t("GROUPBY",v,3,8,void 0,[0,1,2,6],[0,1,2,5,6],{r9t:!0},!0),r.Functions.F6t("PIVOTBY",h,4,11,void 0,[0,1,2,3,9],[0,1,2,3,6,8,9],{r9t:!0},!0)}Object.defineProperty(n,"__esModule",{value:!0}),n.HEr=void 0,r=i("CalcEngine"),e=i("Common"),o=i("./dist/src/calculation/functions/aggregationFunctions/interface.js"),u=i("./dist/src/calculation/functions/aggregationFunctions/dataModel.js"),s=i("./dist/src/calculation/functions/aggregationFunctions/pivotLayout.js"),f=e.Common.lt.ht,c=r.Convert.q8,a=r.Convert.BJ,n.HEr=b},"./dist/src/calculation/functions/aggregationFunctions/interface.js":function(t,n){"use strict";var i,r;Object.defineProperty(n,"__esModule",{value:!0}),n.TotalDepth=n.FieldHeaders=void 0,function(t){t[t.No=0]="No",t[t.YesAndDoNotShow=1]="YesAndDoNotShow",t[t.NoButGenerate=2]="NoButGenerate",t[t.YesAndShow=3]="YesAndShow"}(i=n.FieldHeaders||(n.FieldHeaders={})),function(t){t[t.NoTotal=0]="NoTotal",t[t.GrandTotals=1]="GrandTotals",t[t.GrandAndSubtotals=2]="GrandAndSubtotals",t[t.GrandTotalsAtTopOrLeft=-1]="GrandTotalsAtTopOrLeft",t[t.GrandAndSubtotalsAtTopOrLeft=-2]="GrandAndSubtotalsAtTopOrLeft"}(r=n.TotalDepth||(n.TotalDepth={}))},"./dist/src/calculation/functions/aggregationFunctions/pivotLayout.js":function(t,n,i){"use strict";var r,e,o,u,s,f,c,a,h,l,v=this&&this.qKr||(d=function(t,n){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},d(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}d(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),d;function p(t,n,i){return s(t)&&(t=0),s(n)&&(n=0),t&&(0,u.isCalcError)(t)?i?-1:1:n&&(0,u.isCalcError)(n)||(0,u.isString)(t)&&"number"==typeof n?i?1:-1:(0,u.isString)(n)&&"number"==typeof t?i?-1:1:i?(0,r.$kt)(n,t):(0,r.$kt)(t,n)}Object.defineProperty(n,"__esModule",{value:!0}),n.hDr=n.lDr=void 0,r=i("CalcEngine"),e=i("Common"),o=i("./dist/src/calculation/functions/aggregationFunctions/interface.js"),u=i("./dist/src/dataManager.entry.js"),s=e.Common.lt.ht,f=e.Common.lt.Nh,c=function(){function t(t){this.dDr=new Map,this.vDr=t}return t.prototype.TDr=function(t,n,i){var r=this.d7e(t,n,i),e=this.dDr.get(r);return s(e)?(e=this.vDr?s(i)?t.cellNode.children.findIndex((function(t){return t.templateCell.dataColumn.columnName===n&&s(t.leftParent)})):t.cellNode.children.findIndex((function(t){return t.templateCell.dataColumn.columnName===n&&!s(t.leftParent)&&t.leftParent.templateCell.dataColumn.columnName===i.cellNode.templateCell.dataColumn.columnName})):s(i)?t.cellNode.children.findIndex((function(t){return t.templateCell.dataColumn.columnName===n&&s(t.upParent)})):t.cellNode.children.findIndex((function(t){return t.templateCell.dataColumn.columnName===n&&!s(t.upParent)&&t.upParent.templateCell.dataColumn.columnName===i.cellNode.templateCell.dataColumn.columnName})),this.dDr[r]=e,e):e},t.prototype.d7e=function(t,n,i){return this.vDr?s(i)?"H-".concat(t.cellNode.templateCell.dataColumn.columnName,"-").concat(n,"-V-null"):"H-".concat(t.cellNode.templateCell.dataColumn.columnName,"-").concat(n,"-V-").concat(i.cellNode.templateCell.dataColumn.columnName):s(i)?"V-".concat(t.cellNode.templateCell.dataColumn.columnName,"-").concat(n,"-H-null"):"V-".concat(t.cellNode.templateCell.dataColumn.columnName,"-").concat(n,"-H-").concat(i.cellNode.templateCell.dataColumn.columnName)},t}(),h=function(t){function n(n,i,r,e,o){var u=t.call(this)||this;return u.gDr=n,u.mDr=i,u.pDr=r,u.bDr=e,u.CRt=o,u.wDr=new c(!1),u.yDr=u.MDr(),u}return v(n,t),n.prototype.GY=function(){var t,n,i,e,u,f,c,a,h,l,v,d,p,w,b,m,j,y,g,_,O;if(s(this.gDr)||s(this.gDr.treeData))return r.Errors.Value;if(t=this.gDr.rowFields.length,n=this.gDr.valueFields.length,e=(i=this.kDr(this.gDr.treeData,0,0,n<1?1:n)).headerRecords,u=i.leafHeaders,f=[],this.jDr(f,e),c=this.yDr,a=Math.abs(this.gDr.sDr)-1,this.gDr.sDr&&!this.CRt&&this.DDr(this.gDr.treeData,c[a],a,this.gDr.sDr<0),h=this._Dr(this.gDr.treeData,this.bDr,this.gDr.rowFields.length),this.CRt){if(Math.abs(this.bDr)>1)return r.Errors.Value;this.ODr(h,c[a],a)}for(l=u.length*(n>0?n:1),v=function(i,r){return i<0?t+l+r:t+i*n+r},d=0,p=h;d<p.length;d++)b=(w=p[d]).headerRecords,m=w.leafHeader,c.length>0?this.EDr(c,v,m,b,f):f.push(b);if(j=Math.abs(this.bDr)>0||0===t){for(y=0===t?[]:[this.IDr(this.bDr)],g=1;g<t;g++)y.push("");_=this.RDr(i),y=y.concat(_),O=void 0,O=this.LDr(y,c,v),f=this.bDr<0?O.concat(f):f.concat(O)}return o.FieldHeaders.NoButGenerate!==this.pDr&&o.FieldHeaders.YesAndShow!==this.pDr||this.FDr(f,this.gDr.rowFields,this.gDr.valueFields),this.mDr.headers&&!this.mDr.uDr&&this.BDr(this.gDr.rowFields,f),new r.CalcArray(f)},n.prototype.PDr=function(t,n){var i,r,e=this.wDr;return t?(i=t.childrenArray[e.TDr(t,n,null)][0].value,f(i)?i:[i]):(r=this.yDr.indexOf(n),this.gDr.valueFields[r].Vkr())},n.prototype.GDr=function(t,n,i){var r,e,o=this.PDr(t,n);return o.length>0?(r=null==t?void 0:t.leftParent,e=this.PDr(r,n),this.mDr[i](o,e)):""},n.prototype.EDr=function(t,n,i,r,e){var o,u,s,f,c;if(this.mDr.uDr)for(u=0;u<t.length;u++)s=r.slice(),(null===(o=this.mDr.headers)||void 0===o?void 0:o[u])&&s.push(this.mDr.headers[u]),f=t[u],s.push(this.GDr(i,f,u)),e.push(s);else{for(u=0;u<t.length;u++)c=n(-1,u),f=t[u],r[c]=this.GDr(i,f,u);e.push(r)}},n.prototype.LDr=function(t,n,i){var r,e,o,u,s,f=[];if(this.mDr.uDr)for(e=0;e<n.length;e++)o=t.slice(),(null===(r=this.mDr.headers)||void 0===r?void 0:r[e])&&o.push(this.mDr.headers[e]),u=n[e],o.push(this.GDr(null,u,e)),f.push(o);else{for(e=0;e<n.length;e++)s=i(-1,e),u=n[e],t[s]=this.GDr(null,u,e);f.push(t)}return f},n.prototype.BDr=function(t,n){var i=Array(t.length).fill("").concat(this.mDr.headers);return n.splice(0,0,i)},n.prototype.RDr=function(t){var n,i,r,e=this,o=t.leafHeaders,u=[],a=this.yDr,h=new c(!0),l=function(t){a.forEach((function(n,i){var r=h.TDr(t,n,null),o=t.childrenArray[r],c=o[0].value,a=f(c)?c:[c];!s(c)&&a.length>0?u.push(e.mDr[i](a)):u.push("")}))};for(n=0,i=o;n<i.length;n++)l(r=i[n]);return u},n.prototype.FDr=function(t,n,i){var r,e,o,u,s,f,c,a;if(!(t.length<1)){if(r=t[0].length,e=n.length>0,o=i.length>0,u=e?n.map((function(t){return t.itn})):[],o)if(s=i.map((function(t){return t.itn})),this.mDr.uDr)u.push("",s[0]);else for(f=u.length;f<r;f+=i.length)u.push.apply(u,s);else c=u.length,u.length=r,u.fill("",c,r);a=0,t.splice(a,0,u)}},n.prototype.ODr=function(t,n,i){var r,e=this,o=this.gDr.wwn,u=o<0;o=Math.abs(o)-1,r=this.gDr.sDr?function(t){return e.GDr(t.leafHeader,n,i)}:function(t){return t.headerRecords[o]},t.sort((function(t,n){var i=r(t),e=r(n);return p(i,e,u)}))},n.prototype.DDr=function(t,n,i,r){var e,o,u,f,c,a,h,l=this,v=t.verticalExpansionTrees;if(!(s(v)||1!==v.length||(f=null===(u=null===(o=null===(e=v[0])||void 0===e?void 0:e.root)||void 0===o?void 0:o.data)||void 0===u?void 0:u.groups,s(f)||f.length<1)))for(f.sort((function(t,e){var o=l.GDr(t,n,i),u=l.GDr(e,n,i);return p(o,u,r)})),c=0,a=f;c<a.length;c++)h=a[c],this.UDr(h,n,i,r)},n.prototype.UDr=function(t,n,i,r){var e,o,u,s=this,f=t.childrenArray[0];if(f)for(f.sort((function(t,e){var o=s.GDr(t,n,i),u=s.GDr(e,n,i);return p(o,u,r)})),e=0,o=f;e<o.length;e++)u=o[e],this.UDr(u,n,i,r)},n}(a=function(){function t(){}return t.prototype.MDr=function(){var t=this,n=this.gDr.valueFields.map((function(n){return t.gDr.fieldNameToColumnNames.get(n._getName())}));return this.mDr.valueFieldRepeat?Array.from({length:this.mDr.valueFieldRepeat},(function(){return n[0]})):n},t.prototype.ADr=function(t,n,i,r,e){var o,u,s,f,c,a=n.length<Math.abs(i),h=i<0,l=function(){var i,o=n.slice();for(i=o.length;i<r;i++)o.push("");e.push({headerRecords:o,leafHeader:t})};if(n.length===r)e.push({headerRecords:n,leafHeader:t});else{for(o=t.childrenArray[0],a&&h&&l(),u=0,s=o;u<s.length;u++)f=s[u],(c=n.slice()).push(f.value),this.ADr(f,c,i,r,e);a&&!h&&l()}},t.prototype.IDr=function(t){return Math.abs(t)>1?(0,r.sR)().Aggregate_GrandTotal:(0,r.sR)().Aggregate_Total},t.prototype.jDr=function(t,n){var i,r,e,o,u,s=this.gDr.rowFields.length;if(this.mDr.uDr&&s++,s>0)for(i=0,r=n;i<r.length;i++)e=r[i],t.push(Array(s).fill("").concat(e));else for(o=0,u=n;o<u.length;o++)e=u[o],t.push(e)},t.prototype._Dr=function(t,n,i){var r,e,o,u,f,c,a,h,l,v=t.verticalExpansionTrees;if(s(v)||1!==v.length)return[];if(u=null===(o=null===(e=null===(r=v[0])||void 0===r?void 0:r.root)||void 0===e?void 0:e.data)||void 0===o?void 0:o.groups,s(u)||u.length<1)return[];for(f=[],c=0,a=u;c<a.length;c++)l=[(h=a[c]).value],this.ADr(h,l,n,i,f);return f},t.prototype.kDr=function(t,n,i,r){var e,o,u,f,c,a,h,l,v,d,p,w={headerRecords:[],leafHeaders:[]},b=t.horizontalExpansionTrees;if(s(b)||1!==b.length)return w;if(f=null===(u=null===(o=null===(e=b[0])||void 0===e?void 0:e.root)||void 0===o?void 0:o.data)||void 0===u?void 0:u.groups,s(f)||f.length<1)return w;for(c=0;c<i;c++)w.headerRecords[c]=[];for(a=0,h=f;a<h.length;a++)l=h[a],this.NDr(l,w,n,0,i,r);if(d=n<0,(v=Math.abs(n)>0)&&r>0)if(p=this.IDr(n),d)for(w.headerRecords[0]=Array(r).fill(p).concat(w.headerRecords[0]),c=1;c<w.headerRecords.length;c++)w.headerRecords[c]=Array(r).fill("").concat(w.headerRecords[c]);else for(w.headerRecords[0]=w.headerRecords[0].concat(Array(r).fill(p)),c=1;c<w.headerRecords.length;c++)w.headerRecords[c]=w.headerRecords[c].concat(Array(r).fill(""));return w},t.prototype.NDr=function(t,n,i,r,e,o){var u,s,f,c,a,h,l,v,d,p,w=n.headerRecords,b=w[r];if(r+1===e)for(n.leafHeaders.push(t),u=0;u<o;u++)b.push(t.value);else{for(s=Array(o).fill(""),f=function(){var i;for(n.leafHeaders.push(t),i=0;i<o;i++)b.push(t.value);for(i=r+1;i<w.length;i++)w[i]=w[i].concat(s)},a=i<0,(c=r+1<Math.abs(i))&&a&&f(),l=0,v=h=t.childrenArray[0];l<v.length;l++)d=v[l],this.NDr(d,n,i,r+1,e,o);for(c&&!a&&f(),p=w[r+1].length-b.length,u=0;u<p;u++)b.push(t.value)}},t}()),n.lDr=h,l=function(t){function n(n,i,r,e,o,u){var s=t.call(this)||this;return s.gDr=n,s.mDr=i,s.pDr=r,s.bDr=e,s.CDr=o,s.CRt=u,s.SDr=new c(!1),s.xDr=new c(!0),s.yDr=s.MDr(),s}return v(n,t),n.prototype.GY=function(){var t,n,i,e,u,f,c,a,h,l,v,d,p,w,b,m,j,y,g,_,O,C,S,M,N;if(s(this.gDr)||s(this.gDr.treeData))return r.Errors.Value;for(n=this.gDr.rowFields.length,i=this.gDr.colFields.length,e=this.mDr.valueFieldRepeat||this.gDr.valueFields.length,u=this.yDr,this.gDr.cDr&&(f=Math.abs(this.gDr.cDr)-1,this.HDr(this.gDr.treeData,u[f],f,this.gDr.cDr<0)),a=(c=this.kDr(this.gDr.treeData,this.CDr,i,e<1||this.mDr.uDr?1:e)).headerRecords,h=c.leafHeaders,l=[],v=[],this.jDr(v,a),d=Math.abs(this.CDr)>0,p=this.CDr<0,this.gDr.sDr&&(f=Math.abs(this.gDr.sDr)-1,this.zDr(this.gDr.treeData,u[f],f,this.gDr.sDr<0)),w=this._Dr(this.gDr.treeData,this.bDr,this.gDr.rowFields.length),b=d&&p?e>0?e:1:0,m=h.length*(e>0?e:1),j=function(t,r){return t<0?d&&p||0===i?n+r:n+m+r:n+b+t*e+r},y=0,g=w;y<g.length;y++)_=g[y],this.VDr(h,u,j,_,l,d,i);if(O=Math.abs(this.bDr)>0||0===n){for(C=0===n?[]:[this.IDr(this.bDr)],S=1;S<n;S++)C.push("");M=this.YDr(c,C),l=this.bDr<0?M.concat(l):l.concat(M)}if(this.mDr.headers&&!this.mDr.uDr){for(N=Array(this.gDr.rowFields.length).fill("").concat(this.mDr.headers);N.length<l[0].length;)N=N.concat(this.mDr.headers);v.push(N)}return o.FieldHeaders.NoButGenerate!==this.pDr&&o.FieldHeaders.YesAndShow!==this.pDr||this.ZDr(v,this.gDr.rowFields,this.gDr.colFields,this.gDr.valueFields,null===(t=l[0])||void 0===t?void 0:t.length),l=v.concat(l),new r.CalcArray(l)},n.prototype.WDr=function(t,n,i){var r=[];return r=1===this.CRt?this.PDr(t,n,null):2===this.CRt?this.PDr(null,n,null):3===this.CRt?this.PDr(t,n,i&&i.upParent):4===this.CRt?this.PDr(t&&t.leftParent,n,i):this.PDr(null,n,i)},n.prototype.PDr=function(t,n,i){var r,e,o,u,s,c;if(t)if(i){for(e=this.SDr.TDr(t,n,i),o=t.crossChildren[e],u=0;u<o.length;u++)if((s=o[u][0]).upParent===i){r=s.value;break}}else r=t.childrenArray[this.SDr.TDr(t,n,null)][0].value;else{if(!i)return c=this.yDr.indexOf(n),r=this.gDr.valueFields[c].Vkr();r=i.childrenArray[this.xDr.TDr(i,n,null)][0].value}return f(r)?r:[r]},n.prototype.QDr=function(t,n,i,r){var e,o=this.PDr(t,n,r);return!s(o)&&o.length>0?(e=this.WDr(t,n,r),this.mDr[i](o,e)):""},n.prototype.VDr=function(t,n,i,r,e,o,u){var s,f,c,a,h,l,v,d,p;if(this.mDr.uDr)for(f=r.headerRecords,c=r.leafHeader,a=0;a<n.length;a++){for(h=f.slice(),(null===(s=this.mDr.headers)||void 0===s?void 0:s[a])&&h.push(this.mDr.headers[a]),l=0;l<t.length;l++)v=t[l],d=n[a],h.push(this.QDr(c,d,a,v));(o||0===u&&n.length>0)&&(d=n[a],h.push(this.QDr(c,d,a))),e.push(h)}else{for(f=r.headerRecords,c=r.leafHeader,l=0;l<t.length;l++)for(v=t[l],a=0;a<n.length;a++)p=i(l,a),d=n[a],f[p]=this.QDr(c,d,a,v);if(o||0===u&&n.length>0)for(a=0;a<n.length;a++)p=i(-1,a),d=n[a],f[p]=this.QDr(c,d,a);e.push(f)}},n.prototype.YDr=function(t,n){var i,r,e,o,u,s,f,c,a,h,l,v,d=t.leafHeaders,p=Math.abs(this.CDr)>0,w=this.CDr<0,b=[],m=this,j=n,y=this.yDr,g=this.gDr.rowFields.length,_=this.gDr.colFields.length,O=this.mDr.valueFieldRepeat||this.gDr.valueFields.length,C=d.length*(O>0?O:1);if(this.mDr.uDr)for(r=0;r<y.length;r++){for(e=n.slice(),(null===(i=this.mDr.headers)||void 0===i?void 0:i[r])&&e.push(this.mDr.headers[r]),o=y[r],p&&w&&e.push(this.QDr(null,o,r)),u=0,s=d;u<s.length;u++)f=s[u],c=m.QDr(null,o,r,f),e.push(c);0===_&&y.length>0&&(c=m.QDr(null,o,r),e.push(c)),p&&!w&&e.push(this.QDr(null,o,r)),b.push(e)}else{if((p&&w||0===_)&&(C=0),p&&w)for(r=0;r<y.length;r++)a=g+C+r,o=y[r],j[a]=this.QDr(null,o,r);for(h=function(t){y.forEach((function(n,i){var r=m.QDr(null,n,i,t);j.push(r)}))},l=0,v=d;l<v.length;l++)h(f=v[l]);if(0===_&&y.length>0&&y.forEach((function(t,n){var i=m.QDr(null,t,n,null);j.push(i)})),p&&!w)for(r=0;r<y.length;r++)a=g+C+r,o=y[r],j[a]=this.QDr(null,o,r);b.push(j)}return b},n.prototype.ZDr=function(t,n,i,r,e){var o,u,s,f,c,a,h,l,v,d;if(!(e<1)&&e&&(o=n.length>0,u=i.length>0,s=r.length>0,f=this.mDr.uDr?n.length+1:n.length,u&&(c=i.map((function(t){return t.itn})).join(", "),a=Array(f).fill("").concat([c]).concat(Array(e-f-1).fill("")),t.unshift(a)),o||s)){if(h=o?n.map((function(t){return t.itn})):[],this.mDr.uDr&&h.push(""),s){for(l=r.map((function(t){return t.itn})),v=h.length;v<e;v+=r.length)h.push.apply(h,l);h=h.slice(0,e)}else d=h.length,h.length=e,h.fill("",d,e);t.push(h)}},n.prototype.zDr=function(t,n,i,r){var e,o,u,f,c,a,h,l=this,v=t.verticalExpansionTrees;if(!(s(v)||1!==v.length||(f=null===(u=null===(o=null===(e=v[0])||void 0===e?void 0:e.root)||void 0===o?void 0:o.data)||void 0===u?void 0:u.groups,s(f)||f.length<1)))for(f.sort((function(t,e){var o=l.QDr(t,n,i,null),u=l.QDr(e,n,i,null);return p(o,u,r)})),c=0,a=f;c<a.length;c++)h=a[c],this.JDr(h,n,i,r)},n.prototype.JDr=function(t,n,i,r){var e,o,u,s=this,f=t.childrenArray[0];if(f)for(f.sort((function(t,e){var o=s.QDr(t,n,i),u=s.QDr(e,n,i);return p(o,u,r)})),e=0,o=f;e<o.length;e++)u=o[e],this.JDr(u,n,i,r)},n.prototype.HDr=function(t,n,i,r){var e,o,u,f,c,a,h,l=this,v=t.horizontalExpansionTrees;if(!(s(v)||1!==v.length||(f=null===(u=null===(o=null===(e=v[0])||void 0===e?void 0:e.root)||void 0===o?void 0:o.data)||void 0===u?void 0:u.groups,s(f)||f.length<1)))for(f.sort((function(t,e){var o=l.QDr(null,n,i,t),u=l.QDr(null,n,i,e);return p(o,u,r)})),c=0,a=f;c<a.length;c++)h=a[c],this.KDr(h,n,i,r)},n.prototype.KDr=function(t,n,i,r){var e,o,u,s=this,f=t.childrenArray[0];if(f)for(f.sort((function(t,e){var o=s.QDr(null,n,i,t),u=s.QDr(null,n,i,e);return p(o,u,r)})),e=0,o=f;e<o.length;e++)u=o[e],this.KDr(u,n,i,r)},n}(a),n.hDr=l},"./dist/src/calculation/functions/functions.entry.js":function(t,n,i){"use strict";var r,e,o,u,s,f,c,a,h,l,v;function d(){(0,r.addScopeCustomFunctions)(),(0,e.addParentCustomFunctions)(),(0,o.addChildrenCustomFunctions)(),(0,u.addOnlyChildrenCustomFunctions)(),(0,s.addLevelCustomFunctions)(),(0,f.addLevelRowNumberCustomFunctions)(),(0,c.addQueryFunction)(),(0,a.addWindowOverFunctions)(),(0,h.addWindowFunctions)(),(0,l.addTriggerFieldValueCustomFunctions)()}Object.defineProperty(n,"__esModule",{value:!0}),n.addCustomFunctions=void 0,r=i("./dist/src/calculation/functions/scope.js"),e=i("./dist/src/calculation/functions/hierarchyParent.js"),o=i("./dist/src/calculation/functions/hierarchyChildren.js"),u=i("./dist/src/calculation/functions/hierarchyOnlyChildren.js"),s=i("./dist/src/calculation/functions/hierarchyLevel.js"),f=i("./dist/src/calculation/functions/hierarchyLevelRowNumber.js"),c=i("./dist/src/calculation/functions/query.js"),a=i("./dist/src/calculation/functions/windowOvers/windowOvers.entry.js"),h=i("./dist/src/calculation/functions/windowFunctions/windowFunctions.entry.js"),l=i("./dist/src/calculation/functions/triggerFieldValue.js"),v=i("./dist/src/calculation/functions/aggregationFunctions/index.js"),n.addCustomFunctions=d,(0,v.HEr)()},"./dist/src/calculation/functions/hierarchyChildren.js":function(t,n,i){"use strict";var r,e,o,u;function s(){function t(){this.R9t=[{J6t:3,pkt:["< 1","> 999"]},{J6t:5}]}t.prototype=new o.CalcFunction(u,2,2),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t,n,i){var o,u=[],s=t.source.nM,f=t.source.DJ;return s.CEt()&&(o=s.SEt(f),!(0,e.isNullOrUndefined)(o)&&n>0&&!(0,e.isNullOrEmpty)(i)&&((0,e.traversalTree)(o,{invoking:function(t){if(0===--n){var r=t.lp,e=s._dataSource.TEt(r),o=s._getValueByField(i,e);return u.push(o),{cancelDeepRecursion:!0}}if(0===t.children.length)return{cancelDeepRecursion:!0}},invoked:function(){n++}}),t.source.DJ=f)),new r.CalcArray([u])},r.Functions.defineGlobalCustomFunction(u,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addChildrenCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),u="CHILDREN",n.addChildrenCustomFunctions=s},"./dist/src/calculation/functions/hierarchyLevel.js":function(t,n,i){"use strict";var r,e,o,u;function s(){function t(){}t.prototype=new o.CalcFunction(u),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){var n,i=t.source.nM,r=t.source.DJ;if(i.CEt()&&(n=i.SEt(r),!(0,e.isNullOrUndefined)(n)))return n.level},r.Functions.defineGlobalCustomFunction(u,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addLevelCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),u="LEVEL",n.addLevelCustomFunctions=s},"./dist/src/calculation/functions/hierarchyLevelRowNumber.js":function(t,n,i){"use strict";var r,e,o,u;function s(){function t(){}t.prototype=new o.CalcFunction(u),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){var n,i=t.source.nM,r=t.source.DJ;if(i.CEt()&&(n=i.SEt(r),!(0,e.isNullOrUndefined)(n)))return n.getCurrentIndex()+1},r.Functions.defineGlobalCustomFunction(u,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addLevelRowNumberCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),u="LEVELROWNUMBER",n.addLevelRowNumberCustomFunctions=s},"./dist/src/calculation/functions/hierarchyOnlyChildren.js":function(t,n,i){"use strict";var r,e,o,u;function s(){function t(){this.R9t=[{J6t:5}]}t.prototype=new o.CalcFunction(u,1,1),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t,n){var i,o=[],u=t.source.nM,s=t.source.DJ;return u.CEt()&&(i=u.SEt(s),(0,e.isNullOrUndefined)(i)||(0,e.isNullOrEmpty)(n)||((0,e.traversalTree)(i,(function(t){if(0===t.children.length){var i=t.lp,r=u._dataSource.TEt(i),e=u._getValueByField(n,r);o.push(e)}})),t.source.DJ=s)),new r.CalcArray([o])},r.Functions.defineGlobalCustomFunction(u,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addOnlyChildrenCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),u="ONLYCHILDREN",n.addOnlyChildrenCustomFunctions=s},"./dist/src/calculation/functions/hierarchyParent.js":function(t,n,i){"use strict";var r,e,o,u;function s(){function t(){this.R9t=[{J6t:3,pkt:["< 1","> 999"]},{J6t:5}]}t.prototype=new o.CalcFunction(u,2,2),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t,n,i){var r,o,u,s,c,a=t.source.nM,h=t.source.DJ;if(a.CEt()&&(r=a.SEt(h),!(0,e.isNullOrUndefined)(r)&&n>0&&!(0,e.isNullOrEmpty)(i)&&!(o=f(r,n)).isRoot))return u=o.lp,s=a._dataSource.TEt(u),c=a._getValueByField(i,s),t.source.DJ=h,c},r.Functions.defineGlobalCustomFunction(u,new t)}function f(t,n){return 0===n||t.isRoot?t:f(t.parent,n-1)}Object.defineProperty(n,"__esModule",{value:!0}),n.addParentCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),u="PARENT",n.addParentCustomFunctions=s},"./dist/src/calculation/functions/query.js":function(t,n,i){"use strict";var r,e,o;function u(){if(!r.Functions.findGlobalFunction(o)){var t=new r.Functions.AsyncFunction(o,1,3);t.isContextSensitive=function(){return!0},t.evaluateAsync=function(t,n,i,o){var u,s,f,c,a=t.ctx.source;function h(){var e,u,f,c,a=s.xEt(n,i,o);a&&(a.Mgr=void 0),(null===(f=null===(u=null===(e=t.ctx)||void 0===e?void 0:e.Xkt)||void 0===u?void 0:u.node)||void 0===f?void 0:f.WK)?(c=s.IEt(n,i,o))&&(o?t.setAsyncResult(c[0]):t.setAsyncResult(new r.CalcArray(c))):s.IEt(n,i,o,h,!0)}function l(e){var u,f,c,a,l,v=s.IEt(n,i,o,h,!1,!(null===(c=null===(f=null===(u=t.ctx)||void 0===u?void 0:u.Xkt)||void 0===f?void 0:f.node)||void 0===c?void 0:c.WK));if(v)if(o){if(a=v[0],e)return t.node.yL||setTimeout((function(){t.setAsyncResult(a)}),0),a;t.setAsyncResult(a)}else{if(l=new r.CalcArray(v),e)return t.node.yL||setTimeout((function(){t.setAsyncResult(l)}),0),l;t.setAsyncResult(l)}}if(c=(f=(s=a instanceof e.DataManagerCalcSource?a.nM.QOt:t.ctx.source.Mf.parent.dataManager()).xEt(n,i,o)).table){if(c.qGr||(null===(u=null==t?void 0:t.node)||void 0===u?void 0:u.yL))return l(!0);c.NEt().then((function(){l()}))}},t.acceptsReference=function(t){return!0},t.acceptsArray=function(t){return!0},r.Functions.defineGlobalCustomFunction(o,t)}}Object.defineProperty(n,"__esModule",{value:!0}),n.addQueryFunction=void 0,r=i("CalcEngine"),e=i("./dist/src/calculation/calcSource.js"),o="QUERY",n.addQueryFunction=u},"./dist/src/calculation/functions/scope.js":function(t,n,i){"use strict";var r,e,o,u,s;function f(){function t(){}function n(){}t.prototype=new o.CalcFunction(u,2,2),t.prototype.isContextSensitive=function(){return!0},t.prototype.isReverseArgs=function(){return!0},t.prototype.evaluate=function(t,n,i){return t.source.ak=n.start,t.source.DJ=n.context,i},r.Functions.defineGlobalCustomFunction(u,new t),n.prototype=new o.CalcFunction(s,0,255),n.prototype.isContextSensitive=function(){return!0},n.prototype.evaluate=function(t){var n,i,r,e=[];for(n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i={start:t.source.ak,context:t.source.DJ},r=t.source.MEt,t.source.ak=0,t.source.DJ=c(r.groupContext,e),i},r.Functions.defineGlobalCustomFunction(s,new n)}function c(t,n){var i=a(t.groupOptions.slice(0,t.path.length),n);return h(t.path,i)?t.entireScope:l(t.path,i)}function a(t,n){var i,r;if(n&&n.length>0){for(i=-1,t.reverse(),r=0;r<t.length;r++)if(t[r].field!==n[r]){(0,e.isNullOrUndefined)(n[r])&&n.length<=r&&(i=t.length-r-1);break}return i}return-1}function h(t,n){return-1===n||t.length-1<=n}function l(t,n){var i,r=[];return v(t[n],r),r}function v(t,n){var i,r,e,o,u,s,f=n.length,c=t.recordRowNumbers;if(c)for(i=0,r=c.length;i<r;i++)n[f+i]=c[i];else for(o=0,u=e=t.children;o<u.length;o++)v(s=u[o],n)}Object.defineProperty(n,"__esModule",{value:!0}),n.addScopeCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),u="CALCULATE",s="REMOVEFILTERS",n.addScopeCustomFunctions=f},"./dist/src/calculation/functions/triggerFieldValue.js":function(t,n,i){"use strict";var r,e,o;function u(){function t(){}t.prototype=new o.CalcFunction(n.TRIGGERFIELDVALUE,1,2),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t,n,i){var r=t.source.nM._dataSource,o=r.getFieldValue(n,0);return(0,e.isUndefined)(o)&&i?r.getFieldOriginalValue(n,0):o},r.Functions.defineGlobalCustomFunction(n.TRIGGERFIELDVALUE,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addTriggerFieldValueCustomFunctions=n.TRIGGERFIELDVALUE=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/utils.js"),n.TRIGGERFIELDVALUE="TRIGGERFIELDVALUE",n.addTriggerFieldValueCustomFunctions=u},"./dist/src/calculation/functions/utils.js":function(t,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CalcFunction=void 0;var r=i("./dist/src/dataManager.common.js");n.CalcFunction=r.CalcFunction},"./dist/src/calculation/functions/windowFunctions/cumeDist.js":function(t,n,i){"use strict";var r,e;function o(){function t(){}t.prototype=new e.CalcFunction(e.CUMEDIST),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){return(0,e.expandContext)(t,(function(t){var n,i,r,e,o,f,c,a,h,l,v,d=t.indexes,p=t.begin,w=t.length,b=t.result,m=t.orders,j=t.isOrderValid,y=t.reader,g=w-p,_=j&&1===m.length,O=j&&m[0].field,C=function(t){return y(O,d[t])},S=function(t,n){return y(m[n].field,t)},M=function(t){return d[t]};for(n=p;n<w;n++)if(j){if(i=d[n],r=void 0,o=d[e=n+1],_)(r=y(O,i))===y(O,o)&&(e=(-1!==(f=u(C,r,e,w-1))?f:e)+1);else{for(r=[],c=void 0,a=!0,h=0;h<m.length;h++){if(O=m[h].field,(c=y(O,i))!==y(O,o)){a=!1;break}r.push(c)}a&&(e=(-1!==(f=s(M,S,r,e,w-1))?f:e)+1)}for(l=(e-p)/g,v=e-n;v>0;)v--,b.push(l);n=e-1}else b.push(1)}))},r.Functions.defineGlobalCustomFunction(e.CUMEDIST,new t)}function u(t,n,i,r){for(var e,o,u=i,s=r,f=-1;u<=s;)n===(o=t(e=Math.floor((u+s)/2)))?(u=e+1,f=e):s=e-1;return f}function s(t,n,i,r,e){for(var o,u,s,f,c=r,a=e,h=-1,l=i.length-1;c<=a;){for(u=t(o=Math.floor((c+a)/2)),s=!0,f=l;f>=0;f--)if(n(u,f)!==i[f]){s=!1;break}s?(c=o+1,h=o):a=o-1}return h}Object.defineProperty(n,"__esModule",{value:!0}),n.addCumeDistCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addCumeDistCustomFunctions=o},"./dist/src/calculation/functions/windowFunctions/denseRank.js":function(t,n,i){"use strict";var r,e;function o(){function t(){}t.prototype=new e.CalcFunction(e.DENSERANK),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){return(0,e.expandContext)(t,(function(t){var n,i,r,e,o,u,s,f,c=t.indexes,a=t.begin,h=t.length,l=t.result,v=t.orders,d=t.reader,p=t.isOrderValid,w=0,b=!1;for(p&&((r=1===v.length)?e=v[0].field:n=[]),o=a;o<h;o++){if(p)if(u=c[o],r)(i=d(e,u))===n&&o!==a||(w+=1,n=i);else{for(i=[],s=v.length-1;s>=0;s--)f=d(v[s].field,u),i.unshift(f),f!==n[s]&&(b=!0);(b||o===a)&&(b=!1,w+=1,n=i)}else w=1;l.push(w)}}))},r.Functions.defineGlobalCustomFunction(e.DENSERANK,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addDenseRankCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addDenseRankCustomFunctions=o},"./dist/src/calculation/functions/windowFunctions/firstLastNthValue.js":function(t,n,i){"use strict";var r,e,o,u;function s(){function t(){}t.prototype=new o.CalcFunction(o.FIRSTVALUE,1,1),t.prototype.isContextSensitive=function(){return!0},t.prototype.acceptsExpressionArgument=function(t){return 0===t},t.prototype.evaluate=function(t,n){return a(t,n,u.first,1)},r.Functions.defineGlobalCustomFunction(o.FIRSTVALUE,new t)}function f(){function t(){}t.prototype=new o.CalcFunction(o.LASTVALUE,1,1),t.prototype.isContextSensitive=function(){return!0},t.prototype.acceptsExpressionArgument=function(t){return 0===t},t.prototype.evaluate=function(t,n){return a(t,n,u.last,1)},r.Functions.defineGlobalCustomFunction(o.LASTVALUE,new t)}function c(){function t(){}t.prototype=new o.CalcFunction(o.NTHVALUE,1,2),t.prototype.isContextSensitive=function(){return!0},t.prototype.acceptsExpressionArgument=function(t){return 0===t},t.prototype.evaluate=function(t,n,i){return a(t,n,u.nth,i)},r.Functions.defineGlobalCustomFunction(o.NTHVALUE,new t)}function a(t,n,i,r){var s,f=t.source.nM.wve(n);return(0,o.expandContext)(t,(function(t){var n,o,s,c,a,h,l=t.indexes,v=t.begin,d=t.length,p=t.result,w=t.frame,b=t.evaluateWindowIndexes,m=t.buildFrameGroups;if((0,e.isNumber)(r)&&r>0)for(r=Math.floor(r),n={startIndex:v,endIndex:v,lastStartIndex:v,lastEndIndex:v},o=m(l,v),s=v;s<d;s++)if(b(w,v,s,l,n,o),-1===n.startIndex&&-1===n.endIndex)p.push(null);else if(i===u.first)p.push(f(l[n.startIndex]));else if(i===u.last)p.push(f(l[n.endIndex]));else if((c=n.startIndex+r-1)<=n.endIndex){if(void 0!==n.gapStartIndex&&void 0!==n.gapEndIndex&&(a=n.gapStartIndex-n.startIndex,r>a&&(c=void 0!==n.currentIndex?1===(h=r-a)?n.currentIndex:h-1+n.gapEndIndex:r-a+n.gapEndIndex)>n.endIndex)){p.push(null);continue}p.push(f(l[c]))}else p.push(null)}))}Object.defineProperty(n,"__esModule",{value:!0}),n.addNthValueCustomFunctions=n.addLastValueCustomFunctions=n.addFirstValueCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/windowFunctions/util.js"),function(t){t[t.first=0]="first",t[t.last=1]="last",t[t.nth=2]="nth"}(u||(u={})),n.addFirstValueCustomFunctions=s,n.addLastValueCustomFunctions=f,n.addNthValueCustomFunctions=c},"./dist/src/calculation/functions/windowFunctions/leadLag.js":function(t,n,i){"use strict";var r,e,o;function u(){function t(){}t.prototype=new o.CalcFunction(o.LEAD,1,3),t.prototype.isContextSensitive=function(){return!0},t.prototype.acceptsExpressionArgument=function(t){return 0===t},t.prototype.evaluate=function(t,n,i,r){return f(t,n,i,r)},r.Functions.defineGlobalCustomFunction(o.LEAD,new t)}function s(){function t(){}t.prototype=new o.CalcFunction(o.LAG,1,3),t.prototype.isContextSensitive=function(){return!0},t.prototype.acceptsExpressionArgument=function(t){return 0===t},t.prototype.evaluate=function(t,n,i,r){return f(t,n,i,r,!0)},r.Functions.defineGlobalCustomFunction(o.LAG,new t)}function f(t,n,i,r,u){var s,f=t.source.nM.wve(n);return(0,o.expandContext)(t,(function(t){var n,o,s,c=t.indexes,a=t.begin,h=t.length,l=t.result;if(i=(0,e.isNullOrUndefined)(i)?1:i,(0,e.isNumber)(i)&&i>=0)for(i=Math.floor(i),r=(0,e.isNullOrUndefined)(r)?null:r,n=a;n<h;n++)o=void 0,s=void 0,(s=u?(o=n-i)>=a:(o=n+i)<h)?l.push(f(c[o])):l.push(r)}))}Object.defineProperty(n,"__esModule",{value:!0}),n.addLagCustomFunctions=n.addLeadCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addLeadCustomFunctions=u,n.addLagCustomFunctions=s},"./dist/src/calculation/functions/windowFunctions/nTile.js":function(t,n,i){"use strict";var r,e,o;function u(){function t(){}t.prototype=new o.CalcFunction(o.NTILE,1,1),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t,n){return(0,o.expandContext)(t,(function(t){var i,r,o,u,s,f,c=t.begin,a=t.length,h=t.result;if((0,e.isNumber)(n)&&n>0&&n<a)for(i=a-c,u=(r=Math.floor(i/n))+((o=i%n)>0?1:0),o--,s=c,f=1;s<a;s++)h.push(f),0===--u&&(u=r+(o>0?1:0),o--,f++);else for(s=c;s<a;s++)h.push(s-c+1)}))},r.Functions.defineGlobalCustomFunction(o.NTILE,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addNTileCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/dataSource/utils.js"),o=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addNTileCustomFunctions=u},"./dist/src/calculation/functions/windowFunctions/percentRank.js":function(t,n,i){"use strict";var r,e,o;function u(){function t(){}t.prototype=new o.CalcFunction(o.WPERCENTRANK),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){return(0,e.evaluateRank)(t,(function(t,n){return 1===n?0:(t-1)/(n-1)}))},r.Functions.defineGlobalCustomFunction(o.WPERCENTRANK,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addWPercentRankCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/calculation/functions/windowFunctions/rank.js"),o=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addWPercentRankCustomFunctions=u},"./dist/src/calculation/functions/windowFunctions/rank.js":function(t,n,i){"use strict";var r,e;function o(){function t(){}t.prototype=new e.CalcFunction(e.WRANK),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){return u(t)},r.Functions.defineGlobalCustomFunction(e.WRANK,new t)}function u(t,n){return(0,e.expandContext)(t,(function(t){var i,r,e,o,u,s,f,c=t.indexes,a=t.begin,h=t.length,l=t.result,v=t.orders,d=t.isOrderValid,p=t.reader,w=1,b=!1,m=h-a,j=!1;for(d&&((j=1===v.length)?e=v[0].field:i=[]),o=a;o<h;o++){if(d)if(u=c[o],j)(r=p(e,u))===i&&o!==a||(w=o-a+1,n&&(w=n(w,m)),i=r);else{for(r=[],s=v.length-1;s>=0;s--)f=p(v[s].field,u),r.unshift(f),f!==i[s]&&(b=!0);(b||o===a)&&(b=!1,w=o-a+1,n&&(w=n(w,m)),i=r)}l.push(w)}}))}Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateRank=n.addWRankCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addWRankCustomFunctions=o,n.evaluateRank=u},"./dist/src/calculation/functions/windowFunctions/rowNumber.js":function(t,n,i){"use strict";var r,e;function o(){function t(){}t.prototype=new e.CalcFunction(e.ROWNUMBER),t.prototype.isContextSensitive=function(){return!0},t.prototype.evaluate=function(t){return(0,e.expandContext)(t,(function(t){var n,i=t.begin,r=t.length,e=t.result;for(n=i;n<r;n++)e.push(n-i+1)}))},r.Functions.defineGlobalCustomFunction(e.ROWNUMBER,new t)}Object.defineProperty(n,"__esModule",{value:!0}),n.addRowNumberCustomFunctions=void 0,r=i("CalcEngine"),e=i("./dist/src/calculation/functions/windowFunctions/util.js"),n.addRowNumberCustomFunctions=o},"./dist/src/calculation/functions/windowFunctions/util.js":function(t,n,i){"use strict";var r,e;function o(t,n){return t.getCalcService().evaluateExpression(t,n,{row:0,col:0})}function u(t,n,i){return t.map((function(t){return n(t.field,i)}))}function s(t,n){if(t!==n){if((0,r.isNullOrUndefined)(t)||(0,r.isNullOrUndefined)(n)||t.length!==n.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==n[i])return!1}return!0}function f(t,n,i){var r,e=t.DJ;return t.DJ=i,r=o(t,n),t.DJ=e,r}function c(t,n){var i,e,o,u,s,f,c,a,h,l,v,d,p;if(!(0,r.isNullOrUndefined)(t.source.MEt)&&!(0,r.isNullOrUndefined)(t.source.MEt.extendContext))return i=t.source.DJ,o=(e=t.source.MEt.extendContext).begin,u=e.evaluator,s=i.length,f=!1,c=void 0,a=u.options.windowFrame,h=u.options.orders,l=!(0,r.isNullOrUndefined)(h)&&h.length>0,v=function(t,n){return u.zhe(t)