(window.expressions_bundle_jsonpfunction=window.expressions_bundle_jsonpfunction||[]).push([[5],{95:function(n,e,o){"use strict";o.r(e),o.d(e,"overallMetricFn",(function(){return t}));var r=o(22);const t=(n,{by:e,inputColumnId:o,outputColumnId:t,outputColumnName:s,metric:a})=>{const c=Object(r.a)(n,t,o,s);if(!c)return n;const u={},i={};return n.rows.forEach((n=>{var t;const s=Object(r.b)(n,e),c=u[s],m=n[o];if(null!=m){const n=(b=m,Array.isArray(b)?b.map((n=>Number(n))):[Number(b)]);switch(a){case"average":i[s]=(null!==(t=i[s])&&void 0!==t?t:0)+n.length;case"sum":u[s]=n.reduce(((n,e)=>n+e),c||0);break;case"min":u[s]=void 0!==c?Math.min(c,...n):Math.min(...n);break;case"max":u[s]=void 0!==c?Math.max(c,...n):Math.max(...n)}}var b})),"average"===a&&Object.keys(u).forEach((n=>{const e=u[n],o=i[n];void 0!==e&&void 0!==o&&(u[n]=e/o)})),{...n,columns:c,rows:n.rows.map((n=>{const o={...n},s=Object(r.b)(n,e);return o[t]=u[s],o}))}}}}]);