usage-board 3.2.1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/public/_nuxt/37OOe3RF.js +1 -0
- package/dist/public/_nuxt/65Ayv2XK.js +146 -0
- package/dist/public/_nuxt/BOWwkrCY.js +25 -0
- package/dist/public/_nuxt/C0GhHHgI.js +3 -0
- package/dist/public/_nuxt/{CLHpvfq1.js → D7qEPtpx.js} +1 -1
- package/dist/public/_nuxt/D9-Yw1TR.js +1 -0
- package/dist/public/_nuxt/DF2WsXH3.js +1 -0
- package/dist/public/_nuxt/DKaPq50Z.js +6 -0
- package/dist/public/_nuxt/{CBu27bzx.js → DXWxIyGU.js} +1 -1
- package/dist/public/_nuxt/De8DvPWL.js +1 -0
- package/dist/public/_nuxt/DgMMKsPE.js +258 -0
- package/dist/public/_nuxt/DxvuOJRP.js +1 -0
- package/dist/public/_nuxt/Jp5cgQZi.js +4 -0
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/34b12f78-e5b7-490f-99ba-b4a8ab41b914.json +1 -0
- package/dist/public/_nuxt/entry.DnkKc-6G.css +1 -0
- package/dist/public/_nuxt/qXgLTL_3.js +21 -0
- package/dist/public/_nuxt/y6mAKUDU.js +1 -0
- package/dist/server/chunks/build/client.precomputed.mjs +1 -1
- package/dist/server/chunks/nitro/nitro.mjs +2509 -1687
- package/dist/server/chunks/routes/api/analysis/agent/session.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/agent/token.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/cache.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/hot-project.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/model.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/overview-cards.json.mjs +4 -4
- package/dist/server/chunks/routes/api/analysis/session.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/token/daily.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/token/today-hourly.json.mjs +21 -0
- package/dist/server/chunks/routes/api/analysis/token.json.mjs +1 -1
- package/dist/server/chunks/routes/api/payload.json.mjs +2 -2
- package/dist/server/chunks/routes/api/projects/_project/modules.get.mjs +2 -2
- package/dist/server/chunks/routes/api/projects/catalog.get.mjs +2 -2
- package/dist/server/chunks/routes/renderer.mjs +2 -2
- package/dist/server/chunks/routes/ws.mjs +2 -2
- package/dist/server/index.mjs +2 -2
- package/dist/server/package.json +1 -1
- package/package.json +2 -2
- package/dist/public/_nuxt/BL-DadsH.js +0 -260
- package/dist/public/_nuxt/BO_d_Oyx.js +0 -6
- package/dist/public/_nuxt/BtuXxixc.js +0 -25
- package/dist/public/_nuxt/CC4_0abj.js +0 -1
- package/dist/public/_nuxt/CGsjOcfM.js +0 -21
- package/dist/public/_nuxt/COBlwcVj.js +0 -1
- package/dist/public/_nuxt/CjeAKHhp.js +0 -1
- package/dist/public/_nuxt/CvvesHM7.js +0 -105
- package/dist/public/_nuxt/IstswKJB.js +0 -4
- package/dist/public/_nuxt/N8W_Dp-N.js +0 -119
- package/dist/public/_nuxt/builds/meta/be10c896-ee75-4f4f-911d-c3f0a8b4d417.json +0 -1
- package/dist/public/_nuxt/entry.vHfFzkyD.css +0 -1
- package/dist/public/_nuxt/vkAmg0G5.js +0 -1
- package/dist/public/_nuxt/wUprbfrX.js +0 -1
package/dist/index.mjs
CHANGED
|
@@ -539,7 +539,7 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari"
|
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region package.json
|
|
541
541
|
var name = "usage-board";
|
|
542
|
-
var version = "
|
|
542
|
+
var version = "4.0.1";
|
|
543
543
|
//#endregion
|
|
544
544
|
//#region src/index.ts
|
|
545
545
|
const cli = cac(name);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as n}from"./Jp5cgQZi.js";const w=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),g=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),p=t=>{const e=g(t);return e.charAt(0).toUpperCase()+e.slice(1)},C=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim(),d=t=>t==="";var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const f=({name:t,iconNode:e,absoluteStrokeWidth:o,"absolute-stroke-width":r,strokeWidth:c,"stroke-width":a,size:i=s.width,color:h=s.stroke,...l},{slots:u})=>n("svg",{...s,...l,width:i,height:i,stroke:h,"stroke-width":d(o)||d(r)||o===!0||r===!0?Number(c||a||s["stroke-width"])*24/Number(i):c||a||s["stroke-width"],class:C("lucide",l.class,...t?[`lucide-${w(p(t))}-icon`,`lucide-${w(t)}`]:["lucide-icon"])},[...e.map(m=>n(...m)),...u.default?[u.default()]:[]]);const v=(t,e)=>(o,{slots:r,attrs:c})=>n(f,{...c,...o,iconNode:e,name:t},r);export{v as c};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import{E as Se,F as Ae,G as Ct,H as st,I as $e,J as qt,K as dt,L as et,M as X,N as Jt,O as J,P as St,Q as gt,R as Dt,T as Zt,U as I,V as Te,W as Kt,X as we,Y as Ce,Z as De,$ as oe,a0 as nt,a1 as le,a2 as Me,a3 as Re,a4 as ut,a5 as Mt,a6 as Le,a7 as jt,a8 as Ee,a9 as Qt,aa as $t,ab as Ue,ac as Pe,ad as je,ae as ie,af as He,ag as Oe,ah as Ve,ai as We,aj as Be,ak as Vt,al as Wt,am as Ge,an as ze,ao as re,_ as Bt,S as ce,C as Ne,a as Tt,z as Gt,A as Fe,B as xt,f as it,e as wt,m as yt,c as te,w as de,q as Rt,i as Ie,b as Ye,d as Xe,g as qe,h as Je,j as Ze,k as Ke,l as vt,x as Qe,y as ta}from"./DgMMKsPE.js";import{j as ea,k as ee,l as aa,m as ae,n as na,o as ne,u as sa,i as Lt,_ as oa,a as la,b as ia}from"./BOWwkrCY.js";import{e as ot,$ as ra,k as ca,I as ft,a0 as zt,o as $,c as j,h as da,r as Nt,Y as Et,H as ue,a7 as Ut,W as he,L as ge,a1 as fe,G as R,B as ua,C as ha,g as W,w as T,i as u,b as x,l as _t,a as D,D as rt,t as H,F as at,E as mt,O as ga,P as se,q as fa,d as Y,x as ma,J as pa}from"./Jp5cgQZi.js";import{u as Pt}from"./DKaPq50Z.js";import"./C0GhHHgI.js";const va=Object.assign(Object.assign({},Se),{tooltip:void 0,annotations:void 0});class ba extends Ae{constructor(e,t,s){var i;super(e),this._defaultConfig=va,this.config=this._defaultConfig,t&&(this.updateContainer(t,!0),this.component=t.component),s&&this.setData(s,!0),!((i=this.component)===null||i===void 0)&&i.datamodel.data&&this.render()}setData(e,t){var s;const{config:i}=this;this.component&&this.component.setData(e),t||this.render(),(s=i.tooltip)===null||s===void 0||s.hide()}updateContainer(e,t){super.updateContainer(e),this._removeAllChildren(),this.component=e.component,e.sizing&&(this.component.sizing=e.sizing),this.element.appendChild(this.component.element);const s=e.tooltip;s&&(s.hasContainer()||s.setContainer(this._container),s.setComponents([this.component]));const i=e.annotations;i&&this.element.appendChild(i.element),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),t||this.render()}updateComponent(e,t){this.component.setConfig(e),t||this.render()}update(e,t,s){e&&this.updateContainer(e,!0),t&&this.updateComponent(t,!0),s&&this.setData(s,!0),this.render()}getFitWidthScale(){const{config:e,component:t}=this,s=t;if(!s.getWidth)return 1;const i=s.getWidth()+e.margin.left+e.margin.right;return this.width/i}_preRender(){var e,t;super._preRender(),this.component.setSize(this.width,this.height,this.containerWidth,this.containerHeight),this.component.setContainerMargin(this.config.margin),(e=this.config.annotations)===null||e===void 0||e.setSize(this.width,this.height,this.containerWidth,this.containerHeight),(t=this.config.annotations)===null||t===void 0||t.setContainerMargin(this.config.margin)}_render(e){var t,s;const{config:i,component:c}=this;super._render(e),c.g.attr("transform",`translate(${i.margin.left},${i.margin.top})`),c.render(e),(t=i.annotations)===null||t===void 0||t.render(e),i.tooltip&&i.tooltip.update(),(s=i.onRenderComplete)===null||s===void 0||s.call(i,this.svg.node(),i.margin,this.containerWidth,this.containerHeight,this.width,this.height)}render(e=this.config.duration){const{config:t,component:s}=this;if(t.sizing===Ct.Extend||t.sizing===Ct.FitWidth){const i=t.sizing===Ct.FitWidth,c=s,n=c.getWidth()+t.margin.left+t.margin.right,a=c.getHeight()+t.margin.top+t.margin.bottom,d=i?this.getFitWidthScale():1,l=this.svg.attr("width"),o=this.svg.attr("height"),g=n*d,f=a*d,k=l||o;st(this.svg,k?e:0).attr("width",g).attr("height",f).attr("viewBox",`0 0 ${n} ${i?f:a}`).attr("preserveAspectRatio","xMinYMin")}else this.svg.attr("width",this.config.width||this.containerWidth).attr("height",this.config.height||this.containerHeight);this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}_onResize(){var e;const{config:t}=this;super._onResize(),(e=t.tooltip)===null||e===void 0||e.hide()}destroy(){var e,t;const{component:s,config:i}=this;super.destroy(),s?.destroy(),(e=i.tooltip)===null||e===void 0||e.destroy(),(t=i.annotations)===null||t===void 0||t.destroy()}}function ya(h){return h.innerRadius}function _a(h){return h.outerRadius}function xa(h){return h.startAngle}function ka(h){return h.endAngle}function Sa(h){return h&&h.padAngle}function Aa(h,e,t,s,i,c,n,a){var d=t-h,l=s-e,o=n-i,g=a-c,f=g*d-o*l;if(!(f*f<J))return f=(o*(e-c)-g*(h-i))/f,[h+f*d,e+f*l]}function kt(h,e,t,s,i,c,n){var a=h-t,d=e-s,l=(n?c:-c)/gt(a*a+d*d),o=l*d,g=-l*a,f=h+o,k=e+g,b=t+o,y=s+g,r=(f+b)/2,m=(k+y)/2,p=b-f,S=y-k,L=p*p+S*S,O=i-c,_=f*y-b*k,C=(S<0?-1:1)*gt(Te(0,O*O*L-_*_)),P=(_*S-p*C)/L,z=(-_*p-S*C)/L,N=(_*S+p*C)/L,B=(-_*p+S*C)/L,G=P-r,A=z-m,M=N-r,F=B-m;return G*G+A*A>M*M+F*F&&(P=N,z=B),{cx:P,cy:z,x01:-o,y01:-g,x11:P*(i/O-1),y11:z*(i/O-1)}}function $a(){var h=ya,e=_a,t=X(0),s=null,i=xa,c=ka,n=Sa,a=null,d=$e(l);function l(){var o,g,f=+h.apply(this,arguments),k=+e.apply(this,arguments),b=i.apply(this,arguments)-Jt,y=c.apply(this,arguments)-Jt,r=Zt(y-b),m=y>b;if(a||(a=o=d()),k<f&&(g=k,k=f,f=g),!(k>J))a.moveTo(0,0);else if(r>St-J)a.moveTo(k*dt(b),k*et(b)),a.arc(0,0,k,b,y,!m),f>J&&(a.moveTo(f*dt(y),f*et(y)),a.arc(0,0,f,y,b,m));else{var p=b,S=y,L=b,O=y,_=r,C=r,P=n.apply(this,arguments)/2,z=P>J&&(s?+s.apply(this,arguments):gt(f*f+k*k)),N=Dt(Zt(k-f)/2,+t.apply(this,arguments)),B=N,G=N,A,M;if(z>J){var F=Kt(z/f*et(P)),K=Kt(z/k*et(P));(_-=F*2)>J?(F*=m?1:-1,L+=F,O-=F):(_=0,L=O=(b+y)/2),(C-=K*2)>J?(K*=m?1:-1,p+=K,S-=K):(C=0,p=S=(b+y)/2)}var v=k*dt(p),E=k*et(p),U=f*dt(O),V=f*et(O);if(N>J){var q=k*dt(S),tt=k*et(S),lt=f*dt(L),pt=f*et(L),Q;if(r<qt)if(Q=Aa(v,E,lt,pt,q,tt,U,V)){var ht=v-Q[0],w=E-Q[1],Z=q-Q[0],ct=tt-Q[1],Yt=1/et(we((ht*Z+w*ct)/(gt(ht*ht+w*w)*gt(Z*Z+ct*ct)))/2),Xt=gt(Q[0]*Q[0]+Q[1]*Q[1]);B=Dt(N,(f-Xt)/(Yt-1)),G=Dt(N,(k-Xt)/(Yt+1))}else B=G=0}C>J?G>J?(A=kt(lt,pt,v,E,k,G,m),M=kt(q,tt,U,V,k,G,m),a.moveTo(A.cx+A.x01,A.cy+A.y01),G<N?a.arc(A.cx,A.cy,G,I(A.y01,A.x01),I(M.y01,M.x01),!m):(a.arc(A.cx,A.cy,G,I(A.y01,A.x01),I(A.y11,A.x11),!m),a.arc(0,0,k,I(A.cy+A.y11,A.cx+A.x11),I(M.cy+M.y11,M.cx+M.x11),!m),a.arc(M.cx,M.cy,G,I(M.y11,M.x11),I(M.y01,M.x01),!m))):(a.moveTo(v,E),a.arc(0,0,k,p,S,!m)):a.moveTo(v,E),!(f>J)||!(_>J)?a.lineTo(U,V):B>J?(A=kt(U,V,q,tt,f,-B,m),M=kt(v,E,lt,pt,f,-B,m),a.lineTo(A.cx+A.x01,A.cy+A.y01),B<N?a.arc(A.cx,A.cy,B,I(A.y01,A.x01),I(M.y01,M.x01),!m):(a.arc(A.cx,A.cy,B,I(A.y01,A.x01),I(A.y11,A.x11),!m),a.arc(0,0,f,I(A.cy+A.y11,A.cx+A.x11),I(M.cy+M.y11,M.cx+M.x11),m),a.arc(M.cx,M.cy,B,I(M.y11,M.x11),I(M.y01,M.x01),!m))):a.arc(0,0,f,O,L,m)}if(a.closePath(),o)return a=null,o+""||null}return l.centroid=function(){var o=(+h.apply(this,arguments)+ +e.apply(this,arguments))/2,g=(+i.apply(this,arguments)+ +c.apply(this,arguments))/2-qt/2;return[dt(g)*o,et(g)*o]},l.innerRadius=function(o){return arguments.length?(h=typeof o=="function"?o:X(+o),l):h},l.outerRadius=function(o){return arguments.length?(e=typeof o=="function"?o:X(+o),l):e},l.cornerRadius=function(o){return arguments.length?(t=typeof o=="function"?o:X(+o),l):t},l.padRadius=function(o){return arguments.length?(s=o==null?null:typeof o=="function"?o:X(+o),l):s},l.startAngle=function(o){return arguments.length?(i=typeof o=="function"?o:X(+o),l):i},l.endAngle=function(o){return arguments.length?(c=typeof o=="function"?o:X(+o),l):c},l.padAngle=function(o){return arguments.length?(n=typeof o=="function"?o:X(+o),l):n},l.context=function(o){return arguments.length?(a=o??null,l):a},l}function Ta(h,e){return e<h?-1:e>h?1:e>=h?0:NaN}function wa(h){return h}function Ca(){var h=wa,e=Ta,t=null,s=X(0),i=X(St),c=X(0);function n(a){var d,l=(a=Ce(a)).length,o,g,f=0,k=new Array(l),b=new Array(l),y=+s.apply(this,arguments),r=Math.min(St,Math.max(-St,i.apply(this,arguments)-y)),m,p=Math.min(Math.abs(r)/l,c.apply(this,arguments)),S=p*(r<0?-1:1),L;for(d=0;d<l;++d)(L=b[k[d]=d]=+h(a[d],d,a))>0&&(f+=L);for(e!=null?k.sort(function(O,_){return e(b[O],b[_])}):t!=null&&k.sort(function(O,_){return t(a[O],a[_])}),d=0,g=f?(r-l*S)/f:0;d<l;++d,y=m)o=k[d],L=b[o],m=y+(L>0?L*g:0)+S,b[o]={data:a[o],index:d,value:L,startAngle:y,endAngle:m,padAngle:p};return b}return n.value=function(a){return arguments.length?(h=typeof a=="function"?a:X(+a),n):h},n.sortValues=function(a){return arguments.length?(e=a,t=null,n):e},n.sort=function(a){return arguments.length?(t=a,e=null,n):t},n.startAngle=function(a){return arguments.length?(s=typeof a=="function"?a:X(+a),n):s},n.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:X(+a),n):i},n.padAngle=function(a){return arguments.length?(c=typeof a=="function"?a:X(+a),n):c},n}function Da({x:h,y:e,w:t,h:s,tl:i=!1,tr:c=!1,bl:n=!1,br:a=!1,r:d=0}){let l;l=`M${h+d},${e}h${t-2*d}`;let o=c?d:0,g=c?0:d;return l+=`a${o},${o} 0 0 1 ${o},${o}`,l+=`h${g}v${g}`,l+=`v${s-2*d}`,o=a?d:0,g=a?0:d,l+=`a${o},${o} 0 0 1 ${-o},${o}`,l+=`v${g}h${-g}`,l+=`h${2*d-t}`,o=n?d:0,g=n?0:d,l+=`a${o},${o} 0 0 1 ${-o},${-o}`,l+=`h${-g}v${-g}`,l+=`v${2*d-s}`,o=i?d:0,g=i?0:d,l+=`a${o},${o} 0 0 1 ${o},${-o}`,l+=`v${-g}h${g}`,l+="z",l}const Ma=Object.assign(Object.assign({},De),{color:void 0,barMaxWidth:void 0,barWidth:void 0,dataStep:void 0,barPadding:0,roundedCorners:2,cursor:null,barMinHeight1Px:!1,barMinHeightZeroValue:null,orientation:oe.Vertical}),me=nt`
|
|
2
|
+
label: stacked-bar-component;
|
|
3
|
+
`,Ra=le`
|
|
4
|
+
:root {
|
|
5
|
+
--vis-stacked-bar-cursor: default;
|
|
6
|
+
--vis-stacked-bar-fill-color: var(--vis-color-main);
|
|
7
|
+
--vis-stacked-bar-stroke-color: none;
|
|
8
|
+
--vis-stacked-bar-stroke-width: 0px;
|
|
9
|
+
--vis-stacked-bar-hover-stroke-width: none;
|
|
10
|
+
--vis-stacked-bar-hover-stroke-color: none;
|
|
11
|
+
|
|
12
|
+
/* Dark Theme */
|
|
13
|
+
--vis-dark-stacked-bar-stroke-color: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body.theme-dark ${`.${me}`} {
|
|
17
|
+
--vis-stacked-bar-stroke-color: var(--vis-dark-stacked-bar-stroke-color);
|
|
18
|
+
}
|
|
19
|
+
`,At=nt`
|
|
20
|
+
label: bar;
|
|
21
|
+
fill: var(--vis-stacked-bar-fill-color);
|
|
22
|
+
stroke: var(--vis-stacked-bar-stroke-color);
|
|
23
|
+
stroke-width: var(--vis-stacked-bar-stroke-width);
|
|
24
|
+
cursor: var(--vis-stacked-bar-cursor);
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
stroke-width: var(--vis-stacked-bar-hover-stroke-width);
|
|
28
|
+
stroke: var(--vis-stacked-bar-hover-stroke-color);
|
|
29
|
+
}
|
|
30
|
+
`,Ht=nt`
|
|
31
|
+
label: barGroup;
|
|
32
|
+
`,pe=nt`
|
|
33
|
+
label: barGroupExit;
|
|
34
|
+
`,La=Object.freeze(Object.defineProperty({__proto__:null,bar:At,barGroup:Ht,barGroupExit:pe,globalStyles:Ra,root:me},Symbol.toStringTag,{value:"Module"}));class Ft extends Me{constructor(e){super(),this._defaultConfig=Ma,this.config=this._defaultConfig,this.getAccessors=()=>Re(this.config.y)?this.config.y:[this.config.y],this.stacked=!0,this.events={},this._barData=[],e&&this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};const e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],t=this.dataScale.domain(),s=this._getBarWidth()/2,i=this._barData.map((k,b)=>ut(k,this.config.x,b)),c=Mt(i),n=Le(i),a=this.dataScale(c),d=this.dataScale(n),l=this.dataScale.invert(a+(e?s:-s)),o=this.dataScale.invert(d+(e?-s:s)),g=l<=t[0]?this.dataScale(t[0])-this.dataScale(l):0,f=o>t[1]?this.dataScale(o)-this.dataScale(t[1]):0;return{top:this.isVertical()?0:e?-f:g,bottom:this.isVertical()?0:e?-g:f,left:this.isVertical()?g:0,right:this.isVertical()?f:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===oe.Vertical}_render(e){const{config:t}=this,s=jt(e)?e:t.duration,i=this.getAccessors(),c=Ee(this._barData,0,i,this._prevNegative);this._prevNegative=c.map(b=>!!b.isMostlyNegative);const n=this.g.selectAll(`.${Ht}`).data(this._barData,(b,y)=>{var r;return`${(r=Qt(b,t.id,y))!==null&&r!==void 0?r:y}`}),a=(b,y)=>{const r=this.dataScale(ut(b,t.x,y)),m=this.isVertical()?r:0,p=this.isVertical()?0:r;return`translate(${m},${p})`},l=n.enter().append("g").attr("class",Ht).attr("transform",a).style("opacity",1).merge(n);st(l,s).attr("transform",a).style("opacity",1);const o=n.exit().attr("class",pe);st(o,s).style("opacity",0).remove(),st(o.selectAll(`.${At}`),s).attr("transform",this.isVertical()?`translate(0,${this._height/3})`:`translate(${this._width/6},0)`);const g=l.selectAll(`.${At}`).data((b,y)=>c.map((r,m)=>({datum:b,index:y,stacked:r[y],stackIndex:m,isEnding:m===c.length-1||m<=c.length-1&&c[m+1][y][0]!==r[y][1]})).filter(r=>r.stacked[0]!==r.stacked[1]),b=>b.stackIndex),k=g.enter().append("path").attr("class",At).attr("d",b=>this._getBarPath(b,!0)).style("fill",b=>$t(b.datum,t.color,b.stackIndex)).merge(g);st(k,s).attr("d",b=>this._getBarPath(b)).style("fill",b=>$t(b.datum,t.color,b.stackIndex)).style("cursor",b=>Qt(b.datum,t.cursor,b.stackIndex)),st(g.exit(),s).style("opacity",0).remove()}_getBarWidth(){const{config:e,datamodel:{data:t}}=this;if(Ue(t))return 0;if(e.barWidth)return Mt([e.barWidth,e.barMaxWidth]);const s=this.dataScale.bandwidth,i=this.dataScale.domain?this.dataScale.domain():[];let n=1+(s?i.length:i[1]-i[0])/e.dataStep||!s&&t.filter((l,o)=>{const g=ut(l,e.x,o);return g>=i[0]&&g<=i[1]}).length||t.length;!s&&n>=2&&(n+=1);const d=(n<2?1:1-e.barPadding)*(this.isVertical()?this._width:this._height)/n;return Mt([d,e.barMaxWidth])}_getVisibleData(){const{config:e,datamodel:{data:t}}=this,s=this._getBarWidth(),i=t.length<2?0:s/2,c=this.dataScale,n=Math.abs(c.invert(i)-c.invert(0));return t?.filter((d,l)=>{const o=ut(d,e.x,l),g=c.domain(),f=+g[0],k=+g[1];return o>=f-n&&o<=k+n})}_getBarPath(e,t=!1){const{config:s}=this,i=this.getAccessors(),c=this._getBarWidth(),n=e.stacked[1]<0,a=e.isEnding,d=ut(e.datum,i[e.stackIndex],e.index),l=t?0:Math.abs(this.valueScale(e.stacked[0])-this.valueScale(e.stacked[1])),o=!t&&s.barMinHeight1Px&&l<1&&isFinite(d)&&d!==s.barMinHeightZeroValue?1:l,g=t?this.valueScale(0):this.valueScale(n?e.stacked[0]:e.stacked[1])-(l<1&&s.barMinHeight1Px?1:0),f=-c/2,k=c,b=s.roundedCorners?jt(s.roundedCorners)?+s.roundedCorners:k/2:0,y=ie(b,0,Math.min(l,k)/2),r=this.yScale.range()[0]>this.yScale.range()[1];return Da({x:this.isVertical()?f:g-o,y:this.isVertical()?g+(r?0:-o):f,w:this.isVertical()?k:o,h:this.isVertical()?o:k,tl:a&&(this.isVertical()?!n&&r||n&&!r:n),tr:a&&(this.isVertical()?!n&&r||n&&!r:!n),br:a&&(this.isVertical()?n&&r||!n&&!r:!n),bl:a&&(this.isVertical()?n&&r||!n&&!r:n),r:y})}getValueScaleExtent(e){const{datamodel:t}=this,s=this.getAccessors(),i=e?this._getVisibleData():t.data;return Pe(i,...s)}getDataScaleExtent(){const{config:e,datamodel:t}=this;return je(t.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}}Ft.selectors=La;const Ea=Object.assign(Object.assign({},He),{id:(h,e)=>{var t;return(t=h.id)!==null&&t!==void 0?t:e},value:void 0,angleRange:[0,2*Math.PI],padAngle:0,sortFunction:void 0,cornerRadius:0,color:void 0,radius:void 0,arcWidth:20,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,showEmptySegments:!1,emptySegmentAngle:.5*Math.PI/180,showBackground:!0,backgroundAngleRange:void 0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0});function Ua(h,e){h.style("fill",t=>$t(t.data,e.color,t.index)).style("opacity",0).each((t,s,i)=>{const c=i[s],n=(t.startAngle+t.endAngle)/2,a=(t.endAngle-t.startAngle)/2;c._animState={startAngle:n-a,endAngle:n+a,innerRadius:t.innerRadius,outerRadius:t.outerRadius,padAngle:t.padAngle}})}function Pa(h,e,t,s){h.style("transition",`fill ${s}ms`).style("fill",c=>$t(c.data,e.color,c.index));const i=c=>e.showEmptySegments||c.value?1:0;s?st(h,s).style("opacity",i).attrTween("d",(n,a,d)=>{const l=d[a],o={startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle},g=Oe(l._animState,o);return f=>(l._animState=g(f),t(l._animState))}):h.attr("d",t).style("opacity",i)}function ja(h,e){st(h,e).style("opacity",0).remove()}const ve=Array.from({length:4},(h,e)=>{const t=-Math.PI/2+e*Math.PI/2;return[t,t+Math.PI]}),[Fn,In,Yn,Xn]=ve,be=nt`
|
|
35
|
+
label: donut-component;
|
|
36
|
+
`,Ha=le`
|
|
37
|
+
:root {
|
|
38
|
+
--vis-donut-central-label-font-size: 16px;
|
|
39
|
+
--vis-donut-central-label-text-color: #5b5f6d;
|
|
40
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
41
|
+
/* --vis-donut-central-label-font-family: */
|
|
42
|
+
--vis-donut-central-label-font-weight: 600;
|
|
43
|
+
|
|
44
|
+
--vis-donut-central-sub-label-font-size: 12px;
|
|
45
|
+
--vis-donut-central-sub-label-text-color: #5b5f6d;
|
|
46
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
47
|
+
/* --vis-donut-central-sub-label-font-family: */
|
|
48
|
+
--vis-donut-central-sub-label-font-weight: 500;
|
|
49
|
+
|
|
50
|
+
--vis-donut-background-color: #E7E9F3;
|
|
51
|
+
--vis-donut-segment-stroke-width: 0;
|
|
52
|
+
// The line segment color variable is not defined by default
|
|
53
|
+
// to allow it to fallback to the donut background color
|
|
54
|
+
/* --vis-donut-segment-stroke-color: none; */
|
|
55
|
+
|
|
56
|
+
--vis-dark-donut-central-label-text-color: #C2BECE;
|
|
57
|
+
--vis-dark-donut-central-sub-label-text-color: #C2BECE;
|
|
58
|
+
--vis-dark-donut-background-color: #18160C;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
body.theme-dark ${`.${be}`} {
|
|
62
|
+
--vis-donut-central-label-text-color: var(--vis-dark-donut-central-label-text-color);
|
|
63
|
+
--vis-donut-central-sub-label-text-color: var(--vis-dark-donut-central-sub-label-text-color);
|
|
64
|
+
--vis-donut-background-color: var(--vis-dark-donut-background-color);
|
|
65
|
+
}
|
|
66
|
+
`,ye=nt`
|
|
67
|
+
label: background;
|
|
68
|
+
fill: var(--vis-donut-background-color);
|
|
69
|
+
`,Ot=nt`
|
|
70
|
+
label: segment;
|
|
71
|
+
stroke-width: var(--vis-donut-segment-stroke-width);
|
|
72
|
+
stroke: var(--vis-donut-segment-stroke-color, var(--vis-donut-background-color));
|
|
73
|
+
`,_e=nt`
|
|
74
|
+
label: segment-exit;
|
|
75
|
+
`,xe=nt`
|
|
76
|
+
label: central-label;
|
|
77
|
+
text-anchor: middle;
|
|
78
|
+
dominant-baseline: middle;
|
|
79
|
+
font-size: var(--vis-donut-central-label-font-size);
|
|
80
|
+
font-family: var(--vis-donut-central-label-font-family, var(--vis-font-family));
|
|
81
|
+
font-weight: var(--vis-donut-central-label-font-weight);
|
|
82
|
+
fill: var(--vis-donut-central-label-text-color);
|
|
83
|
+
`,ke=nt`
|
|
84
|
+
label: central-label;
|
|
85
|
+
text-anchor: middle;
|
|
86
|
+
dominant-baseline: middle;
|
|
87
|
+
font-size: var(--vis-donut-central-sub-label-font-size);
|
|
88
|
+
font-family: var(--vis-donut-central-sub-label-font-family, var(--vis-font-family));
|
|
89
|
+
font-weight: var(--vis-donut-central-sub-label-font-weight);
|
|
90
|
+
fill: var(--vis-donut-central-sub-label-text-color);
|
|
91
|
+
`,Oa=Object.freeze(Object.defineProperty({__proto__:null,background:ye,centralLabel:xe,centralSubLabel:ke,root:be,segment:Ot,segmentExit:_e,variables:Ha},Symbol.toStringTag,{value:"Module"}));class It extends Ve{constructor(e){super(),this._defaultConfig=Ea,this.config=this._defaultConfig,this.datamodel=new We,this.arcGen=$a(),this.events={},e&&this.setConfig(e),this.arcBackground=this.g.append("path"),this.arcGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",xe),this.centralSubLabel=this.g.append("text").attr("class",ke)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){var t,s,i,c,n,a,d,l,o,g,f,k,b,y;const{config:r,datamodel:m,bleed:p}=this,S=m.data.map((w,Z)=>({index:Z,datum:w})).filter(w=>r.showEmptySegments||ut(w.datum,r.value,w.index)),L=jt(e)?e:r.duration,[O,_,C,P]=ve.map(w=>r.angleRange&&r.angleRange[0]===w[0]&&r.angleRange[1]===w[1]),z=O||C,N=_||P,B=this._width*(N?2:1),G=this._height*(z?2:1),A=r.radius||Math.min(B-p.left-p.right,G-p.top-p.bottom)/2,M=r.arcWidth===0?0:ie(A-r.arcWidth,0,A-1),F=this._height/2+(O?A/2:C?-A/2:0),K=this._width/2+(P?A/2:_?-A/2:0),v=`translate(${K},${F})`;this.arcGroup.attr("transform",v),this.arcGen.startAngle(w=>w.startAngle).endAngle(w=>w.endAngle).innerRadius(w=>w.innerRadius).outerRadius(w=>w.outerRadius).padAngle(w=>w.padAngle).cornerRadius(r.cornerRadius);const U=Ca().startAngle((s=(t=r.angleRange)===null||t===void 0?void 0:t[0])!==null&&s!==void 0?s:0).endAngle((c=(i=r.angleRange)===null||i===void 0?void 0:i[1])!==null&&c!==void 0?c:2*Math.PI).padAngle(r.padAngle).value(w=>ut(w.datum,r.value,w.index)||0).sort((w,Z)=>{var ct;return(ct=r.sortFunction)===null||ct===void 0?void 0:ct.call(r,w.datum,Z.datum)})(S).map(w=>{const Z=Object.assign(Object.assign({},w),{data:w.data.datum,index:w.data.index,innerRadius:M,outerRadius:A});return r.showEmptySegments&&w.endAngle-w.startAngle-w.padAngle<=Number.EPSILON&&(Z.endAngle=w.startAngle+Math.max(r.emptySegmentAngle,r.padAngle),Z.padAngle=w.padAngle/2),Z}),V=this.arcGroup.selectAll(`.${Ot}`).data(U,w=>r.id(w.data,w.index)),q=V.enter().append("path").attr("class",Ot).call(Ua,r),tt=V.merge(q);tt.call(Pa,r,this.arcGen,L),tt.sort((w,Z)=>Z.value-w.value),V.exit().attr("class",_e).call(ja,L);const lt=_?"start":P?"end":"middle";this.centralLabel.attr("dy",r.centralSubLabel?"-0.55em":null).style("text-anchor",lt).text((n=r.centralLabel)!==null&&n!==void 0?n:null),this.centralSubLabel.attr("dy",r.centralLabel?"0.55em":null).style("text-anchor",lt).text((a=r.centralSubLabel)!==null&&a!==void 0?a:null),r.centralSubLabelWrap&&Be(this.centralSubLabel,M*1.9);const pt=(r.centralLabelOffsetX||0)+K;let Q=(r.centralLabelOffsetY||0)+F;z&&r.centralLabelOffsetX===void 0&&r.centralLabelOffsetY===void 0&&(Q=(O?-this.centralSubLabel.node().getBoundingClientRect().height:C?this.centralLabel.node().getBoundingClientRect().height:0)+F);const ht=`translate(${pt},${Q})`;this.centralLabel.attr("transform",ht),this.centralSubLabel.attr("transform",ht),this.arcBackground.attr("class",ye).attr("visibility",r.showBackground?null:"hidden").attr("transform",v),st(this.arcBackground,L).attr("d",this.arcGen({startAngle:(g=(l=(d=r.backgroundAngleRange)===null||d===void 0?void 0:d[0])!==null&&l!==void 0?l:(o=r.angleRange)===null||o===void 0?void 0:o[0])!==null&&g!==void 0?g:0,endAngle:(y=(k=(f=r.backgroundAngleRange)===null||f===void 0?void 0:f[1])!==null&&k!==void 0?k:(b=r.angleRange)===null||b===void 0?void 0:b[1])!==null&&y!==void 0?y:2*Math.PI,innerRadius:M,outerRadius:A}))}}It.selectors=Oa;const Va=ot({__name:"index",props:{component:{},tooltip:{},annotations:{},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(h,{expose:e}){const t=h,{data:s}=ra(t),i=Vt(t);let c;const n=ue({component:void 0,tooltip:void 0,annotations:void 0}),a=Nt(),d=()=>{c||a.value&&n.component&&(c=new ba(a.value,{...Ut(n)},s.value))};return ca(()=>{var l;d(),(l=n.component)==null||l.config,c?.updateContainer({...Ut(i.value),...Ut(n)})}),ft(s,()=>{c?c.setData(s.value,!0):d()}),zt(()=>c?.destroy()),Et(Wt,{data:s,update:l=>n.component=l,destroy:()=>n.component=void 0}),Et(Ge,{data:s,update:l=>n.tooltip=l,destroy:()=>{n.tooltip=void 0}}),Et(ze,{data:s,update:l=>n.annotations=l,destroy:()=>{n.annotations=void 0}}),e({component:c}),(l,o)=>($(),j("div",{"data-vis-single-container":"",ref_key:"elRef",ref:a,class:"unovis-single-container"},[da(l.$slots,"default")],512))}}),Wa={"data-vis-component":""},Ba=Ft.selectors,Ga=ot({__name:"index",props:{color:{type:[Function,String,Array,null]},barWidth:{},barMaxWidth:{},dataStep:{},barPadding:{},roundedCorners:{type:[Number,Boolean]},cursor:{type:[Function,String,null]},barMinHeight1Px:{type:Boolean},barMinHeightZeroValue:{},orientation:{},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(h,{expose:e}){const t=he(Wt),s=h,i=R(()=>t.data.value??s.data),c=Vt(s),n=Nt();return ge(()=>{fe(()=>{var a;n.value=new Ft(c.value),(a=n.value)==null||a.setData(i.value),t.update(n.value)})}),zt(()=>{var a;(a=n.value)==null||a.destroy(),t.destroy()}),ft(c,(a,d)=>{var l;re(a,d)||(l=n.value)==null||l.setConfig(c.value)}),ft(i,()=>{var a;(a=n.value)==null||a.setData(i.value)}),e({component:n}),(a,d)=>($(),j("div",Wa))}}),za={"data-vis-component":""},Na=It.selectors,Fa=ot({__name:"index",props:{id:{type:Function},value:{type:[Function,Number,null]},angleRange:{},padAngle:{},sortFunction:{type:Function},cornerRadius:{},color:{type:[Function,String,Array,null]},radius:{},arcWidth:{},centralLabel:{},centralSubLabel:{},centralSubLabelWrap:{type:Boolean},showEmptySegments:{type:Boolean},emptySegmentAngle:{},showBackground:{type:Boolean},backgroundAngleRange:{},centralLabelOffsetX:{},centralLabelOffsetY:{},duration:{},events:{},attributes:{},data:{}},setup(h,{expose:e}){const t=he(Wt),s=h,i=R(()=>t.data.value??s.data),c=Vt(s),n=Nt();return ge(()=>{fe(()=>{var a;n.value=new It(c.value),(a=n.value)==null||a.setData(i.value),t.update(n.value)})}),zt(()=>{var a;(a=n.value)==null||a.destroy(),t.destroy()}),ft(c,(a,d)=>{var l;re(a,d)||(l=n.value)==null||l.setConfig(c.value)}),ft(i,()=>{var a;(a=n.value)==null||a.setData(i.value)}),e({component:n}),(a,d)=>($(),j("div",za))}}),Ia={key:0,class:"pointer-events-none absolute inset-0 z-10"},Ya={key:1,class:"flex h-72 items-center justify-center rounded-md border border-dashed text-sm text-muted-foreground"},Xa={class:"mt-4 flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground"},qa={class:"font-medium text-foreground tabular-nums"},Ja=288,Za=ot({__name:"TodayUsageTrendPanel",props:{items:{}},setup(h){const e=h,t={bottom:32,left:56,right:28,top:8},s={left:8,right:18},i=[0,void 0],c=ua("chartRoot"),{width:n}=ha(c),a=ue({hour:null,pointerY:null}),d=R(()=>ga.map(v=>{const E=e.items.reduce((U,V)=>U+(V.agents[v]?.totalTokens??0),0);return{color:v==="codex"?"#94a3b8":se[v].color,key:v,label:se[v].label,totalTokens:E}}).filter(v=>v.totalTokens>0).sort((v,E)=>E.totalTokens-v.totalTokens)),l=R(()=>e.items.map(v=>({costUSD:v.costUSD,hour:v.hour,label:v.label,totalTokens:v.totalTokens,values:Object.fromEntries(d.value.map(E=>[E.key,v.agents[E.key]?.totalTokens??0]))}))),o=R(()=>d.value.map(v=>E=>E.values[v.key]??0)),g=R(()=>Object.fromEntries(d.value.map(v=>[v.key,{color:v.color,label:v.label}]))),f=R(()=>d.value.map(v=>`
|
|
92
|
+
<linearGradient id="${K(v.key)}" x1="0" y1="0" x2="0" y2="1">
|
|
93
|
+
<stop offset="0%" stop-color="${v.color}" stop-opacity="0.42" />
|
|
94
|
+
<stop offset="100%" stop-color="${v.color}" stop-opacity="0.07" />
|
|
95
|
+
</linearGradient>
|
|
96
|
+
`).join("")),k=[0,23],b=[0,4,8,12,16,20,23],y=R(()=>t.left),r=R(()=>t.top),m=R(()=>Math.max(n.value-t.left-t.right,0)),p=R(()=>Math.max(Ja-t.top-t.bottom,0)),S=R(()=>r.value+p.value),L=R(()=>Math.max(m.value-s.left-s.right,0)),O=R(()=>Math.max(...l.value.map(v=>v.totalTokens),0)),_=R(()=>{if(a.hour===null||a.pointerY===null)return null;const v=l.value[a.hour];if(!v||m.value<=0||p.value<=0)return null;const E=y.value+s.left+a.hour/23*L.value,U=te(a.pointerY,r.value,S.value),V=p.value<=0?0:1-(U-r.value)/p.value;return{x:E,xLabel:v.label,y:U,yLabel:it(V*O.value)}});function C(v,E){return d.value[E]?`url(#${K(d.value[E].key)})`:"#2563eb"}function P(v){return v?.hour??0}function z(v,E){return d.value[E]?.color??"#2563eb"}function N(v,E){return d.value[E]?.color??"#2563eb"}function B(v){return v instanceof Date?"":e.items[v]?.label??""}function G(v){return v instanceof Date?"":it(v)}function A(v){if(!v)return"";const E=d.value.map(U=>({color:U.color,costUSD:e.items[v.hour]?.agents[U.key]?.costUSD??0,label:U.label,totalTokens:v.values[U.key]??0})).filter(U=>U.totalTokens>0||U.costUSD>0).sort((U,V)=>V.totalTokens-U.totalTokens);return`
|
|
97
|
+
<div class="grid min-w-56 gap-2 rounded-md border bg-background px-3 py-2 text-xs shadow-lg">
|
|
98
|
+
<div class="flex items-center justify-between gap-4">
|
|
99
|
+
<span class="font-medium text-foreground">${wt(v.label)}</span>
|
|
100
|
+
<span class="font-mono text-muted-foreground">${yt(v.costUSD)}</span>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="flex items-center justify-between gap-4 border-b pb-2 text-muted-foreground">
|
|
103
|
+
<span>Total Tokens</span>
|
|
104
|
+
<span class="font-mono font-semibold text-foreground">${it(v.totalTokens)}</span>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="grid gap-1 text-muted-foreground">
|
|
107
|
+
${E.map(U=>`
|
|
108
|
+
<div class="flex items-center justify-between gap-4">
|
|
109
|
+
<span class="flex min-w-0 items-center gap-2">
|
|
110
|
+
<span class="size-2 shrink-0 rounded-sm" style="background-color: ${U.color}"></span>
|
|
111
|
+
<span class="truncate">${wt(U.label)}</span>
|
|
112
|
+
</span>
|
|
113
|
+
<span class="font-mono font-medium text-foreground">${it(U.totalTokens)} / ${yt(U.costUSD)}</span>
|
|
114
|
+
</div>
|
|
115
|
+
`).join("")}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
`}function M(v){const E=c.value?.getBoundingClientRect();if(!E||e.items.length===0)return;const U=v.clientX-E.left,V=v.clientY-E.top,q=y.value+m.value,tt=y.value+s.left,lt=q-s.right;if(U<y.value||U>q||V<r.value||V>S.value||L.value<=0){F();return}a.hour=Math.round(te((U-tt)/Math.max(lt-tt,1)*23,0,23)),a.pointerY=V}function F(){a.hour=null,a.pointerY=null}function K(v){return`today-usage-trend-${v}`}return(v,E)=>{const U=Bt,V=xt;return $(),W(V,{description:"Hourly token and spend by agent for today",icon:"lucide:chart-area",title:"Today's Token Trend"},{default:T(()=>[u(d).length>0?($(),j("div",{key:0,ref_key:"chartRoot",ref:c,class:"relative",onPointerleave:F,onPointermove:M},[x(U,{class:"h-72 w-full",config:u(g)},{default:T(()=>[x(u(ce),{"auto-margin":!1,data:u(l),height:288,margin:t,padding:s,"svg-defs":u(f),"x-domain":k,"y-domain":i},{default:T(()=>[x(u(Ne),{color:C,"curve-type":"monotoneX",line:!0,"line-color":z,"line-width":2,opacity:.82,x:P,y:u(o)},null,8,["y"]),x(u(Tt),{"grid-line":!1,"tick-format":B,"tick-padding":10,"tick-values":b,type:"x"}),x(u(Tt),{"num-ticks":4,"tick-format":G,type:"y"}),u(d).length>0?($(),W(u(Gt),{key:0})):_t("",!0),u(d).length>0?($(),W(u(Fe),{key:1,color:N,template:A,x:P,"y-stacked":u(o)},null,8,["y-stacked"])):_t("",!0)]),_:1},8,["data","svg-defs"])]),_:1},8,["config"]),u(_)?($(),j("div",Ia,[D("div",{class:"absolute border-l border-dashed border-border/80",style:rt({height:`${u(p)}px`,left:`${u(_).x}px`,top:`${u(r)}px`})},null,4),D("div",{class:"absolute border-t border-dashed border-border/80",style:rt({left:`${u(y)}px`,top:`${u(_).y}px`,width:`${u(m)}px`})},null,4),D("div",{class:"absolute rounded-sm bg-foreground px-2 py-1 text-[11px] font-medium text-background shadow-sm",style:rt({left:`${u(_).x}px`,top:`${u(S)+6}px`,transform:"translateX(-50%)"})},H(u(_).xLabel),5),D("div",{class:"absolute rounded-sm bg-foreground px-2 py-1 text-[11px] font-medium text-background shadow-sm",style:rt({left:`${Math.max(u(y)-8,0)}px`,top:`${u(_).y}px`,transform:"translate(-100%, -50%)"})},H(u(_).yLabel),5)])):_t("",!0)],544)):($(),j("div",Ya," No usage recorded today. ")),D("div",Xa,[($(!0),j(at,null,mt(u(d),q=>($(),j("div",{key:q.key,class:"flex items-center gap-2"},[D("span",{class:"size-2.5 rounded-sm",style:rt({backgroundColor:q.color})},null,4),D("span",null,H(q.label),1),D("span",qa,H(u(it)(q.totalTokens)),1)]))),128))])]),_:1})}}}),Ka=Object.assign(Za,{__name:"DashboardTodayUsageTrendPanel"}),Qa={key:0,class:"text-xs text-destructive"},tn={class:"mb-4 grid grid-cols-2 gap-3"},en={class:"mb-4 grid grid-cols-2 gap-3"},an={class:"rounded-md border px-3 py-2"},nn={class:"mt-1 text-xl font-semibold tabular-nums"},sn={class:"rounded-md border px-3 py-2"},on={class:"mt-1 text-xl font-semibold tabular-nums"},ln={class:"mt-4 flex flex-wrap justify-center items-center gap-3 text-xs text-muted-foreground"},rn=ot({name:"StatisticalAnalysisSessionAnalysisPanel",__name:"SessionAnalysisPanel",props:{errorMessage:{},items:{},loading:{type:Boolean},totalSessions:{}},setup(h){const e=h,t=[{color:"#2563eb",key:"tokens",label:"Token Usage"},{color:"#b6d72f",key:"duration",label:"Duration"},{color:"#f97316",key:"cost",label:"Cost"}],s={cost:{color:t[2].color,label:t[2].label},duration:{color:t[1].color,label:t[1].label},tokens:{color:t[0].color,label:t[0].label}},i={bottom:32,left:120,right:12,top:8},c=R(()=>{if(e.items.length===0)return yt(0);const m=e.items.reduce((p,S)=>p+S.costUSD,0)/e.items.length;return yt(m)}),n=R(()=>{const m=new Map;for(const _ of e.items){const C=m.get(_.project)??{costUSD:0,durationMinutes:0,sessionCount:0,tokenTotal:0};C.costUSD+=_.costUSD,C.durationMinutes+=l(_.duration),C.sessionCount+=1,C.tokenTotal+=_.tokenTotal,m.set(_.project,C)}const p=Array.from(m.entries()).map(([_,C])=>({project:_,...C})).sort((_,C)=>C.costUSD-_.costUSD),S=Math.max(...p.map(_=>_.tokenTotal),0),L=Math.max(...p.map(_=>_.durationMinutes),0),O=Math.max(...p.map(_=>_.costUSD),0);return p.map((_,C)=>({..._,costLabel:yt(_.costUSD),costScore:g(_.costUSD,O),durationLabel:o(_.durationMinutes),durationScore:g(_.durationMinutes,L),index:C,tokenLabel:it(_.tokenTotal),tokenScore:g(_.tokenTotal,S)}))}),a=R(()=>n.value.map(m=>m.index)),d=R(()=>({[Ba.bar]:k}));function l(m){const p=m.match(/(\d+)h/)?.[1],S=m.match(/(\d+)m/)?.[1];return Number(p??0)*60+Number(S??0)}function o(m){const p=Math.floor(m/60),S=m%60;return p===0?`${S}m`:S===0?`${p}h`:`${p}h ${S}m`}function g(m,p){return p>0?m/p*100:0}function f(m,p){return t[p]?.color??t[0].color}function k(m){const p=m.datum,S=t[m.stackIndex]??t[0],L=b(p,m.stackIndex);return`
|
|
119
|
+
<div class="grid min-w-44 gap-2 rounded-md border bg-background px-3 py-2 text-xs shadow-lg">
|
|
120
|
+
<div class="font-medium text-foreground">${wt(p.project)}</div>
|
|
121
|
+
<div class="flex items-center justify-between gap-4">
|
|
122
|
+
<span class="flex items-center gap-2 text-muted-foreground">
|
|
123
|
+
<span class="size-2 rounded-sm" style="background-color: ${S.color}"></span>
|
|
124
|
+
${S.label}
|
|
125
|
+
</span>
|
|
126
|
+
<span class="font-mono font-semibold text-foreground">${L}</span>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="grid gap-1 border-t pt-2 text-muted-foreground">
|
|
129
|
+
<div class="flex justify-between gap-4"><span>Tokens</span><span>${p.tokenLabel}</span></div>
|
|
130
|
+
<div class="flex justify-between gap-4"><span>Duration</span><span>${p.durationLabel}</span></div>
|
|
131
|
+
<div class="flex justify-between gap-4"><span>Cost</span><span>${p.costLabel}</span></div>
|
|
132
|
+
<div class="flex justify-between gap-4"><span>Sessions</span><span>${p.sessionCount}</span></div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
`}function b(m,p){return p===0?`${m.tokenLabel} tokens`:p===1?m.durationLabel:m.costLabel}function y(m){return m instanceof Date?"":n.value.find(p=>p.index===m)?.project??""}function r(m){return m instanceof Date?"":`${Math.round(m)}%`}return(m,p)=>{const S=de,L=Bt,O=xt;return $(),W(O,{description:"Token, duration, and cost grouped by project",icon:"lucide:messages-square",title:"Session Analysis"},{default:T(()=>[h.errorMessage?($(),j("p",Qa,H(h.errorMessage),1)):h.loading?($(),j(at,{key:1},[D("div",tn,[x(S,{class:"h-20 w-full rounded-md"}),x(S,{class:"h-20 w-full rounded-md"})]),x(S,{class:"h-80 w-full rounded-md"})],64)):($(),j(at,{key:2},[D("div",en,[D("div",an,[p[0]||(p[0]=D("p",{class:"text-xs text-muted-foreground"}," Total Sessions ",-1)),D("p",nn,H(h.totalSessions),1)]),D("div",sn,[p[1]||(p[1]=D("p",{class:"text-xs text-muted-foreground"}," Top Session Avg ",-1)),D("p",on,H(c.value),1)])]),x(L,{class:"h-80 w-full",config:s},{default:T(()=>[x(u(ce),{"auto-margin":!1,data:n.value,height:320,margin:i,"y-direction":"south"},{default:T(()=>[x(u(Ga),{"bar-max-width":28,"bar-padding":.28,color:f,cursor:"pointer",orientation:"horizontal","rounded-corners":3,x:_=>_.index,y:[_=>_.tokenScore,_=>_.durationScore,_=>_.costScore]},null,8,["x","y"]),x(u(Tt),{"grid-line":!1,"tick-format":y,"tick-text-width":100,"tick-text-fit-mode":"trim","tick-text-trim-type":"end","tick-values":a.value,type:"y"},null,8,["tick-values"]),x(u(Tt),{"num-ticks":4,"tick-format":r,type:"x"}),x(u(Gt),{triggers:d.value},null,8,["triggers"])]),_:1},8,["data"])]),_:1}),D("div",ln,[($(),j(at,null,mt(t,_=>D("div",{key:_.key,class:"flex items-center gap-2"},[D("span",{class:"size-2.5 rounded-sm",style:rt({backgroundColor:_.color})},null,4),D("span",null,H(_.label),1)])),64))])],64))]),_:1})}}}),cn=Object.assign(rn,{__name:"StatisticalAnalysisSessionAnalysisPanel"}),dn={class:"space-y-4"},un={class:"flex items-start justify-between gap-3"},hn={class:"min-w-0"},gn={class:"truncate text-sm font-medium"},fn={class:"truncate text-xs text-muted-foreground"},mn={class:"shrink-0 text-sm font-semibold tabular-nums"},pn={class:"h-2 overflow-hidden rounded-full bg-secondary"},vn=ot({name:"StatisticalAnalysisUsageBarList",__name:"UsageBarList",props:{items:{}},setup(h){function e(s){switch(s){case"green":return"bg-emerald-500";case"amber":return"bg-amber-500";case"sky":return"bg-sky-500";case"rose":return"bg-rose-500";default:return"bg-primary"}}function t(s){return`${Math.max(s.percent,s.percent>0?3:0)}%`}return(s,i)=>($(),j("div",dn,[($(!0),j(at,null,mt(h.items,c=>($(),j("div",{key:c.label,class:"space-y-2"},[D("div",un,[D("div",hn,[D("p",gn,H(c.label),1),D("p",fn,H(c.detail),1)]),D("span",mn,H(c.value),1)]),D("div",pn,[D("div",{class:fa(["h-full rounded-full transition-[width]",e(c.tone)]),style:rt({width:t(c)})},null,6)])]))),128))]))}}),bn=Object.assign(vn,{__name:"StatisticalAnalysisUsageBarList"}),yn={class:"grid gap-6 lg:grid-cols-[220px_1fr] lg:items-center"},_n={class:"flex items-center justify-center"},xn={class:"space-y-3"},kn={class:"flex min-w-0 items-center gap-2"},Sn={class:"truncate text-sm text-muted-foreground"},An={class:"text-sm font-semibold tabular-nums"},$n={class:"w-12 text-right text-xs text-muted-foreground tabular-nums"},Tn={class:"mt-5 border-t pt-4"},wn=ot({name:"StatisticalAnalysisEfficiencyCachePanel",__name:"EfficiencyCachePanel",props:{dailyItems:{},items:{}},setup(h){const e=h,t=R(()=>e.dailyItems.reduce((g,f)=>g+f.inputTokens,0)),s=R(()=>e.dailyItems.reduce((g,f)=>g+f.cachedInputTokens,0)),i=R(()=>Math.max(t.value-s.value,0)),c=R(()=>t.value>0?s.value/t.value:0),n=R(()=>Rt(c.value)),a=R(()=>[{color:"#059669",key:"cached",label:"Cached Input",shareLabel:Rt(c.value),value:s.value,valueLabel:it(s.value)},{color:"#0ea5e9",key:"fresh",label:"Fresh Input",shareLabel:Rt(t.value>0?i.value/t.value:0),value:i.value,valueLabel:it(i.value)}]),d=R(()=>Object.fromEntries(a.value.map(g=>[g.key,{color:g.color,label:g.label}]))),l=R(()=>({[Na.segment]:o}));function o(g){const f=g.data;return`
|
|
136
|
+
<div class="grid min-w-40 gap-2 rounded-md border bg-background px-3 py-2 text-xs shadow-lg">
|
|
137
|
+
<div class="flex items-center gap-2 font-medium text-foreground">
|
|
138
|
+
<span class="size-2 rounded-sm" style="background-color: ${f.color}"></span>
|
|
139
|
+
${wt(f.label)}
|
|
140
|
+
</div>
|
|
141
|
+
<div class="grid gap-1 text-muted-foreground">
|
|
142
|
+
<div class="flex justify-between gap-4"><span>Tokens</span><span class="font-mono font-medium text-foreground">${f.valueLabel}</span></div>
|
|
143
|
+
<div class="flex justify-between gap-4"><span>Share</span><span class="font-mono font-medium text-foreground">${f.shareLabel}</span></div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
`}return(g,f)=>{const k=Bt,b=bn,y=xt;return $(),W(y,{description:"Cached input ratio across total input tokens",icon:"lucide:gauge",title:"Efficiency / Cache"},{default:T(()=>[D("div",yn,[D("div",_n,[x(k,{class:"h-52 w-full max-w-56",config:u(d)},{default:T(()=>[x(u(Va),{data:u(a),height:208},{default:T(()=>[x(u(Fa),{"arc-width":26,"central-label":u(n),"central-sub-label":"Hit Rate",color:r=>r.color,"corner-radius":4,"pad-angle":.04,value:r=>r.value},null,8,["central-label","color","value"]),x(u(Gt),{triggers:u(l)},null,8,["triggers"])]),_:1},8,["data"])]),_:1},8,["config"])]),D("div",xn,[($(!0),j(at,null,mt(u(a),r=>($(),j("div",{key:r.key,class:"grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-3"},[D("div",kn,[D("span",{class:"size-2.5 shrink-0 rounded-full",style:rt({backgroundColor:r.color})},null,4),D("span",Sn,H(r.label),1)]),D("span",An,H(r.valueLabel),1),D("span",$n,H(r.shareLabel),1)]))),128))])]),D("div",Tn,[x(b,{items:h.items},null,8,["items"])])]),_:1})}}}),Cn=Object.assign(wn,{__name:"StatisticalAnalysisEfficiencyCachePanel"}),bt=10,Dn=ot({name:"StatisticalAnalysisTokensUsagePanel",__name:"TokensUsagePanel",props:{items:{}},setup(h){const e=h,t=pa(1),s=R(()=>Math.max(1,Math.ceil(e.items.length/bt))),i=R(()=>{const n=(Math.min(t.value,s.value)-1)*bt;return e.items.slice(n,n+bt)});return ft(()=>e.items,()=>{t.value=1}),(c,n)=>{const a=qe,d=Xe,l=Ye,o=Ke,g=Je,f=Ie,k=Ze,b=xt;return $(),W(b,{description:"Daily model activity by token type, cache reads, total usage, and cost",icon:"lucide:calendar-days",title:"Daily Token Usage"},{default:T(()=>[x(f,null,{default:T(()=>[x(l,null,{default:T(()=>[x(d,null,{default:T(()=>[x(a,null,{default:T(()=>[...n[1]||(n[1]=[Y("Date",-1)])]),_:1}),x(a,null,{default:T(()=>[...n[2]||(n[2]=[Y("Models",-1)])]),_:1}),x(a,{class:"text-right"},{default:T(()=>[...n[3]||(n[3]=[Y(" Input ",-1)])]),_:1}),x(a,{class:"text-right"},{default:T(()=>[...n[4]||(n[4]=[Y(" Output ",-1)])]),_:1}),x(a,{class:"text-right"},{default:T(()=>[...n[5]||(n[5]=[Y(" Reasoning ",-1)])]),_:1}),x(a,{class:"text-right"},{default:T(()=>[...n[6]||(n[6]=[Y(" Cache Read ",-1)])]),_:1}),x(a,{class:"text-right"},{default:T(()=>[...n[7]||(n[7]=[Y(" Total Tokens ",-1)])]),_:1}),x(a,{class:"text-right"},{default:T(()=>[...n[8]||(n[8]=[Y(" Cost (USD) ",-1)])]),_:1})]),_:1})]),_:1}),x(g,null,{default:T(()=>[($(!0),j(at,null,mt(u(i),y=>($(),W(d,{key:y.date},{default:T(()=>[x(o,{class:"font-medium"},{default:T(()=>[Y(H(y.date),1)]),_:2},1024),x(o,null,{default:T(()=>[Y(H(Object.keys(y.models).join(", ")),1)]),_:2},1024),x(o,{class:"text-right"},{default:T(()=>[Y(H(u(vt)(y.inputTokens)),1)]),_:2},1024),x(o,{class:"text-right"},{default:T(()=>[Y(H(u(vt)(y.outputTokens)),1)]),_:2},1024),x(o,{class:"text-right"},{default:T(()=>[Y(H(u(vt)(y.reasoningOutputTokens)),1)]),_:2},1024),x(o,{class:"text-right"},{default:T(()=>[Y(H(u(vt)(y.cachedInputTokens)),1)]),_:2},1024),x(o,{class:"text-right"},{default:T(()=>[Y(H(u(vt)(y.totalTokens)),1)]),_:2},1024),x(o,{class:"text-right"},{default:T(()=>[Y(H(y.costUSD.toFixed(2)),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1}),h.items.length>bt?($(),W(k,{key:0,page:u(t),"onUpdate:page":n[0]||(n[0]=y=>ma(t)?t.value=y:null),"page-count":u(s),"page-size":bt,total:h.items.length},null,8,["page","page-count","total"])):_t("",!0)]),_:1})}}}),Mn=Object.assign(Dn,{__name:"StatisticalAnalysisTokensUsagePanel"});function Rn(){const h=ee(),e=ae(),t=ne().sessionAnalysis,{data:s,error:i,refresh:c,status:n}=Pt("analysis:home:core",ea,{default:ee}),{clear:a,data:d,error:l,execute:o,refresh:g,status:f}=Pt("analysis:home:usage",aa,{default:ae,immediate:!1,server:!1}),{clear:k,data:b,error:y,execute:r,refresh:m,status:p}=Pt("analysis:home:session",na,{default:()=>ne().sessionAnalysis,immediate:!1,server:!1}),{refresh:S}=sa({clearDeferred:()=>{a(),k()},coreStatus:n,executeDeferred:()=>Promise.all([o(),r()]),refreshCore:c,refreshDeferred:()=>Promise.all([g(),m()])});return{dailyTokenUsage:R(()=>d.value?.dailyTokenUsage??e.dailyTokenUsage),efficiencyMetrics:R(()=>d.value?.efficiencyMetrics??e.efficiencyMetrics),error:i,monthlyModelUsage:R(()=>s.value?.modelUsage??h.modelUsage),overviewCards:R(()=>s.value?.overviewCards??h.overviewCards),projectUsage:R(()=>s.value?.hotProjects??h.hotProjects),refresh:S,sessionAnalysisError:y,sessionAnalysisStatus:p,sessionUsage:R(()=>b.value?.items??t.items),status:n,todayHourlyUsage:R(()=>d.value?.todayHourlyUsage??e.todayHourlyUsage),totalSessions:R(()=>b.value?.totalSessions??t.totalSessions),usageError:l,usageStatus:f}}const Ln={class:"bg-background border border-input rounded-xl shadow-xs min-h-0 flex-1 overflow-y-auto"},En={class:"grid content-start p-4 space-y-3"},Un={key:0,class:"text-xs text-destructive"},Pn={class:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4"},jn={key:0,class:"text-xs text-destructive"},Hn={key:0,class:"text-xs text-destructive"},On={key:0,class:"text-xs text-destructive"},Vn={key:0,class:"text-xs text-destructive"},qn=ot({__name:"index",setup(h){const{dailyTokenUsage:e,error:t,efficiencyMetrics:s,monthlyModelUsage:i,projectUsage:c,sessionAnalysisError:n,sessionAnalysisStatus:a,sessionUsage:d,totalSessions:l,todayHourlyUsage:o,status:g,usageError:f,usageStatus:k,overviewCards:b}=Rn(),{errorText:y,showSkeleton:r}=Lt(g,t),{errorText:m,showSkeleton:p}=Lt(a,n),{errorText:S,showSkeleton:L}=Lt(k,f);return(O,_)=>{const C=de,P=xt,z=Qe,N=ta,B=oa,G=la,A=Ka,M=ia,F=cn,K=Cn,v=Mn;return $(),j("div",Ln,[D("div",En,[u(y)?($(),j("p",Un,H(u(y)),1)):_t("",!0),u(r)?($(),j(at,{key:1},[D("div",Pn,[($(),j(at,null,mt(4,E=>x(C,{key:E,class:"h-28 rounded-md"})),64))]),x(z,null,{default:T(()=>[x(P,{class:"md:col-span-8",description:"Monthly token trends by model",icon:"solar:cpu-line-duotone",title:"Model Usage"},{default:T(()=>[x(C,{class:"h-72 w-full rounded-md"})]),_:1}),x(P,{class:"md:col-span-4",description:"Best performers by spend",icon:"lucide:folder-git-2",title:"Top Projects"},{default:T(()=>[x(C,{class:"h-72 w-full rounded-md"})]),_:1}),x(P,{class:"md:col-span-12",description:"Hourly token and spend by agent for today",icon:"lucide:chart-area",title:"Today's Token Trend"},{default:T(()=>[x(C,{class:"h-72 w-full rounded-md"})]),_:1}),x(P,{class:"md:col-span-12",description:"Usage trend over the selected period",icon:"lucide:activity",title:"Usage Trend"},{default:T(()=>[x(C,{class:"h-80 w-full rounded-md"})]),_:1}),x(P,{class:"md:col-span-6",description:"Token, duration, and cost grouped by project",icon:"lucide:messages-square",title:"Session Analysis"},{default:T(()=>[x(C,{class:"h-72 w-full rounded-md"})]),_:1}),x(P,{class:"md:col-span-6",description:"Cached input ratio across total input tokens",icon:"lucide:gauge",title:"Efficiency / Cache"},{default:T(()=>[x(C,{class:"h-72 w-full rounded-md"})]),_:1}),x(P,{class:"md:col-span-12",description:"Daily model activity by token type, cache reads, total usage, and cost",icon:"lucide:calendar-days",title:"Daily Token Usage"},{default:T(()=>[x(C,{class:"h-72 w-full rounded-md"})]),_:1})]),_:1})],64)):($(),j(at,{key:2},[x(N,{cards:u(b)},null,8,["cards"]),x(z,null,{default:T(()=>[x(B,{"monthly-items":u(i),class:"md:col-span-8"},null,8,["monthly-items"]),x(G,{items:u(c),class:"md:col-span-4"},null,8,["items"]),u(L)||u(S)?($(),W(P,{key:0,class:"md:col-span-12",description:"Hourly token and spend by agent for today",icon:"lucide:chart-area",title:"Today's Token Trend"},{default:T(()=>[u(S)?($(),j("p",jn,H(u(S)),1)):($(),W(C,{key:1,class:"h-72 w-full rounded-md"}))]),_:1})):($(),W(A,{key:1,items:u(o),class:"md:col-span-12"},null,8,["items"])),u(L)||u(S)?($(),W(P,{key:2,class:"md:col-span-12",description:"Usage trend over the selected period",icon:"lucide:activity",title:"Usage Trend"},{default:T(()=>[u(S)?($(),j("p",Hn,H(u(S)),1)):($(),W(C,{key:1,class:"h-80 w-full rounded-md"}))]),_:1})):($(),W(M,{key:3,items:u(e),class:"md:col-span-12","heat-metric":"cost",title:"Usage Trend"},null,8,["items"])),x(F,{"error-message":u(m),items:u(d),loading:u(p),"total-sessions":u(l),class:"md:col-span-6"},null,8,["error-message","items","loading","total-sessions"]),u(L)||u(S)?($(),W(P,{key:4,class:"md:col-span-6",description:"Cached input ratio across total input tokens",icon:"lucide:gauge",title:"Efficiency / Cache"},{default:T(()=>[u(S)?($(),j("p",On,H(u(S)),1)):($(),W(C,{key:1,class:"h-72 w-full rounded-md"}))]),_:1})):($(),W(K,{key:5,"daily-items":u(e),items:u(s),class:"md:col-span-6"},null,8,["daily-items","items"])),u(L)||u(S)?($(),W(P,{key:6,class:"md:col-span-12",description:"Daily model activity by token type, cache reads, total usage, and cost",icon:"lucide:calendar-days",title:"Daily Token Usage"},{default:T(()=>[u(S)?($(),j("p",Vn,H(u(S)),1)):($(),W(C,{key:1,class:"h-72 w-full rounded-md"}))]),_:1})):($(),W(v,{key:7,items:u(e),class:"md:col-span-12"},null,8,["items"]))]),_:1})],64))])])}}});export{qn as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{B as ce,_ as ve,S as ke,C as xe,a as pe,z as _e,A as we,e as Te,f as D,c as fe,m as z}from"./DgMMKsPE.js";import{e as ue,B as Ce,C as De,o as d,g as Z,w as ee,a as s,b as q,i,l as I,c as f,D as F,t as m,F as j,E as R,G as l,J as re,q as V,d as ge,P as ye,I as he}from"./Jp5cgQZi.js";import{_ as Me}from"./DKaPq50Z.js";const Se={key:0,class:"pointer-events-none absolute inset-0 z-10"},Ue={class:"mt-4 flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground"},$e={class:"font-medium text-foreground tabular-nums"},je=288,Re=ue({name:"StatisticalAnalysisModelUsagePanel",__name:"ModelUsagePanel",props:{monthlyItems:{},year:{}},setup(n){const r=n,h=["#2563eb","#f97316","#0891b2","#8b5cf6","#059669","#f43f5e"],y={bottom:32,left:56,right:12,top:8},C=[0,void 0],U=Ce("chartRoot"),{width:Y}=De(U),L=re(null),b=re(null),A=l(()=>r.year??be(r.monthlyItems)??new Date().getFullYear()),_=l(()=>Array.from({length:12},(t,c)=>{const u=`${c+1}`.padStart(2,"0");return`${A.value}-${u}`})),G=l(()=>[0,Math.max(_.value.length-1,0)]),v=l(()=>_.value.map((t,c)=>c)),W=l(()=>r.monthlyItems.filter(t=>t.month.startsWith(`${A.value}-`))),te=l(()=>Array.from(new Set(W.value.map(t=>t.model)))),O=l(()=>_.value.map((t,c)=>{const u=Object.fromEntries(te.value.map(g=>[g,W.value.find(k=>k.month===t&&k.model===g)?.tokenTotal??0]));return{month:t,monthIndex:c,tokensByModel:u,totalTokens:Object.values(u).reduce((g,k)=>g+k,0)}})),S=l(()=>te.value.map((t,c)=>{const u=ne(c),g=O.value.reduce((k,Q)=>k+(Q.tokensByModel[t]??0),0);return{color:u,model:t,totalLabel:D(g),totalTokens:g}}).sort((t,c)=>c.totalTokens-t.totalTokens)),X=l(()=>S.value.map(t=>c=>c.tokensByModel[t.model]??0)),oe=l(()=>Object.fromEntries(S.value.map(t=>[t.model,{color:t.color,label:t.model}]))),ae=l(()=>S.value.map(t=>`
|
|
2
|
+
<linearGradient id="${me(t.model)}" x1="0" y1="0" x2="0" y2="1">
|
|
3
|
+
<stop offset="0%" stop-color="${t.color}" stop-opacity="0.45" />
|
|
4
|
+
<stop offset="100%" stop-color="${t.color}" stop-opacity="0.08" />
|
|
5
|
+
</linearGradient>
|
|
6
|
+
`).join("")),J=l(()=>O.value.length>0&&S.value.length>0),H=l(()=>y.left),P=l(()=>y.top),B=l(()=>Math.max(Y.value-y.left-y.right,0)),N=l(()=>Math.max(je-y.top-y.bottom,0)),K=l(()=>P.value+N.value),le=l(()=>Math.max(...O.value.map(t=>t.totalTokens),0)),$=l(()=>{if(L.value===null||b.value===null)return null;const t=O.value[L.value];if(!t||B.value<=0||N.value<=0)return null;const c=_.value.length<=1?0:L.value/(_.value.length-1),u=H.value+c*B.value,g=fe(b.value,P.value,K.value),Q=(N.value<=0?0:1-(g-P.value)/N.value)*le.value;return{x:u,xLabel:E(t.month),y:g,yLabel:D(Q)}});function se(t,c){const u=S.value[c];return u?`url(#${me(u.model)})`:ne(0)}function ie(t,c){return S.value[c]?.color??ne(0)}function e(t,c){return S.value[c]?.color??ne(0)}function o(t){const c=S.value.map(u=>({...u,tokenTotal:t.tokensByModel[u.model]??0})).sort((u,g)=>g.tokenTotal-u.tokenTotal);return`
|
|
7
|
+
<div class="grid min-w-48 gap-2 rounded-md border bg-background px-3 py-2 text-xs shadow-lg">
|
|
8
|
+
<div class="font-medium text-foreground">${x(t.month)} ${t.month.slice(0,4)}</div>
|
|
9
|
+
<div class="grid gap-1 text-muted-foreground">
|
|
10
|
+
${c.map(u=>`
|
|
11
|
+
<div class="flex items-center justify-between gap-4">
|
|
12
|
+
<span class="flex items-center gap-2">
|
|
13
|
+
<span class="size-2 rounded-sm" style="background-color: ${u.color}"></span>
|
|
14
|
+
${Te(u.model)}
|
|
15
|
+
</span>
|
|
16
|
+
<span class="font-mono font-medium text-foreground">${D(u.tokenTotal)}</span>
|
|
17
|
+
</div>
|
|
18
|
+
`).join("")}
|
|
19
|
+
</div>
|
|
20
|
+
<div class="flex justify-between gap-4 border-t pt-2 text-muted-foreground">
|
|
21
|
+
<span>Total</span>
|
|
22
|
+
<span class="font-mono font-semibold text-foreground">${D(t.totalTokens)}</span>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
`}function p(t){if(t instanceof Date)return"";const c=_.value[t];return c?x(c):""}function a(t){return t instanceof Date?"":D(t)}function x(t){const[c,u]=t.split("-"),g=new Date(Number(c),Number(u)-1,1);return new Intl.DateTimeFormat("en-US",{month:"short"}).format(g)}function E(t){return`${x(t)} ${t.slice(0,4)}`}function M(t){const c=U.value?.getBoundingClientRect();if(!c)return;const u=t.clientX-c.left,g=t.clientY-c.top,k=H.value+B.value;if(u<H.value||u>k||g<P.value||g>K.value||B.value<=0||!J.value||_.value.length===0){w();return}const Q=fe((u-H.value)/Math.max(B.value,1),0,1);L.value=_.value.length<=1?0:Math.round(Q*(_.value.length-1)),b.value=g}function w(){L.value=null,b.value=null}function be(t){const u=[...t].sort((g,k)=>k.month.localeCompare(g.month))[0]?.month?.split("-")[0];return u?Number(u):null}function me(t){return`model-usage-${t.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`}function ne(t){return h[t%h.length]??"#2563eb"}return(t,c)=>{const u=ve,g=ce;return d(),Z(g,{description:"Monthly token trends by model",icon:"solar:cpu-line-duotone",title:"Model Usage"},{default:ee(()=>[s("div",{ref_key:"chartRoot",ref:U,class:"relative",onPointerleave:w,onPointermove:M},[q(u,{class:"h-72 w-full",config:i(oe)},{default:ee(()=>[q(i(ke),{"auto-margin":!1,data:i(O),height:288,margin:y,"svg-defs":i(ae),"x-domain":i(G),"y-domain":C},{default:ee(()=>[q(i(xe),{color:se,line:!0,"line-color":ie,"line-width":2.5,opacity:.82,x:k=>k.monthIndex,y:i(X)},null,8,["x","y"]),q(i(pe),{"grid-line":!1,"tick-format":p,"tick-values":i(v),type:"x"},null,8,["tick-values"]),q(i(pe),{"num-ticks":4,"tick-format":a,type:"y"}),i(J)?(d(),Z(i(_e),{key:0})):I("",!0),i(J)?(d(),Z(i(we),{key:1,color:e,template:o,x:k=>k.monthIndex,"y-stacked":i(X)},null,8,["x","y-stacked"])):I("",!0)]),_:1},8,["data","svg-defs","x-domain"])]),_:1},8,["config"]),i($)?(d(),f("div",Se,[s("div",{class:"absolute border-l border-dashed border-border/80",style:F({height:`${i(N)}px`,left:`${i($).x}px`,top:`${i(P)}px`})},null,4),s("div",{class:"absolute border-t border-dashed border-border/80",style:F({left:`${i(H)}px`,top:`${i($).y}px`,width:`${i(B)}px`})},null,4),s("div",{class:"absolute rounded-sm bg-foreground px-2 py-1 text-[11px] font-medium text-background shadow-sm",style:F({left:`${i($).x}px`,top:`${i(K)+6}px`,transform:"translateX(-50%)"})},m(i($).xLabel),5),s("div",{class:"absolute rounded-sm bg-foreground px-2 py-1 text-[11px] font-medium text-background shadow-sm",style:F({left:`${Math.max(i(H)-8,0)}px`,top:`${i($).y}px`,transform:"translate(-100%, -50%)"})},m(i($).yLabel),5)])):I("",!0)],544),s("div",Ue,[(d(!0),f(j,null,R(i(S),k=>(d(),f("div",{key:k.model,class:"flex items-center gap-2"},[s("span",{class:"size-2.5 rounded-sm",style:F({backgroundColor:k.color})},null,4),s("span",null,m(k.model),1),s("span",$e,m(k.totalLabel),1)]))),128))])]),_:1})}}}),Tt=Object.assign(Re,{__name:"StatisticalAnalysisModelUsagePanel"}),Le={class:"space-y-3"},Ae={class:"flex flex-col flex-1"},Pe={class:"truncate text-sm font-medium tracking-tight"},Be={class:"mt-1 truncate text-xs text-muted-foreground"},Ne={class:"text-right"},Ee={class:"text-xs font-medium tracking-tight tabular-nums"},Ie={class:"mt-1 flex items-center justify-end gap-1"},He=ue({name:"StatisticalAnalysisProjectUsagePanel",__name:"ProjectUsagePanel",props:{items:{}},setup(n){const r=n,h=[{trend:"+12.4%",trendTone:"up"},{trend:"-8.2%",trendTone:"down"},{trend:"+22.1%",trendTone:"up"},{trend:"+15.8%",trendTone:"up"},{trend:"-3.4%",trendTone:"down"},{trend:"+9.6%",trendTone:"up"},{trend:"-5.1%",trendTone:"down"},{trend:"+4.7%",trendTone:"up"}],y=l(()=>r.items.slice(0,6).map((b,A)=>{const _=h[A]??{trend:"+0.0%",trendTone:"up"};return{...b,shortName:L(b.label),trend:_.trend,trendTone:_.trendTone}}));function C(b){return b==="down"?"lucide:trending-down":"lucide:trending-up"}function U(b){return b==="down"?"size-3 text-red-500":"size-3 text-emerald-600 dark:text-emerald-400"}function Y(b){return b==="down"?"text-sm font-medium text-red-500 tabular-nums":"text-sm font-medium text-emerald-600 dark:text-emerald-400 tabular-nums"}function L(b){return b.split(/[-_\s]+/).filter(Boolean).slice(0,2).map(A=>A[0]?.toUpperCase()??"").join("")}return(b,A)=>{const _=Me,G=ce;return d(),Z(G,{description:"Best performers by spend",icon:"lucide:folder-git-2",title:"Top Projects"},{default:ee(()=>[s("div",Le,[(d(!0),f(j,null,R(i(y),v=>(d(),f("div",{key:v.repository,class:"flex justify-between items-center gap-3 rounded-md transition-colors"},[s("div",Ae,[s("p",Pe,m(v.label),1),s("p",Be,m(v.detail),1)]),s("div",Ne,[s("p",Ee,m(v.value),1),s("div",Ie,[q(_,{class:V(U(v.trendTone)),mode:"svg",name:C(v.trendTone)},null,8,["class","name"]),s("span",{class:V(Y(v.trendTone))},m(v.trend),3)])])]))),128))])]),_:1})}}}),Ct=Object.assign(He,{__name:"StatisticalAnalysisProjectUsagePanel"}),ze={class:"mb-4 grid grid-cols-1 gap-3 sm:grid-cols-3"},Fe={class:"text-xs text-muted-foreground"},Ye={class:"mt-1 text-lg font-semibold tabular-nums"},Oe={class:"border-b pb-4"},Ge=["aria-label","tabindex"],qe={class:"sr-only"},Ve={class:"font-medium"},We={key:0,class:"flex items-center justify-between gap-4 text-muted-foreground"},Xe={class:"font-mono font-medium text-foreground"},Je={class:"flex items-center justify-between gap-4 text-muted-foreground"},Ke={class:"font-mono font-medium text-foreground"},Qe={key:1,class:"flex items-center justify-between gap-4 text-muted-foreground"},Ze={class:"font-mono font-medium text-foreground"},et={key:2,class:"mt-1 grid max-h-56 gap-2 overflow-y-auto border-t pt-2 pr-1"},tt={class:"flex items-center justify-between gap-3 text-[11px] font-semibold"},ot={class:"font-mono text-muted-foreground"},at={class:"min-w-0 truncate"},st={key:0},nt={class:"shrink-0 font-mono"},rt={class:"min-w-0 truncate"},lt={key:0},it={class:"shrink-0 font-mono"},ct={class:"mt-4 flex items-center justify-between gap-4"},ut={class:"text-xs text-muted-foreground"},dt={class:"flex items-center gap-1 text-xs text-muted-foreground"},mt={class:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3"},pt={class:"text-xs text-muted-foreground"},ft={class:"mt-1 flex items-center justify-between gap-2"},gt={class:"text-sm font-semibold"},yt={class:"text-xs text-muted-foreground"},ht=ue({name:"UsageHeatmapPanel",__name:"UsageHeatmapPanel",props:{heatMetric:{default:"tokens"},items:{},title:{}},setup(n){const r=n,h=["bg-zinc-100 dark:bg-zinc-800/80","bg-emerald-50 dark:bg-emerald-950/70","bg-emerald-100 dark:bg-emerald-900/70","bg-teal-100 dark:bg-teal-900/75","bg-teal-200 dark:bg-teal-800/80","bg-cyan-200 dark:bg-cyan-800/85","bg-cyan-300 dark:bg-cyan-700/90","bg-sky-300 dark:bg-sky-600/90","bg-sky-400 dark:bg-sky-500/95","bg-blue-500 dark:bg-blue-400"],y=[...h],C=[{key:"sun",label:"S",row:"1"},{key:"mon",label:"M",row:"2"},{key:"tue",label:"T",row:"3"},{key:"wed",label:"W",row:"4"},{key:"thu",label:"T",row:"5"},{key:"fri",label:"F",row:"6"},{key:"sat",label:"S",row:"7"}],U=l(()=>P(new Date)),Y=l(()=>{const e=P(U.value);return e.setDate(e.getDate()-364),e}),L=l(()=>`${N(Y.value)} - ${N(U.value)}`),b=l(()=>r.heatMetric==="cost"?"spend":"tokens"),A=l(()=>`${L.value} ${b.value} heatmap. Darker cells mean higher daily ${b.value}.`),_=l(()=>`Colored by daily ${b.value}`),G=l(()=>{const e=new Map(r.items.map(o=>[B(H(o.date)),o]));return Array.from({length:365},(o,p)=>{const a=P(Y.value);return a.setDate(a.getDate()+p),{date:a,usage:e.get(B(a))}})}),v=l(()=>{const e=Math.max(...G.value.map(o=>r.heatMetric==="cost"?o.usage?.costUSD??0:o.usage?.totalTokens??0));return G.value.map(o=>{const p=o.usage?.costUSD??0,a=o.usage?.totalTokens??0,x=r.heatMetric==="cost"?p:a;return{colorClass:h[K(x,e)],costLabel:z(p),costUSD:p,date:N(o.date),hasUsage:!!o.usage,modelRows:$(o.usage?.models??{}),platformSections:le(o.usage?.platforms),tokenLabel:D(a),totalTokens:a}})}),W=l(()=>{const e=Y.value.getDay(),o=(7-(e+v.value.length)%7)%7,p=Math.ceil((e+v.value.length+o)/7),a=Array.from({length:e},(M,w)=>({column:String(Math.floor(w/7)+2),colorClass:"bg-transparent",costLabel:"",date:"",isBlank:!0,key:`blank-${w}`,modelRows:[],platformSections:[],row:String(w%7+1),title:"No date",tooltipArrowClass:"",tooltipClass:"",tokenLabel:""})),x=v.value.map((M,w)=>({...M,column:String(Math.floor((e+w)/7)+2),isBlank:!1,key:M.date,row:String((e+w)%7+1),title:r.heatMetric==="cost"?`${M.date}: ${z(M.costUSD)} / ${D(M.totalTokens)} tokens`:`${M.date}: ${D(M.totalTokens)} tokens / ${z(M.costUSD)}`,...ie(Math.floor((e+w)/7),p)})),E=Array.from({length:o},(M,w)=>({column:String(Math.floor((e+v.value.length+w)/7)+2),colorClass:"bg-transparent",costLabel:"",date:"",isBlank:!0,key:`trailing-blank-${w}`,modelRows:[],platformSections:[],row:String((e+v.value.length+w)%7+1),title:"No date",tooltipArrowClass:"",tooltipClass:"",tokenLabel:""}));return[...a,...x,...E]}),te=l(()=>Math.ceil(W.value.length/7)),O=l(()=>({gridTemplateColumns:`max-content repeat(${te.value}, minmax(0, 1fr))`,gridTemplateRows:"repeat(7, minmax(0, 1fr))"})),S=l(()=>v.value.filter(e=>e.hasUsage).slice(-3)),X=l(()=>v.value.filter(e=>e.hasUsage).length),oe=l(()=>z(v.value.reduce((e,o)=>e+o.costUSD,0))),ae=l(()=>D(v.value.reduce((e,o)=>e+o.totalTokens,0))),J=l(()=>r.heatMetric==="cost"?[{key:"year-cost",label:"Year Spend",value:oe.value},{key:"year-tokens",label:"Year Tokens",value:ae.value},{key:"active-days",label:"Active Days",value:String(X.value)}]:[{key:"year-tokens",label:"Year Tokens",value:ae.value},{key:"year-cost",label:"Year Spend",value:oe.value},{key:"active-days",label:"Active Days",value:String(X.value)}]);function H(e){return new Date(e)}function P(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function B(e){const o=e.getFullYear(),p=`${e.getMonth()+1}`.padStart(2,"0"),a=`${e.getDate()}`.padStart(2,"0");return`${o}-${p}-${a}`}function N(e){return new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"short",year:"numeric"}).format(e)}function K(e,o){return e<=0||o<=0?0:Math.min(9,Math.max(1,Math.ceil(e/o*9)))}function le(e){return Object.entries(e??{}).map(([o,p])=>({costLabel:z(p.costUSD),costUSD:p.costUSD,key:o,label:ye[o]?.label??o,models:$(p.models),totalTokens:p.totalTokens,tokenLabel:D(p.totalTokens)})).sort(se)}function $(e){return Object.entries(e).map(([o,p])=>({costLabel:z(p.costUSD),costUSD:p.costUSD,isFallback:p.isFallback,key:o,label:o,totalTokens:p.totalTokens,tokenLabel:D(p.totalTokens)})).sort(se)}function se(e,o){const p=r.heatMetric==="cost"?o.costUSD-e.costUSD:o.totalTokens-e.totalTokens;return p!==0?p:o.totalTokens!==e.totalTokens?o.totalTokens-e.totalTokens:o.costUSD!==e.costUSD?o.costUSD-e.costUSD:e.label.localeCompare(o.label)}function ie(e,o){return e<=1?{tooltipArrowClass:"left-3.5",tooltipClass:"left-0"}:e>=o-2?{tooltipArrowClass:"right-3.5",tooltipClass:"right-0"}:{tooltipArrowClass:"left-1/2 -translate-x-1/2",tooltipClass:"left-1/2 -translate-x-1/2"}}return(e,o)=>{const p=ce;return d(),Z(p,{description:A.value,icon:"lucide:calendar-days",title:r.title},{default:ee(()=>[s("div",ze,[(d(!0),f(j,null,R(J.value,a=>(d(),f("div",{key:a.key,class:"rounded-md border px-3 py-2"},[s("p",Fe,m(a.label),1),s("p",Ye,m(a.value),1)]))),128))]),s("div",Oe,[s("div",{class:"grid w-full gap-1",style:F(O.value)},[(d(),f(j,null,R(C,a=>s("span",{key:a.key,class:"flex items-center justify-end pr-1 text-[10px] text-muted-foreground",style:F({gridColumn:"1",gridRow:a.row})},m(a.label),5)),64)),(d(!0),f(j,null,R(W.value,a=>(d(),f("div",{key:a.key,class:V(["group relative aspect-square w-full max-w-3 justify-self-center rounded-sm border border-black/5 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/50 dark:border-white/10",[a.colorClass,{"border-transparent opacity-0":a.isBlank}]]),"aria-label":a.title,style:F({gridColumn:a.column,gridRow:a.row}),tabindex:a.isBlank?-1:0},[s("span",qe,m(a.title),1),a.isBlank?I("",!0):(d(),f("div",{key:0,class:V(["pointer-events-none absolute bottom-full z-30 mb-2 hidden w-64 max-w-[calc(100vw-2rem)] gap-1 rounded-md border bg-popover px-2.5 py-2 text-xs text-popover-foreground shadow-md group-hover:grid group-focus-visible:grid",a.tooltipClass]),role:"tooltip"},[s("span",Ve,m(a.date),1),r.heatMetric==="tokens"?(d(),f("span",We,[o[0]||(o[0]=s("span",null,"Tokens",-1)),s("span",Xe,m(a.tokenLabel),1)])):I("",!0),s("span",Je,[o[1]||(o[1]=s("span",null,"Cost",-1)),s("span",Ke,m(a.costLabel),1)]),r.heatMetric==="cost"?(d(),f("span",Qe,[o[2]||(o[2]=s("span",null,"Tokens",-1)),s("span",Ze,m(a.tokenLabel),1)])):I("",!0),a.platformSections.length>0||a.modelRows.length>0?(d(),f("div",et,[a.platformSections.length>0?(d(!0),f(j,{key:0},R(a.platformSections,x=>(d(),f("div",{key:x.key,class:"grid gap-1"},[s("div",tt,[s("span",null,m(x.label),1),s("span",ot,m(x.costLabel)+" / "+m(x.tokenLabel),1)]),(d(!0),f(j,null,R(x.models,E=>(d(),f("div",{key:E.key,class:"flex items-center justify-between gap-3 text-[11px] text-muted-foreground"},[s("span",at,[ge(m(E.label),1),E.isFallback?(d(),f("span",st," (fallback)")):I("",!0)]),s("span",nt,m(E.costLabel)+" / "+m(E.tokenLabel),1)]))),128))]))),128)):(d(!0),f(j,{key:1},R(a.modelRows,x=>(d(),f("div",{key:x.key,class:"flex items-center justify-between gap-3 text-[11px] text-muted-foreground"},[s("span",rt,[ge(m(x.label),1),x.isFallback?(d(),f("span",lt," (fallback)")):I("",!0)]),s("span",it,m(x.costLabel)+" / "+m(x.tokenLabel),1)]))),128))])):I("",!0),s("span",{class:V(["absolute top-full size-2 -translate-y-1/2 rotate-45 border-r border-b border-border bg-popover",a.tooltipArrowClass])},null,2)],2))],14,Ge))),128))],4),s("div",ct,[s("p",ut,m(_.value),1),s("div",dt,[o[3]||(o[3]=s("span",null,"Less",-1)),(d(),f(j,null,R(y,a=>s("span",{key:a,class:V(["size-3 rounded-[2px] border border-black/5 dark:border-white/10",a])},null,2)),64)),o[4]||(o[4]=s("span",null,"More",-1))])])]),s("div",mt,[(d(!0),f(j,null,R(S.value,a=>(d(),f("div",{key:a.date,class:"rounded-md border px-3 py-2"},[s("p",pt,m(a.date),1),s("div",ft,[s("span",gt,m(r.heatMetric==="cost"?("formatCurrency"in e?e.formatCurrency:i(z))(a.costUSD):("formatCompactNumber"in e?e.formatCompactNumber:i(D))(a.totalTokens)),1),s("span",yt,m(r.heatMetric==="cost"?("formatCompactNumber"in e?e.formatCompactNumber:i(D))(a.totalTokens):("formatCurrency"in e?e.formatCurrency:i(z))(a.costUSD)),1)])]))),128))])]),_:1},8,["description","title"])}}}),Dt=Object.assign(ht,{__name:"UsageHeatmapPanel"});function de(){return{dailyRows:[],dailyTokenUsage:[],monthlyModelUsage:[],monthlyRows:[],overviewCards:[],projectUsage:[],sessionRows:[],sessionUsage:[],todayTopModel:null,todayTopProject:null,todayTotalCost:0,todayTotalTokens:0,weeklyRows:[]}}function Mt(){return{hotProjects:[],modelUsage:[],overviewCards:[]}}function St(){return{dailyTokenUsage:[],efficiencyMetrics:[],todayHourlyUsage:[]}}function Ut(){return{sessionAnalysis:{items:[],totalSessions:0}}}function $t(){const n=de();return{dailyRows:n.dailyRows,dailyTokenUsage:n.dailyTokenUsage,monthlyModelUsage:n.monthlyModelUsage,overviewCards:n.overviewCards}}function jt(){const n=de();return{monthlyRows:n.monthlyRows,projectUsage:n.projectUsage,sessionRows:n.sessionRows,weeklyRows:n.weeklyRows}}function Rt(){return{sessionUsage:de().sessionUsage}}const bt=["day","week","month","session"],vt={agentSession:"/api/analysis/agent/session.json",agentToken:"/api/analysis/agent/token.json",cache:"/api/analysis/cache.json",dailyTokenUsage:"/api/analysis/token/daily.json",hotProject:"/api/analysis/hot-project.json",model:"/api/analysis/model.json",overviewCards:"/api/analysis/overview-cards.json",session:"/api/analysis/session.json",token:"/api/analysis/token.json",todayHourlyUsage:"/api/analysis/token/today-hourly.json"};async function Lt(){const[n,r,h]=await Promise.all([T("overviewCards"),T("model"),T("hotProject")]);return{hotProjects:h,modelUsage:r,overviewCards:n}}async function At(){const[n,r,h]=await Promise.all([T("cache"),T("dailyTokenUsage"),T("todayHourlyUsage")]);return{dailyTokenUsage:r,efficiencyMetrics:n.items,todayHourlyUsage:h}}function Pt(){return T("session")}async function Bt(n){const[r,h,y,C]=await Promise.all([T("overviewCards",{agent:n}),T("model",{agent:n}),T("token",{agent:n}),T("agentToken",{agent:n,type:"day"})]);return{dailyRows:C,dailyTokenUsage:y,monthlyModelUsage:h,overviewCards:r}}async function Nt(n){const[r,h]=await Promise.all([T("hotProject",{agent:n}),Promise.all(bt.filter(C=>C!=="day").map(async C=>[C,await T("agentToken",{agent:n,type:C})]))]),y=Object.fromEntries(h);return{monthlyRows:y.month,projectUsage:r,sessionRows:y.session,weeklyRows:y.week}}function Et(n){return T("agentSession",{agent:n}).then(r=>({sessionUsage:r}))}function T(n,r={}){return $fetch(vt[n],{query:kt(r)})}function kt(n){const r={};return n.agent&&(r.agent=ye[n.agent].slug),n.type&&(r.type=n.type),Object.keys(r).length>0?r:void 0}function It(n){const r=re(!1);he(n.coreStatus,async y=>{if(y!=="success"){r.value=!1,n.clearDeferred();return}r.value||(r.value=!0,await n.executeDeferred())},{immediate:!0});async function h(){r.value=!1,await n.refreshCore(),n.coreStatus.value==="success"&&(r.value=!0,await n.refreshDeferred())}return{refresh:h}}function Ht(n,r){const h=re(!1);he(n,U=>{U==="success"&&(h.value=!0)},{immediate:!0});const y=l(()=>!h.value&&n.value!=="error");return{errorText:l(()=>n.value!=="error"?"":r.value instanceof Error?r.value.message:typeof r.value=="string"?r.value:"Failed to load dashboard data."),showSkeleton:y}}export{Tt as _,Ct as a,Dt as b,$t as c,Nt as d,jt as e,Bt as f,Et as g,Rt as h,Ht as i,Lt as j,Mt as k,At as l,St as m,Pt as n,Ut as o,It as u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{aC as $t,F as Ft,aD as It,a9 as gt,a8 as ze,G as _,R as zt,aE as Wt,aF as Ht,k as ae,aG as Vt,r as A,aH as jt,L as We,V as yt,aI as Ut,I as se,a0 as Kt,a1 as Ce,m as He,e as T,$ as Xt,X as _e,aJ as Yt,z as U,aK as Gt,Q as ge,f as K,aL as Jt,o as D,g as L,w as E,h as q,i as g,D as Ve,H as Qt,aM as Zt,l as en,aN as tn,j as je,aO as wt,c as Oe,aP as nn,N as on,aQ as fe,J as rn,aR as sn,b as le,aS as an,a5 as Ue,a6 as Ke,aT as Ee,n as ln,aU as un,ae as ot,d as cn,t as dn,a4 as fn,ac as pn,ai as vn,aV as hn,y as mn,s as bt,q as gn}from"./Jp5cgQZi.js";const rt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,it=$t,yn=(e,t)=>n=>{var o;if(t?.variants==null)return it(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(u=>{const l=n?.[u],d=i?.[u];if(l===null)return null;const p=rt(l)||rt(d);return r[u][p]}),a=n&&Object.entries(n).reduce((u,l)=>{let[d,p]=l;return p===void 0||(u[d]=p),u},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,l)=>{let{class:d,className:p,...f}=l;return Object.entries(f).every(v=>{let[m,h]=v;return Array.isArray(h)?h.includes({...i,...a}[m]):{...i,...a}[m]===h})?[...u,d,p]:u},[]);return it(e,s,c,n?.class,n?.className)};function xt(e,t,n){const o=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(r)}function wn(e){return e==null}function Xe(e){return e?e.flatMap(t=>t.type===Ft?Xe(t.children):[t]):[]}function bn(e){const t=ze(),n=t?.type.emits,o={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(r=>{o[It(gt(r))]=(...i)=>e(r,...i)}),o}function _t(e){const t=ze(),n=Object.keys(t?.type.props??{}).reduce((r,i)=>{const s=(t?.type.props[i]).default;return s!==void 0&&(r[i]=s),r},{}),o=zt(e);return _(()=>{const r={},i=t?.vnode.props??{};return Object.keys(i).forEach(s=>{r[gt(s)]=i[s]}),Object.keys({...n,...r}).reduce((s,a)=>(o.value[a]!==void 0&&(s[a]=o.value[a]),s),{})})}function Ye(e,t){const n=_t(e),o=t?bn(t):{};return _(()=>({...n.value,...o}))}function xn(e,t){const n=Wt(!1,300);Ht(()=>{n.value=!1});const o=A(null),r=Vt();function i(){o.value=null,n.value=!1}function s(a,c){if(!c)return;const u=a.currentTarget,l={x:a.clientX,y:a.clientY},d=_n(l,u.getBoundingClientRect()),p=Cn(l,d,1),f=On(c.getBoundingClientRect()),v=An([...p,...f]);o.value=v,n.value=!0}return ae(a=>{if(e.value&&t.value){const c=l=>s(l,t.value),u=l=>s(l,e.value);e.value.addEventListener("pointerleave",c),t.value.addEventListener("pointerleave",u),a(()=>{e.value?.removeEventListener("pointerleave",c),t.value?.removeEventListener("pointerleave",u)})}}),ae(a=>{if(o.value){const c=u=>{if(!o.value||!(u.target instanceof Element))return;const l=u.target,d={x:u.clientX,y:u.clientY},p=e.value?.contains(l)||t.value?.contains(l),f=!Pn(d,o.value),v=!!l.closest("[data-grace-area-trigger]");p?i():(f||v)&&(i(),r.trigger())};e.value?.ownerDocument.addEventListener("pointermove",c),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",c))}}),{isPointerInTransit:n,onPointerExit:r.on}}function _n(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Cn(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function On(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Pn(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,c=t[i].y,u=t[s].x,l=t[s].y;c>o!=l>o&&n<(u-a)*(o-c)/(l-c)+a&&(r=!r)}return r}function An(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Sn(t)}function Sn(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t.at(-1),s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n.at(-1),s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function En(e,t="reka"){let n;return n=jt?.(),t?`${t}-${n}`:n}function Tn(e){const t=A(),n=_(()=>t.value?.width??0),o=_(()=>t.value?.height??0);return We(()=>{const r=yt(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let c,u;if("borderBoxSize"in a){const l=a.borderBoxSize,d=Array.isArray(l)?l[0]:l;c=d.inlineSize,u=d.blockSize}else c=r.offsetWidth,u=r.offsetHeight;t.value={width:c,height:u}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t.value=void 0}),{width:n,height:o}}function Dn(e,t){const n=A(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}function Rn(e,t){const n=A({}),o=A("none"),r=A(e),i=e.value?"mounted":"unmounted";let s;const a=t.value?.ownerDocument.defaultView??Ut,{state:c,dispatch:u}=Dn(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),l=h=>{if(He){const y=new CustomEvent(h,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(y)}};se(e,async(h,y)=>{const b=y!==h;if(await Ce(),b){const w=o.value,x=be(t.value);h?(u("MOUNT"),l("enter"),x==="none"&&l("after-enter")):x==="none"||x==="undefined"||n.value?.display==="none"?(u("UNMOUNT"),l("leave"),l("after-leave")):y&&w!==x?(u("ANIMATION_OUT"),l("leave")):(u("UNMOUNT"),l("after-leave"))}},{immediate:!0});const d=h=>{const y=be(t.value),b=y.includes(CSS.escape(h.animationName)),w=c.value==="mounted"?"enter":"leave";if(h.target===t.value&&b&&(l(`after-${w}`),u("ANIMATION_END"),!r.value)){const x=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",s=a?.setTimeout(()=>{t.value?.style.animationFillMode==="forwards"&&(t.value.style.animationFillMode=x)})}h.target===t.value&&y==="none"&&u("ANIMATION_END")},p=h=>{h.target===t.value&&(o.value=be(t.value))},f=se(t,(h,y)=>{h?(n.value=getComputedStyle(h),h.addEventListener("animationstart",p),h.addEventListener("animationcancel",d),h.addEventListener("animationend",d)):(u("ANIMATION_END"),s!==void 0&&a?.clearTimeout(s),y?.removeEventListener("animationstart",p),y?.removeEventListener("animationcancel",d),y?.removeEventListener("animationend",d))},{immediate:!0}),v=se(c,()=>{const h=be(t.value);o.value=c.value==="mounted"?h:"none"});return Kt(()=>{f(),v()}),{isPresent:_(()=>["mounted","unmountSuspended"].includes(c.value))}}function be(e){return e&&getComputedStyle(e).animationName||"none"}var qn=T({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){const{present:o,forceMount:r}=Xt(e),i=A(),{isPresent:s}=Rn(o,i);n({present:s});let a=t.default({present:s.value});a=Xe(a||[]);const c=ze();if(a&&a?.length>1){const u=c?.parent?.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${u}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(l=>` - ${l}`).join(`
|
|
2
|
+
`)].join(`
|
|
3
|
+
`))}return()=>r.value||o.value||s.value?_e(t.default({present:s.value})[0],{ref:u=>{const l=yt(u);return typeof l?.hasAttribute>"u"||(l?.hasAttribute("data-reka-popper-content-wrapper")?i.value=l.firstElementChild:i.value=l),l}}):null}});const Bn=T({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;const o=Xe(n.default()),r=o.findIndex(c=>c.type!==Yt);if(r===-1)return o;const i=o[r];delete i.props?.ref;const s=i.props?U(t,i.props):t,a=Gt({...i,props:{}},s);return o.length===1?a:(o[r]=a,o)}}}),Ln=["area","img","input"],ce=T({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&Ln.includes(o)?()=>_e(o,t):o!=="template"?()=>_e(e.as,t,{default:n.default}):()=>_e(Bn,t,{default:n.default})}}),Nn="dismissableLayer.pointerDownOutside",kn="dismissableLayer.focusOutside";function Ct(e,t){if(!(t instanceof Element))return!1;const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(o===n||r.indexOf(o)<r.indexOf(n)))}function Mn(e,t,n=!0){const o=t?.value?.ownerDocument??globalThis?.document,r=A(!1),i=A(()=>{});return ae(s=>{if(!He||!ge(n))return;const a=async u=>{const l=u.target;if(!(!t?.value||!l)){if(Ct(t.value,l)){r.value=!1;return}if(u.target&&!r.value){let p=function(){xt(Nn,e,d)};const d={originalEvent:u};u.pointerType==="touch"?(o.removeEventListener("click",i.value),i.value=p,o.addEventListener("click",i.value,{once:!0})):p()}else o.removeEventListener("click",i.value);r.value=!1}},c=window.setTimeout(()=>{o.addEventListener("pointerdown",a)},0);s(()=>{window.clearTimeout(c),o.removeEventListener("pointerdown",a),o.removeEventListener("click",i.value)})}),{onPointerDownCapture:()=>{ge(n)&&(r.value=!0)}}}function $n(e,t,n=!0){const o=t?.value?.ownerDocument??globalThis?.document,r=A(!1);return ae(i=>{if(!He||!ge(n))return;const s=async a=>{if(!t?.value)return;await Ce(),await Ce();const c=a.target;!t.value||!c||Ct(t.value,c)||a.target&&!r.value&&xt(kn,e,{originalEvent:a})};o.addEventListener("focusin",s),i(()=>o.removeEventListener("focusin",s))}),{onFocusCapture:()=>{ge(n)&&(r.value=!0)},onBlurCapture:()=>{ge(n)&&(r.value=!1)}}}const W=Qt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var Fn=T({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:r,currentElement:i}=K(),s=_(()=>i.value?.ownerDocument??globalThis.document),a=_(()=>W.layersRoot),c=_(()=>i.value?Array.from(a.value).indexOf(i.value):-1),u=_(()=>W.layersWithOutsidePointerEventsDisabled.size>0),l=_(()=>{const f=Array.from(a.value),[v]=[...W.layersWithOutsidePointerEventsDisabled].slice(-1),m=f.indexOf(v);return c.value>=m}),d=Mn(async f=>{const v=[...W.branches].some(m=>m?.contains(f.target));!l.value||v||(o("pointerDownOutside",f),o("interactOutside",f),await Ce(),f.defaultPrevented||o("dismiss"))},i),p=$n(f=>{[...W.branches].some(m=>m?.contains(f.target))||(o("focusOutside",f),o("interactOutside",f),f.defaultPrevented||o("dismiss"))},i);return Jt("Escape",f=>{c.value===a.value.size-1&&(o("escapeKeyDown",f),f.defaultPrevented||o("dismiss"))}),ae(f=>{i.value&&(n.disableOutsidePointerEvents&&(W.layersWithOutsidePointerEventsDisabled.size===0&&(W.originalBodyPointerEvents=s.value.body.style.pointerEvents,s.value.body.style.pointerEvents="none"),W.layersWithOutsidePointerEventsDisabled.add(i.value)),a.value.add(i.value),f(()=>{n.disableOutsidePointerEvents&&W.layersWithOutsidePointerEventsDisabled.size===1&&!wn(W.originalBodyPointerEvents)&&(s.value.body.style.pointerEvents=W.originalBodyPointerEvents)}))}),ae(f=>{f(()=>{i.value&&(a.value.delete(i.value),W.layersWithOutsidePointerEventsDisabled.delete(i.value))})}),(f,v)=>(D(),L(g(ce),{ref:g(r),"as-child":f.asChild,as:f.as,"data-dismissable-layer":"",style:Ve({pointerEvents:u.value?l.value?"auto":"none":void 0}),onFocusCapture:g(p).onFocusCapture,onBlurCapture:g(p).onBlurCapture,onPointerdownCapture:g(d).onPointerDownCapture},{default:E(()=>[q(f.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),In=Fn,zn=T({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=tn();return(n,o)=>g(t)||n.forceMount?(D(),L(Zt,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[q(n.$slots,"default")],8,["to","disabled","defer"])):en("v-if",!0)}}),Wn=zn,Hn=T({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,n)=>(D(),L(g(ce),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:E(()=>[q(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),Vn=Hn;const[Ot,jn]=je("PopperRoot");var Un=T({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=A();return jn({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>q(n.$slots,"default")}}),Kn=Un,Xn=T({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=K(),r=Ot();return wt(()=>{r.onAnchorChange(t.reference??o.value)}),(i,s)=>(D(),L(g(ce),{ref:g(n),as:i.as,"as-child":i.asChild},{default:E(()=>[q(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),Yn=Xn;const Gn={key:0,d:"M0 0L6 6L12 0"},Jn={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Qn=T({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return K(),(n,o)=>(D(),L(g(ce),U(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 12 6",preserveAspectRatio:n.asChild?void 0:"none"}),{default:E(()=>[q(n.$slots,"default",{},()=>[n.rounded?(D(),Oe("path",Jn)):(D(),Oe("path",Gn))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Zn=Qn;function eo(e){return e!==null}function to(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,l]=ke(n),d={start:"0%",center:"50%",end:"100%"}[l],p=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+c/2;let v="",m="";return u==="bottom"?(v=s?d:`${p}px`,m=`${-c}px`):u==="top"?(v=s?d:`${p}px`,m=`${o.floating.height+c}px`):u==="right"?(v=`${-c}px`,m=s?d:`${f}px`):u==="left"&&(v=`${o.floating.width+c}px`,m=s?d:`${f}px`),{data:{x:v,y:m}}}}}function ke(e){const[t,n="center"]=e.split("-");return[t,n]}const no=["top","right","bottom","left"],oe=Math.min,F=Math.max,Pe=Math.round,xe=Math.floor,G=e=>({x:e,y:e}),oo={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e,t,n){return F(e,oe(t,n))}function Z(e,t){return typeof e=="function"?e(t):e}function ee(e){return e.split("-")[0]}function me(e){return e.split("-")[1]}function Ge(e){return e==="x"?"y":"x"}function Je(e){return e==="y"?"height":"width"}function Y(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Qe(e){return Ge(Y(e))}function ro(e,t,n){n===void 0&&(n=!1);const o=me(e),r=Qe(e),i=Je(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ae(s)),[s,Ae(s)]}function io(e){const t=Ae(e);return[$e(e),t,$e(t)]}function $e(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const st=["left","right"],at=["right","left"],so=["top","bottom"],ao=["bottom","top"];function lo(e,t,n){switch(e){case"top":case"bottom":return n?t?at:st:t?st:at;case"left":case"right":return t?so:ao;default:return[]}}function uo(e,t,n,o){const r=me(e);let i=lo(ee(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map($e)))),i}function Ae(e){const t=ee(e);return oo[t]+e.slice(t.length)}function co(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pt(e){return typeof e!="number"?co(e):{top:e,right:e,bottom:e,left:e}}function Se(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function lt(e,t,n){let{reference:o,floating:r}=e;const i=Y(t),s=Qe(t),a=Je(s),c=ee(t),u=i==="y",l=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let f;switch(c){case"top":f={x:l,y:o.y-r.height};break;case"bottom":f={x:l,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(me(t)){case"start":f[s]-=p*(n&&u?-1:1);break;case"end":f[s]+=p*(n&&u?-1:1);break}return f}async function fo(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Z(t,e),v=Pt(f),h=a[p?d==="floating"?"reference":"floating":d],y=Se(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),b=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},O=Se(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(y.top-O.top+v.top)/x.y,bottom:(O.bottom-y.bottom+v.bottom)/x.y,left:(y.left-O.left+v.left)/x.x,right:(O.right-y.right+v.right)/x.x}}const po=50,vo=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:fo},c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:l,y:d}=lt(u,o,c),p=o,f=0;const v={};for(let m=0;m<i.length;m++){const h=i[m];if(!h)continue;const{name:y,fn:b}=h,{x:w,y:x,data:O,reset:P}=await b({x:l,y:d,initialPlacement:o,placement:p,strategy:r,middlewareData:v,rects:u,platform:a,elements:{reference:e,floating:t}});l=w??l,d=x??d,v[y]={...v[y],...O},P&&f<po&&(f++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(u=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):P.rects),{x:l,y:d}=lt(u,p,c)),m=-1)}return{x:l,y:d,placement:p,strategy:r,middlewareData:v}},ho=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:u,padding:l=0}=Z(e,t)||{};if(u==null)return{};const d=Pt(l),p={x:n,y:o},f=Qe(r),v=Je(f),m=await s.getDimensions(u),h=f==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",x=i.reference[v]+i.reference[f]-p[f]-i.floating[v],O=p[f]-i.reference[f],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let C=P?P[w]:0;(!C||!await(s.isElement==null?void 0:s.isElement(P)))&&(C=a.floating[w]||i.floating[v]);const R=x/2-O/2,N=C/2-m[v]/2-1,M=oe(d[y],N),X=oe(d[b],N),S=M,z=C-m[v]-X,B=C/2-m[v]/2+R,Q=Me(S,B,z),H=!c.arrow&&me(r)!=null&&B!==Q&&i.reference[v]/2-(B<S?M:X)-m[v]/2<0,$=H?B<S?B-S:B-z:0;return{[f]:p[f]+$,data:{[f]:Q,centerOffset:B-Q-$,...H&&{alignmentOffset:$}},reset:H}}}),mo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...h}=Z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=ee(r),b=Y(a),w=ee(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(u.floating)),O=p||(w||!m?[Ae(a)]:io(a)),P=v!=="none";!p&&P&&O.push(...uo(a,m,v,x));const C=[a,...O],R=await c.detectOverflow(t,h),N=[];let M=((o=i.flip)==null?void 0:o.overflows)||[];if(l&&N.push(R[y]),d){const B=ro(r,s,x);N.push(R[B[0]],R[B[1]])}if(M=[...M,{placement:r,overflows:N}],!N.every(B=>B<=0)){var X,S;const B=(((X=i.flip)==null?void 0:X.index)||0)+1,Q=C[B];if(Q&&(!(d==="alignment"?b!==Y(Q):!1)||M.every(k=>Y(k.placement)===b?k.overflows[0]>0:!0)))return{data:{index:B,overflows:M},reset:{placement:Q}};let H=(S=M.filter($=>$.overflows[0]<=0).sort(($,k)=>$.overflows[1]-k.overflows[1])[0])==null?void 0:S.placement;if(!H)switch(f){case"bestFit":{var z;const $=(z=M.filter(k=>{if(P){const ne=Y(k.placement);return ne===b||ne==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(ne=>ne>0).reduce((ne,Mt)=>ne+Mt,0)]).sort((k,ne)=>k[1]-ne[1])[0])==null?void 0:z[0];$&&(H=$);break}case"initialPlacement":H=a;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function ut(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ct(e){return no.some(t=>e[t]>=0)}const go=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=Z(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=ut(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ct(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=ut(s,n.floating);return{data:{escapedOffsets:a,escaped:ct(a)}}}default:return{}}}}},At=new Set(["left","top"]);async function yo(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=ee(n),a=me(n),c=Y(n)==="y",u=At.has(s)?-1:1,l=i&&c?-1:1,d=Z(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),c?{x:f*l,y:p*u}:{x:p*u,y:f*l}}const wo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,c=await yo(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},bo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...u}=Z(e,t),l={x:n,y:o},d=await i.detectOverflow(t,u),p=Y(ee(r)),f=Ge(p);let v=l[f],m=l[p];if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=v+d[y],x=v-d[b];v=Me(w,v,x)}if(a){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=m+d[y],x=m-d[b];m=Me(w,m,x)}const h=c.fn({...t,[f]:v,[p]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[f]:s,[p]:a}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Z(e,t),l={x:n,y:o},d=Y(r),p=Ge(d);let f=l[p],v=l[d];const m=Z(a,t),h=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=p==="y"?"height":"width",x=i.reference[p]-i.floating[w]+h.mainAxis,O=i.reference[p]+i.reference[w]-h.mainAxis;f<x?f=x:f>O&&(f=O)}if(u){var y,b;const w=p==="y"?"width":"height",x=At.has(ee(r)),O=i.reference[d]-i.floating[w]+(x&&((y=s.offset)==null?void 0:y[d])||0)+(x?0:h.crossAxis),P=i.reference[d]+i.reference[w]+(x?0:((b=s.offset)==null?void 0:b[d])||0)-(x?h.crossAxis:0);v<O?v=O:v>P&&(v=P)}return{[p]:f,[d]:v}}}},_o=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...u}=Z(e,t),l=await s.detectOverflow(t,u),d=ee(r),p=me(r),f=Y(r)==="y",{width:v,height:m}=i.floating;let h,y;d==="top"||d==="bottom"?(h=d,y=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,h=p==="end"?"top":"bottom");const b=m-l.top-l.bottom,w=v-l.left-l.right,x=oe(m-l[h],b),O=oe(v-l[y],w),P=!t.middlewareData.shift;let C=x,R=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=b),P&&!p){const M=F(l.left,0),X=F(l.right,0),S=F(l.top,0),z=F(l.bottom,0);f?R=v-2*(M!==0||X!==0?M+X:F(l.left,l.right)):C=m-2*(S!==0||z!==0?S+z:F(l.top,l.bottom))}await c({...t,availableWidth:R,availableHeight:C});const N=await s.getDimensions(a.floating);return v!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function Te(){return typeof window<"u"}function de(e){return Ze(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){var t;return(t=(Ze(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ze(e){return Te()?e instanceof Node||e instanceof I(e).Node:!1}function V(e){return Te()?e instanceof Element||e instanceof I(e).Element:!1}function te(e){return Te()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function dt(e){return!Te()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function we(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Co(e){return/^(table|td|th)$/.test(de(e))}function De(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Oo=/transform|translate|scale|rotate|perspective|filter/,Po=/paint|layout|strict|content/,ie=e=>!!e&&e!=="none";let Le;function et(e){const t=V(e)?j(e):e;return ie(t.transform)||ie(t.translate)||ie(t.scale)||ie(t.rotate)||ie(t.perspective)||!tt()&&(ie(t.backdropFilter)||ie(t.filter))||Oo.test(t.willChange||"")||Po.test(t.contain||"")}function Ao(e){let t=re(e);for(;te(t)&&!he(t);){if(et(t))return t;if(De(t))return null;t=re(t)}return null}function tt(){return Le==null&&(Le=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Le}function he(e){return/^(html|body|#document)$/.test(de(e))}function j(e){return I(e).getComputedStyle(e)}function Re(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(de(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dt(e)&&e.host||J(e);return dt(t)?t.host:t}function St(e){const t=re(e);return he(t)?e.ownerDocument?e.ownerDocument.body:e.body:te(t)&&we(t)?t:St(t)}function ye(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=St(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=I(r);if(i){const a=Fe(s);return t.concat(s,s.visualViewport||[],we(r)?r:[],a&&n?ye(a):[])}else return t.concat(r,ye(r,[],n))}function Fe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Et(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=te(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Pe(n)!==i||Pe(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function nt(e){return V(e)?e:e.contextElement}function ve(e){const t=nt(e);if(!te(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Et(t);let s=(i?Pe(n.width):n.width)/o,a=(i?Pe(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const So=G(0);function Tt(e){const t=I(e);return!tt()||!t.visualViewport?So:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function ue(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=nt(e);let s=G(1);t&&(o?V(o)&&(s=ve(o)):s=ve(e));const a=Eo(i,n,o)?Tt(i):G(0);let c=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,l=r.width/s.x,d=r.height/s.y;if(i){const p=I(i),f=o&&V(o)?I(o):o;let v=p,m=Fe(v);for(;m&&o&&f!==v;){const h=ve(m),y=m.getBoundingClientRect(),b=j(m),w=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*h.x,x=y.top+(m.clientTop+parseFloat(b.paddingTop))*h.y;c*=h.x,u*=h.y,l*=h.x,d*=h.y,c+=w,u+=x,v=I(m),m=Fe(v)}}return Se({width:l,height:d,x:c,y:u})}function qe(e,t){const n=Re(e).scrollLeft;return t?t.left+n:ue(J(e)).left+n}function Dt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-qe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function To(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=J(o),a=t?De(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},u=G(1);const l=G(0),d=te(o);if((d||!d&&!i)&&((de(o)!=="body"||we(s))&&(c=Re(o)),d)){const f=ue(o);u=ve(o),l.x=f.x+o.clientLeft,l.y=f.y+o.clientTop}const p=s&&!d&&!i?Dt(s,c):G(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:n.y*u.y-c.scrollTop*u.y+l.y+p.y}}function Do(e){return Array.from(e.getClientRects())}function Ro(e){const t=J(e),n=Re(e),o=e.ownerDocument.body,r=F(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=F(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+qe(e);const a=-n.scrollTop;return j(o).direction==="rtl"&&(s+=F(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const ft=25;function qo(e,t){const n=I(e),o=J(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const l=tt();(!l||l&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const u=qe(o);if(u<=0){const l=o.ownerDocument,d=l.body,p=getComputedStyle(d),f=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-f);v<=ft&&(i-=v)}else u<=ft&&(i+=u);return{width:i,height:s,x:a,y:c}}function Bo(e,t){const n=ue(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=te(e)?ve(e):G(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,u=o*i.y;return{width:s,height:a,x:c,y:u}}function pt(e,t,n){let o;if(t==="viewport")o=qo(e,n);else if(t==="document")o=Ro(J(e));else if(V(t))o=Bo(t,n);else{const r=Tt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Se(o)}function Rt(e,t){const n=re(e);return n===t||!V(n)||he(n)?!1:j(n).position==="fixed"||Rt(n,t)}function Lo(e,t){const n=t.get(e);if(n)return n;let o=ye(e,[],!1).filter(a=>V(a)&&de(a)!=="body"),r=null;const i=j(e).position==="fixed";let s=i?re(e):e;for(;V(s)&&!he(s);){const a=j(s),c=et(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||we(s)&&!c&&Rt(e,s))?o=o.filter(l=>l!==s):r=a,s=re(s)}return t.set(e,o),o}function No(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?De(t)?[]:Lo(t,this._c):[].concat(n),o],a=pt(t,s[0],r);let c=a.top,u=a.right,l=a.bottom,d=a.left;for(let p=1;p<s.length;p++){const f=pt(t,s[p],r);c=F(f.top,c),u=oe(f.right,u),l=oe(f.bottom,l),d=F(f.left,d)}return{width:u-d,height:l-c,x:d,y:c}}function ko(e){const{width:t,height:n}=Et(e);return{width:t,height:n}}function Mo(e,t,n){const o=te(t),r=J(t),i=n==="fixed",s=ue(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=G(0);function u(){c.x=qe(r)}if(o||!o&&!i)if((de(t)!=="body"||we(r))&&(a=Re(t)),o){const f=ue(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&u();i&&!o&&r&&u();const l=r&&!o&&!i?Dt(r,a):G(0),d=s.left+a.scrollLeft-c.x-l.x,p=s.top+a.scrollTop-c.y-l.y;return{x:d,y:p,width:s.width,height:s.height}}function Ne(e){return j(e).position==="static"}function vt(e,t){if(!te(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function qt(e,t){const n=I(e);if(De(e))return n;if(!te(e)){let r=re(e);for(;r&&!he(r);){if(V(r)&&!Ne(r))return r;r=re(r)}return n}let o=vt(e,t);for(;o&&Co(o)&&Ne(o);)o=vt(o,t);return o&&he(o)&&Ne(o)&&!et(o)?n:o||Ao(e)||n}const $o=async function(e){const t=this.getOffsetParent||qt,n=this.getDimensions,o=await n(e.floating);return{reference:Mo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Fo(e){return j(e).direction==="rtl"}const Io={convertOffsetParentRelativeRectToViewportRelativeRect:To,getDocumentElement:J,getClippingRect:No,getOffsetParent:qt,getElementRects:$o,getClientRects:Do,getDimensions:ko,getScale:ve,isElement:V,isRTL:Fo};function Bt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zo(e,t){let n=null,o;const r=J(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:l,top:d,width:p,height:f}=u;if(a||t(),!p||!f)return;const v=xe(d),m=xe(r.clientWidth-(l+p)),h=xe(r.clientHeight-(d+f)),y=xe(l),w={rootMargin:-v+"px "+-m+"px "+-h+"px "+-y+"px",threshold:F(0,oe(1,c))||1};let x=!0;function O(P){const C=P[0].intersectionRatio;if(C!==c){if(!x)return s();C?s(!1,C):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!Bt(u,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(O,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return s(!0),i}function Wo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=nt(e),l=r||i?[...u?ye(u):[],...t?ye(t):[]]:[];l.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=u&&a?zo(u,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),u&&!c&&f.observe(u),t&&f.observe(t));let v,m=c?ue(e):null;c&&h();function h(){const y=ue(e);m&&!Bt(m,y)&&n(),m=y,v=requestAnimationFrame(h)}return n(),()=>{var y;l.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(y=f)==null||y.disconnect(),f=null,c&&cancelAnimationFrame(v)}}const Ho=wo,Vo=bo,ht=mo,jo=_o,Uo=go,Ko=ho,Xo=xo,Yo=(e,t,n)=>{const o=new Map,r={platform:Io,...n},i={...r.platform,_c:o};return vo(e,t,{...r,platform:i})};function Go(e){return e!=null&&typeof e=="object"&&"$el"in e}function Ie(e){if(Go(e)){const t=e.$el;return Ze(t)&&de(t)==="#comment"?null:t}return e}function pe(e){return typeof e=="function"?e():g(e)}function Jo(e){return{name:"arrow",options:e,fn(t){const n=Ie(pe(e.element));return n==null?{}:Ko({element:n,padding:e.padding}).fn(t)}}}function Lt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mt(e,t){const n=Lt(e);return Math.round(t*n)/n}function Qo(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=_(()=>{var C;return(C=pe(n.open))!=null?C:!0}),i=_(()=>pe(n.middleware)),s=_(()=>{var C;return(C=pe(n.placement))!=null?C:"bottom"}),a=_(()=>{var C;return(C=pe(n.strategy))!=null?C:"absolute"}),c=_(()=>{var C;return(C=pe(n.transform))!=null?C:!0}),u=_(()=>Ie(e.value)),l=_(()=>Ie(t.value)),d=A(0),p=A(0),f=A(a.value),v=A(s.value),m=rn({}),h=A(!1),y=_(()=>{const C={position:f.value,left:"0",top:"0"};if(!l.value)return C;const R=mt(l.value,d.value),N=mt(l.value,p.value);return c.value?{...C,transform:"translate("+R+"px, "+N+"px)",...Lt(l.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:R+"px",top:N+"px"}});let b;function w(){if(u.value==null||l.value==null)return;const C=r.value;Yo(u.value,l.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(R=>{d.value=R.x,p.value=R.y,f.value=R.strategy,v.value=R.placement,m.value=R.middlewareData,h.value=C!==!1})}function x(){typeof b=="function"&&(b(),b=void 0)}function O(){if(x(),o===void 0){w();return}if(u.value!=null&&l.value!=null){b=o(u.value,l.value,w);return}}function P(){r.value||(h.value=!1)}return se([i,s,a,r],w,{flush:"sync"}),se([u,l],O,{flush:"sync"}),se(r,P,{flush:"sync"}),nn()&&on(x),{x:fe(d),y:fe(p),strategy:fe(f),placement:fe(v),middlewareData:fe(m),isPositioned:fe(h),floatingStyles:y,update:w}}const Zo={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[er,tr]=je("PopperContent");var nr=T({inheritAttrs:!1,__name:"PopperContent",props:an({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Zo}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Ot(),{forwardRef:i,currentElement:s}=K(),a=A(),c=A(),{width:u,height:l}=Tn(c),d=_(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=_(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=_(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),v=_(()=>({padding:p.value,boundary:f.value.filter(eo),altBoundary:f.value.length>0})),m=_(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),h=sn(()=>[Ho({mainAxis:n.sideOffset+l.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&ht({...v.value,...m.value}),n.avoidCollisions&&Vo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Xo():void 0,...v.value}),!n.prioritizePosition&&n.avoidCollisions&&ht({...v.value,...m.value}),jo({...v.value,apply:({elements:S,rects:z,availableWidth:B,availableHeight:Q})=>{const{width:H,height:$}=z.reference,k=S.floating.style;k.setProperty("--reka-popper-available-width",`${B}px`),k.setProperty("--reka-popper-available-height",`${Q}px`),k.setProperty("--reka-popper-anchor-width",`${H}px`),k.setProperty("--reka-popper-anchor-height",`${$}px`)}}),c.value&&Jo({element:c.value,padding:n.arrowPadding}),to({arrowWidth:u.value,arrowHeight:l.value}),n.hideWhenDetached&&Uo({strategy:"referenceHidden",...v.value})]),y=_(()=>n.reference??r.anchor.value),{floatingStyles:b,placement:w,isPositioned:x,middlewareData:O}=Qo(y,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...S)=>Wo(...S,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:h}),P=_(()=>ke(w.value)[0]),C=_(()=>ke(w.value)[1]);wt(()=>{x.value&&o("placed")});const R=_(()=>{const S=O.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&S}),N=A("");ae(()=>{s.value&&(N.value=window.getComputedStyle(s.value).zIndex)});const M=_(()=>O.value.arrow?.x??0),X=_(()=>O.value.arrow?.y??0);return tr({placedSide:P,onArrowChange:S=>c.value=S,arrowX:M,arrowY:X,shouldHideArrow:R}),(S,z)=>(D(),Oe("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Ve({...g(b),transform:g(x)?g(b).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:N.value,"--reka-popper-transform-origin":[g(O).transformOrigin?.x,g(O).transformOrigin?.y].join(" "),...g(O).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[le(g(ce),U({ref:g(i)},S.$attrs,{"as-child":n.asChild,as:S.as,"data-side":P.value,"data-align":C.value,style:{animation:g(x)?void 0:"none"}}),{default:E(()=>[q(S.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),or=nr;const rr={top:"bottom",right:"left",bottom:"top",left:"right"};var ir=T({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const{forwardRef:t}=K(),n=er(),o=_(()=>rr[n.placedSide.value]);return(r,i)=>(D(),Oe("span",{ref:s=>{g(n).onArrowChange(s??void 0)},style:Ve({position:"absolute",left:g(n).arrowX?.value?`${g(n).arrowX?.value}px`:void 0,top:g(n).arrowY?.value?`${g(n).arrowY?.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[g(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[g(n).placedSide.value],visibility:g(n).shouldHideArrow.value?"hidden":void 0})},[le(Zn,U(r.$attrs,{ref:g(t),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:E(()=>[q(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),sr=ir,ar=T({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return K(),(n,o)=>(D(),L(g(sr),Ue(Ke(t)),{default:E(()=>[q(n.$slots,"default")]),_:3},16))}}),lr=ar;const Nt="tooltip.open",[Be,ur]=je("TooltipRoot");var cr=T({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;K();const r=Ee(),i=_(()=>n.disableHoverableContent??r.disableHoverableContent.value),s=_(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=_(()=>n.disabled??r.disabled.value),c=_(()=>n.delayDuration??r.delayDuration.value),u=_(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),l=ln(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});se(l,w=>{r.onClose&&(w?(r.onOpen(),document.dispatchEvent(new CustomEvent(Nt))):r.onClose())});const d=A(!1),p=A(),f=_(()=>l.value?d.value?"delayed-open":"instant-open":"closed"),{start:v,stop:m}=un(()=>{d.value=!0,l.value=!0},c,{immediate:!1});function h(){m(),d.value=!1,l.value=!0}function y(){m(),l.value=!1}function b(){v()}return ur({contentId:"",open:l,stateAttribute:f,trigger:p,onTriggerChange(w){p.value=w},onTriggerEnter(){r.isOpenDelayed.value?b():h()},onTriggerLeave(){i.value?y():m()},onOpen:h,onClose:y,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:u}),(w,x)=>(D(),L(g(Kn),null,{default:E(()=>[q(w.$slots,"default",{open:g(l)})]),_:3}))}}),dr=cr,fr=T({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=Be(),i=Ee(),{forwardRef:s,currentElement:a}=K(),c=_(()=>n.ariaLabel||a.value?.textContent),u=_(()=>{const{ariaLabel:l,...d}=n;return pn(d,i.content.value??{},{side:"top",sideOffset:0,align:"center",avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:"partial",hideWhenDetached:!1})});return We(()=>{ot(window,"scroll",l=>{l.target?.contains(r.trigger.value)&&r.onClose()},{capture:!0}),ot(window,Nt,r.onClose)}),(l,d)=>(D(),L(g(In),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:d[0]||(d[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:d[1]||(d[1]=p=>{g(r).disableClosingTrigger.value&&g(r).trigger.value?.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:d[2]||(d[2]=fn(()=>{},["prevent"])),onDismiss:d[3]||(d[3]=p=>g(r).onClose())},{default:E(()=>[le(g(or),U({ref:g(s),"data-state":g(r).stateAttribute.value},{...l.$attrs,...u.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:E(()=>[q(l.$slots,"default"),le(g(Vn),{id:g(r).contentId,role:"tooltip"},{default:E(()=>[cn(dn(c.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),kt=fr,pr=T({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){const n=_t(e),{forwardRef:o,currentElement:r}=K(),{trigger:i,onClose:s}=Be(),a=Ee(),{isPointerInTransit:c,onPointerExit:u}=xn(i,r);return a.isPointerInTransitRef=c,u(()=>{s()}),(l,d)=>(D(),L(kt,U({ref:g(o)},g(n)),{default:E(()=>[q(l.$slots,"default")]),_:3},16))}}),vr=pr,hr=T({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=Be(),i=Ye(n,o),{forwardRef:s}=K();return(a,c)=>(D(),L(g(qn),{present:a.forceMount||g(r).open.value},{default:E(()=>[(D(),L(vn(g(r).disableHoverableContent.value?kt:vr),U({ref:g(s)},g(i)),{default:E(()=>[q(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),mr=hr,gr=T({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,o)=>(D(),L(g(Wn),Ue(Ke(t)),{default:E(()=>[q(n.$slots,"default")]),_:3},16))}}),yr=gr,wr=T({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=Be(),o=Ee();n.contentId||=En(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:i}=K(),s=A(!1),a=A(!1),c=_(()=>n.disabled.value?{}:{click:m,focus:f,pointermove:d,pointerleave:p,pointerdown:l,blur:v});We(()=>{n.onTriggerChange(i.value)});function u(){setTimeout(()=>{s.value=!1},1)}function l(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener("pointerup",u,{once:!0})}function d(h){h.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function p(){n.onTriggerLeave(),a.value=!1}function f(h){s.value||n.ignoreNonKeyboardFocus.value&&!h.target.matches?.(":focus-visible")||n.onOpen()}function v(){n.onClose()}function m(){n.disableClosingTrigger.value||n.onClose()}return(h,y)=>(D(),L(g(Yn),{"as-child":"",reference:h.reference},{default:E(()=>[le(g(ce),U({ref:g(r),"aria-describedby":g(n).open.value?g(n).contentId:void 0,"data-state":g(n).stateAttribute.value,as:h.as,"as-child":t.asChild,"data-grace-area-trigger":""},hn(c.value)),{default:E(()=>[q(h.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),br=wr;const Cr=T({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const r=Ye(e,t);return(i,s)=>(D(),L(g(dr),U({"data-slot":"tooltip"},g(r)),{default:E(a=>[q(i.$slots,"default",Ue(Ke(a)))]),_:3},16))}}),Or=T({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=mn(n,"class"),i=Ye(r,o);return(s,a)=>(D(),L(g(yr),null,{default:E(()=>[le(g(mr),U({"data-slot":"tooltip-content"},{...g(i),...s.$attrs},{class:g(bt)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",n.class)}),{default:E(()=>[q(s.$slots,"default"),le(g(lr),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),Pr=T({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(D(),L(g(br),U({"data-slot":"tooltip-trigger"},t),{default:E(()=>[q(n.$slots,"default")]),_:3},16))}}),Ar=T({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(n,o)=>(D(),L(g(ce),{"data-slot":"button","data-variant":e.variant,"data-size":e.size,as:e.as,"as-child":e.asChild,class:gn(g(bt)(g(xr)({variant:e.variant,size:e.size}),t.class))},{default:E(()=>[q(n.$slots,"default")]),_:3},8,["data-variant","data-size","as","as-child","class"]))}}),xr=yn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});export{In as D,ce as P,Bn as S,Wn as T,Ar as _,qn as a,Ye as b,yn as c,_t as d,Cr as e,Pr as f,Or as g,bn as h,En as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s}from"./
|
|
1
|
+
import{_ as s}from"./De8DvPWL.js";import{_ as a,u as i,o as u,c,a as t,t as n,b as l,w as d,d as f}from"./Jp5cgQZi.js";const p={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},m={class:"max-w-520px text-center"},h=["textContent"],b=["textContent"],x=["textContent"],g={class:"flex items-center justify-center w-full"},y={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},status:{type:Number,default:404},statusText:{type:String,default:"Page not found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(e){const r=e;return i({title:`${r.status} - ${r.statusText} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(k,_)=>{const o=s;return u(),c("div",p,[t("div",m,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:n(e.status)},null,8,h),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:n(e.statusText)},null,8,b),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,x),t("div",g,[l(o,{to:"/",class:"font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"},{default:d(()=>[f(n(e.backHome),1)]),_:1})])])])}}},N=a(y,[["__scopeId","data-v-6fc7f42d"]]);export{N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as ee,k as te,B as pe,w as me,i as ve,b as ge,g as _e,h as be,l as q,m as ye,j as he}from"./DgMMKsPE.js";import{S as W,P as E,u as ae,a as Te,b as Ie,d as we}from"./C0GhHHgI.js";import{r as A,G as w,V as Ce,W as Se,e as C,k as ke,X as J,I as xe,Y as Me,Z as Ae,$ as H,n as se,o as h,g as T,w as n,b as d,i as t,h as x,j as oe,L as ne,a0 as Be,a1 as Fe,f as j,J as le,a2 as Re,D as $e,l as re,a3 as Ee,a4 as qe,y as V,z as O,s as N,a5 as Pe,a6 as Ve,a as Oe,c as P,t as I,F as U,x as Ne,E as G,d as _,H as Ue}from"./Jp5cgQZi.js";import{i as je,g as X}from"./DF2WsXH3.js";function ue(s){const e=je({dir:A("ltr")});return w(()=>s?.value||e.dir?.value||"ltr")}function Z(){const s=A(),e=w(()=>["#text","#comment"].includes(s.value?.$el.nodeName)?s.value?.$el.nextElementSibling:Ce(s));return{primitiveElement:s,currentElement:e}}const Q="data-reka-collection-item";function ie(s={}){const{key:e="",isProvider:l=!1}=s,o=`${e}CollectionProvider`;let i;if(l){const a=A(new Map);i={collectionRef:A(),itemMap:a},Me(o,i)}else i=Se(o);const b=(a=!1)=>{const u=i.collectionRef.value;if(!u)return[];const m=Array.from(u.querySelectorAll(`[${Q}]`)),g=Array.from(i.itemMap.value.values()).sort((M,B)=>m.indexOf(M.ref)-m.indexOf(B.ref));return a?g:g.filter(M=>M.ref.dataset.disabled!=="")},c=C({name:"CollectionSlot",inheritAttrs:!1,setup(a,{slots:u,attrs:m}){const{primitiveElement:k,currentElement:g}=Z();return xe(g,()=>{i.collectionRef.value=g.value}),()=>J(W,{ref:k,...m},u)}}),f=C({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(a,{slots:u,attrs:m}){const{primitiveElement:k,currentElement:g}=Z();return ke(M=>{if(g.value){const B=Ae(g.value);i.itemMap.value.set(B,{ref:g.value,value:a.value}),M(()=>i.itemMap.value.delete(B))}}),()=>J(W,{...m,[Q]:"",ref:k},u)}}),p=w(()=>Array.from(i.itemMap.value.values())),r=w(()=>i.itemMap.value.size);return{getItems:b,reactiveItems:p,itemMapSize:r,CollectionSlot:c,CollectionItem:f}}const De="rovingFocusGroup.onEntryFocus",ze={bubbles:!1,cancelable:!0},Ke={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Le(s,e){return e!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function Ge(s,e,l){const o=Le(s.key,l);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Ke[o]}function de(s,e=!1){const l=X();for(const o of s)if(o===l||(o.focus({preventScroll:e}),X()!==l))return}function He(s,e){return s.map((l,o)=>s[(e+o)%s.length])}const[Ye,We]=oe("RovingFocusGroup");var Je=C({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(s,{expose:e,emit:l}){const o=s,i=l,{loop:b,orientation:c,dir:f}=H(o),p=ue(f),r=se(o,"currentTabStopId",i,{defaultValue:o.defaultCurrentTabStopId,passive:o.currentTabStopId===void 0}),a=A(!1),u=A(!1),m=A(0),{getItems:k,CollectionSlot:g}=ie({isProvider:!0});function M(y){const F=!u.value;if(y.currentTarget&&y.target===y.currentTarget&&F&&!a.value){const R=new CustomEvent(De,ze);if(y.currentTarget.dispatchEvent(R),i("entryFocus",R),!R.defaultPrevented){const $=k().map(v=>v.ref).filter(v=>v.dataset.disabled!==""),D=$.find(v=>v.getAttribute("data-active")===""),z=$.find(v=>v.getAttribute("data-highlighted")===""),K=$.find(v=>v.id===r.value),L=[D,z,K,...$].filter(Boolean);de(L,o.preventScrollOnEntryFocus)}}u.value=!1}function B(){setTimeout(()=>{u.value=!1},1)}return e({getItems:k}),We({loop:b,dir:p,orientation:c,currentTabStopId:r,onItemFocus:y=>{r.value=y},onItemShiftTab:()=>{a.value=!0},onFocusableItemAdd:()=>{m.value++},onFocusableItemRemove:()=>{m.value--}}),(y,F)=>(h(),T(t(g),null,{default:n(()=>[d(t(E),{tabindex:a.value||m.value===0?-1:0,"data-orientation":t(c),as:y.as,"as-child":y.asChild,dir:t(p),style:{outline:"none"},onMousedown:F[0]||(F[0]=R=>u.value=!0),onMouseup:B,onFocus:M,onBlur:F[1]||(F[1]=R=>a.value=!1)},{default:n(()=>[x(y.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),Xe=Je,Ze=C({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){const e=s,l=Ye(),o=ae(),i=w(()=>e.tabStopId||o),b=w(()=>l.currentTabStopId.value===i.value),{getItems:c,CollectionItem:f}=ie();ne(()=>{e.focusable&&l.onFocusableItemAdd()}),Be(()=>{e.focusable&&l.onFocusableItemRemove()});function p(r){if(r.key==="Tab"&&r.shiftKey){l.onItemShiftTab();return}if(r.target!==r.currentTarget)return;const a=Ge(r,l.orientation.value,l.dir.value);if(a!==void 0){if(r.metaKey||r.ctrlKey||r.altKey||!e.allowShiftKey&&r.shiftKey)return;r.preventDefault();let u=[...c().map(m=>m.ref).filter(m=>m.dataset.disabled!=="")];if(a==="last")u.reverse();else if(a==="prev"||a==="next"){a==="prev"&&u.reverse();const m=u.indexOf(r.currentTarget);u=l.loop.value?He(u,m+1):u.slice(m+1)}Fe(()=>de(u))}}return(r,a)=>(h(),T(t(f),null,{default:n(()=>[d(t(E),{tabindex:b.value?0:-1,"data-orientation":t(l).orientation.value,"data-active":r.active?"":void 0,"data-disabled":r.focusable?void 0:"",as:r.as,"as-child":r.asChild,onMousedown:a[0]||(a[0]=u=>{r.focusable?t(l).onItemFocus(i.value):u.preventDefault()}),onFocus:a[1]||(a[1]=u=>t(l).onItemFocus(i.value)),onKeydown:p},{default:n(()=>[x(r.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),Qe=Ze;const[Y,et]=oe("TabsRoot");var tt=C({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(s,{emit:e}){const l=s,o=e,{orientation:i,unmountOnHide:b,dir:c}=H(l),f=ue(c);j();const p=se(l,"modelValue",o,{defaultValue:l.defaultValue,passive:l.modelValue===void 0}),r=A(),a=le(new Set);return et({modelValue:p,changeModelValue:u=>{p.value=u},orientation:i,dir:f,unmountOnHide:b,activationMode:l.activationMode,baseId:ae(void 0,"reka-tabs"),tabsList:r,contentIds:a,registerContent:u=>{a.value=new Set([...a.value,u])},unregisterContent:u=>{const m=new Set(a.value);m.delete(u),a.value=m}}),(u,m)=>(h(),T(t(E),{dir:t(f),"data-orientation":t(i),"as-child":u.asChild,as:u.as},{default:n(()=>[x(u.$slots,"default",{modelValue:t(p)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),at=tt;function ce(s,e){return`${s}-trigger-${e}`}function fe(s,e){return`${s}-content-${e}`}var st=C({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const e=s,{forwardRef:l}=j(),o=Y(),i=w(()=>ce(o.baseId,e.value)),b=w(()=>fe(o.baseId,e.value)),c=w(()=>e.value===o.modelValue.value),f=A(c.value);return ne(()=>{o.registerContent(e.value),requestAnimationFrame(()=>{f.value=!1})}),Re(()=>{o.unregisterContent(e.value)}),(p,r)=>(h(),T(t(Te),{present:p.forceMount||c.value,"force-mount":""},{default:n(({present:a})=>[d(t(E),{id:b.value,ref:t(l),"as-child":p.asChild,as:p.as,role:"tabpanel","data-state":c.value?"active":"inactive","data-orientation":t(o).orientation.value,"aria-labelledby":i.value,hidden:!a,tabindex:"0",style:$e({animationDuration:f.value?"0s":void 0})},{default:n(()=>[!t(o).unmountOnHide.value||a?x(p.$slots,"default",{key:0}):re("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ot=st,nt=C({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const e=s,{loop:l}=H(e),{forwardRef:o,currentElement:i}=j(),b=Y();return b.tabsList=i,(c,f)=>(h(),T(t(Xe),{"as-child":"",orientation:t(b).orientation.value,dir:t(b).dir.value,loop:t(l)},{default:n(()=>[d(t(E),{ref:t(o),role:"tablist","as-child":c.asChild,as:c.as,"aria-orientation":t(b).orientation.value},{default:n(()=>[x(c.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),lt=nt,rt=C({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(s){const e=s,{forwardRef:l}=j(),o=Y(),i=w(()=>ce(o.baseId,e.value)),b=w(()=>o.contentIds.value.has(e.value)?fe(o.baseId,e.value):void 0),c=w(()=>e.value===o.modelValue.value);return(f,p)=>(h(),T(t(Qe),{"as-child":"",focusable:!f.disabled,active:c.value},{default:n(()=>[d(t(E),{id:i.value,ref:t(l),role:"tab",type:f.as==="button"?"button":void 0,as:f.as,"as-child":f.asChild,"aria-selected":c.value?"true":"false","aria-controls":b.value,"data-state":c.value?"active":"inactive",disabled:f.disabled,"data-disabled":f.disabled?"":void 0,"data-orientation":t(o).orientation.value,onMousedown:p[0]||(p[0]=qe(r=>{!f.disabled&&r.ctrlKey===!1?t(o).changeModelValue(f.value):r.preventDefault()},["left"])),onKeydown:p[1]||(p[1]=Ee(r=>t(o).changeModelValue(f.value),["enter","space"])),onFocus:p[2]||(p[2]=()=>{const r=t(o).activationMode!=="manual";!c.value&&!f.disabled&&r&&t(o).changeModelValue(f.value)})},{default:n(()=>[x(f.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),ut=rt;const it=C({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(s,{emit:e}){const l=s,o=e,i=V(l,"class"),b=Ie(i,o);return(c,f)=>(h(),T(t(at),O({"data-slot":"tabs"},t(b),{class:t(N)("flex flex-col gap-2",l.class)}),{default:n(p=>[x(c.$slots,"default",Pe(Ve(p)))]),_:3},16,["class"]))}}),dt=C({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(s){const e=s,l=V(e,"class");return(o,i)=>(h(),T(t(ot),O({"data-slot":"tabs-content",class:t(N)("flex-1 outline-none",e.class)},t(l)),{default:n(()=>[x(o.$slots,"default")]),_:3},16,["class"]))}}),ct=C({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(s){const e=s,l=V(e,"class");return(o,i)=>(h(),T(t(lt),O({"data-slot":"tabs-list"},t(l),{class:t(N)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e.class)}),{default:n(()=>[x(o.$slots,"default")]),_:3},16,["class"]))}}),ft=C({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(s){const e=s,l=V(e,"class"),o=we(l);return(i,b)=>(h(),T(t(ut),O({"data-slot":"tabs-trigger",class:t(N)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e.class)},t(o)),{default:n(()=>[x(i.$slots,"default")]),_:3},16,["class"]))}}),pt={class:"flex items-center justify-center py-10"},mt=C({__name:"TableEmpty",props:{class:{type:[Boolean,null,String,Object,Array]},colspan:{default:1}},setup(s){const e=s,l=V(e,"class");return(o,i)=>(h(),T(ee,null,{default:n(()=>[d(te,O({class:t(N)("p-4 whitespace-nowrap align-middle text-sm text-foreground",e.class)},t(l)),{default:n(()=>[Oe("div",pt,[x(o.$slots,"default")])]),_:3},16,["class"])]),_:3}))}}),vt={key:0,class:"text-xs text-destructive"},gt=C({name:"UsageAnalyticsTokenUsageTabsPanel",__name:"TokenUsageTabsPanel",props:{dailyItems:{},errorMessage:{},loading:{type:Boolean},weeklyItems:{},monthlyItems:{},sessionItems:{},pageSize:{default:10},productName:{default:"Product"}},setup(s){const e=s,l=le("day"),o=Ue({day:1,month:1,session:1,week:1}),i=[{heading:"Date",label:"Day",value:"day"},{heading:"Week",label:"Week",value:"week"},{heading:"Month",label:"Month",value:"month"},{heading:"Session ID",label:"Session",value:"session"}],b=w(()=>({day:e.dailyItems,month:e.monthlyItems,session:e.sessionItems,week:e.weeklyItems})),c=w(()=>Object.fromEntries(i.map(r=>{const a=b.value[r.value],u=Math.max(1,Math.ceil(a.length/e.pageSize)),m=Math.min(o[r.value],u),k=(m-1)*e.pageSize;return[r.value,{items:a,page:m,pageCount:u,paginatedItems:a.slice(k,k+e.pageSize)}]})));function f(r,a){const u=c.value[r].pageCount;o[r]=Math.min(u,Math.max(1,a))}function p(r){return r.length>0?r.join(", "):"None"}return(r,a)=>{const u=me,m=ft,k=ct,g=_e,M=ee,B=ge,y=te,F=mt,R=be,$=ve,D=he,z=dt,K=it,L=pe;return h(),T(L,{description:`Browse ${s.productName} token consumption by day, week, month, or session.`,icon:"lucide:table-2",title:`${s.productName} Token Usage`},{default:n(()=>[s.errorMessage?(h(),P("p",vt,I(s.errorMessage),1)):s.loading?(h(),P(U,{key:1},[d(u,{class:"h-10 w-64 rounded-md"}),d(u,{class:"mt-4 h-72 w-full rounded-md"})],64)):(h(),T(K,{key:2,modelValue:t(l),"onUpdate:modelValue":a[0]||(a[0]=v=>Ne(l)?l.value=v:null)},{default:n(()=>[d(k,{class:"grid w-full grid-cols-4 sm:w-fit"},{default:n(()=>[(h(),P(U,null,G(i,v=>d(m,{key:v.value,value:v.value},{default:n(()=>[_(I(v.label),1)]),_:2},1032,["value"])),64))]),_:1}),(h(),P(U,null,G(i,v=>d(z,{key:v.value,class:"mt-4",value:v.value},{default:n(()=>[d($,null,{default:n(()=>[d(B,null,{default:n(()=>[d(M,null,{default:n(()=>[d(g,null,{default:n(()=>[_(I(v.heading),1)]),_:2},1024),d(g,null,{default:n(()=>[...a[1]||(a[1]=[_("Models",-1)])]),_:1}),d(g,null,{default:n(()=>[...a[2]||(a[2]=[_("Projects",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[3]||(a[3]=[_(" Sessions ",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[4]||(a[4]=[_(" Input ",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[5]||(a[5]=[_(" Output ",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[6]||(a[6]=[_(" Reasoning ",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[7]||(a[7]=[_(" Cache Read ",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[8]||(a[8]=[_(" Total Tokens ",-1)])]),_:1}),d(g,{class:"text-right"},{default:n(()=>[...a[9]||(a[9]=[_(" Cost ",-1)])]),_:1})]),_:2},1024)]),_:2},1024),d(R,null,{default:n(()=>[(h(!0),P(U,null,G(t(c)[v.value].paginatedItems,S=>(h(),T(M,{key:S.id},{default:n(()=>[d(y,{class:"max-w-72 truncate font-medium"},{default:n(()=>[_(I(S.label),1)]),_:2},1024),d(y,null,{default:n(()=>[_(I(p(S.models)),1)]),_:2},1024),d(y,{class:"max-w-56 truncate"},{default:n(()=>[_(I(p(S.projects)),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(S.sessionCount),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(t(q)(S.inputTokens)),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(t(q)(S.outputTokens)),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(t(q)(S.reasoningOutputTokens)),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(t(q)(S.cachedInputTokens)),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(t(q)(S.totalTokens)),1)]),_:2},1024),d(y,{class:"text-right tabular-nums"},{default:n(()=>[_(I(("formatCurrency"in r?r.formatCurrency:t(ye))(S.costUSD)),1)]),_:2},1024)]),_:2},1024))),128)),t(c)[v.value].items.length===0?(h(),T(F,{key:0,colspan:10},{default:n(()=>[_(" No "+I(s.productName)+" token usage found. ",1)]),_:1})):re("",!0)]),_:2},1024)]),_:2},1024),d(D,{page:t(c)[v.value].page,"page-count":t(c)[v.value].pageCount,"page-size":s.pageSize,total:t(c)[v.value].items.length,"onUpdate:page":S=>f(v.value,S)},null,8,["page","page-count","page-size","total","onUpdate:page"])]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"]))]),_:1},8,["description","title"])}}}),Tt=Object.assign(gt,{__name:"UsageAnalyticsTokenUsageTabsPanel"});export{mt as _,ct as a,ft as b,dt as c,Tt as d,it as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./Jp5cgQZi.js";function o(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}const[l]=t("ConfigProvider");export{o as g,l as i};
|