"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1074,5732],{59153:(n,t,e)=>{e.r(t),e.d(t,{registerFunctions:()=>s});var r=e(27535),a=e(61363),i=e(24240),u=e(41534);async function o(n,t,e,r,o,s){if(1===r.length){if((0,a.m)(r[0]))return(0,i.t)(n,r[0],(0,a.D)(r[1],-1));if((0,a.o)(r[0]))return(0,i.t)(n,r[0].toArray(),(0,a.D)(r[1],-1))}else if(2===r.length){if((0,a.m)(r[0]))return(0,i.t)(n,r[0],(0,a.D)(r[1],-1));if((0,a.o)(r[0]))return(0,i.t)(n,r[0].toArray(),(0,a.D)(r[1],-1));if((0,a.r)(r[0])){const e=await r[0].load(),i=await c(u.WhereClause.create(r[1],e.getFieldsIndex()),s,o);return r[0].calculateStatistic(n,i,(0,a.D)(r[2],1e3),t.abortSignal)}}else if(3===r.length&&(0,a.r)(r[0])){const e=await r[0].load(),i=await c(u.WhereClause.create(r[1],e.getFieldsIndex()),s,o);return r[0].calculateStatistic(n,i,(0,a.D)(r[2],1e3),t.abortSignal)}return(0,i.t)(n,r,-1)}async function c(n,t,e){const r=n.getVariables();if(r.length>0){const a=[];for(let n=0;n<r.length;n++){const i={name:r[n]};a.push(await t.evaluateIdentifier(e,i))}const i={};for(let n=0;n<r.length;n++)i[r[n]]=a[n];return n.parameters=i,n}return n}function s(n){"async"===n.mode&&(n.functions.stdev=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("stdev",e,0,a,t,n)))},n.functions.variance=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("variance",e,0,a,t,n)))},n.functions.average=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("mean",e,0,a,t,n)))},n.functions.mean=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("mean",e,0,a,t,n)))},n.functions.sum=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("sum",e,0,a,t,n)))},n.functions.min=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("min",e,0,a,t,n)))},n.functions.max=function(t,e){return n.standardFunctionAsync(t,e,((e,r,a)=>o("max",e,0,a,t,n)))},n.functions.count=function(t,e){return n.standardFunctionAsync(t,e,((n,i,u)=>{if((0,a.C)(u,1,1,t,e),(0,a.r)(u[0]))return u[0].count(n.abortSignal);if((0,a.m)(u[0])||(0,a.c)(u[0]))return u[0].length;if((0,a.o)(u[0]))return u[0].length();throw new r.aV(t,r.rH.InvalidParameter,e)}))})}},5732:(n,t,e)=>{e.d(t,{c:()=>r,g:()=>a});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}}}]);