import{A as e}from"./vendor-tanstack-DmFvmRiZ.js";var t=5e4,n=`get_analytics_raw`;function r(t){let{metric:r,startTime:a,endTime:o,conditions:s,instanceParams:c,bucketMs:l}=t,u=c.entityId;return e({queryKey:[n,u,r,a,o,l??null,s??null],queryFn:()=>i(t)})}async function i({metric:e,startTime:n,endTime:r,conditions:i,instanceParams:a,bucketMs:o}){let s={operation:`get_analytics`,metric:e,start_time:n,end_time:r};i&&i.length>0&&(s.conditions=i),o&&o>0&&(s.bucket_ms=o);let{data:c}=await a.instanceClient.post(`/`,s);return c.length>t?(console.warn(`[analytics] response exceeded row cap; truncating oldest`,{metric:e,rows:c.length,cap:t,dropped:c.length-t}),c.slice(-5e4)):c}export{i as n,r,n as t};
//# sourceMappingURL=getAnalytics-HqW0hniG.js.map