!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ecSimpleTransform={})}(this,(function(e){"use strict";function n(e,n){if(!e)throw new Error(n)}function t(e,n){return e.hasOwnProperty(n)}var r={SUM:!0,COUNT:!0,FIRST:!0,AVERAGE:!0,Q1:!0,Q2:!0,Q3:!0,MIN:!0,MAX:!0},o={AVERAGE:["COUNT"]},i={Q1:!0,Q2:!0,Q3:!0},u={MEDIAN:"Q2"},a=function(){function e(e,n,t,r,o){this.collectionInfoList=[],this.gatheredValuesByGroup={},this.gatheredValuesNoGroup=[],this.needGatherValues=!1,this._collectionInfoMap={},this.method=t,this.name=r,this.index=e,this.indexInUpstream=n,this.needGatherValues=o}return e.prototype.addCollectionInfo=function(e){this._collectionInfoMap[e.method]=this.collectionInfoList.length,this.collectionInfoList.push(e)},e.prototype.getCollectionInfo=function(e){return this.collectionInfoList[this._collectionInfoMap[e]]},e.prototype.gatherValue=function(e,n,t){if(t=+t,e){if(null!=n){var r=n+"";(this.gatheredValuesByGroup[r]||(this.gatheredValuesByGroup[r]=[])).push(t)}}else this.gatheredValuesNoGroup.push(t)},e}(),l={type:"ecSimpleTransform:aggregate",transform:function(e){var r,u=e.upstream,l=e.config,p=function(e,t){var r,o=e.groupBy;null!=o&&n(r=t.getDimensionInfo(o),"Can not find dimension by `groupBy`: "+o);return r}(l,u),I=function(e,r,u){for(var l=e.resultDimensions,f=[],c=[],h=0,d=0;d