@misha_misha/agentwatch 0.0.4 → 0.1.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.
Files changed (57) hide show
  1. package/README.md +11 -4
  2. package/dist/index.js +3273 -494
  3. package/dist/web/assets/ActiveShapeUtils-CtEvtbYg.js +1 -0
  4. package/dist/web/assets/Bar-DEgd_1jq.js +1 -0
  5. package/dist/web/assets/BarChart-CLHGmIz1.js +1 -0
  6. package/dist/web/assets/CartesianChart-DgJKUG1O.js +1 -0
  7. package/dist/web/assets/CategoricalChart-DEGrE0Qv.js +33 -0
  8. package/dist/web/assets/ErrorBarContext-BMnGmrrB.js +1 -0
  9. package/dist/web/assets/Legend-CEa2zCmi.js +4 -0
  10. package/dist/web/assets/Line-CCyE37cb.js +1 -0
  11. package/dist/web/assets/LineChart-DmMubyEd.js +1 -0
  12. package/dist/web/assets/ProjectActivity-BG5hEcJl.js +1 -0
  13. package/dist/web/assets/ProjectYield-vVxXaT6e.js +1 -0
  14. package/dist/web/assets/SessionActivity-BUzJpWwc.js +1 -0
  15. package/dist/web/assets/SessionCompaction-Dx3tbM9N.js +1 -0
  16. package/dist/web/assets/{SessionDiffs-LZrXV0AY.js → SessionDiffs-CDUkVqua.js} +3 -3
  17. package/dist/web/assets/SessionGraph-DWP1YyP0.js +1 -0
  18. package/dist/web/assets/SessionReplay-kz1EhiaI.js +1 -0
  19. package/dist/web/assets/SessionTokens-BjuXcVM2.js +1 -0
  20. package/dist/web/assets/SessionYield-DXF-Xb5T.js +1 -0
  21. package/dist/web/assets/Settings-CXCDYvsc.js +1 -0
  22. package/dist/web/assets/Trends-wdNqOtnn.js +1 -0
  23. package/dist/web/assets/arrow-left-B-iQ08P0.js +1 -0
  24. package/dist/web/assets/chart-column-BwF4X7mz.js +1 -0
  25. package/dist/web/assets/clsx-DnEFlO87.js +1 -0
  26. package/dist/web/assets/{clsx-DsHpp3Uj.js → createLucideIcon-Bjwrp8ZV.js} +1 -1
  27. package/dist/web/assets/dist-BYqqB4pa.js +1 -0
  28. package/dist/web/assets/file-pen-CHXP3wF7.js +1 -0
  29. package/dist/web/assets/getRadiusAndStrokeWidthFromDot-CFcPogcT.js +1 -0
  30. package/dist/web/assets/graphicalItemSelectors-DJeUEv0O.js +1 -0
  31. package/dist/web/assets/index-CJArQihV.js +2 -0
  32. package/dist/web/assets/index-CTAomrBX.css +1 -0
  33. package/dist/web/assets/play-ONoP4Jfr.js +1 -0
  34. package/dist/web/assets/tooltipContext-BT7phkqZ.js +1 -0
  35. package/dist/web/assets/triangle-alert-BhvAiLmv.js +1 -0
  36. package/dist/web/assets/useMutation-CfQYV-vU.js +1 -0
  37. package/dist/web/index.html +12 -11
  38. package/package.json +1 -1
  39. package/dist/web/assets/CartesianChart-CZSKepVZ.js +0 -33
  40. package/dist/web/assets/LineChart-BYjz-1bE.js +0 -1
  41. package/dist/web/assets/SessionCompaction-Duzo69wv.js +0 -1
  42. package/dist/web/assets/SessionGraph-Bb1BdCWf.js +0 -1
  43. package/dist/web/assets/SessionReplay-C3AZoYFc.js +0 -1
  44. package/dist/web/assets/SessionTokens-B6wfOhyn.js +0 -1
  45. package/dist/web/assets/Settings-HKanGbBq.js +0 -1
  46. package/dist/web/assets/Trends-p9DnVxWQ.js +0 -1
  47. package/dist/web/assets/arrow-left-Bg6VjX8-.js +0 -1
  48. package/dist/web/assets/chart-column-Brz7pC96.js +0 -1
  49. package/dist/web/assets/dist-w_zu0rIf.js +0 -1
  50. package/dist/web/assets/file-pen-DWwu4Q-r.js +0 -1
  51. package/dist/web/assets/graphicalItemSelectors-Dk1a_HU_.js +0 -4
  52. package/dist/web/assets/index-Bu9taSiK.js +0 -2
  53. package/dist/web/assets/index-CJPUO3dh.css +0 -1
  54. package/dist/web/assets/play-B0mJPrwl.js +0 -1
  55. package/dist/web/assets/triangle-alert-Bx2lGvGN.js +0 -1
  56. package/dist/web/assets/useMutation-BvFLVjYz.js +0 -1
  57. /package/dist/web/assets/{format-zw6IoTwZ.js → format-zsCsqELF.js} +0 -0
@@ -1 +0,0 @@
1
- import{F as e,M as t,N as n,t as r}from"./clsx-DsHpp3Uj.js";import{$ as i,At as a,Bt as o,Ct as s,D as c,E as l,F as u,Gt as d,It as f,Mt as p,Pt as m,Q as h,R as g,Rt as _,S as v,Tt as y,W as b,Wt as x,Xt as S,Yt as C,Z as w,_ as T,a as E,b as D,et as O,f as k,g as A,h as ee,ht as j,i as M,it as N,m as te,nt as ne,o as re,p as ie,qt as P,rt as ae,st as F,t as oe,tt as I,ut as se,v as ce,vt as L,wt as R,x as le,xt as z,z as ue}from"./CartesianChart-CZSKepVZ.js";var de=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),fe=n(((e,t)=>{t.exports=de().isPlainObject})),B=e(t()),pe,me,he,ge,_e;function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?V(Object(n),!0).forEach(function(t){ve(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ve(e,t,n){return(t=ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e){var t=be(e,`string`);return typeof t==`symbol`?t:t+``}function be(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function W(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var G=(e,t,n,r,i)=>{var a=n-r,o=d(pe||=W([`M `,`,`,``]),e,t);return o+=d(me||=W([`L `,`,`,``]),e+n,t),o+=d(he||=W([`L `,`,`,``]),e+n-a/2,t+i),o+=d(ge||=W([`L `,`,`,``]),e+n-a/2-r,t+i),o+=d(_e||=W([`L `,`,`,` Z`]),e,t),o},xe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Se=e=>{var t=m(e,xe),{x:n,y:i,upperWidth:a,lowerWidth:o,height:s,className:c}=t,{animationEasing:l,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,p=(0,B.useRef)(null),[h,g]=(0,B.useState)(-1),v=(0,B.useRef)(a),y=(0,B.useRef)(o),b=(0,B.useRef)(s),x=(0,B.useRef)(n),S=(0,B.useRef)(i),w=O(e,`trapezoid-`);if((0,B.useEffect)(()=>{if(p.current&&p.current.getTotalLength)try{var e=p.current.getTotalLength();e&&g(e)}catch{}},[]),n!==+n||i!==+i||a!==+a||o!==+o||s!==+s||a===0&&o===0||s===0)return null;var T=r(`recharts-trapezoid`,c);if(!f)return B.createElement(`g`,null,B.createElement(`path`,U({},C(t),{className:T,d:G(n,i,a,o,s)})));var E=v.current,D=y.current,k=b.current,A=x.current,ee=S.current,j=`0px ${h===-1?1:h}px`,M=`${h}px ${h}px`,N=ne([`strokeDasharray`],u,l);return B.createElement(I,{animationId:w,key:w,canBegin:h>0,duration:u,easing:l,isActive:f,begin:d},e=>{var r=_(E,a,e),c=_(D,o,e),l=_(k,s,e),u=_(A,n,e),d=_(ee,i,e);p.current&&(v.current=r,y.current=c,b.current=l,x.current=u,S.current=d);var f=e>0?{transition:N,strokeDasharray:M}:{strokeDasharray:j};return B.createElement(`path`,U({},C(t),{className:T,d:G(u,d,r,c,l),ref:p,style:H(H({},f),t.style)}))})},Ce=e(fe()),we=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function Te(e,t){if(e==null)return{};var n,r,i=Ee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?K(Object(n),!0).forEach(function(t){De(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function De(e,t,n){return(t=Oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oe(e){var t=ke(e,`string`);return typeof t==`symbol`?t:t+``}function ke(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ae(e,t){return q(q({},t),e)}function je(e,t){return e===`symbols`}function J(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return B.createElement(i,n);case`trapezoid`:return B.createElement(Se,n);case`sector`:return B.createElement(h,n);case`symbols`:if(je(t,n))return B.createElement(f,n);break;case`curve`:return B.createElement(ae,n);default:return null}}function Me(e){return(0,B.isValidElement)(e)?e.props:e}function Y(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=Te(e,we),o;if((0,B.isValidElement)(t))o=(0,B.cloneElement)(t,q(q({},a),Me(t)));else if(typeof t==`function`)o=t(a,a.index);else if((0,Ce.default)(t)&&typeof t!=`boolean`){var s=Ae(t,a);o=B.createElement(J,{shapeType:n,elementProps:s})}else{var c=a;o=B.createElement(J,{shapeType:n,elementProps:c})}return a.isActive?B.createElement(P,{className:r},o):B.createElement(P,{className:i},o)}var Ne=[`children`];function Pe(e,t){if(e==null)return{};var n,r,i=Fe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ie=(0,B.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function Le(e){var{children:t}=e,n=Pe(e,Ne);return B.createElement(Ie.Provider,{value:n},t)}var Re=(e,t,n,r)=>u(e,`xAxis`,t,r),ze=(e,t,n,r)=>g(e,`xAxis`,t,r),Be=(e,t,n,r)=>u(e,`yAxis`,n,r),Ve=(e,t,n,r)=>g(e,`yAxis`,n,r),He=a([F,Re,Be,ze,Ve],(e,t,n,r,i)=>y(e,`xAxis`)?L(t,r,!1):L(n,i,!1)),Ue=(e,t,n,r,i)=>i;function We(e){return e.type===`line`}var Ge=a([F,Re,Be,ze,Ve,a([ue,Ue],(e,t)=>e.filter(We).find(e=>e.id===t)),He,w],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return mt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}}),Ke=[`id`],qe=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],Je=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}function Ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ye(Object(n),!0).forEach(function(t){Xe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xe(e,t,n){return(t=Ze(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(e){var t=Qe(e,`string`);return typeof t==`symbol`?t:t+``}function Qe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){if(e==null)return{};var n,r,i=$e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var et=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:s(n,t),payload:e}]},tt=B.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:c,unit:l,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:x,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:s(o,t),hide:c,type:u,color:r,unit:l,graphicalItemId:d}};return B.createElement(ce,{tooltipEntrySettings:f})}),$=(e,t)=>`${t}px ${e}px`;function nt(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var rt=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return $(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...nt(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function it(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=S(Q(r,Ke));return B.createElement(te,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function at(e){var{showLabels:t,children:n,points:r}=e,i=(0,B.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return B.createElement(le,{value:t?i:void 0},n)}function ot(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=Z(Z({},C(Q(a,qe))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return B.createElement(B.Fragment,null,r?.length>1&&B.createElement(Y,X({shapeType:`curve`,option:u},d,{pathRef:n})),B.createElement(it,{points:r,clipPathId:t,props:a}))}function st(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function ct(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,animateNewValues:f,width:p,height:m,onAnimationEnd:h,onAnimationStart:g}=n,y=i.current,b=O(o,`recharts-line-`),x=(0,B.useRef)(b),[S,C]=(0,B.useState)(!1),w=!S,T=(0,B.useCallback)(()=>{typeof h==`function`&&h(),C(!1)},[h]),E=(0,B.useCallback)(()=>{typeof g==`function`&&g(),C(!0)},[g]),D=st(r.current),k=(0,B.useRef)(0);x.current!==b&&(k.current=a.current,x.current=b);var A=k.current;return B.createElement(at,{points:o,showLabels:w},n.children,B.createElement(I,{animationId:b,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:T,onAnimationStart:E,key:b},e=>{var l=_(A,D+A,e),u=Math.min(l,D),d=c?s?rt(u,D,`${s}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):$(D,u):s==null?void 0:String(s);if(e>0&&D>0&&(i.current=o,a.current=Math.max(a.current,u)),y){var h=y.length/o.length,g=e===1?o:o.map((t,n)=>{var r=Math.floor(n*h);if(y[r]){var i=y[r];return Z(Z({},t),{},{x:_(i.x,t.x,e),y:_(i.y,t.y,e)})}return f?Z(Z({},t),{},{x:_(p*2,t.x,e),y:_(m/2,t.y,e)}):Z(Z({},t),{},{x:t.x,y:t.y})});return i.current=g,B.createElement(ot,{props:n,points:g,clipPathId:t,pathRef:r,strokeDasharray:d})}return B.createElement(ot,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:d})}),B.createElement(v,{label:n.label}))}function lt(e){var{clipPathId:t,props:n}=e,r=(0,B.useRef)(null),i=(0,B.useRef)(0),a=(0,B.useRef)(null);return B.createElement(ct,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var ut=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:R(e.payload,t)}),dt=class extends B.Component{render(){var{hide:e,dot:t,points:n,className:i,xAxisId:a,yAxisId:o,top:s,left:l,width:u,height:d,id:f,needClip:p,zIndex:m}=this.props;if(e)return null;var h=r(`recharts-line`,i),g=f,{r:_,strokeWidth:v}=M(t),y=D(t),b=_*2+v,x=p?`url(#clipPath-${y?``:`dots-`}${g})`:void 0;return B.createElement(c,{zIndex:m},B.createElement(P,{className:h},p&&B.createElement(`defs`,null,B.createElement(E,{clipPathId:g,xAxisId:a,yAxisId:o}),!y&&B.createElement(`clipPath`,{id:`clipPath-dots-${g}`},B.createElement(`rect`,{x:l-b/2,y:s-b/2,width:u+b,height:d+b}))),B.createElement(Le,{xAxisId:a,yAxisId:o,data:n,dataPointFormatter:ut,errorBarOffset:0},B.createElement(lt,{props:this.props,clipPathId:g}))),B.createElement(k,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:x}))}},ft={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:b.line,type:`linear`};function pt(e){var t=m(e,ft),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:s,dot:c,hide:l,isAnimationActive:u,label:d,legendType:f,xAxisId:h,yAxisId:g,id:_}=t,v=Q(t,Je),{needClip:y}=re(h,g),b=ie(),x=se(),S=j(),C=p(e=>Ge(e,h,g,S,_));if(x!==`horizontal`&&x!==`vertical`||C==null||b==null)return null;var{height:w,width:T,x:E,y:D}=b;return B.createElement(dt,X({},v,{id:_,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:h,yAxisId:g,points:C,layout:x,height:w,width:T,left:E,top:D,needClip:y}))}function mt(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:s,bandSize:c,displayedData:l}=e;return l.map((e,l)=>{var u=R(e,s);if(t===`horizontal`)return{x:z({axis:n,ticks:i,bandSize:c,entry:e,index:l}),y:(o(u)?null:r.scale.map(u))??null,value:u,payload:e};var d=o(u)?null:n.scale.map(u),f=z({axis:r,ticks:a,bandSize:c,entry:e,index:l});return d==null||f==null?null:{x:d,y:f,value:u,payload:e}}).filter(Boolean)}function ht(e){var t=m(e,ft),n=j();return B.createElement(A,{id:t.id,type:`line`},e=>B.createElement(B.Fragment,null,B.createElement(T,{legendPayload:et(t)}),B.createElement(tt,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),B.createElement(ee,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),B.createElement(pt,X({},t,{id:e}))))}var gt=B.memo(ht,N);gt.displayName=`Line`;var _t=[`axis`],vt=(0,B.forwardRef)((e,t)=>B.createElement(oe,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:_t,tooltipPayloadSearcher:l,categoricalChartProps:e,ref:t}));export{Y as i,gt as n,Le as r,vt as t};
@@ -1 +0,0 @@
1
- import{F as e,M as t,a as n,c as r,r as i,t as a}from"./clsx-DsHpp3Uj.js";import{l as o,n as s}from"./dist-w_zu0rIf.js";import{t as c}from"./arrow-left-Bg6VjX8-.js";import{i as l}from"./format-zw6IoTwZ.js";import{B as u,C as d,D as ee,Dt as f,Mt as p,P as m,Pt as h,T as g,V as _,Vt as v,W as y,Yt as b,c as x,d as S,ht as C,jt as w,l as T,mt as E,n as D,pt as O,qt as te,r as k,s as A,u as j,w as M}from"./CartesianChart-CZSKepVZ.js";import{n as N,t as P}from"./LineChart-BYjz-1bE.js";var F=class{constructor(e){var{x:t,y:n}=e;this.xAxisScale=t,this.yAxisScale=n}map(e,t){var{position:n}=t;return{x:this.xAxisScale.map(e.x,{position:n})??0,y:this.yAxisScale.map(e.y,{position:n})??0}}mapWithFallback(e,t){var{position:n,fallback:r}=t,i=r===`rangeMin`?this.yAxisScale.rangeMin():r===`rangeMax`?this.yAxisScale.rangeMax():0,a=r===`rangeMin`?this.xAxisScale.rangeMin():r===`rangeMax`?this.xAxisScale.rangeMax():0;return{x:this.xAxisScale.map(e.x,{position:n})??a,y:this.yAxisScale.map(e.y,{position:n})??i}}isInRange(e){var{x:t,y:n}=e,r=t==null||this.xAxisScale.isInRange(t),i=n==null||this.yAxisScale.isInRange(n);return r&&i}},I=e(t());function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?L(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=V(e,`string`);return typeof t==`symbol`?t:t+``}function V(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H.apply(null,arguments)}var U=(e,t)=>{var n;if(I.isValidElement(e))n=I.cloneElement(e,t);else if(typeof e==`function`)n=e(t);else{if(!f(t.x1)||!f(t.y1)||!f(t.x2)||!f(t.y2))return null;n=I.createElement(`line`,H({},t,{className:`recharts-reference-line-line`}))}return n},W=(e,t,n,r,i,a)=>{var{x:o,width:s}=a,c=i.map(e,{position:n});if(!f(c)||t===`discard`&&!i.isInRange(c))return null;var l=[{x:o+s,y:c},{x:o,y:c}];return r===`left`?l.reverse():l},G=(e,t,n,r,i,a)=>{var{y:o,height:s}=a,c=i.map(e,{position:n});if(!f(c)||t===`discard`&&!i.isInRange(c))return null;var l=[{x:c,y:o+s},{x:c,y:o}];return r===`top`?l.reverse():l},K=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:`rangeMin`}),r.mapWithFallback(e[1],{position:n,fallback:`rangeMax`})];return t===`discard`&&i.some(e=>!r.isInRange(e))?null:i},q=(e,t,n,r,i,a,o)=>{var{x:s,y:c,segment:l,ifOverflow:u}=o,d=v(s);return v(c)?W(c,u,r,a,t,n):d?G(s,u,r,i,e,n):l!=null&&l.length===2?K(l,u,r,new F({x:e,y:t})):null};function J(e){var t=w();return(0,I.useEffect)(()=>(t(T(e)),()=>{t(j(e))})),null}function Y(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:o}=e,s=C(),c=x(),l=p(e=>u(e,t)),f=p(e=>_(e,n)),h=p(e=>m(e,`xAxis`,t,s)),g=p(e=>m(e,`yAxis`,n,s)),v=O();if(!c||!v||l==null||f==null||h==null||g==null)return null;var y=q(h,g,v,e.position,l.orientation,f.orientation,e);if(!y)return null;var w=y[0],T=y[1];if(w==null||T==null)return null;var{x:E,y:D}=w,{x:k,y:A}=T,j=R(R({clipPath:o===`hidden`?`url(#${c})`:void 0},b(e)),{},{x1:E,y1:D,x2:k,y2:A}),N=S({x1:E,y1:D,x2:k,y2:A});return I.createElement(ee,{zIndex:e.zIndex},I.createElement(te,{className:a(`recharts-reference-line`,i)},U(r,j),I.createElement(d,H({},N,{lowerWidth:N.width,upperWidth:N.width}),I.createElement(M,{label:e.label}),e.children)))}var X={ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,label:!1,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`,zIndex:y.line};function Z(e){var t=h(e,X);return I.createElement(I.Fragment,null,I.createElement(J,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),I.createElement(Y,t))}Z.displayName=`ReferenceLine`;var Q=r();function ne(){let{id:e=``}=o(),t=n({queryKey:[`session-compaction`,e],queryFn:()=>i.sessionCompaction(e),refetchInterval:3e3});if(t.isLoading)return(0,Q.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});let r=t.data?.series;if(!r)return(0,Q.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`no series data`});let a=r.points.map((e,t)=>({i:t,time:l(e.ts),kind:e.kind,fill:Math.round(e.fillBefore*100),fillAfter:e.fillAfter==null?null:Math.round(e.fillAfter*100),label:e.label})),u=a.filter(e=>e.kind===`compaction`);return(0,Q.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,Q.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,Q.jsx)(s,{to:`/sessions/${encodeURIComponent(e)}`,className:`text-fg-dim hover:text-accent`,children:(0,Q.jsx)(c,{className:`w-4 h-4 inline`})}),(0,Q.jsx)(`h1`,{className:`text-lg font-bold`,children:`context / compaction`}),(0,Q.jsx)(`span`,{className:`text-sm text-fg-dim mono`,children:e.slice(0,16)})]}),(0,Q.jsxs)(`div`,{className:`px-5 py-4 grid grid-cols-4 gap-3 border-b border-bg-border`,children:[(0,Q.jsx)($,{label:`context window`,value:r.contextWindow.toLocaleString()}),(0,Q.jsx)($,{label:`max fill`,value:`${Math.round(r.maxFill*100)}%`}),(0,Q.jsx)($,{label:`compactions`,value:String(r.compactionCount)}),(0,Q.jsx)($,{label:`turns`,value:String(r.points.filter(e=>e.kind===`turn`).length)})]}),(0,Q.jsxs)(`div`,{className:`p-5`,children:[(0,Q.jsx)(`div`,{className:`text-xs uppercase text-fg-muted mb-2`,children:`context fill % over time`}),(0,Q.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-3`,style:{height:340},children:(0,Q.jsx)(E,{children:(0,Q.jsxs)(P,{data:a,children:[(0,Q.jsx)(A,{strokeDasharray:`3 3`,stroke:`#2b3139`}),(0,Q.jsx)(k,{dataKey:`i`,stroke:`#7d8590`,tick:{fontSize:10}}),(0,Q.jsx)(D,{domain:[0,100],stroke:`#7d8590`,tick:{fontSize:10},unit:`%`}),(0,Q.jsx)(g,{contentStyle:{background:`#0b0d10`,border:`1px solid #2b3139`,fontSize:11}}),(0,Q.jsx)(N,{type:`monotone`,dataKey:`fill`,stroke:`#58a6ff`,strokeWidth:2,dot:!1}),u.map(e=>(0,Q.jsx)(Z,{x:e.i,stroke:`#f85149`,strokeDasharray:`3 3`},e.i)),(0,Q.jsx)(Z,{y:80,stroke:`#d29922`,strokeDasharray:`4 4`,label:{value:`80%`,position:`right`,fill:`#d29922`,fontSize:10}})]})})}),r.compactionCount>0&&(0,Q.jsxs)(`div`,{className:`mt-3 text-xs text-fg-dim`,children:[(0,Q.jsx)(`span`,{className:`text-danger`,children:`■`}),` dashed red lines = compaction points (context reset by the agent).`]})]})]})}function $({label:e,value:t}){return(0,Q.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md px-3 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted`,children:e}),(0,Q.jsx)(`div`,{className:`mono`,children:t})]})}export{ne as SessionCompactionPage};
@@ -1 +0,0 @@
1
- import{F as e,M as t,a as n,c as r,r as i,t as a}from"./clsx-DsHpp3Uj.js";import{l as o,n as s}from"./dist-w_zu0rIf.js";import{t as c}from"./arrow-left-Bg6VjX8-.js";import{o as l,t as u}from"./format-zw6IoTwZ.js";function d(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function f(){return this.eachAfter(d)}function p(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function m(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function h(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function g(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function _(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function v(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function y(e){for(var t=this,n=b(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function b(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function x(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function S(){return Array.from(this)}function C(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function w(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*T(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function E(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=k)):t===void 0&&(t=O);for(var n=new M(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new M(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(j)}function D(){return E(this).eachBefore(A)}function O(e){return e.children}function k(e){return Array.isArray(e)?e[1]:null}function A(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function j(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function M(e){this.data=e,this.depth=this.height=0,this.parent=null}M.prototype=E.prototype={constructor:M,count:f,each:p,eachAfter:h,eachBefore:m,find:g,sum:_,sort:v,path:y,ancestors:x,descendants:S,leaves:C,links:w,copy:D,[Symbol.iterator]:T};function N(e,t){return e.parent===t.parent?1:2}function P(e){var t=e.children;return t?t[0]:e.t}function F(e){var t=e.children;return t?t[t.length-1]:e.t}function I(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function L(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function R(e,t,n){return e.a.parent===t.parent?e.a:n}function z(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}z.prototype=Object.create(M.prototype);function B(e){for(var t=new z(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new z(a[o],o)),i.parent=n;return(t.parent=new z(null,0)).children=[t],t}function V(){var e=N,t=1,n=1,r=null;function i(i){var s=B(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){L(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=F(o),i=P(i),o&&i;)s=P(s),a=F(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(I(R(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!F(a)&&(a.t=o,a.m+=u-l),i&&!P(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}var H=e(t(),1),U=r();function W(){let{id:e=``}=o(),t=n({queryKey:[`session-graph`,e],queryFn:()=>i.sessionGraph(e),refetchInterval:5e3}),r=t.data?.graph,a=(0,H.useMemo)(()=>{if(!r)return null;let e=E(r,e=>e.children),t=e.descendants().length,n=Math.max(900,t*30),i=Math.max(400,e.height*120+120);return{positioned:V().size([n,i-80])(e),width:n,height:i}},[r]);return(0,U.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,U.jsx)(s,{to:`/sessions/${encodeURIComponent(e)}`,className:`text-fg-dim hover:text-accent`,children:(0,U.jsx)(c,{className:`w-4 h-4 inline`})}),(0,U.jsx)(`h1`,{className:`text-lg font-bold`,children:`call graph`}),(0,U.jsx)(`span`,{className:`text-sm text-fg-dim mono`,children:e.slice(0,16)})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-auto p-5`,children:[t.isLoading&&(0,U.jsx)(`div`,{className:`text-fg-dim`,children:`loading…`}),!t.isLoading&&!r&&(0,U.jsx)(`div`,{className:`text-fg-dim`,children:`No call graph — this session didn't spawn any sub-agents or shell-out to other CLIs.`}),r&&a&&(0,U.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4 overflow-auto`,children:(0,U.jsxs)(`svg`,{width:a.width,height:a.height,className:`mono`,children:[a.positioned.links().map((e,t)=>(0,U.jsx)(`path`,{d:G(e.source,e.target),fill:`none`,stroke:`#2b3139`,strokeWidth:1.5},t)),a.positioned.descendants().map(e=>(0,U.jsx)(K,{node:e},e.data.eventId))]})})]})]})}function G(e,t){let n=(e.y+t.y)/2;return`M${e.x},${e.y} C${e.x},${n} ${t.x},${n} ${t.x},${t.y}`}function K({node:e}){let t=e.data,n=t.kind===`session`?t.agent??`session`:`→ ${t.callee??`call`}`,r=t.sessionId?`/sessions/${encodeURIComponent(t.sessionId)}`:null;return(0,U.jsxs)(`g`,{transform:`translate(${e.x},${e.y})`,children:[(0,U.jsx)(`rect`,{x:-80,y:-22,width:160,height:44,rx:6,fill:`#12151a`,stroke:t.kind===`call`?`#d29922`:`#2b3139`,strokeWidth:1}),(0,U.jsx)(`text`,{textAnchor:`middle`,y:-5,fontSize:`11`,className:a(u(t.agent??t.callee??`unknown`)),children:n}),(0,U.jsxs)(`text`,{textAnchor:`middle`,y:10,fontSize:`9`,fill:`#7d8590`,children:[t.events,` ev · `,l(t.cost)]}),r&&(0,U.jsx)(`a`,{href:r,children:(0,U.jsx)(`rect`,{x:-80,y:-22,width:160,height:44,fill:`transparent`})})]})}export{W as SessionGraphPage};
@@ -1 +0,0 @@
1
- import{F as e,M as t,a as n,c as r,n as i,r as a,t as o}from"./clsx-DsHpp3Uj.js";import{l as s,n as c}from"./dist-w_zu0rIf.js";import{t as l}from"./useMutation-BvFLVjYz.js";import{t as u}from"./arrow-left-Bg6VjX8-.js";import{t as d}from"./play-B0mJPrwl.js";import{t as f}from"./format-zw6IoTwZ.js";var p=i(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),m=e(t(),1),h=r(),g=new Set([`claude-code`,`codex`,`gemini`,`hermes`]);function _(){let{id:e=``}=s(),t=n({queryKey:[`session`,e],queryFn:()=>a.session(e)}),[r,i]=(0,m.useState)(``),[_,y]=(0,m.useState)(60),b=t.data?.agent??`unknown`,x=g.has(b);(0,m.useEffect)(()=>{if(!t.data)return;let e=t.data.events.find(e=>e.type===`prompt`),n=e?.details?.fullText??e?.summary??``;n&&!r&&i(n)},[t.data]);let S=l({mutationFn:()=>a.replay(e,{prompt:r,timeoutSec:_})}),C=S.data;return(0,h.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,h.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,h.jsx)(c,{to:`/sessions/${encodeURIComponent(e)}`,className:`text-fg-dim hover:text-accent`,children:(0,h.jsx)(u,{className:`w-4 h-4 inline`})}),(0,h.jsx)(`h1`,{className:`text-lg font-bold`,children:`replay`}),(0,h.jsx)(`span`,{className:o(`text-sm`,f(b)),children:b}),(0,h.jsx)(`span`,{className:`text-sm text-fg-dim mono`,children:e.slice(0,16)})]}),!x&&(0,h.jsxs)(`div`,{className:`m-5 p-4 border border-warn/40 bg-warn/10 rounded-lg flex items-start gap-3 text-sm`,children:[(0,h.jsx)(p,{className:`w-5 h-5 text-warn shrink-0`}),(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`div`,{className:`font-bold`,children:[`Replay not supported for `,(0,h.jsx)(`span`,{className:f(b),children:b}),`.`]}),(0,h.jsx)(`div`,{className:`text-fg-dim mt-1`,children:`Currently wired: claude-code, codex, gemini, hermes (single-turn exec mode). You can still edit the prompt and copy the command below.`})]})]}),(0,h.jsxs)(`div`,{className:`p-5 space-y-4 max-w-4xl`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`label`,{className:`text-xs uppercase text-fg-muted`,children:`edited prompt`}),(0,h.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),spellCheck:!1,className:`mt-1 w-full bg-bg-surface border border-bg-border rounded-lg p-3 mono text-sm outline-none focus:border-accent min-h-[180px]`})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsxs)(`label`,{className:`text-xs text-fg-dim flex items-center gap-2`,children:[`timeout (s)`,(0,h.jsx)(`input`,{type:`number`,min:5,max:300,value:_,onChange:e=>y(Number(e.target.value)||60),className:`bg-bg-surface border border-bg-border rounded-md px-2 py-1 w-20 mono`})]}),(0,h.jsxs)(`button`,{onClick:()=>S.mutate(),disabled:!x||!r.trim()||S.isPending,className:`px-4 py-2 rounded-md bg-accent/20 text-accent hover:bg-accent/30 text-sm flex items-center gap-2 disabled:opacity-40`,children:[(0,h.jsx)(d,{className:`w-4 h-4`}),S.isPending?`running…`:`run replay`]}),(0,h.jsx)(`div`,{className:`text-xs text-fg-muted`,children:`Fresh single-turn exec — doesn't resume the original session.`})]}),S.isError&&(0,h.jsx)(`div`,{className:`border border-danger/40 bg-danger/10 rounded-lg p-3 text-sm text-danger`,children:String(S.error.message)}),C&&(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,h.jsx)(`span`,{className:o(`mono px-2 py-1 rounded`,C.ok?`bg-ok/10 text-ok`:`bg-danger/10 text-danger`),children:C.ok?`ok`:`failed${C.exitCode==null?``:` (code ${C.exitCode})`}`}),(0,h.jsxs)(`span`,{className:`text-fg-dim mono`,children:[C.durationMs,` ms`]}),C.error&&(0,h.jsx)(`span`,{className:`text-danger mono`,children:C.error})]}),(0,h.jsx)(v,{label:`command`,children:(0,h.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:C.command})}),C.stdout&&(0,h.jsx)(v,{label:`stdout`,children:(0,h.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:C.stdout})}),C.stderr&&(0,h.jsx)(v,{label:(0,h.jsx)(`span`,{className:`text-warn`,children:`stderr`}),children:(0,h.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:C.stderr})})]})]})]})}function v({label:e,children:t}){return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted mb-1`,children:e}),(0,h.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md p-3 overflow-x-auto max-h-96 overflow-y-auto`,children:t})]})}export{_ as SessionReplayPage};
@@ -1 +0,0 @@
1
- import{F as e,M as t,a as n,c as r,r as i,t as a}from"./clsx-DsHpp3Uj.js";import{l as o,n as s}from"./dist-w_zu0rIf.js";import{t as c}from"./arrow-left-Bg6VjX8-.js";import{a as l,o as u}from"./format-zw6IoTwZ.js";import{At as d,Bt as f,Ct as p,D as m,Dt as h,E as g,F as _,Ht as v,L as y,Mt as b,O as x,Pt as S,R as C,Rt as w,S as T,St as E,T as D,Tt as O,U as k,W as ee,Wt as te,X as ne,Xt as A,Yt as re,_ as ie,a as ae,b as oe,ct as se,et as ce,f as le,g as ue,h as de,ht as fe,i as pe,it as me,m as he,mt as ge,n as _e,o as ve,p as ye,q as be,qt as j,r as xe,rt as M,s as Se,st as N,t as Ce,tt as we,ut as Te,v as Ee,vt as P,wt as F,x as De,xt as I,z as Oe,zt as ke}from"./CartesianChart-CZSKepVZ.js";import{n as L,r as Ae,t as R}from"./graphicalItemSelectors-Dk1a_HU_.js";var je=(e,t,n)=>_(e,`xAxis`,R(e,t),n),z=(e,t,n)=>C(e,`xAxis`,R(e,t),n),B=(e,t,n)=>_(e,`yAxis`,L(e,t),n),V=(e,t,n)=>C(e,`yAxis`,L(e,t),n),Me=d([N,je,B,z,V],(e,t,n,r,i)=>O(e,`xAxis`)?P(t,r,!1):P(n,i,!1)),H=d([Oe,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),U=e=>O(N(e),`xAxis`)?`yAxis`:`xAxis`,Ne=(e,t)=>U(e)===`yAxis`?L(e,t):R(e,t),Pe=d([N,je,B,z,V,d([H,(e,t,n)=>y(e,U(e),Ne(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var{stackId:n}=e,r=k(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),ne,Me,H,be],(e,t,n,r,i,a,o,s,c,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:f}=o;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var{data:p}=c,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return et({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),W=e(t()),Fe=[`id`],Ie=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}function K(e,t){if(e==null)return{};var n,r,i=Le(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Le(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?q(Object(n),!0).forEach(function(t){Re(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Re(e,t,n){return(t=ze(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e){var t=Be(e,`string`);return typeof t==`symbol`?t:t+``}function Be(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Y(e,t){return e&&e!==`none`?e:t}var Ve=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Y(r,i),value:p(n,t),payload:e}]},He=W.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:te,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:p(o,t),hide:s,type:l,color:Y(r,a),unit:c,graphicalItemId:u}};return W.createElement(Ee,{tooltipEntrySettings:d})});function Ue(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,s=A(r);return W.createElement(he,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function We(e){var{showLabels:t,children:n,points:r}=e,i=r.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return J(J({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return W.createElement(De,{value:t?i:void 0},n)}function X(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:s,stroke:c,connectNulls:l,isRange:u}=a,{id:d}=a,f=K(a,Fe),p=A(f),m=re(f);return W.createElement(W.Fragment,null,t?.length>1&&W.createElement(j,{clipPath:r?`url(#clipPath-${i})`:void 0},W.createElement(M,G({},m,{id:d,points:t,connectNulls:l,type:s,baseLine:n,layout:o,stroke:`none`,className:`recharts-area-area`})),c!==`none`&&W.createElement(M,G({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:t})),c!==`none`&&u&&Array.isArray(n)&&W.createElement(M,G({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:n}))),W.createElement(Ue,{points:t,props:f,clipPathId:i}))}function Ge(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.y,o=r[r.length-1]?.y;if(!h(a)||!h(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return v(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),v(c)?W.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function Ke(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.x,o=r[r.length-1]?.x;if(!h(a)||!h(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return v(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),v(c)?W.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function qe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n===`vertical`?W.createElement(Ge,{alpha:t,points:r,baseLine:i,strokeWidth:a}):W.createElement(Ke,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Je(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:p,onAnimationEnd:m}=r,h=ce((0,W.useMemo)(()=>({points:o,baseLine:s}),[o,s]),`recharts-area-`),g=se(),[_,y]=(0,W.useState)(!1),b=!_,x=(0,W.useCallback)(()=>{typeof m==`function`&&m(),y(!1)},[m]),S=(0,W.useCallback)(()=>{typeof p==`function`&&p(),y(!0)},[p]);if(g==null)return null;var C=i.current,E=a.current;return W.createElement(We,{showLabels:b,points:o},r.children,W.createElement(we,{animationId:h,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:x,onAnimationStart:S,key:h},e=>{if(C){var l=C.length/o.length,u=e===1?o:o.map((t,n)=>{var r=Math.floor(n*l);if(C[r]){var i=C[r];return J(J({},t),{},{x:w(i.x,t.x,e),y:w(i.y,t.y,e)})}return t}),d=v(s)?w(E,s,e):f(s)||ke(s)?w(E,0,e):s.map((t,n)=>{var r=Math.floor(n*l);if(Array.isArray(E)&&E[r]){var i=E[r];return J(J({},t),{},{x:w(i.x,t.x,e),y:w(i.y,t.y,e)})}return t});return e>0&&(i.current=u,a.current=d),W.createElement(X,{points:u,baseLine:d,needClip:t,clipPathId:n,props:r})}return e>0&&(i.current=o,a.current=s),W.createElement(j,null,c&&W.createElement(`defs`,null,W.createElement(`clipPath`,{id:`animationClipPath-${n}`},W.createElement(qe,{alpha:e,points:o,baseLine:s,layout:g,strokeWidth:r.strokeWidth}))),W.createElement(j,{clipPath:`url(#animationClipPath-${n})`},W.createElement(X,{points:o,baseLine:s,needClip:t,clipPathId:n,props:r})))}),W.createElement(T,{label:r.label}))}function Ye(e){var{needClip:t,clipPathId:n,props:r}=e,i=(0,W.useRef)(null),a=(0,W.useRef)();return W.createElement(Je,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var Xe=class extends W.PureComponent{render(){var{hide:e,dot:t,points:n,className:r,top:i,left:o,needClip:s,xAxisId:c,yAxisId:l,width:u,height:d,id:f,baseLine:p,zIndex:h}=this.props;if(e)return null;var g=a(`recharts-area`,r),_=f,{r:v,strokeWidth:y}=pe(t),b=oe(t),x=v*2+y,S=s?`url(#clipPath-${b?``:`dots-`}${_})`:void 0;return W.createElement(m,{zIndex:h},W.createElement(j,{className:g},s&&W.createElement(`defs`,null,W.createElement(ae,{clipPathId:_,xAxisId:c,yAxisId:l}),!b&&W.createElement(`clipPath`,{id:`clipPath-dots-${_}`},W.createElement(`rect`,{x:o-x/2,y:i-x/2,width:u+x,height:d+x}))),W.createElement(Ye,{needClip:s,clipPathId:_,props:this.props})),W.createElement(le,{points:n,mainColor:Y(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&W.createElement(le,{points:p,mainColor:Y(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}},Ze={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,xAxisId:0,yAxisId:0,zIndex:ee.area};function Qe(e){var{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,connectNulls:a,dot:o,fill:s,fillOpacity:c,hide:l,isAnimationActive:u,legendType:d,stroke:f,xAxisId:p,yAxisId:m}=e,h=K(e,Ie),g=Te(),_=x(),{needClip:v}=ve(p,m),y=fe(),{points:S,isRange:C,baseLine:w}=b(t=>Pe(t,e.id,y))??{},T=ye();if(g!==`horizontal`&&g!==`vertical`||T==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var{height:E,width:D,x:O,y:k}=T;return!S||!S.length?null:W.createElement(Xe,G({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:v,points:S,stroke:f,width:D,left:O,top:k,xAxisId:p,yAxisId:m}))}var $e=(e,t,n,r,i)=>{var a=n??t;if(v(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function et(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:s,yAxis:c,displayedData:l,dataStartIndex:u,xAxisTicks:d,yAxisTicks:f,bandSize:p}=e,m=i&&i.length,h=$e(a,o,n,s,c),g=a===`horizontal`,_=!1,v=l.map((e,n)=>{var a;if(m)a=i[u+n];else{var o=F(e,r);Array.isArray(o)?(a=o,_=!0):a=[h,o]}var l=a?.[1]??null,v=l==null||m&&!t&&F(e,r)==null;return g?{x:I({axis:s,ticks:d,bandSize:p,entry:e,index:n}),y:v?null:c.scale.map(l)??null,value:a,payload:e}:{x:v?null:s.scale.map(l)??null,y:I({axis:c,ticks:f,bandSize:p,entry:e,index:n}),value:a,payload:e}});return{points:v,baseLine:(m||_?v.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?c.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:s.scale.map(t)??null,y:e.y,payload:e.payload}}):g?c.scale.map(h):s.scale.map(h))??0,isRange:_}}function tt(e){var t=S(e,Ze),n=fe();return W.createElement(ue,{id:t.id,type:`area`},e=>W.createElement(W.Fragment,null,W.createElement(ie,{legendPayload:Ve(t)}),W.createElement(He,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),W.createElement(de,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:E(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),W.createElement(Qe,G({},t,{id:e}))))}var Z=W.memo(tt,me);Z.displayName=`Area`;var nt=[`axis`],rt=(0,W.forwardRef)((e,t)=>W.createElement(Ce,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:nt,tooltipPayloadSearcher:g,categoricalChartProps:e,ref:t})),Q=r();function it(){let{id:e=``}=o(),t=n({queryKey:[`session-tokens`,e],queryFn:()=>i.sessionTokens(e),refetchInterval:3e3});if(t.isLoading)return(0,Q.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});let r=t.data?.turns??[],a=t.data?.breakdown;return(0,Q.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,Q.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,Q.jsx)(s,{to:`/sessions/${encodeURIComponent(e)}`,className:`text-fg-dim hover:text-accent`,children:(0,Q.jsx)(c,{className:`w-4 h-4 inline`})}),(0,Q.jsx)(`h1`,{className:`text-lg font-bold`,children:`token attribution`}),(0,Q.jsx)(`span`,{className:`text-sm text-fg-dim mono`,children:e.slice(0,16)})]}),a&&(0,Q.jsxs)(`div`,{className:`px-5 py-4 grid grid-cols-2 md:grid-cols-6 gap-3 border-b border-bg-border`,children:[(0,Q.jsx)($,{label:`input`,value:l(a.input)}),(0,Q.jsx)($,{label:`output`,value:l(a.output)}),(0,Q.jsx)($,{label:`cache read`,value:l(a.cacheRead)}),(0,Q.jsx)($,{label:`cache write`,value:l(a.cacheCreate)}),(0,Q.jsx)($,{label:`thinking`,value:l(a.thinking)}),(0,Q.jsx)($,{label:`cost`,value:u(a.cost)})]}),(0,Q.jsxs)(`div`,{className:`p-5`,children:[(0,Q.jsx)(`div`,{className:`text-xs uppercase text-fg-muted mb-2`,children:`tokens per turn`}),(0,Q.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-3`,style:{height:320},children:(0,Q.jsx)(ge,{children:(0,Q.jsxs)(rt,{data:r,children:[(0,Q.jsx)(Se,{strokeDasharray:`3 3`,stroke:`#2b3139`}),(0,Q.jsx)(xe,{dataKey:`turnIdx`,stroke:`#7d8590`,tick:{fontSize:10}}),(0,Q.jsx)(_e,{stroke:`#7d8590`,tick:{fontSize:10}}),(0,Q.jsx)(D,{contentStyle:{background:`#0b0d10`,border:`1px solid #2b3139`,fontSize:11}}),(0,Q.jsx)(Ae,{wrapperStyle:{fontSize:11}}),(0,Q.jsx)(Z,{type:`monotone`,dataKey:`input`,stackId:`1`,stroke:`#58a6ff`,fill:`#58a6ff33`}),(0,Q.jsx)(Z,{type:`monotone`,dataKey:`output`,stackId:`1`,stroke:`#3fb950`,fill:`#3fb95033`}),(0,Q.jsx)(Z,{type:`monotone`,dataKey:`cacheRead`,stackId:`1`,stroke:`#d29922`,fill:`#d2992233`}),(0,Q.jsx)(Z,{type:`monotone`,dataKey:`cacheCreate`,stackId:`1`,stroke:`#f85149`,fill:`#f8514933`})]})})})]}),(0,Q.jsxs)(`div`,{className:`px-5 pb-6`,children:[(0,Q.jsx)(`div`,{className:`text-xs uppercase text-fg-muted mb-2`,children:`per-turn rows`}),(0,Q.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Q.jsx)(`thead`,{className:`text-left text-xs uppercase text-fg-muted`,children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{className:`py-1 w-12`,children:`turn`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`input`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`output`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`cache r`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`cache w`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`thinking`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`tool i/o`}),(0,Q.jsx)(`th`,{className:`py-1`,children:`cost`})]})}),(0,Q.jsx)(`tbody`,{children:r.map(e=>(0,Q.jsxs)(`tr`,{className:`mono text-xs border-b border-bg-border/30`,children:[(0,Q.jsx)(`td`,{className:`py-1 text-fg-muted`,children:e.turnIdx}),(0,Q.jsx)(`td`,{className:`py-1`,children:l(e.input)}),(0,Q.jsx)(`td`,{className:`py-1`,children:l(e.output)}),(0,Q.jsx)(`td`,{className:`py-1`,children:l(e.cacheRead)}),(0,Q.jsx)(`td`,{className:`py-1`,children:l(e.cacheCreate)}),(0,Q.jsx)(`td`,{className:`py-1`,children:l(e.thinking)}),(0,Q.jsx)(`td`,{className:`py-1`,children:l(e.toolTokens)}),(0,Q.jsx)(`td`,{className:`py-1`,children:u(e.cost)})]},e.turnIdx))})]})]})]})}function $({label:e,value:t}){return(0,Q.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md px-3 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted`,children:e}),(0,Q.jsx)(`div`,{className:`mono`,children:t})]})}export{it as SessionTokensPage};
@@ -1 +0,0 @@
1
- import{F as e,M as t,a as n,c as r,n as i,r as a,s as o,t as s}from"./clsx-DsHpp3Uj.js";import{a as c,r as l}from"./dist-w_zu0rIf.js";import{t as u}from"./useMutation-BvFLVjYz.js";import{n as d,t as f}from"./triangle-alert-Bx2lGvGN.js";var p=i(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),m=i(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),h=i(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),g=i(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),_=e(t(),1),v=r();function y(){return(0,v.jsxs)(`div`,{className:`h-full flex`,children:[(0,v.jsxs)(`aside`,{className:`w-60 border-r border-bg-border bg-bg-surface px-3 py-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 mb-4 px-2`,children:[(0,v.jsx)(d,{className:`w-4 h-4 text-accent`}),(0,v.jsx)(`h2`,{className:`font-bold`,children:`settings`})]}),(0,v.jsxs)(`nav`,{className:`flex flex-col gap-1 text-sm`,children:[(0,v.jsx)(b,{to:`/settings/budgets`,icon:(0,v.jsx)(m,{className:`w-4 h-4`}),children:`Budgets`}),(0,v.jsx)(b,{to:`/settings/anomaly`,icon:(0,v.jsx)(f,{className:`w-4 h-4`}),children:`Anomaly thresholds`}),(0,v.jsx)(b,{to:`/settings/triggers`,icon:(0,v.jsx)(p,{className:`w-4 h-4`}),children:`Triggers`})]})]}),(0,v.jsx)(`main`,{className:`flex-1 overflow-auto`,children:(0,v.jsx)(c,{})})]})}function b({to:e,icon:t,children:n}){return(0,v.jsxs)(l,{to:e,className:({isActive:e})=>s(`flex items-center gap-2 px-3 py-2 rounded-md transition`,e?`bg-accent/20 text-accent`:`text-fg-dim hover:bg-bg-elev hover:text-fg`),children:[t,n]})}function x({kind:e,label:t,description:r}){let i=o(),s=n({queryKey:[`config`,e],queryFn:()=>a.config(e)}),[c,l]=(0,_.useState)(``),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[y,b]=(0,_.useState)(null);(0,_.useEffect)(()=>{s.data&&l(JSON.stringify(s.data.value,null,2))},[s.data]);let x=u({mutationFn:t=>a.saveConfig(e,t),onSuccess:()=>{b(`saved`),setTimeout(()=>b(null),1500),i.invalidateQueries({queryKey:[`config`,e]})},onError:e=>{m(e.message)}});return(0,v.jsxs)(`div`,{className:`p-6 max-w-4xl`,children:[(0,v.jsxs)(`div`,{className:`flex items-baseline gap-3 mb-1`,children:[(0,v.jsx)(`h1`,{className:`text-lg font-bold`,children:t}),s.data?.path&&(0,v.jsx)(`span`,{className:`text-xs text-fg-muted mono`,children:s.data.path})]}),(0,v.jsx)(`p`,{className:`text-sm text-fg-dim mb-4`,children:r}),(0,v.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg overflow-hidden`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-bg-elev border-b border-bg-border`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-dim`,children:[(0,v.jsx)(h,{className:`w-3.5 h-3.5`}),`JSON`]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y&&(0,v.jsxs)(`span`,{className:`text-xs text-ok`,children:[`✓ `,y]}),(0,v.jsx)(`button`,{onClick:()=>{s.data&&(l(JSON.stringify(s.data.defaults,null,2)),f(null),m(null))},className:`text-xs px-2 py-1 rounded-md border border-bg-border text-fg-dim hover:bg-bg`,children:`reset to defaults`}),(0,v.jsxs)(`button`,{onClick:()=>{m(null);try{let e=JSON.parse(c);f(null),x.mutate(e)}catch(e){f(String(e.message??e))}},disabled:x.isPending,className:`text-xs px-3 py-1 rounded-md bg-accent/20 text-accent hover:bg-accent/30 flex items-center gap-1 disabled:opacity-50`,children:[(0,v.jsx)(g,{className:`w-3.5 h-3.5`}),` save`]})]})]}),(0,v.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),spellCheck:!1,className:`w-full p-3 mono text-sm bg-bg outline-none min-h-[300px] focus:ring-1 focus:ring-accent/50`})]}),d&&(0,v.jsxs)(`div`,{className:`mt-3 text-sm text-danger bg-danger/10 border border-danger/30 rounded-md px-3 py-2`,children:[`invalid JSON: `,d]}),p&&(0,v.jsxs)(`div`,{className:`mt-3 text-sm text-danger bg-danger/10 border border-danger/30 rounded-md px-3 py-2`,children:[`save failed: `,p]})]})}function S(){return(0,v.jsx)(x,{kind:`budgets`,label:`Budgets`,description:`Cost caps. perSessionUsd fires a notification when any one session exceeds it; perDayUsd fires when aggregate daily cost breaches. Set to null to disable a cap.`})}function C(){return(0,v.jsx)(x,{kind:`anomaly`,label:`Anomaly thresholds`,description:`zScore = MAD z-score cutoff for cost/tokens/duration outliers (default 3.5). loopWindow = how many recent events to scan for stuck-loop patterns. loopMinRepeats = same-tool repeats before flagging. minSamples = minimum history before scoring kicks in.`})}function w(){return(0,v.jsx)(x,{kind:`triggers`,label:`Triggers`,description:`Custom desktop notifications. Each rule: { match?: regex, pathMatch?: regex, type?: EventType, thresholdUsd?: number, title: string, body: string }. The first rule whose condition fires notifies.`})}export{C as AnomalySettings,S as BudgetsSettings,y as SettingsShell,w as TriggersSettings};
@@ -1 +0,0 @@
1
- import{F as e,M as t,a as n,c as r,r as i,t as a}from"./clsx-DsHpp3Uj.js";import{t as o}from"./chart-column-Brz7pC96.js";import{o as s}from"./format-zw6IoTwZ.js";import{A as c,At as l,Bt as u,Ct as d,D as f,Dt as p,E as m,Et as h,F as g,Ft as _,G as v,H as y,Ht as b,I as x,J as S,K as C,L as w,Lt as T,M as E,Mt as D,N as O,Pt as k,R as A,Rt as j,S as M,St as N,T as P,U as ee,Ut as te,W as F,Wt as ne,X as re,Xt as ie,Y as ae,Zt as oe,_ as se,_t as ce,a as le,bt as ue,et as de,g as fe,gt as pe,h as me,ht as he,it as ge,j as _e,jt as I,k as ve,mt as ye,n as be,o as xe,qt as L,r as R,s as z,st as B,t as Se,tt as Ce,ut as we,v as Te,vt as Ee,wt as De,x as Oe,y as ke,yt as Ae,z as je,zt as Me}from"./CartesianChart-CZSKepVZ.js";import{n as V,r as Ne,t as H}from"./graphicalItemSelectors-Dk1a_HU_.js";import{i as Pe,n as Fe,r as Ie,t as Le}from"./LineChart-BYjz-1bE.js";var Re=e=>null;Re.displayName=`Cell`;var ze=(e,t,n)=>{var r=I();return(i,a)=>o=>{e?.(i,a,o),r(O({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Be=e=>{var t=I();return(n,r)=>i=>{e?.(n,r,i),t(_e())}},Ve=(e,t,n)=>{var r=I();return(i,a)=>o=>{e?.(i,a,o),r(E({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},He=(e,t,n)=>{var r=n??e;if(!u(r))return T(r,t,0)},Ue=(e,t,n)=>{var r={},i=e.filter(y),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:He(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:He(t,n,e.barSize)}));return[...s,...c]};function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?We(Object(n),!0).forEach(function(t){Ge(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ge(e,t,n){return(t=Ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ke(e){var t=qe(e,`string`);return typeof t==`symbol`?t:t+``}function qe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Je(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=T(e,n,0,!0),s,c=[];if(p(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var m=T(t,n,0,!0);n-2*m-(a-1)*o<=0&&(o=0);var h=(n-2*m-(a-1)*o)/a;h>1&&(h>>=0);var g=p(i)?Math.min(h,i):h;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:m+(h+o)*n+(h-g)/2,size:g}}],c)}return s}}var Ye=(e,t,n,r,i,a,o)=>{var s=u(o)?t:o,c=Je(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>U(U({},e),{},{position:U(U({},e.position),{},{offset:e.position.offset-i/2})}))),c},Xe=(e,t)=>{var n=ee(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},Ze=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Qe(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&p(e.zIndex)?e.zIndex:t}var $e=!0,W=`Invariant failed`;function et(e,t){if(!e){if($e)throw Error(W);var n=typeof t==`function`?t():t,r=n?`${W}: ${n}`:W;throw Error(r)}}var G=e(t());function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(null,arguments)}function q(e){return G.createElement(Pe,K({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var tt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(b(e))return e;var i=b(n)||u(n);return i?e(n,r):(!i&&et(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},nt=(e,t,n)=>n,J=l([je,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),rt=l([J],e=>e?.maxBarSize),it=(e,t,n,r)=>r,at=l([B,je,H,V,nt],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),ot=(e,t,n)=>{var r=B(e),i=H(e,t),a=V(e,t);if(!(i==null||a==null))return r===`horizontal`?w(e,`yAxis`,a,n):w(e,`xAxis`,i,n)},st=l([at,S,(e,t)=>{var n=B(e),r=H(e,t),i=V(e,t);if(!(r==null||i==null))return n===`horizontal`?x(e,`xAxis`,r):x(e,`yAxis`,i)}],Ue),ct=(e,t,n)=>{var r=J(e,t);if(r==null)return 0;var i=H(e,t),a=V(e,t);if(i==null||a==null)return 0;var o=B(e),s=ae(e),{maxBarSize:c}=r,l=u(c)?s:c,d,f;return o===`horizontal`?(d=g(e,`xAxis`,i,n),f=A(e,`xAxis`,i,n)):(d=g(e,`yAxis`,a,n),f=A(e,`yAxis`,a,n)),Ee(d,f,!0)??l??0},lt=(e,t,n)=>{var r=B(e),i=H(e,t),a=V(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=g(e,`xAxis`,i,n),s=A(e,`xAxis`,i,n)):(o=g(e,`yAxis`,a,n),s=A(e,`yAxis`,a,n)),Ee(o,s)}},ut=l([ce,pe,(e,t,n)=>{var r=H(e,t);if(r!=null)return g(e,`xAxis`,r,n)},(e,t,n)=>{var r=V(e,t);if(r!=null)return g(e,`yAxis`,r,n)},(e,t,n)=>{var r=H(e,t);if(r!=null)return A(e,`xAxis`,r,n)},(e,t,n)=>{var r=V(e,t);if(r!=null)return A(e,`yAxis`,r,n)},l([l([st,ae,C,v,ct,lt,rt],Ye),J],Ze),B,re,lt,l([ot,J],Xe),J,it],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return Ht({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),dt=[`index`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function ft(e,t){if(e==null)return{};var n,r,i=pt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var mt=(0,G.createContext)(void 0),ht=e=>{var t=(0,G.useContext)(mt);if(t!=null)return t.stackId;if(e!=null)return N(e)},gt=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,_t=e=>{var t=(0,G.useContext)(mt);if(t!=null){var{stackId:n}=t;return`url(#${gt(n,e)})`}},vt=e=>{var{index:t}=e,n=ft(e,dt),r=_t(t);return G.createElement(L,Y({className:`recharts-bar-stack-layer`,clipPath:r},n))},yt=[`onMouseEnter`,`onMouseLeave`,`onClick`],bt=[`value`,`background`,`tooltipPosition`],xt=[`id`],St=[`onMouseEnter`,`onClick`,`onMouseLeave`];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ct(Object(n),!0).forEach(function(t){wt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wt(e,t,n){return(t=Tt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e){var t=Et(e,`string`);return typeof t==`symbol`?t:t+``}function Et(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){if(e==null)return{};var n,r,i=Dt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ot=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:d(n,t),payload:e}]},kt=G.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:ne,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:d(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return G.createElement(Te,{tooltipEntrySettings:u})});function At(e){var t=D(c),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:l}=a,u=Q(a,yt),d=ze(o,r,a.id),p=Be(s),m=Ve(l,r,a.id);if(!i||n==null)return null;var h=oe(i);return G.createElement(f,{zIndex:Qe(i,F.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=Q(e,bt);if(!o)return null;var l=d(e,n),f=p(e,n),g=m(e,n),v=Z(Z(Z(Z(Z({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),h),_(u,e,n)),{},{onMouseEnter:l,onMouseLeave:f,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return G.createElement(q,X({key:`background-bar-${n}`},v))}))}function jt(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return G.createElement(Oe,{value:t?i:void 0},n)}function Mt(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=D(c),l=D(ve),u=n&&String(i.originalDataIndex)===s&&(l==null||o===l),[d,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(!1);(0,G.useEffect)(()=>{var e;return u?(p(!0),e=requestAnimationFrame(()=>{h(!0)})):h(!1),()=>{cancelAnimationFrame(e)}},[u]);var g=(0,G.useCallback)(()=>{u||p(!1)},[u]),_=u&&m,v=u||d,y=u?n===!0?t:n:t,b=G.createElement(q,X({},r,{name:String(r.name)},i,{isActive:_,option:y,index:a,dataKey:o,onTransitionEnd:g}));return v?G.createElement(f,{zIndex:F.activeBar},G.createElement(vt,{index:i.originalDataIndex},b)):b}function Nt(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return G.createElement(q,X({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function Pt(e){var{data:t,props:n}=e,r=ie(n)??{},{id:i}=r,a=Q(r,xt),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=Q(n,St),p=ze(l,s,i),m=Be(d),h=Ve(u,s,i);return t?G.createElement(G.Fragment,null,t.map((e,t)=>G.createElement(vt,X({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},_(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?G.createElement(Mt,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):G.createElement(Nt,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function Ft(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=de(t,`recharts-bar-`),[p,m]=(0,G.useState)(!1),h=!p,g=(0,G.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,G.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return G.createElement(jt,{showLabels:h,rects:r},G.createElement(Ce,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return Z(Z({},t),{},{x:j(r.x,t.x,e),y:j(r.y,t.y,e),width:j(r.width,t.width,e),height:j(r.height,t.height,e)});if(i===`horizontal`){var a=j(0,t.height,e),o=j(t.stackedBarStart,t.y,e);return Z(Z({},t),{},{y:o,height:a})}var s=j(0,t.width,e),c=j(t.stackedBarStart,t.x,e);return Z(Z({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:G.createElement(L,null,G.createElement(Pt,{props:t,data:a}))}),G.createElement(M,{label:t.label}),t.children)}function It(e){var t=(0,G.useRef)(null);return G.createElement(Ft,{previousRectanglesRef:t,props:e})}var Lt=0,Rt=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:De(e,t)}},zt=class extends G.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:o,needClip:s,background:c,id:l}=this.props;if(e||t==null)return null;var u=a(`recharts-bar`,r),d=l;return G.createElement(L,{className:u,id:l},s&&G.createElement(`defs`,null,G.createElement(le,{clipPathId:d,xAxisId:i,yAxisId:o})),G.createElement(L,{className:`recharts-bar-rectangles`,clipPath:s?`url(#clipPath-${d})`:void 0},G.createElement(At,{data:t,dataKey:n,background:c,allOtherBarProps:this.props}),G.createElement(It,this.props)))}},Bt={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:Lt,xAxisId:0,yAxisId:0,zIndex:F.bar};function Vt(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=xe(t,n),f=we(),p=he(),m=ke(e.children,Re),h=D(t=>ut(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,G.createElement(Ie,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:Rt,errorBarOffset:g},G.createElement(zt,X({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function Ht(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:g,dataStartIndex:_}=e,v=t===`horizontal`?c:s,y=d?v.scale.domain():null,b=Ae({numericAxis:v}),x=v.scale.map(b);return f.map((e,f)=>{var v,S,C,w,T,E;if(d){var D=d[f+_];if(D==null)return null;v=h(D,y)}else v=De(e,n),Array.isArray(v)||(v=[b,v]);var O=tt(r,Lt)(v[1],f);if(t===`horizontal`){var k=c.scale.map(v[0]),A=c.scale.map(v[1]);if(k==null||A==null)return null;S=ue({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),C=A??k??void 0,w=a.size;var j=k-A;if(T=Me(j)?0:j,E={x:S,y:p.top,width:w,height:p.height},Math.abs(O)>0&&Math.abs(T)<Math.abs(O)){var M=te(T||O)*(Math.abs(O)-Math.abs(T));C-=M,T+=M}}else{var N=s.scale.map(v[0]),P=s.scale.map(v[1]);if(N==null||P==null)return null;if(S=N,C=ue({axis:c,ticks:u,bandSize:o,offset:a.offset,entry:e,index:f}),w=P-N,T=a.size,E={x:p.left,y:C,width:p.width,height:T},Math.abs(O)>0&&Math.abs(w)<Math.abs(O)){var ee=te(w||O)*(Math.abs(O)-Math.abs(w));w+=ee}}return S==null||C==null||w==null||T==null||!i&&(w===0||T===0)?null:Z(Z({},e),{},{stackedBarStart:x,x:S,y:C,width:w,height:T,value:d?v:v[1],payload:e,background:E,tooltipPosition:{x:S+w/2,y:C+T/2},parentViewBox:g,originalDataIndex:f},m&&m[f]&&m[f].props)}).filter(Boolean)}function Ut(e){var t=k(e,Bt),n=ht(t.stackId),r=he();return G.createElement(fe,{id:t.id,type:`bar`},e=>G.createElement(G.Fragment,null,G.createElement(se,{legendPayload:Ot(t)}),G.createElement(kt,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),G.createElement(me,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),G.createElement(f,{zIndex:t.zIndex},G.createElement(Vt,X({},t,{id:e})))))}var Wt=G.memo(Ut,ge);Wt.displayName=`Bar`;var Gt=[`axis`,`item`],Kt=(0,G.forwardRef)((e,t)=>G.createElement(Se,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Gt,tooltipPayloadSearcher:m,categoricalChartProps:e,ref:t})),$=r(),qt={"claude-code":`#f0883e`,codex:`#3fb950`,cursor:`#da70d6`,gemini:`#58a6ff`,openclaw:`#2dd4bf`,hermes:`#facc15`,aider:`#ec4899`,cline:`#bef264`,windsurf:`#5eead4`,goose:`#fbbf24`,continue:`#a78bfa`,unknown:`#7d8590`};function Jt(){let[e,t]=(0,G.useState)(30),r=n({queryKey:[`trends-cost`,e],queryFn:()=>i.trendsCost(e),refetchInterval:3e4}),a=n({queryKey:[`trends-cache-hit`,e],queryFn:()=>i.trendsCacheHit(e),refetchInterval:3e4}),c=n({queryKey:[`trends-by-agent`,e],queryFn:()=>i.trendsByAgent(e),refetchInterval:3e4});return(0,$.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,$.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,$.jsx)(o,{className:`w-5 h-5 text-accent`}),(0,$.jsx)(`h1`,{className:`text-lg font-bold`,children:`trends`}),(0,$.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-xs`,children:[(0,$.jsx)(`span`,{className:`text-fg-dim`,children:`window:`}),[7,14,30,60].map(n=>(0,$.jsxs)(`button`,{onClick:()=>t(n),className:`px-2 py-1 rounded-md border ${n===e?`bg-accent/20 text-accent border-accent/40`:`border-bg-border text-fg-dim hover:bg-bg-elev`}`,children:[n,`d`]},n))]})]}),(0,$.jsxs)(`div`,{className:`p-5 space-y-6 max-w-6xl`,children:[(0,$.jsx)(Yt,{title:`Cost per day (USD)`,subtitle:`Assistant-turn costs summed across all sessions.`,children:(0,$.jsx)(`div`,{style:{height:260},children:r.data&&(0,$.jsx)(ye,{children:(0,$.jsxs)(Kt,{data:r.data.data,children:[(0,$.jsx)(z,{strokeDasharray:`3 3`,stroke:`#2b3139`}),(0,$.jsx)(R,{dataKey:`day`,stroke:`#7d8590`,tick:{fontSize:10}}),(0,$.jsx)(be,{stroke:`#7d8590`,tick:{fontSize:10},tickFormatter:e=>`$${e.toFixed(2)}`}),(0,$.jsx)(P,{formatter:e=>s(Number(e)),contentStyle:{background:`#0b0d10`,border:`1px solid #2b3139`,fontSize:11}}),(0,$.jsx)(Wt,{dataKey:`cost`,fill:`#58a6ff`})]})})})}),(0,$.jsx)(Yt,{title:`Cache-hit ratio`,subtitle:`Fraction of input tokens served from prompt cache. A drop here usually means the provider's cache has invalidated (AUR-215).`,children:(0,$.jsx)(`div`,{style:{height:260},children:a.data&&(0,$.jsx)(ye,{children:(0,$.jsxs)(Le,{data:a.data.data,children:[(0,$.jsx)(z,{strokeDasharray:`3 3`,stroke:`#2b3139`}),(0,$.jsx)(R,{dataKey:`day`,stroke:`#7d8590`,tick:{fontSize:10}}),(0,$.jsx)(be,{domain:[0,1],stroke:`#7d8590`,tick:{fontSize:10},tickFormatter:e=>`${Math.round(e*100)}%`}),(0,$.jsx)(P,{formatter:e=>`${(Number(e)*100).toFixed(1)}%`,contentStyle:{background:`#0b0d10`,border:`1px solid #2b3139`,fontSize:11}}),(0,$.jsx)(Fe,{type:`monotone`,dataKey:`hitRatio`,stroke:`#3fb950`,strokeWidth:2,dot:!1})]})})})}),(0,$.jsx)(Yt,{title:`Events per agent per day`,subtitle:`Stacked event counts — shows cross-agent workload distribution (AUR-115).`,children:(0,$.jsx)(`div`,{style:{height:280},children:c.data&&(0,$.jsx)(ye,{children:(0,$.jsxs)(Kt,{data:c.data.data,children:[(0,$.jsx)(z,{strokeDasharray:`3 3`,stroke:`#2b3139`}),(0,$.jsx)(R,{dataKey:`day`,stroke:`#7d8590`,tick:{fontSize:10}}),(0,$.jsx)(be,{stroke:`#7d8590`,tick:{fontSize:10}}),(0,$.jsx)(P,{contentStyle:{background:`#0b0d10`,border:`1px solid #2b3139`,fontSize:11}}),(0,$.jsx)(Ne,{wrapperStyle:{fontSize:10}}),c.data.agents.map(e=>(0,$.jsx)(Wt,{dataKey:e,stackId:`agents`,fill:qt[e]??`#7d8590`},e))]})})})})]})]})}function Yt({title:e,subtitle:t,children:n}){return(0,$.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:[(0,$.jsx)(`div`,{className:`mb-1 font-bold`,children:e}),t&&(0,$.jsx)(`div`,{className:`text-xs text-fg-dim mb-3`,children:t}),n]})}export{Jt as TrendsPage};
@@ -1 +0,0 @@
1
- import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{F as e,M as t,j as n}from"./clsx-DsHpp3Uj.js";var r=e(t()),i=e(n());function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}var o;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(o||={});var s=`popstate`;function c(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return p(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:m(t)}return g(t,n,null,e)}function l(e,t){if(e===!1||e==null)throw Error(t)}function u(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function d(){return Math.random().toString(36).substr(2,8)}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,n,r){return n===void 0&&(n=null),a({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?h(t):t,{state:n,key:t&&t.key||r||d()})}function m(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function h(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:c=!1}=r,u=i.history,d=o.Pop,h=null,g=_();g??(g=0,u.replaceState(a({},u.state,{idx:g}),``));function _(){return(u.state||{idx:null}).idx}function v(){d=o.Pop;let e=_(),t=e==null?null:e-g;g=e,h&&h({action:d,location:S.location,delta:t})}function y(e,t){d=o.Push;let r=p(S.location,e,t);n&&n(r,e),g=_()+1;let a=f(r,g),s=S.createHref(r);try{u.pushState(a,``,s)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(s)}c&&h&&h({action:d,location:S.location,delta:1})}function b(e,t){d=o.Replace;let r=p(S.location,e,t);n&&n(r,e),g=_();let i=f(r,g),a=S.createHref(r);u.replaceState(i,``,a),c&&h&&h({action:d,location:S.location,delta:0})}function x(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:m(e);return n=n.replace(/ $/,`%20`),l(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let S={get action(){return d},get location(){return e(i,u)},listen(e){if(h)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,v),h=e,()=>{i.removeEventListener(s,v),h=null}},createHref(e){return t(i,e)},createURL:x,encodeLocation(e){let t=x(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:y,replace:b,go(e){return u.go(e)}};return S}var _;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(_||={});function v(e,t,n){return n===void 0&&(n=`/`),y(e,t,n,!1)}function y(e,t,n,r){let i=A((typeof t==`string`?h(t):t).pathname||`/`,n);if(i==null)return null;let a=b(e);S(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=ae(i);o=re(a[e],t,r)}return o}function b(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(l(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=F([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),b(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:te(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of x(e.path))i(e,t,n)}),t}function x(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=x(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function S(e){e.sort((e,t)=>e.score===t.score?ne(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var C=/^:[\w-]+$/,w=3,T=2,E=1,D=10,ee=-2,O=e=>e===`*`;function te(e,t){let n=e.split(`/`),r=n.length;return n.some(O)&&(r+=ee),t&&(r+=T),n.filter(e=>!O(e)).reduce((e,t)=>e+(C.test(t)?w:t===``?E:D),r)}function ne(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function re(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=k({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=k({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:F([a,u.pathname]),pathnameBase:ue(F([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=F([a,u.pathnameBase]))}return o}function k(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ie(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ie(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),u(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ae(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function A(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var oe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,se=e=>oe.test(e);function ce(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e,a;if(n)if(se(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),u(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?j(n.substring(1),`/`):j(n,t)}else a=t;return{pathname:a,search:de(r),hash:fe(i)}}function j(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function M(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function le(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function N(e,t){let n=le(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function P(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=h(e):(i=a({},e),l(!i.pathname||!i.pathname.includes(`?`),M(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),M(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),M(`#`,`search`,`hash`,i)));let o=e===``||i.pathname===``,s=o?`/`:i.pathname,c;if(s==null)c=n;else{let e=t.length-1;if(!r&&s.startsWith(`..`)){let t=s.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}c=e>=0?t[e]:`/`}let u=ce(i,c),d=s&&s!==`/`&&s.endsWith(`/`),f=(o||s===`.`)&&n.endsWith(`/`);return!u.pathname.endsWith(`/`)&&(d||f)&&(u.pathname+=`/`),u}var F=e=>e.join(`/`).replace(/\/\/+/g,`/`),ue=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),de=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,fe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function pe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var I=[`post`,`put`,`patch`,`delete`];new Set(I);var me=[`get`,...I];new Set(me);function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}var R=r.createContext(null),z=r.createContext(null),B=r.createContext(null),V=r.createContext(null),H=r.createContext({outlet:null,matches:[],isDataRoute:!1}),U=r.createContext(null);function he(e,t){let{relative:n}=t===void 0?{}:t;!W()&&l(!1);let{basename:i,navigator:a}=r.useContext(B),{hash:o,pathname:s,search:c}=J(e,{relative:n}),u=s;return i!==`/`&&(u=s===`/`?i:F([i,s])),a.createHref({pathname:u,search:c,hash:o})}function W(){return r.useContext(V)!=null}function G(){return!W()&&l(!1),r.useContext(V).location}function K(e){r.useContext(B).static||r.useLayoutEffect(e)}function q(){let{isDataRoute:e}=r.useContext(H);return e?Me():ge()}function ge(){!W()&&l(!1);let e=r.useContext(R),{basename:t,future:n,navigator:i}=r.useContext(B),{matches:a}=r.useContext(H),{pathname:o}=G(),s=JSON.stringify(N(a,n.v7_relativeSplatPath)),c=r.useRef(!1);return K(()=>{c.current=!0}),r.useCallback(function(n,r){if(r===void 0&&(r={}),!c.current)return;if(typeof n==`number`){i.go(n);return}let a=P(n,JSON.parse(s),o,r.relative===`path`);e==null&&t!==`/`&&(a.pathname=a.pathname===`/`?t:F([t,a.pathname])),(r.replace?i.replace:i.push)(a,r.state,r)},[t,i,s,o,e])}var _e=r.createContext(null);function ve(e){let t=r.useContext(H).outlet;return t&&r.createElement(_e.Provider,{value:e},t)}function ye(){let{matches:e}=r.useContext(H),t=e[e.length-1];return t?t.params:{}}function J(e,t){let{relative:n}=t===void 0?{}:t,{future:i}=r.useContext(B),{matches:a}=r.useContext(H),{pathname:o}=G(),s=JSON.stringify(N(a,i.v7_relativeSplatPath));return r.useMemo(()=>P(e,JSON.parse(s),o,n===`path`),[e,s,o,n])}function be(e,t){return xe(e,t)}function xe(e,t,n,i){!W()&&l(!1);let{navigator:a}=r.useContext(B),{matches:s}=r.useContext(H),c=s[s.length-1],u=c?c.params:{};c&&c.pathname;let d=c?c.pathnameBase:`/`;c&&c.route;let f=G(),p;if(t){let e=typeof t==`string`?h(t):t;!(d===`/`||e.pathname?.startsWith(d))&&l(!1),p=e}else p=f;let m=p.pathname||`/`,g=m;if(d!==`/`){let e=d.replace(/^\//,``).split(`/`);g=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=v(e,{pathname:g}),y=Ee(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:F([d,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?d:F([d,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,n,i);return t&&y?r.createElement(V.Provider,{value:{location:L({pathname:`/`,search:``,hash:``,state:null,key:`default`},p),navigationType:o.Pop}},y):y}function Se(){let e=je(),t=pe(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Ce=r.createElement(Se,null),we=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:r.createElement(H.Provider,{value:this.props.routeContext},r.createElement(U.Provider,{value:this.state.error,children:this.props.component}))}};function Te(e){let{routeContext:t,match:n,children:i}=e,a=r.useContext(R);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(H.Provider,{value:t},i)}function Ee(e,t,n,i){if(t===void 0&&(t=[]),n===void 0&&(n=null),i===void 0&&(i=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=i)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let e=o.findIndex(e=>e.route.id&&s?.[e.route.id]!==void 0);!(e>=0)&&l(!1),o=o.slice(0,Math.min(o.length,e+1))}let c=!1,u=-1;if(n&&i&&i.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){c=!0,o=u>=0?o.slice(0,u+1):[o[0]];break}}}return o.reduceRight((e,i,a)=>{let l,d=!1,f=null,p=null;n&&(l=s&&i.route.id?s[i.route.id]:void 0,f=i.route.errorElement||Ce,c&&(u<0&&a===0?(Pe(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):u===a&&(d=!0,p=i.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,a+1)),h=()=>{let t;return t=l?f:d?p:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(Te,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(i.route.ErrorBoundary||i.route.errorElement||a===0)?r.createElement(we,{location:n.location,revalidation:n.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var Y=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(Y||{}),X=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(X||{});function De(e){let t=r.useContext(R);return!t&&l(!1),t}function Oe(e){let t=r.useContext(z);return!t&&l(!1),t}function ke(e){let t=r.useContext(H);return!t&&l(!1),t}function Ae(e){let t=ke(e),n=t.matches[t.matches.length-1];return!n.route.id&&l(!1),n.route.id}function je(){let e=r.useContext(U),t=Oe(X.UseRouteError),n=Ae(X.UseRouteError);return e===void 0?t.errors?.[n]:e}function Me(){let{router:e}=De(Y.UseNavigateStable),t=Ae(X.UseNavigateStable),n=r.useRef(!1);return K(()=>{n.current=!0}),r.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,L({fromRouteId:t},i)))},[e,t])}var Ne={};function Pe(e,t,n){!t&&!Ne[e]&&(Ne[e]=!0)}var Z=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function Fe(e,t){e?.v7_startTransition===void 0&&Z(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&Z(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&Z(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&Z(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&Z(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&Z(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}r.startTransition;function Ie(e){let{to:t,replace:n,state:i,relative:a}=e;!W()&&l(!1);let{future:o,static:s}=r.useContext(B),{matches:c}=r.useContext(H),{pathname:u}=G(),d=q(),f=P(t,N(c,o.v7_relativeSplatPath),u,a===`path`),p=JSON.stringify(f);return r.useEffect(()=>d(JSON.parse(p),{replace:n,state:i,relative:a}),[d,p,a,n,i]),null}function Le(e){return ve(e.context)}function Re(e){l(!1)}function ze(e){let{basename:t=`/`,children:n=null,location:i,navigationType:a=o.Pop,navigator:s,static:c=!1,future:u}=e;W()&&l(!1);let d=t.replace(/^\/*/,`/`),f=r.useMemo(()=>({basename:d,navigator:s,static:c,future:L({v7_relativeSplatPath:!1},u)}),[d,u,s,c]);typeof i==`string`&&(i=h(i));let{pathname:p=`/`,search:m=``,hash:g=``,state:_=null,key:v=`default`}=i,y=r.useMemo(()=>{let e=A(p,d);return e==null?null:{location:{pathname:e,search:m,hash:g,state:_,key:v},navigationType:a}},[d,p,m,g,_,v,a]);return y==null?null:r.createElement(B.Provider,{value:f},r.createElement(V.Provider,{children:n,value:y}))}function Be(e){let{children:t,location:n}=e;return be(Q(t),n)}var Ve=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Ve||{});new Promise(()=>{}),r.Component;function Q(e,t){t===void 0&&(t=[]);let n=[];return r.Children.forEach(e,(e,i)=>{if(!r.isValidElement(e))return;let a=[...t,i];if(e.type===r.Fragment){n.push.apply(n,Q(e.props.children,a));return}e.type!==Re&&l(!1),!(!e.props.index||!e.props.children)&&l(!1);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=Q(e.props.children,a)),n.push(o)}),n}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}function He(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Ue(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function We(e,t){return e.button===0&&(!t||t===`_self`)&&!Ue(e)}var Ge=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],Ke=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`viewTransition`,`children`],qe=`6`;try{window.__reactRouterVersion=qe}catch{}var Je=r.createContext({isTransitioning:!1}),Ye=r.startTransition;i.flushSync,r.useId;function Xe(e){let{basename:t,children:n,future:i,window:a}=e,o=r.useRef();o.current??=c({window:a,v5Compat:!0});let s=o.current,[l,u]=r.useState({action:s.action,location:s.location}),{v7_startTransition:d}=i||{},f=r.useCallback(e=>{d&&Ye?Ye(()=>u(e)):u(e)},[u,d]);return r.useLayoutEffect(()=>s.listen(f),[s,f]),r.useEffect(()=>Fe(i),[i]),r.createElement(ze,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:i})}var Ze=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Qe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$e=r.forwardRef(function(e,t){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d}=e,f=He(e,Ge),{basename:p}=r.useContext(B),m,h=!1;if(typeof l==`string`&&Qe.test(l)&&(m=l,Ze))try{let e=new URL(window.location.href),t=l.startsWith(`//`)?new URL(e.protocol+l):new URL(l),n=A(t.pathname,p);t.origin===e.origin&&n!=null?l=n+t.search+t.hash:h=!0}catch{}let g=he(l,{relative:i}),_=it(l,{replace:o,state:s,target:c,preventScrollReset:u,relative:i,viewTransition:d});function v(e){n&&n(e),e.defaultPrevented||_(e)}return r.createElement(`a`,$({},f,{href:m||g,onClick:h||a?n:v,ref:t,target:c}))}),et=r.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:i=!1,className:a=``,end:o=!1,style:s,to:c,viewTransition:l,children:u}=e,d=He(e,Ke),f=J(c,{relative:d.relative}),p=G(),m=r.useContext(z),{navigator:h,basename:g}=r.useContext(B),_=m!=null&&at(f)&&l===!0,v=h.encodeLocation?h.encodeLocation(f).pathname:f.pathname,y=p.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=A(b,g)||b);let x=v!==`/`&&v.endsWith(`/`)?v.length-1:v.length,S=y===v||!o&&y.startsWith(v)&&y.charAt(x)===`/`,C=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)===`/`),w={isActive:S,isPending:C,isTransitioning:_},T=S?n:void 0,E;E=typeof a==`function`?a(w):[a,S?`active`:null,C?`pending`:null,_?`transitioning`:null].filter(Boolean).join(` `);let D=typeof s==`function`?s(w):s;return r.createElement($e,$({},d,{"aria-current":T,className:E,ref:t,style:D,to:c,viewTransition:l}),typeof u==`function`?u(w):u)}),tt;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(tt||={});var nt;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(nt||={});function rt(e){let t=r.useContext(R);return!t&&l(!1),t}function it(e,t){let{target:n,replace:i,state:a,preventScrollReset:o,relative:s,viewTransition:c}=t===void 0?{}:t,l=q(),u=G(),d=J(e,{relative:s});return r.useCallback(t=>{We(t,n)&&(t.preventDefault(),l(e,{replace:i===void 0?m(u)===m(d):i,state:a,preventScrollReset:o,relative:s,viewTransition:c}))},[u,l,d,i,a,n,e,o,s,c])}function at(e,t){t===void 0&&(t={});let n=r.useContext(Je);n??l(!1);let{basename:i}=rt(tt.useViewTransitionState),a=J(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=A(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=A(n.nextLocation.pathname,i)||n.nextLocation.pathname;return k(a.pathname,s)!=null||k(a.pathname,o)!=null}export{Le as a,q as c,Ie as i,ye as l,$e as n,Re as o,et as r,Be as s,Xe as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]);export{t};
@@ -1,4 +0,0 @@
1
- import{F as e,M as t,j as n,t as r}from"./clsx-DsHpp3Uj.js";import{Ft as i,It as a,Jt as o,Kt as s,Mt as c,Nt as l,Ot as u,Pt as d,at as f,dt as p,ft as m,it as h,jt as g,kt as _,lt as v,ot as y}from"./CartesianChart-CZSKepVZ.js";var b=e(n()),x=e(t());function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(null,arguments)}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?C(Object(n),!0).forEach(function(t){T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=D(e,`string`);return typeof t==`symbol`?t:t+``}function D(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var O=32,k={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function A(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function j(e){var{data:t,iconType:n,inactiveColor:r}=e,i=O/2,o=O/6,s=O/3,c=t.inactive?r:t.color,l=n??t.type;if(l===`none`)return null;if(l===`plainline`)return x.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:c,strokeDasharray:A(t.payload),x1:0,y1:i,x2:O,y2:i,className:`recharts-legend-icon`});if(l===`line`)return x.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:c,d:`M0,${i}h${s}
2
- A${o},${o},0,1,1,${2*s},${i}
3
- H${O}M${2*s},${i}
4
- A${o},${o},0,1,1,${s},${i}`,className:`recharts-legend-icon`});if(l===`rect`)return x.createElement(`path`,{stroke:`none`,fill:c,d:`M0,${O/8}h${O}v${O*3/4}h${-O}z`,className:`recharts-legend-icon`});if(x.isValidElement(t.legendIcon)){var u=w({},t);return delete u.legendIcon,x.cloneElement(t.legendIcon,u)}return x.createElement(a,{fill:c,cx:i,cy:i,size:O,sizeType:`diameter`,type:l})}function M(e){var{payload:t,iconSize:n,layout:a,formatter:s,inactiveColor:c,iconType:l,labelStyle:u}=e,d={x:0,y:0,width:O,height:O},f={display:a===`horizontal`?`inline-block`:`block`,marginRight:10},p={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,a)=>{var m=t.formatter||s,h=r({"recharts-legend-item":!0,[`legend-item-${a}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var g=typeof u==`object`?w({},u):{};g.color=t.inactive?c:g.color||t.color;var _=m?m(t.value,t,a):t.value;return x.createElement(`li`,S({className:h,style:f,key:`legend-item-${a}`},i(e,t,a)),x.createElement(o,{width:n,height:n,viewBox:d,style:p,"aria-label":`${t.value} legend icon`},x.createElement(j,{data:t,iconType:l,inactiveColor:c})),x.createElement(`span`,{className:`recharts-legend-item-text`,style:g},_))})}var N=e=>{var t=d(e,k),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return x.createElement(`ul`,{className:`recharts-default-legend`,style:a},x.createElement(M,S({},t,{payload:n})))};function P(){return c(_)}var F=[`contextPayload`];function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(null,arguments)}function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?L(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=V(e,`string`);return typeof t==`symbol`?t:t+``}function V(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H(e,t){if(e==null)return{};var n,r,i=U(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function U(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function W(e){return e.value}function G(e){var{contextPayload:t}=e,n=H(e,F),r=l(t,e.payloadUniqBy,W),i=R(R({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content==`function`?x.createElement(e.content,i):x.createElement(N,i)}function K(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),R(R({},l),u)}function q(e){var t=g();return(0,x.useEffect)(()=>{t(f(e))},[t,e]),null}function J(e){var t=g();return(0,x.useEffect)(()=>(t(y(e)),()=>{t(y({width:0,height:0}))}),[t,e]),null}function Y(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var X={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function Z(e){var t=d(e,X),n=P(),r=s(),i=m(),{width:a,height:o,wrapperStyle:c,portal:l}=t,[f,h]=u([n]),g=p(),_=v();if(g==null||_==null)return null;var y=g-(i?.left||0)-(i?.right||0),S=Y(t.layout,o,a,y),C=l?c:R(R({position:`absolute`,width:S?.width||a||`auto`,height:S?.height||o||`auto`},K(c,t,i,g,_,f)),c),w=l??r;return w==null||n==null?null:(0,b.createPortal)(x.createElement(`div`,{className:`recharts-legend-wrapper`,style:C,ref:h},x.createElement(q,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!l&&x.createElement(J,{width:f.width,height:f.height}),x.createElement(G,I({},t,S,{margin:i,chartWidth:g,chartHeight:_,contextPayload:n}))),w)}var Q=x.memo(Z,h);Q.displayName=`Legend`;function $(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function ee(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}export{ee as n,Q as r,$ as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionTokens-B6wfOhyn.js","assets/clsx-DsHpp3Uj.js","assets/CartesianChart-CZSKepVZ.js","assets/dist-w_zu0rIf.js","assets/arrow-left-Bg6VjX8-.js","assets/graphicalItemSelectors-Dk1a_HU_.js","assets/format-zw6IoTwZ.js","assets/SessionCompaction-Duzo69wv.js","assets/LineChart-BYjz-1bE.js","assets/SessionGraph-Bb1BdCWf.js","assets/SessionDiffs-LZrXV0AY.js","assets/file-pen-DWwu4Q-r.js","assets/SessionReplay-C3AZoYFc.js","assets/useMutation-BvFLVjYz.js","assets/play-B0mJPrwl.js","assets/Trends-p9DnVxWQ.js","assets/chart-column-Brz7pC96.js","assets/Settings-HKanGbBq.js","assets/triangle-alert-Bx2lGvGN.js"])))=>i.map(i=>d[i]);
2
- import{A as e,C as t,F as n,M as r,N as i,O as a,S as o,T as s,_ as c,a as l,b as u,c as d,f,g as p,h as m,i as h,j as ee,k as g,l as te,m as ne,n as _,o as re,p as v,r as y,t as b,v as ie,w as x,x as ae,y as S}from"./clsx-DsHpp3Uj.js";import{a as oe,c as se,i as ce,l as C,n as w,o as T,r as le,s as ue,t as de}from"./dist-w_zu0rIf.js";import{n as fe,t as pe}from"./useMutation-BvFLVjYz.js";import{t as E}from"./arrow-left-Bg6VjX8-.js";import{t as me}from"./chart-column-Brz7pC96.js";import{t as he}from"./file-pen-DWwu4Q-r.js";import{t as ge}from"./play-B0mJPrwl.js";import{n as _e,t as ve}from"./triangle-alert-Bx2lGvGN.js";import{a as D,c as O,i as ye,n as k,o as A,r as be,s as j,t as M}from"./format-zw6IoTwZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xe=i((e=>{var t=ee();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}));function Se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let n=!1,u=e=>{ne(e,()=>t.signal,()=>n=!0)},d=c(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await d((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})()),{maxPages:o}=t.options,s=i?p:m;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ce:N,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=l===0?o[0]??r.initialPageParam:N(r,s);if(l>0&&e==null)break;s=await f(s,e),l++}while(l<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function N(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var we=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new fe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=P(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=P(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=P(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=P(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){v.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ae(t,e))}findAll(e={}){return this.getAll().filter(t=>ae(e,t))}notify(e){v.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return v.batch(()=>Promise.all(e.map(e=>e.continue().catch(t))))}};function P(e){return e.options.scope?.id}var Te=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??u(r,t),a=this.get(i);return a||(a=new te({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){v.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>o(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>o(e,t)):t}notify(e){v.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){v.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){v.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ee=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Te,this.#t=e.mutationCache||new we,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=g.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=f.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(s(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ie(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return v.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;v.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return v.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,n={}){let r={revert:!0,...n},i=v.batch(()=>this.#e.findAll(e).map(e=>e.cancel(r)));return Promise.all(i).then(t).catch(t)}invalidateQueries(e,t={}){return v.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,n={}){let r={...n,cancelRefetch:n.cancelRefetch??!0},i=v.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let n=e.fetch(void 0,r);return r.throwOnError||(n=n.catch(t)),e.state.fetchStatus===`paused`?Promise.resolve():n}));return Promise.all(i).then(t)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(s(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t).catch(t)}fetchInfiniteQuery(e){return e.behavior=Se(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t).catch(t)}ensureInfiniteQueryData(e){return e.behavior=Se(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(S(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{x(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(S(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{x(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=u(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===a&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},F=_(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),De=_(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Oe=_(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),ke=_(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ae=_(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),je=_(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Me=_(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ne=_(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Pe=_(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Fe=_(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ie=_(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),I=_(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),L=_(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Le=_(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Re=_(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),R=_(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),z=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),B=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ze=(e=>e?B(e):B),V=n(r(),1),Be=e=>e;function Ve(e,t=Be){let n=V.useSyncExternalStore(e.subscribe,V.useCallback(()=>t(e.getState()),[e,t]),V.useCallback(()=>t(e.getInitialState()),[e,t]));return V.useDebugValue(n),n}var He=e=>{let t=ze(e),n=e=>Ve(t,e);return Object.assign(n,t),n},Ue=(e=>e?He(e):He),We=n(xe(),1),Ge=2e3,H=Ue(e=>({events:[],initialized:!1,setInitial:t=>e({events:t,initialized:!0}),push:t=>e(e=>{if(e.events.find(e=>e.id===t.id))return{};let n=[t,...e.events];return n.length>Ge&&(n.length=Ge),{events:n}})})),U=0,W=null;function Ke(){let{initialized:e,setInitial:t,push:n}=H();(0,V.useEffect)(()=>(e||y.events({limit:1e3}).then(e=>t(e.events)).catch(()=>t([])),U+=1,W||=h(e=>n(e)),()=>{--U,U<=0&&W&&(W(),W=null)}),[])}var G=d(),qe=[{id:`nav:timeline`,title:`Timeline`,to:`/`,group:`nav`},{id:`nav:logs`,title:`Logs (disk-backed history)`,to:`/logs`,group:`nav`},{id:`nav:projects`,title:`Projects`,to:`/projects`,group:`nav`},{id:`nav:search`,title:`Search`,to:`/search`,group:`nav`},{id:`nav:agents`,title:`Agents`,to:`/agents`,group:`nav`},{id:`nav:permissions`,title:`Permissions`,to:`/permissions`,group:`nav`},{id:`nav:cron`,title:`Scheduled`,to:`/cron`,group:`nav`},{id:`nav:trends`,title:`Trends`,to:`/trends`,group:`nav`},{id:`nav:budgets`,title:`Settings · Budgets`,to:`/settings/budgets`,group:`nav`},{id:`nav:anomaly`,title:`Settings · Anomaly`,to:`/settings/anomaly`,group:`nav`},{id:`nav:triggers`,title:`Settings · Triggers`,to:`/settings/triggers`,group:`nav`}];function Je(){let[e,t]=(0,V.useState)(!1),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(0),o=se(),s=l({queryKey:[`projects`],queryFn:y.projects,enabled:e});(0,V.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e),r(``),a(0)),e.key===`Escape`&&t(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let c=(0,V.useMemo)(()=>(s.data?.projects??[]).map(e=>({id:`proj:${e.name}`,title:e.name,hint:`${e.eventCount} events · ${e.sessionIds.length} sessions`,to:`/projects/${encodeURIComponent(e.name)}`,group:`project`})),[s.data]),u=(0,V.useMemo)(()=>[...qe,...c],[c]),d=(0,V.useMemo)(()=>{let e=n.trim().toLowerCase();return e?u.filter(t=>t.title.toLowerCase().includes(e)||(t.hint??``).toLowerCase().includes(e)).slice(0,30):u.slice(0,20)},[u,n]);if((0,V.useEffect)(()=>a(0),[n]),!e)return null;let f=e=>{t(!1),o(e.to)};return(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-start justify-center pt-[10vh] px-4`,onClick:()=>t(!1),children:(0,G.jsxs)(`div`,{className:`w-full max-w-xl bg-bg-surface border border-bg-border rounded-xl shadow-2xl overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-bg-border`,children:[(0,G.jsx)(L,{className:`w-4 h-4 text-fg-muted`}),(0,G.jsx)(`input`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),a(e=>Math.min(e+1,d.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),a(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=d[i];t&&f(t)}},placeholder:`Jump to view, project, session…`,className:`flex-1 bg-transparent outline-none text-sm`}),(0,G.jsx)(`kbd`,{className:`text-[10px] text-fg-muted mono border border-bg-border rounded px-1`,children:`esc`})]}),(0,G.jsxs)(`div`,{className:`max-h-[60vh] overflow-y-auto py-1`,children:[d.length===0&&(0,G.jsx)(`div`,{className:`p-4 text-fg-muted text-sm text-center`,children:`no results`}),d.map((e,t)=>(0,G.jsxs)(`button`,{onClick:()=>f(e),className:b(`w-full flex items-center justify-between gap-3 px-4 py-2 text-left transition`,t===i?`bg-accent/20 text-accent`:`text-fg hover:bg-bg-elev`),onMouseEnter:()=>a(t),children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm`,children:e.title}),e.hint&&(0,G.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:e.hint})]}),(0,G.jsx)(`div`,{className:`text-[10px] text-fg-muted uppercase mono`,children:e.group})]},e.id))]}),(0,G.jsxs)(`div`,{className:`px-4 py-2 border-t border-bg-border flex items-center justify-between text-[11px] text-fg-muted`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1 mono`,children:`↑↓`}),` navigate`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1 mono`,children:`↵`}),` open`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1 mono`,children:`⌘K`}),` toggle`]})]})]})})}function Ye(){Ke();let e=l({queryKey:[`health`],queryFn:y.health,refetchInterval:1e4});return(0,G.jsxs)(`div`,{className:`h-full flex flex-col bg-bg text-fg`,children:[(0,G.jsxs)(`header`,{className:`flex items-center gap-6 px-5 py-3 border-b border-bg-border`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(F,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`div`,{className:`font-bold`,children:`agentwatch`}),(0,G.jsx)(`div`,{className:`text-xs text-fg-dim`,children:e.data?.version?`v${e.data.version}`:``})]}),(0,G.jsxs)(`nav`,{className:`flex items-center gap-1 text-sm`,children:[(0,G.jsx)(K,{to:`/`,label:`Timeline`,icon:(0,G.jsx)(F,{className:`w-4 h-4`}),end:!0}),(0,G.jsx)(K,{to:`/logs`,label:`Logs`,icon:(0,G.jsx)(I,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/projects`,label:`Projects`,icon:(0,G.jsx)(Ne,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/search`,label:`Search`,icon:(0,G.jsx)(L,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/agents`,label:`Agents`,icon:(0,G.jsx)(z,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/permissions`,label:`Permissions`,icon:(0,G.jsx)(R,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/cron`,label:`Scheduled`,icon:(0,G.jsx)(je,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/trends`,label:`Trends`,icon:(0,G.jsx)(me,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/settings`,label:`Settings`,icon:(0,G.jsx)(_e,{className:`w-4 h-4`})})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-xs text-fg-dim`,children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1.5 py-0.5 mono text-[10px]`,children:`⌘K`}),(0,G.jsx)(`span`,{className:b(`w-2 h-2 rounded-full`,e.isSuccess?`bg-ok`:`bg-warn`)}),(0,G.jsx)(`span`,{children:e.isSuccess?`connected`:`connecting…`})]})]}),(0,G.jsx)(`main`,{className:`flex-1 overflow-hidden`,children:(0,G.jsx)(oe,{})}),(0,G.jsx)(Je,{})]})}function K({to:e,label:t,icon:n,end:r,disabled:i}){return i?(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-fg-muted cursor-not-allowed`,title:`coming in the next phase`,children:[n,t]}):(0,G.jsxs)(le,{to:e,end:r,className:({isActive:e})=>b(`flex items-center gap-1.5 px-3 py-1.5 rounded-md transition`,e?`bg-accent/20 text-accent`:`text-fg-dim hover:bg-bg-elev hover:text-fg`),children:[n,t]})}var Xe=[`prompt`,`response`,`tool_call`,`shell_exec`,`file_write`,`file_read`,`file_change`,`session_start`,`session_end`,`compaction`],Ze=[{id:`1h`,label:`1h`,ms:60*6e4},{id:`24h`,label:`24h`,ms:1440*6e4},{id:`7d`,label:`7d`,ms:10080*6e4},{id:`all`,label:`all`,ms:null}];function Qe(){let e=H(e=>e.events),t=H(e=>e.initialized),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(`all`),[o,s]=(0,V.useState)(`all`),[c,u]=(0,V.useState)(`24h`),d=(0,V.useRef)(null),f=l({queryKey:[`agents`],queryFn:y.agents,refetchInterval:1e4});(0,V.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey)return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`)||(e.preventDefault(),d.current?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let p=(0,V.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.agent,(t.get(n.agent)??0)+1);return t},[e]),m=(0,V.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.type,(t.get(n.type)??0)+1);return t},[e]),h=(0,V.useMemo)(()=>{let t=[[`all`,e.length]],n=f.data?.agents??[];for(let e of n)!e.present||!e.instrumented||t.push([e.name,p.get(e.name)??0]);for(let[e,n]of p)t.find(t=>t[0]===e)||t.push([e,n]);return t},[f.data,p,e.length]),ee=(0,V.useMemo)(()=>[[`all`,e.length]].concat(Xe.filter(e=>m.has(e)).map(e=>[e,m.get(e)])),[e.length,m]),g=(0,V.useMemo)(()=>{let t=n.trim().toLowerCase(),r=Ze.find(e=>e.id===c)?.ms??null,a=r==null?0:Date.now()-r;return e.filter(e=>i!==`all`&&e.agent!==i||o!==`all`&&e.type!==o||r!=null&&new Date(e.ts).getTime()<a?!1:t?(e.summary??``).toLowerCase().includes(t)||(e.path??``).toLowerCase().includes(t)||(e.cmd??``).toLowerCase().includes(t)||(e.tool??``).toLowerCase().includes(t)||(e.details?.fullText??``).toLowerCase().includes(t):!0)},[e,n,i,o,c]),te=t&&e.length>0&&g.length===0&&i!==`all`;return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 px-5 py-3 border-b border-bg-border bg-bg-surface`,children:[(0,G.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-lg`,children:[(0,G.jsx)(L,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none`}),(0,G.jsx)(`input`,{ref:d,value:n,onChange:e=>r(e.target.value),placeholder:`filter the live buffer… (press / to focus)`,className:`w-full bg-bg-elev border border-bg-border rounded-md pl-9 pr-3 py-1.5 text-sm outline-none focus:border-accent`})]}),(0,G.jsx)(et,{label:`agent`,value:i,options:h,onChange:e=>a(e)}),(0,G.jsx)(et,{label:`type`,value:o,options:ee,onChange:e=>s(e)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-dim`,children:`window:`}),Ze.map(e=>(0,G.jsx)(`button`,{onClick:()=>u(e.id),className:b(`px-2 py-1 rounded-md transition mono`,c===e.id?`bg-accent/20 text-accent border border-accent/40`:`border border-bg-border text-fg-dim hover:bg-bg-elev`),children:e.label},e.id))]}),(0,G.jsxs)(`div`,{className:`ml-auto text-xs text-fg-dim`,children:[(0,G.jsx)(Pe,{className:`inline w-3.5 h-3.5 mr-1`}),g.length,` / `,e.length,` events`]})]}),te&&(0,G.jsxs)(`div`,{className:`px-5 py-2 text-xs text-warn bg-warn/10 border-b border-warn/30`,children:[`No `,(0,G.jsx)(`span`,{className:`mono`,children:i}),` events in the live buffer. agentwatch only captures events fired `,(0,G.jsx)(`i`,{children:`after`}),` it started. To see historical `,(0,G.jsx)(`span`,{className:`mono`,children:i}),` activity, open the `,(0,G.jsx)(w,{to:`/logs`,className:`text-accent underline`,children:`Logs`}),` view (reads disk JSONLs).`]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[!t&&(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`}),t&&e.length===0&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsx)(`div`,{className:`mb-2`,children:`No events yet.`}),(0,G.jsxs)(`div`,{className:`text-xs`,children:[`Launch a Claude Code / Codex / Cursor / Gemini / Hermes / OpenClaw session and events will stream in real-time.`,` `,(0,G.jsx)(w,{to:`/logs`,className:`text-accent underline`,children:`Or open /logs to search historical JSONLs.`})]})]}),t&&e.length>0&&(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 bg-bg-surface border-b border-bg-border z-10`,children:(0,G.jsxs)(`tr`,{className:`text-left text-xs uppercase text-fg-muted`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 w-36`,children:`date / time`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-28`,children:`agent`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-32`,children:`type`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-10`,children:`risk`}),(0,G.jsx)(`th`,{className:`px-3 py-2`,children:`event`})]})}),(0,G.jsx)(`tbody`,{children:g.slice(0,500).map(e=>(0,G.jsx)($e,{event:e},e.id))})]})]})]})}function $e({event:e}){let t=e.summary??e.cmd??e.path??e.tool??`—`;return(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/40 row-hover`,children:[(0,G.jsx)(`td`,{className:`px-4 py-1.5 text-fg-dim mono text-xs align-top whitespace-nowrap`,children:be(e.ts)}),(0,G.jsx)(`td`,{className:b(`px-2 py-1.5 mono text-xs align-top`,M(e.agent)),children:e.agent}),(0,G.jsxs)(`td`,{className:`px-2 py-1.5 mono text-xs align-top`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted mr-1`,children:O(e.type)}),e.type]}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:(0,G.jsx)(`span`,{className:b(`inline-block text-[10px] mono px-1.5 py-0.5 rounded`,j(e.riskScore)),children:e.riskScore})}),(0,G.jsxs)(`td`,{className:`px-3 py-1.5 align-top`,children:[(0,G.jsx)(w,{to:`/events/${encodeURIComponent(e.id)}`,className:`hover:text-accent`,children:(0,G.jsx)(`span`,{className:`mono text-xs truncate inline-block max-w-3xl`,children:t})}),e.sessionId&&(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e.sessionId)}`,className:`ml-3 text-[10px] text-fg-muted hover:text-accent mono`,title:e.sessionId,children:[`session:`,e.sessionId.slice(0,10)]})]})]})}function et({label:e,value:t,options:n,onChange:r}){return(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-fg-dim`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`select`,{value:t,onChange:e=>r(e.target.value),className:`bg-bg-elev border border-bg-border rounded-md px-2 py-1 outline-none focus:border-accent`,children:n.map(([e,t])=>(0,G.jsxs)(`option`,{value:e,children:[e,` (`,t,`)`]},e))})]})}function tt(){let e=l({queryKey:[`projects`],queryFn:y.projects,refetchInterval:5e3});if(e.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});if(e.error)return(0,G.jsxs)(`div`,{className:`p-6 text-danger`,children:[`failed: `,String(e.error)]});let t=e.data?.projects??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`Projects`}),(0,G.jsx)(`span`,{className:`text-sm text-fg-dim`,children:t.length})]}),t.length===0?(0,G.jsx)(`div`,{className:`p-10 text-center text-fg-dim`,children:`No projects detected yet — once an agent writes to a project, it'll appear here.`}):(0,G.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 p-5`,children:t.map(e=>(0,G.jsxs)(w,{to:`/projects/${encodeURIComponent(e.name)}`,className:`block border border-bg-border rounded-lg p-4 bg-bg-surface hover:bg-bg-elev hover:border-accent/40 transition`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,G.jsx)(Ne,{className:`w-4 h-4 text-accent shrink-0`}),(0,G.jsx)(`div`,{className:`font-medium truncate`,children:e.name})]}),(0,G.jsx)(De,{className:`w-4 h-4 text-fg-muted`})]}),(0,G.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 gap-2 text-xs`,children:[(0,G.jsx)(q,{label:`events`,value:String(e.eventCount)}),(0,G.jsx)(q,{label:`sessions`,value:String(e.sessionIds.length)}),(0,G.jsx)(q,{label:`cost`,value:A(e.cost)})]}),e.lastTs&&(0,G.jsxs)(`div`,{className:`mt-2 text-[11px] text-fg-muted mono`,children:[`last: `,k(e.lastTs)]})]},e.name))})]})}function q({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`bg-bg-elev rounded-md px-2 py-1.5`,children:[(0,G.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`mono`,children:t})]})}function nt(){let{name:e=``}=C(),t=l({queryKey:[`project-sessions`,e],queryFn:()=>y.projectSessions(e),refetchInterval:5e3}).data?.sessions??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(w,{to:`/projects`,className:`text-fg-dim hover:text-accent`,children:(0,G.jsx)(E,{className:`w-4 h-4 inline`})}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:decodeURIComponent(e)}),(0,G.jsxs)(`span`,{className:`text-sm text-fg-dim`,children:[t.length,` sessions`]})]}),(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 bg-bg-surface border-b border-bg-border`,children:(0,G.jsxs)(`tr`,{className:`text-left text-xs uppercase text-fg-muted`,children:[(0,G.jsx)(`th`,{className:`px-5 py-2 w-32`,children:`agent`}),(0,G.jsx)(`th`,{className:`px-2 py-2`,children:`session`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-20`,children:`events`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-24`,children:`cost`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-44`,children:`first`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-44`,children:`last`})]})}),(0,G.jsx)(`tbody`,{children:t.map(e=>(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/40 row-hover`,children:[(0,G.jsx)(`td`,{className:b(`px-5 py-1.5 mono text-xs`,M(e.agent)),children:e.agent}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs`,children:(0,G.jsx)(w,{to:`/sessions/${encodeURIComponent(e.sessionId)}`,className:`hover:text-accent`,children:e.sessionId})}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs`,children:e.eventCount}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs`,children:A(e.cost)}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs text-fg-dim`,children:e.firstTs?k(e.firstTs):`—`}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs text-fg-dim`,children:e.lastTs?k(e.lastTs):`—`})]},e.sessionId))})]})]})}function rt(){let{id:e=``}=C(),t=l({queryKey:[`session`,e],queryFn:()=>y.session(e),refetchInterval:2e3});if(t.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});if(t.error)return(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:String(t.error)});let n=t.data?.events??[],r=n;return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(w,{to:-1,className:`text-fg-dim hover:text-accent`,children:(0,G.jsx)(E,{className:`w-4 h-4 inline`})}),(0,G.jsxs)(`h1`,{className:`text-lg font-bold mono`,children:[`session:`,e.slice(0,16)]}),(0,G.jsx)(`span`,{className:b(`text-sm`,M(t.data?.agent)),children:t.data?.agent}),(0,G.jsxs)(`span`,{className:`text-sm text-fg-dim`,children:[n.length,` events`]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/tokens`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(me,{className:`w-3.5 h-3.5`}),` tokens`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/compaction`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(F,{className:`w-3.5 h-3.5`}),` compaction`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/graph`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(Fe,{className:`w-3.5 h-3.5`}),` graph`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/diffs`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(he,{className:`w-3.5 h-3.5`}),` diffs`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/replay`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(ge,{className:`w-3.5 h-3.5`}),` replay`]}),(0,G.jsxs)(`a`,{href:`/api/sessions/${encodeURIComponent(e)}/export?format=md&inline=1`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(Me,{className:`w-3.5 h-3.5`}),` .md`]}),(0,G.jsxs)(`a`,{href:`/api/sessions/${encodeURIComponent(e)}/export?format=json&inline=1`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(Me,{className:`w-3.5 h-3.5`}),` .json`]})]})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-auto`,children:r.map(e=>(0,G.jsx)(it,{event:e},e.id))})]})}function it({event:e}){let t=e.details?.fullText??e.details?.toolResult??e.details?.thinking;return(0,G.jsxs)(`div`,{className:`px-5 py-2 border-b border-bg-border/30 hover:bg-bg-surface/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted mono`,children:ye(e.ts)}),(0,G.jsx)(`span`,{className:b(`mono`,M(e.agent)),children:e.agent}),(0,G.jsxs)(`span`,{className:`mono text-fg-dim`,children:[O(e.type),` `,e.type]}),(0,G.jsx)(`span`,{className:b(`text-[10px] mono px-1.5 rounded`,j(e.riskScore)),children:e.riskScore}),(0,G.jsx)(w,{to:`/events/${encodeURIComponent(e.id)}`,className:`ml-auto text-fg-muted hover:text-accent text-[11px]`,children:`detail →`})]}),e.summary&&(0,G.jsx)(`div`,{className:`mt-1 text-sm mono whitespace-pre-wrap`,children:e.summary}),t&&(0,G.jsxs)(`pre`,{className:`mt-1 text-xs mono text-fg-dim bg-bg-surface rounded p-2 overflow-x-auto max-h-40 overflow-y-auto whitespace-pre-wrap`,children:[t.slice(0,2e3),t.length>2e3&&`… (${t.length-2e3} more chars)`]})]})}function at(){let{id:e=``}=C(),t=l({queryKey:[`event`,e],queryFn:()=>y.event(e)});if(t.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});if(t.error)return(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:String(t.error)});let n=t.data?.event;return n?(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(w,{to:-1,className:`text-fg-dim hover:text-accent`,children:(0,G.jsx)(E,{className:`w-4 h-4 inline`})}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`event`}),(0,G.jsx)(`span`,{className:`text-sm text-fg-dim mono`,children:n.id})]}),(0,G.jsxs)(`div`,{className:`p-5 space-y-4 max-w-5xl`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,G.jsx)(J,{label:`time`,value:k(n.ts)}),(0,G.jsx)(J,{label:`agent`,value:(0,G.jsx)(`span`,{className:M(n.agent),children:n.agent})}),(0,G.jsx)(J,{label:`type`,value:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`text-fg-muted`,children:[O(n.type),` `]}),n.type]})}),(0,G.jsx)(J,{label:`risk`,value:(0,G.jsx)(`span`,{className:b(`mono px-1.5 rounded`,j(n.riskScore)),children:n.riskScore})}),n.sessionId&&(0,G.jsx)(J,{label:`session`,value:(0,G.jsx)(w,{to:`/sessions/${encodeURIComponent(n.sessionId)}`,className:`hover:text-accent mono text-xs`,children:n.sessionId.slice(0,20)})}),n.tool&&(0,G.jsx)(J,{label:`tool`,value:n.tool}),n.path&&(0,G.jsx)(J,{label:`path`,value:(0,G.jsx)(`span`,{className:`mono text-xs`,children:n.path})})]}),n.summary&&(0,G.jsx)(Y,{label:`summary`,children:(0,G.jsx)(`div`,{className:`whitespace-pre-wrap mono text-sm`,children:n.summary})}),n.cmd&&(0,G.jsx)(Y,{label:`cmd`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:n.cmd})}),n.details?.fullText&&(0,G.jsx)(Y,{label:`full text`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:n.details.fullText})}),n.details?.thinking&&(0,G.jsx)(Y,{label:`thinking`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap text-fg-dim`,children:n.details.thinking})}),n.details?.toolInput&&(0,G.jsx)(Y,{label:`tool input`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:JSON.stringify(n.details.toolInput,null,2)})}),n.details?.toolResult&&(0,G.jsx)(Y,{label:b(`tool result`,n.details.toolError&&`(error)`),children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:n.details.toolResult})}),n.details?.usage&&(0,G.jsx)(Y,{label:`usage`,children:(0,G.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 text-sm`,children:[(0,G.jsx)(J,{label:`input`,value:D(n.details.usage.input)}),(0,G.jsx)(J,{label:`output`,value:D(n.details.usage.output)}),(0,G.jsx)(J,{label:`cache read`,value:D(n.details.usage.cacheRead)}),(0,G.jsx)(J,{label:`cache create`,value:D(n.details.usage.cacheCreate)}),n.details.cost!=null&&(0,G.jsx)(J,{label:`cost`,value:A(n.details.cost)}),n.details.model&&(0,G.jsx)(J,{label:`model`,value:(0,G.jsx)(`span`,{className:`mono text-xs`,children:n.details.model})})]})}),n.details?.source&&(0,G.jsxs)(`div`,{className:`text-xs text-fg-muted mono`,children:[`source: `,n.details.source]})]})]}):(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:`event not found`})}function J({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`mt-0.5`,children:t})]})}function Y({label:e,children:t}){return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-xs uppercase text-fg-muted mb-1`,children:e}),(0,G.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md p-3 overflow-x-auto`,children:t})]})}function ot(){let[e,t]=(0,V.useState)(``),[n,r]=(0,V.useState)(`live`),i=(0,V.useRef)(null);(0,V.useEffect)(()=>{i.current?.focus()},[]);let a=pe({mutationFn:({q:e,m:t})=>y.search(e,t,100)});return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let r=e.trim();r&&a.mutate({q:r,m:n})},className:`px-5 py-4 border-b border-bg-border bg-bg-surface flex items-center gap-3`,children:[(0,G.jsxs)(`div`,{className:`relative flex-1`,children:[(0,G.jsx)(L,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none`}),(0,G.jsx)(`input`,{ref:i,value:e,onChange:e=>t(e.target.value),placeholder:`search — enter to run`,className:`w-full bg-bg-elev border border-bg-border rounded-md pl-9 pr-3 py-2 outline-none focus:border-accent`})]}),(0,G.jsx)(`div`,{className:`flex rounded-md overflow-hidden border border-bg-border`,children:[`live`,`cross`,`semantic`].map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:b(`px-3 py-2 text-xs transition`,n===e?`bg-accent/20 text-accent`:`bg-bg-elev text-fg-dim hover:bg-bg`),children:e},e))}),(0,G.jsx)(`button`,{type:`submit`,disabled:!e.trim()||a.isPending,className:`px-4 py-2 bg-accent/20 text-accent rounded-md text-xs hover:bg-accent/30 disabled:opacity-40`,children:a.isPending?`searching…`:`search`})]}),(0,G.jsx)(st,{mode:n}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[a.data?.status&&(0,G.jsx)(`div`,{className:`px-5 py-2 text-xs text-warn bg-warn/10 border-b border-warn/30`,children:a.data.status}),a.data?.error&&(0,G.jsx)(`div`,{className:`px-5 py-2 text-xs text-danger bg-danger/10 border-b border-danger/30`,children:a.data.error}),a.data&&a.data.hits.length===0&&!a.isPending&&(0,G.jsx)(`div`,{className:`p-10 text-center text-fg-dim`,children:`no matches.`}),a.data&&a.data.hits.length>0&&(0,G.jsx)(ct,{hits:a.data.hits,mode:a.data.mode}),!a.data&&!a.isPending&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsx)(`div`,{className:`mb-1`,children:`Three modes:`}),(0,G.jsxs)(`ul`,{className:`text-xs space-y-1 inline-block text-left`,children:[(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`b`,{children:`live`}),` — substring across the current in-memory buffer (fast, recent only)`]}),(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`b`,{children:`cross`}),` — ripgrep across every JSONL on disk (slow first time, thorough)`]}),(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`b`,{children:`semantic`}),` — hybrid BM25 + embedding search (fuzzy, needs the index built in the TUI first)`]})]})]})]})]})}function st({mode:e}){return(0,G.jsx)(`div`,{className:`px-5 py-2 text-xs text-fg-muted bg-bg-surface border-b border-bg-border/50`,children:{live:`searching the in-memory ring buffer (500–2000 events).`,cross:`searching every session JSONL on disk.`,semantic:`searching the hybrid BM25 + embedding index.`}[e]})}function ct({hits:e}){return(0,G.jsx)(`div`,{children:e.map((e,t)=>{if(e.kind===`live`){let n=e.event;return(0,G.jsxs)(w,{to:`/events/${encodeURIComponent(n.id)}`,className:`block px-5 py-2 border-b border-bg-border/40 row-hover`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted mono`,children:ye(n.ts)}),(0,G.jsx)(`span`,{className:b(`mono`,M(n.agent)),children:n.agent}),(0,G.jsxs)(`span`,{className:`mono text-fg-dim`,children:[O(n.type),` `,n.type]})]}),(0,G.jsx)(`div`,{className:`mt-0.5 mono text-sm truncate`,children:n.summary??n.cmd??n.path??n.tool??``})]},t)}let n=e.hit;return(0,G.jsxs)(w,{to:n.sessionId?`/sessions/${encodeURIComponent(n.sessionId)}`:`#`,className:`block px-5 py-2 border-b border-bg-border/40 row-hover`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:b(`mono`,M(n.agent??`unknown`)),children:n.agent??`—`}),(0,G.jsx)(`span`,{className:`mono text-fg-dim`,children:n.sessionId?.slice(0,20)}),n.score!=null&&(0,G.jsxs)(`span`,{className:`text-fg-muted mono text-[10px]`,children:[`score `,n.score.toFixed(3)]})]}),(0,G.jsx)(`div`,{className:`mt-0.5 mono text-sm whitespace-pre-wrap line-clamp-3 text-fg-dim`,children:n.snippet??``})]},t)})})}function lt(){let e=l({queryKey:[`agents`],queryFn:y.agents,refetchInterval:1e4}).data?.agents??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(z,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`agents`}),(0,G.jsxs)(`span`,{className:`text-sm text-fg-dim`,children:[e.filter(e=>e.present).length,` installed`]})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 p-5`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.present?e.instrumented?(0,G.jsx)(ke,{className:`w-4 h-4 text-ok`}):(0,G.jsx)(ve,{className:`w-4 h-4 text-warn`}):(0,G.jsx)(Ae,{className:`w-4 h-4 text-fg-muted`}),(0,G.jsx)(`div`,{className:b(`font-bold`,M(e.name)),children:e.label})]}),(0,G.jsx)(`div`,{className:`mt-2 text-xs text-fg-dim mono`,children:e.present?e.instrumented?`installed · events captured`:`detected · events TBD`:`not detected`}),e.configPath&&(0,G.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-muted mono break-all`,children:e.configPath}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-center gap-4 text-xs`,children:[(0,G.jsxs)(`span`,{className:`text-fg-dim`,children:[`events: `,(0,G.jsx)(`span`,{className:`mono`,children:e.eventCount})]}),e.lastEventAt&&(0,G.jsxs)(`span`,{className:`text-fg-dim`,children:[`last: `,(0,G.jsx)(`span`,{className:`mono`,children:k(e.lastEventAt)})]})]})]},e.name))})]})}function ut(){let e=l({queryKey:[`permissions`],queryFn:y.permissions});if(e.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});let t=e.data??{};return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(R,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`permissions`})]}),(0,G.jsxs)(`div`,{className:`p-5 space-y-5 max-w-5xl`,children:[(0,G.jsx)(X,{label:`Claude Code`,perms:t.claude}),(0,G.jsx)(X,{label:`Codex`,perms:t.codex}),(0,G.jsx)(X,{label:`Gemini`,perms:t.gemini}),(0,G.jsx)(X,{label:`OpenClaw`,perms:t.openclaw})]})]})}function X({label:e,perms:t}){return t?(0,G.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,G.jsx)(Re,{className:`w-4 h-4 text-ok`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:e})]}),(0,G.jsx)(`pre`,{className:`mono text-xs text-fg-dim overflow-x-auto whitespace-pre-wrap`,children:JSON.stringify(t,null,2)})]}):(0,G.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,G.jsx)(Le,{className:`w-4 h-4 text-fg-muted`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:e}),(0,G.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`not installed / no config`})]})})}function dt(){let e=l({queryKey:[`cron`],queryFn:y.cron,refetchInterval:1e4});if(e.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});let t=e.data?.jobs??[],n=e.data?.heartbeats??[],r=e.data?.scheduledEvents??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(je,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`scheduled`})]}),(0,G.jsxs)(`section`,{className:`p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,G.jsx)(Oe,{className:`w-4 h-4 text-accent`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:`cron jobs`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-dim`,children:t.length})]}),t.length===0&&(0,G.jsx)(`div`,{className:`text-sm text-fg-dim`,children:`No OpenClaw cron jobs installed.`}),t.length>0&&(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`text-left text-xs uppercase text-fg-muted`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`name`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`schedule`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`agent`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`channel`}),(0,G.jsx)(`th`,{className:`py-1`,children:`last run`})]})}),(0,G.jsx)(`tbody`,{children:t.map(e=>(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/30 mono text-xs`,children:[(0,G.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.name??e.id}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.cron??e.schedule??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.agentId??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.channel??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 text-fg-dim`,children:e.lastRunAt?k(e.lastRunAt):`never`})]},e.id))})]})]}),(0,G.jsxs)(`section`,{className:`p-5 border-t border-bg-border`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,G.jsx)(Ie,{className:`w-4 h-4 text-accent`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:`heartbeats`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-dim`,children:n.length})]}),n.length===0&&(0,G.jsx)(`div`,{className:`text-sm text-fg-dim`,children:`No heartbeat tasks detected.`}),n.length>0&&(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`text-left text-xs uppercase text-fg-muted`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`task`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`agent`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`last`}),(0,G.jsx)(`th`,{className:`py-1`,children:`file`})]})}),(0,G.jsx)(`tbody`,{children:n.map((e,t)=>(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/30 mono text-xs`,children:[(0,G.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.taskName??e.name??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.agentId??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.lastHeartbeatAt?k(e.lastHeartbeatAt):`—`}),(0,G.jsx)(`td`,{className:`py-1.5 text-fg-dim truncate max-w-md`,children:e.filePath??e.file??``})]},t))})]})]}),(0,G.jsxs)(`section`,{className:`p-5 border-t border-bg-border`,children:[(0,G.jsxs)(`h2`,{className:`font-bold mb-3`,children:[`recent scheduled events `,(0,G.jsx)(`span`,{className:`text-xs font-normal text-fg-dim`,children:r.length})]}),r.length===0&&(0,G.jsx)(`div`,{className:`text-sm text-fg-dim`,children:`No scheduled events in the live buffer.`}),r.slice(0,50).map(e=>(0,G.jsxs)(`div`,{className:`mono text-xs py-1 border-b border-bg-border/20`,children:[(0,G.jsx)(`span`,{className:`text-fg-dim mr-2`,children:k(e.ts)}),(0,G.jsx)(`span`,{className:`text-accent mr-2`,children:e.agent}),(0,G.jsx)(`span`,{className:`mr-2`,children:e.type}),(0,G.jsx)(`span`,{className:`text-fg-dim`,children:e.summary})]},e.id))]})]})}var Z=[{id:`1h`,label:`1h`,hours:1},{id:`24h`,label:`24h`,hours:24},{id:`7d`,label:`7d`,hours:168},{id:`30d`,label:`30d`,hours:720},{id:`all`,label:`all`,hours:null}],ft=[`claude-code`,`codex`,`gemini`];function pt(){let[e,t]=(0,V.useState)(``),[n,r]=(0,V.useState)(`7d`),[i,a]=(0,V.useState)(new Set),[o,s]=(0,V.useState)(100),c=(0,V.useRef)(null);(0,V.useEffect)(()=>{c.current?.focus()},[]);let u=l({queryKey:[`agents`],queryFn:y.agents});(0,V.useMemo)(()=>new Set(ft),[]);let d=pe({mutationFn:({q:e,since:t,agents:n,limit:r})=>y.search(e,`cross`,r,{since:t,agents:n})});return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`form`,{onSubmit:t=>{t?.preventDefault();let r=e.trim();if(!r)return;let a=Z.find(e=>e.id===n)?.hours??null,s=a==null?void 0:new Date(Date.now()-a*36e5).toISOString(),c=i.size>0?Array.from(i):void 0;d.mutate({q:r,since:s,agents:c,limit:o})},className:`flex flex-wrap items-center gap-3 px-5 py-3 border-b border-bg-border bg-bg-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(I,{className:`w-4 h-4 text-accent`}),(0,G.jsx)(`h1`,{className:`font-bold`,children:`Logs`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-dim`,children:`disk-backed history search`})]}),(0,G.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-xl`,children:[(0,G.jsx)(L,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none`}),(0,G.jsx)(`input`,{ref:c,value:e,onChange:e=>t(e.target.value),placeholder:`search every session file on disk — press enter`,className:`w-full bg-bg-elev border border-bg-border rounded-md pl-9 pr-3 py-1.5 text-sm outline-none focus:border-accent`})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-dim`,children:`when:`}),Z.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:b(`px-2 py-1 rounded-md transition mono`,n===e.id?`bg-accent/20 text-accent border border-accent/40`:`border border-bg-border text-fg-dim hover:bg-bg-elev`),children:e.label},e.id))]}),(0,G.jsx)(`button`,{type:`submit`,disabled:!e.trim()||d.isPending,className:`px-4 py-1.5 rounded-md bg-accent/20 text-accent text-xs hover:bg-accent/30 disabled:opacity-40`,children:d.isPending?`searching…`:`search`})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 px-5 py-2 border-b border-bg-border/50 text-xs bg-bg/40`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted`,children:`agents:`}),ft.map(e=>{let t=i.has(e),n=u.data?.agents.find(t=>t.name===e&&t.present);return(0,G.jsx)(`button`,{onClick:()=>{let n=new Set(i);t?n.delete(e):n.add(e),a(n)},className:b(`px-2 py-0.5 rounded-md border transition mono`,t?`border-accent/40 bg-accent/20 ${M(e)}`:`border-bg-border text-fg-dim hover:bg-bg-elev ${n?``:`opacity-50`}`),title:n?`${e} (installed)`:`${e} — not detected on disk`,children:e},e)}),(0,G.jsx)(`span`,{className:`text-fg-muted ml-3`,children:`results cap:`}),(0,G.jsx)(`select`,{value:o,onChange:e=>s(Number(e.target.value)),className:`bg-bg-elev border border-bg-border rounded-md px-2 py-0.5 mono`,children:[50,100,200,500].map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),u.data?.agents.some(e=>e.name===`openclaw`&&e.present)&&(0,G.jsx)(`span`,{className:`ml-auto text-warn/80`,children:`OpenClaw + Hermes not scanned yet (SQLite storage — adapter TBD).`})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[d.isPending&&(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`searching disk…`}),d.isError&&(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:String(d.error.message)}),d.data&&d.data.hits.length===0&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsxs)(`div`,{children:[`No matches on disk for “`,e.trim(),`”.`]}),(0,G.jsx)(`div`,{className:`text-xs mt-2`,children:`Try a wider time window, drop agent filters, or switch query to something broader.`})]}),d.data&&d.data.hits.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`px-5 py-2 text-xs text-fg-dim bg-bg-surface border-b border-bg-border`,children:[(0,G.jsx)(Pe,{className:`inline w-3.5 h-3.5 mr-1`}),d.data.hits.length,` hits`,d.data.totalScanned!=null&&d.data.totalScanned!==d.data.hits.length&&(0,G.jsxs)(`span`,{children:[` · `,d.data.totalScanned,` scanned before filters`]}),(0,G.jsxs)(`span`,{children:[` · window: `,Z.find(e=>e.id===n)?.label]}),i.size>0&&(0,G.jsxs)(`span`,{children:[` · agents: `,Array.from(i).join(`, `)]})]}),(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 bg-bg-surface border-b border-bg-border z-10`,children:(0,G.jsxs)(`tr`,{className:`text-left text-xs uppercase text-fg-muted`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 w-36`,children:`date / time`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-28`,children:`agent`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-44`,children:`session`}),(0,G.jsx)(`th`,{className:`px-3 py-2`,children:`match`})]})}),(0,G.jsx)(`tbody`,{children:d.data.hits.map((e,t)=>{let n=e.hit??e,r=n.ts;return(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/30 row-hover`,children:[(0,G.jsx)(`td`,{className:`px-4 py-1.5 text-fg-dim mono text-xs align-top whitespace-nowrap`,children:r?be(r):`—`}),(0,G.jsx)(`td`,{className:b(`px-2 py-1.5 mono text-xs align-top`,M(n.agent)),children:n.agent}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs align-top`,children:n.sessionId?(0,G.jsx)(w,{to:`/sessions/${encodeURIComponent(n.sessionId)}`,className:`hover:text-accent`,title:n.sessionId,children:n.sessionId.slice(0,16)}):(0,G.jsx)(`span`,{className:`text-fg-muted`,children:`—`})}),(0,G.jsx)(`td`,{className:`px-3 py-1.5 mono text-xs align-top whitespace-pre-wrap truncate max-w-3xl`,children:n.line})]},`${n.path}:${n.lineNumber}:${t}`)})})]})]}),!d.data&&!d.isPending&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsx)(`div`,{className:`mb-2`,children:`Type a query + enter.`}),(0,G.jsx)(`div`,{className:`text-xs`,children:"This scans the session JSONLs on disk (`~/.claude/projects/`, `~/.codex/sessions/`, `~/.gemini/tmp/`). Unlike the Timeline page, results go all the way back, not just since agentwatch booted."})]})]})]})}var mt=`modulepreload`,ht=function(e){return`/`+e},gt={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ht(t,n),t in gt)return;gt[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:mt,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},_t=(0,V.lazy)(()=>Q(()=>import(`./SessionTokens-B6wfOhyn.js`).then(e=>({default:e.SessionTokensPage})),__vite__mapDeps([0,1,2,3,4,5,6]))),vt=(0,V.lazy)(()=>Q(()=>import(`./SessionCompaction-Duzo69wv.js`).then(e=>({default:e.SessionCompactionPage})),__vite__mapDeps([7,1,2,3,8,4,6]))),yt=(0,V.lazy)(()=>Q(()=>import(`./SessionGraph-Bb1BdCWf.js`).then(e=>({default:e.SessionGraphPage})),__vite__mapDeps([9,1,3,4,6]))),bt=(0,V.lazy)(()=>Q(()=>import(`./SessionDiffs-LZrXV0AY.js`).then(e=>({default:e.SessionDiffsPage})),__vite__mapDeps([10,1,3,4,11,6]))),xt=(0,V.lazy)(()=>Q(()=>import(`./SessionReplay-C3AZoYFc.js`).then(e=>({default:e.SessionReplayPage})),__vite__mapDeps([12,1,3,13,4,14,6]))),St=(0,V.lazy)(()=>Q(()=>import(`./Trends-p9DnVxWQ.js`).then(e=>({default:e.TrendsPage})),__vite__mapDeps([15,1,2,8,16,5,6]))),Ct=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.SettingsShell})),__vite__mapDeps([17,1,3,13,18]))),wt=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.BudgetsSettings})),__vite__mapDeps([17,1,3,13,18]))),Tt=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.AnomalySettings})),__vite__mapDeps([17,1,3,13,18]))),Et=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.TriggersSettings})),__vite__mapDeps([17,1,3,13,18]))),Dt=new Ee({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:2e3}}});function $(e){return(0,G.jsx)(V.Suspense,{fallback:(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`}),children:e})}We.createRoot(document.getElementById(`root`)).render((0,G.jsx)(V.StrictMode,{children:(0,G.jsx)(re,{client:Dt,children:(0,G.jsx)(de,{children:(0,G.jsx)(ue,{children:(0,G.jsxs)(T,{element:(0,G.jsx)(Ye,{}),children:[(0,G.jsx)(T,{index:!0,element:(0,G.jsx)(Qe,{})}),(0,G.jsx)(T,{path:`projects`,element:(0,G.jsx)(tt,{})}),(0,G.jsx)(T,{path:`projects/:name`,element:(0,G.jsx)(nt,{})}),(0,G.jsx)(T,{path:`sessions/:id`,element:(0,G.jsx)(rt,{})}),(0,G.jsx)(T,{path:`sessions/:id/tokens`,element:$((0,G.jsx)(_t,{}))}),(0,G.jsx)(T,{path:`sessions/:id/compaction`,element:$((0,G.jsx)(vt,{}))}),(0,G.jsx)(T,{path:`sessions/:id/graph`,element:$((0,G.jsx)(yt,{}))}),(0,G.jsx)(T,{path:`sessions/:id/diffs`,element:$((0,G.jsx)(bt,{}))}),(0,G.jsx)(T,{path:`sessions/:id/replay`,element:$((0,G.jsx)(xt,{}))}),(0,G.jsx)(T,{path:`events/:id`,element:(0,G.jsx)(at,{})}),(0,G.jsx)(T,{path:`search`,element:(0,G.jsx)(ot,{})}),(0,G.jsx)(T,{path:`logs`,element:(0,G.jsx)(pt,{})}),(0,G.jsx)(T,{path:`agents`,element:(0,G.jsx)(lt,{})}),(0,G.jsx)(T,{path:`permissions`,element:(0,G.jsx)(ut,{})}),(0,G.jsx)(T,{path:`cron`,element:(0,G.jsx)(dt,{})}),(0,G.jsx)(T,{path:`trends`,element:$((0,G.jsx)(St,{}))}),(0,G.jsxs)(T,{path:`settings`,element:$((0,G.jsx)(Ct,{})),children:[(0,G.jsx)(T,{index:!0,element:(0,G.jsx)(ce,{to:`budgets`,replace:!0})}),(0,G.jsx)(T,{path:`budgets`,element:$((0,G.jsx)(wt,{}))}),(0,G.jsx)(T,{path:`anomaly`,element:$((0,G.jsx)(Tt,{}))}),(0,G.jsx)(T,{path:`triggers`,element:$((0,G.jsx)(Et,{}))})]}),(0,G.jsx)(T,{path:`*`,element:(0,G.jsx)(ce,{to:`/`,replace:!0})})]})})})})}));
@@ -1 +0,0 @@
1
- *,:before,:after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.left-3{left:.75rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-50{z-index:50}.m-5{margin:1.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-full{height:100%}.max-h-40{max-height:10rem}.max-h-96{max-height:24rem}.max-h-\[60vh\]{max-height:60vh}.min-h-\[180px\]{min-height:180px}.min-h-\[300px\]{min-height:300px}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-60{width:15rem}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[240px\]{min-width:240px}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-accent\/40{border-color:#58a6ff66}.border-bg-border{--tw-border-opacity:1;border-color:rgb(43 49 57/var(--tw-border-opacity,1))}.border-bg-border\/20{border-color:#2b313933}.border-bg-border\/30{border-color:#2b31394d}.border-bg-border\/40{border-color:#2b313966}.border-bg-border\/50{border-color:#2b313980}.border-danger\/30{border-color:#f851494d}.border-danger\/40{border-color:#f8514966}.border-warn\/30{border-color:#d299224d}.border-warn\/40{border-color:#d2992266}.bg-accent\/10{background-color:#58a6ff1a}.bg-accent\/20{background-color:#58a6ff33}.bg-bg{--tw-bg-opacity:1;background-color:rgb(11 13 16/var(--tw-bg-opacity,1))}.bg-bg-elev{--tw-bg-opacity:1;background-color:rgb(26 31 38/var(--tw-bg-opacity,1))}.bg-bg-surface{--tw-bg-opacity:1;background-color:rgb(18 21 26/var(--tw-bg-opacity,1))}.bg-bg\/30{background-color:#0b0d104d}.bg-bg\/40{background-color:#0b0d1066}.bg-black\/60{background-color:#0009}.bg-danger\/10{background-color:#f851491a}.bg-danger\/20{background-color:#f8514933}.bg-fg\/5{background-color:#e6edf30d}.bg-ok{--tw-bg-opacity:1;background-color:rgb(63 185 80/var(--tw-bg-opacity,1))}.bg-ok\/10{background-color:#3fb9501a}.bg-transparent{background-color:#0000}.bg-warn{--tw-bg-opacity:1;background-color:rgb(210 153 34/var(--tw-bg-opacity,1))}.bg-warn\/10{background-color:#d299221a}.bg-warn\/20{background-color:#d2992233}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pl-9{padding-left:2.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-\[10vh\]{padding-top:10vh}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.text-accent{--tw-text-opacity:1;color:rgb(88 166 255/var(--tw-text-opacity,1))}.text-amber-400{--tw-text-opacity:1;color:rgb(251 191 36/var(--tw-text-opacity,1))}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.text-cyan-400{--tw-text-opacity:1;color:rgb(34 211 238/var(--tw-text-opacity,1))}.text-danger{--tw-text-opacity:1;color:rgb(248 81 73/var(--tw-text-opacity,1))}.text-emerald-400{--tw-text-opacity:1;color:rgb(52 211 153/var(--tw-text-opacity,1))}.text-fg{--tw-text-opacity:1;color:rgb(230 237 243/var(--tw-text-opacity,1))}.text-fg-dim{--tw-text-opacity:1;color:rgb(125 133 144/var(--tw-text-opacity,1))}.text-fg-muted{--tw-text-opacity:1;color:rgb(72 79 88/var(--tw-text-opacity,1))}.text-fuchsia-400{--tw-text-opacity:1;color:rgb(232 121 249/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-lime-400{--tw-text-opacity:1;color:rgb(163 230 53/var(--tw-text-opacity,1))}.text-ok{--tw-text-opacity:1;color:rgb(63 185 80/var(--tw-text-opacity,1))}.text-orange-400{--tw-text-opacity:1;color:rgb(251 146 60/var(--tw-text-opacity,1))}.text-pink-400{--tw-text-opacity:1;color:rgb(244 114 182/var(--tw-text-opacity,1))}.text-purple-400{--tw-text-opacity:1;color:rgb(192 132 252/var(--tw-text-opacity,1))}.text-teal-400{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity,1))}.text-warn{--tw-text-opacity:1;color:rgb(210 153 34/var(--tw-text-opacity,1))}.text-warn\/80{color:#d29922cc}.text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.outline-none{outline-offset:2px;outline:2px solid #0000}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}html,body,#root{height:100%}body{font-feature-settings:"ss01", "cv11"}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#2b3139;border-radius:5px}::-webkit-scrollbar-thumb:hover{background:#484f58}.mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace}.row-hover:hover{background:#12151a}.hover\:border-accent\/40:hover{border-color:#58a6ff66}.hover\:bg-accent\/30:hover{background-color:#58a6ff4d}.hover\:bg-bg:hover{--tw-bg-opacity:1;background-color:rgb(11 13 16/var(--tw-bg-opacity,1))}.hover\:bg-bg-elev:hover{--tw-bg-opacity:1;background-color:rgb(26 31 38/var(--tw-bg-opacity,1))}.hover\:bg-bg-surface\/40:hover{background-color:#12151a66}.hover\:text-accent:hover{--tw-text-opacity:1;color:rgb(88 166 255/var(--tw-text-opacity,1))}.hover\:text-fg:hover{--tw-text-opacity:1;color:rgb(230 237 243/var(--tw-text-opacity,1))}.focus\:border-accent:focus{--tw-border-opacity:1;border-color:rgb(88 166 255/var(--tw-border-opacity,1))}.focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ring-accent\/50:focus{--tw-ring-color:#58a6ff80}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
@@ -1 +0,0 @@
1
- import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t};
@@ -1 +0,0 @@
1
- import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),n=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t as n,n as t};
@@ -1 +0,0 @@
1
- import{A as e,C as t,D as n,E as r,F as i,M as a,d as o,p as s,s as c,u as l,y as u}from"./clsx-DsHpp3Uj.js";var d=class extends l{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||f(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=o({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),s.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function f(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var p=class extends e{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&u(t.mutationKey)!==u(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??f();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){s.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},m=i(a(),1);function h(e,r){let i=c(r),[a]=m.useState(()=>new p(i,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let o=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(s.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l=m.useCallback((e,n)=>{a.mutate(e,n).catch(t)},[a]);if(o.error&&n(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}export{d as n,h as t};