@mcpjam/inspector 3.12.0 → 3.12.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 (25) hide show
  1. package/dist/client/assets/{OAuthDesktopReturnNotice-iYC9JwKS.js → OAuthDesktopReturnNotice-DrCSUffX.js} +2 -2
  2. package/dist/client/assets/{app-bootstrap-CFIJ9N6G.js → app-bootstrap-C0wjVteM.js} +118 -118
  3. package/dist/client/assets/{button-BPKzBERq.js → button-DQ9bR46C.js} +2 -2
  4. package/dist/client/assets/{chunk-YOKDWASO-BBgLTb-C.js → chunk-YOKDWASO-Cpy4vQY8.js} +5 -5
  5. package/dist/client/assets/{dead-clicks-autocapture-vzk4B4ag.js → dead-clicks-autocapture-D3WNuKsf.js} +2 -2
  6. package/dist/client/assets/{error-reporting-B2Nfbu05.js → error-reporting-BHW3WviX.js} +6 -6
  7. package/dist/client/assets/{error-reporting-DiPgrWbD.js → error-reporting-DmfwQkBP.js} +1 -1
  8. package/dist/client/assets/{exception-autocapture-CbirCY_N.js → exception-autocapture-D0Qfhhbc.js} +2 -2
  9. package/dist/client/assets/{failed-request-tracker-mpVBJT24.js → failed-request-tracker-DyZB_Nfp.js} +2 -2
  10. package/dist/client/assets/{highlighted-body-KPVGNVTW-D71DU577.js → highlighted-body-KPVGNVTW-QEEOJH_y.js} +2 -2
  11. package/dist/client/assets/{index-foMfZA46.js → index-pxVGER4l.js} +3 -3
  12. package/dist/client/assets/{jszip.min-DP15U89q.js → jszip.min-DPr4_u5f.js} +2 -2
  13. package/dist/client/assets/{mermaid-HWGCJPDP-GcLzqiVf.js → mermaid-HWGCJPDP-DNAzcUbW.js} +1 -1
  14. package/dist/client/assets/{posthog-recorder-ChO49lxL.js → posthog-recorder-dQnAa9ak.js} +2 -2
  15. package/dist/client/assets/{preload-helper-CzPH2rtr.js → preload-helper-DsxBH8kv.js} +2 -2
  16. package/dist/client/assets/{rolldown-runtime-C3dIJScy.js → rolldown-runtime-DeZZUx0l.js} +1 -1
  17. package/dist/client/assets/{surveys-Cr5c_q1f.js → surveys-CdlQJ0hc.js} +2 -2
  18. package/dist/client/assets/{trace-timeline-D2HsPXC-.js → trace-timeline-2WCodaTP.js} +2 -2
  19. package/dist/client/assets/{trace-timeline-CLFYdXi8.js → trace-timeline-Ix3CoQw4.js} +1 -1
  20. package/dist/client/assets/{web-vitals-CdUasvTy.js → web-vitals-DdK10Etm.js} +2 -2
  21. package/dist/client/index.html +6 -6
  22. package/dist/server/{chunk-RGDNQUHE.js → chunk-R5EHY55H.js} +2 -2
  23. package/dist/server/harness-install-cli.js +1 -1
  24. package/dist/server/index.js +41 -26
  25. package/package.json +3 -2
@@ -1,4 +1,4 @@
1
- import{a as GC,n as QC,o as gy,r as XC}from"./rolldown-runtime-C3dIJScy.js";import{a as YC,i as JC,o as ZC}from"./preload-helper-CzPH2rtr.js";import{a as eT,i as tT,l as Ae,o as Xi,r as X,s as nT,t as Nt}from"./button-BPKzBERq.js";import{An as rh,Cn as xr,En as Va,Gi as rT,Hi as Pn,Ki as iT,On as ve,Sn as ct,Ui as yl,Vi as ih,Wi as Fn,cn as xl,d as sT,fn as vy,jn as Wc,mn as Ue,pn as yn,qi as oT,t as aT,yn as dr,zn as lT}from"./error-reporting-B2Nfbu05.js";import{a as cT,n as uT}from"./chunk-YOKDWASO-BBgLTb-C.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.12.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8770d1c1-a35a-4f4d-8a31-74baacd8af48",e._sentryDebugIdIdentifier="sentry-dbid-8770d1c1-a35a-4f4d-8a31-74baacd8af48")}catch{}})();var m=gy(ZC(),1),_o=gy(YC(),1),g=JC(),hT=Object.defineProperty,fT=(e,t)=>hT(e,"name",{value:t,configurable:!0}),_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Xi(`Primitive.${t}`),r=m.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hd(e,t){e&&_o.flushSync(()=>e.dispatchEvent(t))}fT(hd,"dispatchDiscreteCustomEvent");var dT=Object.defineProperty,pT=(e,t)=>dT(e,"name",{value:t,configurable:!0}),mT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gT=m.forwardRef(pT(function(t,n){return(0,g.jsx)(_e.span,{...t,ref:n,style:{...mT,...t.style}})},"VisuallyHidden")),vT=gT,yT=Object.defineProperty,Lt=(e,t)=>yT(e,"name",{value:t,configurable:!0});function xT(e,t){const n=m.createContext(t);n.displayName=e+"Context";const r=Lt(s=>{const{children:o,...a}=s,l=m.useMemo(()=>a,Object.values(a));return(0,g.jsx)(n.Provider,{value:l,children:o})},"Provider");r.displayName=e+"Provider";function i(s,o={}){const{optional:a=!1}=o,l=m.useContext(n);if(l)return l;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Lt(i,"useContext"),[r,i]}Lt(xT,"createContext");function rr(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o);a.displayName=s+"Context";const l=n.length;n=[...n,o];const c=Lt(h=>{const{scope:f,children:d,...p}=h,v=f?.[e]?.[l]||a,y=m.useMemo(()=>p,Object.values(p));return(0,g.jsx)(v.Provider,{value:y,children:d})},"Provider");c.displayName=s+"Provider";function u(h,f,d={}){const{optional:p=!1}=d,v=f?.[e]?.[l]||a,y=m.useContext(v);if(y)return y;if(o!==void 0)return o;if(!p)throw new Error(`\`${h}\` must be used within \`${s}\``)}return Lt(u,"useContext"),[c,u]}Lt(r,"createContext");const i=Lt(()=>{const s=n.map(o=>m.createContext(o));return Lt(function(a){const l=a?.[e]||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])},"useScope")},"createScope");return i.scopeName=e,[r,yy(i,...t)]}Lt(rr,"createContextScope");function yy(...e){const t=e[0];if(e.length===1)return t;const n=Lt(()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return Lt(function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Lt(yy,"composeContextScopes");var bT=Object.defineProperty,Ge=(e,t)=>bT(e,"name",{value:t,configurable:!0});function fd(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Ge(v=>{const{scope:y,children:x}=v,b=m.useRef(null),w=m.useRef(new Map).current;return(0,g.jsx)(i,{scope:y,itemMap:w,collectionRef:b,children:x})},"CollectionProvider");o.displayName=t;const a=e+"CollectionSlot",l=Xi(a),c=m.forwardRef((v,y)=>{const{scope:x,children:b}=v,w=s(a,x),S=Ae(y,w.collectionRef);return(0,g.jsx)(l,{ref:S,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",f=Xi(u),d=m.forwardRef((v,y)=>{const{scope:x,children:b,...w}=v,S=m.useRef(null),C=Ae(y,S),T=s(u,x);return m.useEffect(()=>(T.itemMap.set(S,{ref:S,...w}),()=>{T.itemMap.delete(S)})),(0,g.jsx)(f,{[h]:"",ref:C,children:b})});d.displayName=u;function p(v){const y=s(e+"CollectionConsumer",v);return m.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((w,S)=>b.indexOf(w.ref.current)-b.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return Ge(p,"useCollection"),[{Provider:o,Slot:c,ItemSlot:d},p,r]}Ge(fd,"createCollection");var Zp=new WeakMap,qc=class lr extends Map{static{Ge(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],Zp.set(this,!0)}set(t,n){return Zp.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,n),this}insert(t,n,r){const i=this.has(n),s=this.#e.length,o=dd(t);let a=o>=0?o:s+o;const l=a<0||a>=s?-1:a;if(l===this.size||i&&l===this.size-1||l===-1)return this.set(n,r),this;const c=this.size+(i?0:1);o<0&&a++;const u=[...this.#e];let h,f=!1;for(let d=a;d<c;d++)if(a===d){let p=u[d];u[d]===n&&(p=u[d+1]),i&&this.delete(n),h=this.get(p),this.set(n,r)}else{!f&&u[d-1]===n&&(f=!0);const p=u[f?d:d-1],v=h;h=this.get(p),this.delete(p),this.set(p,v)}return this}with(t,n,r){const i=new lr(this);return i.insert(t,n,r),i}before(t){const n=this.#e.indexOf(t)-1;if(!(n<0))return this.entryAt(n)}setBefore(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i,n,r)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i+1,n,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){const n=super.delete(t);return n&&this.#e.splice(this.#e.indexOf(t),1),n}deleteAt(t){const n=this.keyAt(t);return n!==void 0?this.delete(n):!1}at(t){const n=Fa(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){const n=Fa(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Fa(this.#e,t)}from(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return i;r++}}findIndex(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return r;r++}return-1}filter(t,n){const r=[];let i=0;for(const s of this)Reflect.apply(t,n,[s,i,this])&&r.push(s),i++;return new lr(r)}map(t,n){const r=[];let i=0;for(const s of this)r.push([s[0],Reflect.apply(t,n,[s,i,this])]),i++;return new lr(r)}reduce(...t){const[n,r]=t;let i=0,s=r??this.at(0);for(const o of this)i===0&&t.length===1?s=o:s=Reflect.apply(n,this,[s,o,i,this]),i++;return s}reduceRight(...t){const[n,r]=t;let i=r??this.at(-1);for(let s=this.size-1;s>=0;s--){const o=this.at(s);s===this.size-1&&t.length===1?i=o:i=Reflect.apply(n,this,[i,o,s,this])}return i}toSorted(t){const n=[...this.entries()].sort(t);return new lr(n)}toReversed(){const t=new lr;for(let n=this.size-1;n>=0;n--){const r=this.keyAt(n),i=this.get(r);t.set(r,i)}return t}toSpliced(...t){const n=[...this.entries()];return n.splice(...t),new lr(n)}slice(t,n){const r=new lr;let i=this.size-1;if(t===void 0)return r;t<0&&(t=t+this.size),n!==void 0&&n>0&&(i=n-1);for(let s=t;s<=i;s++){const o=this.keyAt(s),a=this.get(o);r.set(o,a)}return r}every(t,n){let r=0;for(const i of this){if(!Reflect.apply(t,n,[i,r,this]))return!1;r++}return!0}some(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return!0;r++}return!1}};function Fa(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=xy(e,t);return n===-1?void 0:e[n]}Ge(Fa,"at");function xy(e,t){const n=e.length,r=dd(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Ge(xy,"toSafeIndex");function dd(e){return e!==e||e===0?0:Math.trunc(e)}Ge(dd,"toSafeInteger");function wT(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qc,setItemMap:Ge(()=>{},"setItemMap")}),o=Ge(({state:b,...w})=>b?(0,g.jsx)(l,{...w,state:b}):(0,g.jsx)(a,{...w}),"CollectionProvider");o.displayName=t;const a=Ge(b=>{const w=y();return(0,g.jsx)(l,{...b,state:w})},"CollectionInit");a.displayName=t+"Init";const l=Ge(b=>{const{scope:w,children:S,state:C}=b,T=m.useRef(null),[k,A]=m.useState(null),E=Ae(T,A),[R,O]=C;return m.useEffect(()=>{if(!k)return;const M=Sy(()=>{});return M.observe(k,{childList:!0,subtree:!0}),()=>{M.disconnect()}},[k]),(0,g.jsx)(i,{scope:w,itemMap:R,setItemMap:O,collectionRef:E,collectionRefObject:T,collectionElement:k,children:S})},"CollectionProviderImpl");l.displayName=t+"Impl";const c=e+"CollectionSlot",u=Xi(c),h=m.forwardRef((b,w)=>{const{scope:S,children:C}=b,T=s(c,S),k=Ae(w,T.collectionRef);return(0,g.jsx)(u,{ref:k,children:C})});h.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Xi(f),v=m.forwardRef((b,w)=>{const{scope:S,children:C,...T}=b,k=m.useRef(null),[A,E]=m.useState(null),R=Ae(w,k,E),{setItemMap:O}=s(f,S),M=m.useRef(T);by(M.current,T)||(M.current=T);const j=M.current;return m.useEffect(()=>{const N=j;return O(P=>A?P.has(A)?P.set(A,{...N,element:A}).toSorted(sh):(P.set(A,{...N,element:A}),P.toSorted(sh)):P),()=>{O(P=>!A||!P.has(A)?P:(P.delete(A),new qc(P)))}},[A,j,O]),(0,g.jsx)(p,{[d]:"",ref:R,children:C})});v.displayName=f;function y(){return m.useState(new qc)}Ge(y,"useInitCollection");function x(b){const{itemMap:w}=s(e+"CollectionConsumer",b);return w}return Ge(x,"useCollection"),[{Provider:o,Slot:h,ItemSlot:v},{createCollectionScope:r,useCollection:x,useInitCollection:y}]}Ge(wT,"createCollection");function by(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}Ge(by,"shallowEqual");function wy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ge(wy,"isElementPreceding");function sh(e,t){return!e[1].element||!t[1].element?0:wy(e[1].element,t[1].element)?-1:1}Ge(sh,"sortByDocumentPosition");function Sy(e){return new MutationObserver(t=>{for(const n of t)if(n.type==="childList"){e();return}})}Ge(Sy,"getChildListObserver");var ST=Object.defineProperty,fs=(e,t)=>ST(e,"name",{value:t,configurable:!0}),ky=!!(typeof window<"u"&&window.document&&window.document.createElement);function te(e,t,{checkForDefaultPrevented:n=!0}={}){return fs(function(i){if(e?.(i),n===!1||!i||!i.defaultPrevented)return t?.(i)},"handleEvent")}fs(te,"composeEventHandlers");function kT(e){if(!ky)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}fs(kT,"getOwnerWindow");function oh(e){if(!ky)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}fs(oh,"getOwnerDocument");function Cy(e,t=!1){const{activeElement:n}=oh(e);if(!n?.nodeName)return null;if(Ty(n)&&n.contentDocument)return Cy(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=oh(n).getElementById(r);if(i)return i}}return n}fs(Cy,"getActiveElement");function Ty(e){return e.tagName==="IFRAME"}fs(Ty,"isFrame");var Dt=globalThis?.document?m.useLayoutEffect:()=>{},CT=Object.defineProperty,TT=(e,t)=>CT(e,"name",{value:t,configurable:!0}),em=m[" useEffectEvent ".trim().toString()],tm=m[" useInsertionEffect ".trim().toString()];function Ay(e){if(typeof em=="function")return em(e);const t=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof tm=="function"?tm(()=>{t.current=e}):Dt(()=>{t.current=e}),m.useMemo(()=>((...n)=>t.current?.(...n)),[])}TT(Ay,"useEffectEvent");var AT=Object.defineProperty,Bo=(e,t)=>AT(e,"name",{value:t,configurable:!0}),RT=m[" useInsertionEffect ".trim().toString()]||Dt;function Vo({prop:e,defaultProp:t,onChange:n=Bo(()=>{},"onChange"),caller:r}){const[i,s,o]=Ry({defaultProp:t,onChange:n}),a=e!==void 0;return[a?e:i,m.useCallback(c=>{if(a){const u=My(c)?c(e):c;u!==e&&o.current?.(u)}else s(c)},[a,e,s,o])]}Bo(Vo,"useControllableState");function Ry({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),i=m.useRef(n),s=m.useRef(t);return RT(()=>{s.current=t},[t]),m.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}Bo(Ry,"useUncontrolledState");function My(e){return typeof e=="function"}Bo(My,"isFunction");var nm=Symbol("RADIX:SYNC_STATE");function MT(e,t,n,r){const{prop:i,defaultProp:s,onChange:o,caller:a}=t,l=i!==void 0,c=Ay(o),u=[{...n,state:s}];r&&u.push(r);const[h,f]=m.useReducer((y,x)=>{if(x.type===nm)return{...y,state:x.state};const b=e(y,x);return l&&!Object.is(b.state,y.state)&&c(b.state),b},...u),d=h.state,p=m.useRef(d);m.useEffect(()=>{p.current!==d&&(p.current=d,l||c(d))},[d,p,l]);const v=m.useMemo(()=>i!==void 0?{...h,state:i}:h,[h,i]);return m.useEffect(()=>{l&&!Object.is(i,h.state)&&f({type:nm,state:i})},[i,h.state,l]),[v,f]}Bo(MT,"useControllableStateReducer");var PT=Object.defineProperty,er=(e,t)=>PT(e,"name",{value:t,configurable:!0});function Py(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}er(Py,"useStateMachine");var Nn=er(e=>{const{present:t,children:n}=e,r=Ey(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=Oy(r.ref,Iy(i));return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:s}):null},"Presence");function Ey(e){const[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),s=m.useRef("none"),o=m.useRef(void 0),[a,l]=Py(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{a==="mounted"?(s.current=o.current??Ai(r.current),o.current=void 0):s.current="none"},[a]),Dt(()=>{const c=r.current,u=i.current;if(u!==e){const h=s.current,f=Ai(c);e?(o.current=f,l("MOUNT")):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Dt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,h=er(d=>{const p=Ai(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},"handleAnimationEnd"),f=er(d=>{d.target===t&&(s.current=Ai(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{if(c){const u=getComputedStyle(c);r.current=u,o.current=Ai(u)}else r.current=null;n(c)},[])}}er(Ey,"usePresence");function ah(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}er(ah,"setRef");function Oy(...e){const t=m.useRef(e);return t.current=e,m.useCallback(n=>{const r=t.current;let i=!1;const s=r.map(o=>{const a=ah(o,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let o=0;o<s.length;o++){const a=s[o];typeof a=="function"?a():ah(r[o],null)}}},[])}er(Oy,"useStableComposedRefs");function Ai(e){return e?.animationName||"none"}er(Ai,"getAnimationName");function Iy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}er(Iy,"getElementRef");var ET=Object.defineProperty,OT=(e,t)=>ET(e,"name",{value:t,configurable:!0}),IT=m[" useId ".trim().toString()]||(()=>{}),DT=0;function ni(e){const[t,n]=m.useState(IT());return Dt(()=>{e||n(r=>r??String(DT++))},[e]),e||(t?`radix-${t}`:"")}OT(ni,"useId");var NT=Object.defineProperty,LT=(e,t)=>NT(e,"name",{value:t,configurable:!0}),jT=m.createContext(void 0);function tc(e){const t=m.useContext(jT);return e||t||"ltr"}LT(tc,"useDirection");var _T=Object.defineProperty,BT=(e,t)=>_T(e,"name",{value:t,configurable:!0});function Qe(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...n)=>t.current?.(...n)),[])}BT(Qe,"useCallbackRef");var VT=Object.defineProperty,Ke=(e,t)=>VT(e,"name",{value:t,configurable:!0}),lh="dismissableLayer.update",FT="dismissableLayer.pointerDownOutside",zT="dismissableLayer.focusOutside",rm,Dy=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ny=m.forwardRef(Ke(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=t,h=m.useContext(Dy),[f,d]=m.useState(null),p=f?.ownerDocument??globalThis?.document,[,v]=m.useState({}),y=Ae(n,d),x=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),w=b?x.indexOf(b):-1,S=f?x.indexOf(f):-1,C=h.layersWithOutsidePointerEventsDisabled.size>0,T=S>=w,k=m.useRef(!1),A=Ly(M=>{o?.(M),l?.(M),M.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(M=>{if(!(M instanceof Node))return!1;const j=[...h.branches].some(N=>N.contains(M));return T&&!j},[h.branches,T])}),E=jy(M=>{if(i&&k.current)return;const j=M.target;[...h.branches].some(N=>N.contains(j))||(a?.(M),l?.(M),M.defaultPrevented||c?.())},p),R=f?S===x.length-1:!1,O=Qe(M=>{M.key==="Escape"&&(s?.(M),!M.defaultPrevented&&c&&(M.preventDefault(),c()))});return m.useEffect(()=>{if(R)return p.addEventListener("keydown",O,{capture:!0}),()=>p.removeEventListener("keydown",O,{capture:!0})},[p,R,O]),m.useEffect(()=>{if(f)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(rm=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(f)),h.layers.add(f),ch(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(f),h.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=rm))}},[f,p,r,h]),m.useEffect(()=>()=>{f&&(h.layers.delete(f),h.layersWithOutsidePointerEventsDisabled.delete(f),ch())},[f,h]),m.useEffect(()=>{const M=Ke(()=>v({}),"handleUpdate");return document.addEventListener(lh,M),()=>document.removeEventListener(lh,M)},[]),(0,g.jsx)(_e.div,{...u,ref:y,style:{pointerEvents:C?T?"auto":"none":void 0,...t.style},onFocusCapture:te(t.onFocusCapture,E.onFocusCapture),onBlurCapture:te(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:te(t.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function $T(){const e=m.useContext(Dy),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ke($T,"useDismissableLayerSurface");var HT=Ke(()=>!0,"IS_TRUE");function Ly(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=HT}=t,a=Qe(e),l=m.useRef(!1),c=m.useRef(!1),u=m.useRef(new Map),h=m.useRef(()=>{});return m.useEffect(()=>{function f(){c.current=!1,i.current=!1,u.current.clear()}Ke(f,"resetOutsideInteraction");function d(){return Array.from(u.current.values()).some(Boolean)}Ke(d,"isOutsideInteractionIntercepted");function p(w){if(!c.current)return;const S=w.target;S instanceof Node&&[...s].some(C=>C.contains(S))||u.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{c.current&&h.current()},0)}Ke(p,"handleInteractionCapture");function v(w){c.current&&u.current.set(w.type,!1)}Ke(v,"handleInteractionBubble");const y=Ke(w=>{if(w.target&&!l.current){let S=function(){n.removeEventListener("click",h.current);const T=d();f(),T||pd(FT,a,C,{discrete:!0})};if(Ke(S,"handleAndDispatchPointerDownOutsideEvent"),!o(w.target)){n.removeEventListener("click",h.current),f(),l.current=!1;return}const C={originalEvent:w};c.current=!0,i.current=r&&w.button===0,u.current.clear(),!r||w.button!==0?S():(n.removeEventListener("click",h.current),h.current=S,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),f();l.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of x)n.addEventListener(w,p,!0),n.addEventListener(w,v);const b=window.setTimeout(()=>{n.addEventListener("pointerdown",y)},0);return()=>{window.clearTimeout(b),n.removeEventListener("pointerdown",y),n.removeEventListener("click",h.current);for(const w of x)n.removeEventListener(w,p,!0),n.removeEventListener(w,v)}},[n,a,r,i,s,o]),{onPointerDownCapture:Ke(()=>l.current=!0,"onPointerDownCapture")}}Ke(Ly,"usePointerDownOutside");function jy(e,t=globalThis?.document){const n=Qe(e),r=m.useRef(!1);return m.useEffect(()=>{const i=Ke(s=>{s.target&&!r.current&&pd(zT,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:Ke(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ke(()=>r.current=!1,"onBlurCapture")}}Ke(jy,"useFocusOutside");function ch(){const e=new CustomEvent(lh);document.dispatchEvent(e)}Ke(ch,"dispatchUpdate");function pd(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?hd(i,s):i.dispatchEvent(s)}Ke(pd,"handleAndDispatchCustomEvent");var WT=Object.defineProperty,ht=(e,t)=>WT(e,"name",{value:t,configurable:!0}),Uc="focusScope.autoFocusOnMount",Kc="focusScope.autoFocusOnUnmount",im={bubbles:!1,cancelable:!0},qT=m.forwardRef(ht(function(t,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=t,[l,c]=m.useState(null),u=Qe(s),h=Qe(o),f=m.useRef(null),d=Ae(n,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(i){let y=function(S){if(p.paused||!l)return;const C=S.target;l.contains(C)?f.current=C:Vn(f.current,{select:!0})},x=function(S){if(p.paused||!l)return;const C=S.relatedTarget;C!==null&&(l.contains(C)||Vn(f.current,{select:!0}))},b=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Vn(l)};ht(y,"handleFocusIn"),ht(x,"handleFocusOut"),ht(b,"handleMutations"),document.addEventListener("focusin",y),document.addEventListener("focusout",x);const w=new MutationObserver(b);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),w.disconnect()}}},[i,l,p.paused]),m.useEffect(()=>{if(l){sm.add(p);const y=document.activeElement;if(!l.contains(y)){const x=new CustomEvent(Uc,im);l.addEventListener(Uc,u),l.dispatchEvent(x),x.defaultPrevented||(_y($y(md(l)),{select:!0}),document.activeElement===y&&Vn(l))}return()=>{l.removeEventListener(Uc,u),setTimeout(()=>{const x=new CustomEvent(Kc,im);l.addEventListener(Kc,h),l.dispatchEvent(x),x.defaultPrevented||Vn(y??document.body,{select:!0}),l.removeEventListener(Kc,h),sm.remove(p)},0)}}},[l,u,h,p]);const v=m.useCallback(y=>{if(!r&&!i||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,b=document.activeElement;if(x&&b){const w=y.currentTarget,[S,C]=By(w);S&&C?!y.shiftKey&&b===C?(y.preventDefault(),r&&Vn(S,{select:!0})):y.shiftKey&&b===S&&(y.preventDefault(),r&&Vn(C,{select:!0})):b===w&&y.preventDefault()}},[r,i,p.paused]);return(0,g.jsx)(_e.div,{tabIndex:-1,...a,ref:d,onKeyDown:v})},"FocusScope"));function _y(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vn(r,{select:t}),document.activeElement!==n)return}ht(_y,"focusFirst");function By(e){const t=md(e);return[uh(t,e),uh(t.reverse(),e)]}ht(By,"getTabbableEdges");function md(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ht(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}ht(md,"getTabbableCandidates");function uh(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Vy(r,{upTo:t})))return r}ht(uh,"findVisible");function Vy(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ht(Vy,"isHidden");function Fy(e){return e instanceof HTMLInputElement&&"select"in e}ht(Fy,"isSelectableInput");function Vn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fy(e)&&t&&e.select()}}ht(Vn,"focus");var sm=zy();function zy(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=hh(e,t),e.unshift(t)},remove(t){e=hh(e,t),e[0]?.resume()}}}ht(zy,"createFocusScopesStack");function hh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ht(hh,"arrayRemove");function $y(e){return e.filter(t=>t.tagName!=="A")}ht($y,"removeLinks");var UT=Object.defineProperty,KT=(e,t)=>UT(e,"name",{value:t,configurable:!0}),Hy=m.forwardRef(KT(function(t,n){const{container:r,...i}=t,[s,o]=m.useState(!1);Dt(()=>o(!0),[]);const a=r||s&&globalThis?.document?.body;return a?_o.createPortal((0,g.jsx)(_e.div,{...i,ref:n}),a):null},"Portal")),GT=Object.defineProperty,gd=(e,t)=>GT(e,"name",{value:t,configurable:!0}),sa=0,mi=null;function QT(e){return vd(),e.children}gd(QT,"FocusGuards");function vd(){m.useEffect(()=>{mi||(mi={start:fh(),end:fh()});const{start:e,end:t}=mi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),sa++,()=>{sa===1&&(mi?.start.remove(),mi?.end.remove(),mi=null),sa=Math.max(0,sa-1)}},[])}gd(vd,"useFocusGuards");function fh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}gd(fh,"createFocusGuard");var bn=function(){return bn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},bn.apply(this,arguments)};function Wy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function XT(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var za="right-scroll-bar-position",$a="width-before-scroll-bar",YT="with-scroll-bars-hidden",JT="--removed-body-scroll-bar-size";function Gc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ZT(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var eA=typeof window<"u"?m.useLayoutEffect:m.useEffect,om=new WeakMap;function tA(e,t){var n=ZT(t||null,function(r){return e.forEach(function(i){return Gc(i,r)})});return eA(function(){var r=om.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(a){s.has(a)||Gc(a,null)}),s.forEach(function(a){i.has(a)||Gc(a,o)})}om.set(n,e)},[e]),n}function nA(e){return e}function rA(e,t){t===void 0&&(t=nA);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(i),s=n}var a=function(){var c=s;s=[],c.forEach(i)},l=function(){return Promise.resolve().then(a)};l(),n={push:function(c){s.push(c),l()},filter:function(c){return s=s.filter(c),n}}}}}function iA(e){e===void 0&&(e={});var t=rA(null);return t.options=bn({async:!0,ssr:!1},e),t}var qy=function(e){var t=e.sideCar,n=Wy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,bn({},n))};qy.isSideCarExport=!0;function sA(e,t){return e.useMedium(t),qy}var Uy=iA(),Qc=function(){},nc=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Qc,onWheelCapture:Qc,onTouchMoveCapture:Qc}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,h=e.shards,f=e.sideCar,d=e.noRelative,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=Wy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,T=tA([n,t]),k=bn(bn({},S),i);return m.createElement(m.Fragment,null,u&&m.createElement(C,{sideCar:Uy,removeScrollBar:c,shards:h,noRelative:d,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?m.cloneElement(m.Children.only(a),bn(bn({},k),{ref:T})):m.createElement(b,bn({},k,{className:l,ref:T}),a))});nc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nc.classNames={fullWidth:$a,zeroRight:za};var am,oA=function(){if(am)return am;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=oA();return t&&e.setAttribute("nonce",t),e}function lA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cA(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var uA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=aA())&&(lA(t,n),cA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hA=function(){var e=uA();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ky=function(){var e=hA(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},fA={left:0,top:0,right:0,gap:0},Xc=function(e){return parseInt(e||"",10)||0},dA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Xc(n),Xc(r),Xc(i)]},pA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fA;var t=dA(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},mA=Ky(),Qs="data-scroll-locked",gA=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
1
+ import{a as GC,n as QC,o as gy,r as XC}from"./rolldown-runtime-DeZZUx0l.js";import{a as YC,i as JC,o as ZC}from"./preload-helper-DsxBH8kv.js";import{a as eT,i as tT,l as Ae,o as Xi,r as X,s as nT,t as Nt}from"./button-DQ9bR46C.js";import{An as rh,Cn as xr,En as Va,Gi as rT,Hi as Pn,Ki as iT,On as ve,Sn as ct,Ui as yl,Vi as ih,Wi as Fn,cn as xl,d as sT,fn as vy,jn as Wc,mn as Ue,pn as yn,qi as oT,t as aT,yn as dr,zn as lT}from"./error-reporting-BHW3WviX.js";import{a as cT,n as uT}from"./chunk-YOKDWASO-Cpy4vQY8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.12.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8770d1c1-a35a-4f4d-8a31-74baacd8af48",e._sentryDebugIdIdentifier="sentry-dbid-8770d1c1-a35a-4f4d-8a31-74baacd8af48")}catch{}})();var m=gy(ZC(),1),_o=gy(YC(),1),g=JC(),hT=Object.defineProperty,fT=(e,t)=>hT(e,"name",{value:t,configurable:!0}),_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Xi(`Primitive.${t}`),r=m.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hd(e,t){e&&_o.flushSync(()=>e.dispatchEvent(t))}fT(hd,"dispatchDiscreteCustomEvent");var dT=Object.defineProperty,pT=(e,t)=>dT(e,"name",{value:t,configurable:!0}),mT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gT=m.forwardRef(pT(function(t,n){return(0,g.jsx)(_e.span,{...t,ref:n,style:{...mT,...t.style}})},"VisuallyHidden")),vT=gT,yT=Object.defineProperty,Lt=(e,t)=>yT(e,"name",{value:t,configurable:!0});function xT(e,t){const n=m.createContext(t);n.displayName=e+"Context";const r=Lt(s=>{const{children:o,...a}=s,l=m.useMemo(()=>a,Object.values(a));return(0,g.jsx)(n.Provider,{value:l,children:o})},"Provider");r.displayName=e+"Provider";function i(s,o={}){const{optional:a=!1}=o,l=m.useContext(n);if(l)return l;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Lt(i,"useContext"),[r,i]}Lt(xT,"createContext");function rr(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o);a.displayName=s+"Context";const l=n.length;n=[...n,o];const c=Lt(h=>{const{scope:f,children:d,...p}=h,v=f?.[e]?.[l]||a,y=m.useMemo(()=>p,Object.values(p));return(0,g.jsx)(v.Provider,{value:y,children:d})},"Provider");c.displayName=s+"Provider";function u(h,f,d={}){const{optional:p=!1}=d,v=f?.[e]?.[l]||a,y=m.useContext(v);if(y)return y;if(o!==void 0)return o;if(!p)throw new Error(`\`${h}\` must be used within \`${s}\``)}return Lt(u,"useContext"),[c,u]}Lt(r,"createContext");const i=Lt(()=>{const s=n.map(o=>m.createContext(o));return Lt(function(a){const l=a?.[e]||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])},"useScope")},"createScope");return i.scopeName=e,[r,yy(i,...t)]}Lt(rr,"createContextScope");function yy(...e){const t=e[0];if(e.length===1)return t;const n=Lt(()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return Lt(function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Lt(yy,"composeContextScopes");var bT=Object.defineProperty,Ge=(e,t)=>bT(e,"name",{value:t,configurable:!0});function fd(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Ge(v=>{const{scope:y,children:x}=v,b=m.useRef(null),w=m.useRef(new Map).current;return(0,g.jsx)(i,{scope:y,itemMap:w,collectionRef:b,children:x})},"CollectionProvider");o.displayName=t;const a=e+"CollectionSlot",l=Xi(a),c=m.forwardRef((v,y)=>{const{scope:x,children:b}=v,w=s(a,x),S=Ae(y,w.collectionRef);return(0,g.jsx)(l,{ref:S,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",f=Xi(u),d=m.forwardRef((v,y)=>{const{scope:x,children:b,...w}=v,S=m.useRef(null),C=Ae(y,S),T=s(u,x);return m.useEffect(()=>(T.itemMap.set(S,{ref:S,...w}),()=>{T.itemMap.delete(S)})),(0,g.jsx)(f,{[h]:"",ref:C,children:b})});d.displayName=u;function p(v){const y=s(e+"CollectionConsumer",v);return m.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((w,S)=>b.indexOf(w.ref.current)-b.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return Ge(p,"useCollection"),[{Provider:o,Slot:c,ItemSlot:d},p,r]}Ge(fd,"createCollection");var Zp=new WeakMap,qc=class lr extends Map{static{Ge(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],Zp.set(this,!0)}set(t,n){return Zp.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,n),this}insert(t,n,r){const i=this.has(n),s=this.#e.length,o=dd(t);let a=o>=0?o:s+o;const l=a<0||a>=s?-1:a;if(l===this.size||i&&l===this.size-1||l===-1)return this.set(n,r),this;const c=this.size+(i?0:1);o<0&&a++;const u=[...this.#e];let h,f=!1;for(let d=a;d<c;d++)if(a===d){let p=u[d];u[d]===n&&(p=u[d+1]),i&&this.delete(n),h=this.get(p),this.set(n,r)}else{!f&&u[d-1]===n&&(f=!0);const p=u[f?d:d-1],v=h;h=this.get(p),this.delete(p),this.set(p,v)}return this}with(t,n,r){const i=new lr(this);return i.insert(t,n,r),i}before(t){const n=this.#e.indexOf(t)-1;if(!(n<0))return this.entryAt(n)}setBefore(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i,n,r)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i+1,n,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){const n=super.delete(t);return n&&this.#e.splice(this.#e.indexOf(t),1),n}deleteAt(t){const n=this.keyAt(t);return n!==void 0?this.delete(n):!1}at(t){const n=Fa(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){const n=Fa(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Fa(this.#e,t)}from(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return i;r++}}findIndex(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return r;r++}return-1}filter(t,n){const r=[];let i=0;for(const s of this)Reflect.apply(t,n,[s,i,this])&&r.push(s),i++;return new lr(r)}map(t,n){const r=[];let i=0;for(const s of this)r.push([s[0],Reflect.apply(t,n,[s,i,this])]),i++;return new lr(r)}reduce(...t){const[n,r]=t;let i=0,s=r??this.at(0);for(const o of this)i===0&&t.length===1?s=o:s=Reflect.apply(n,this,[s,o,i,this]),i++;return s}reduceRight(...t){const[n,r]=t;let i=r??this.at(-1);for(let s=this.size-1;s>=0;s--){const o=this.at(s);s===this.size-1&&t.length===1?i=o:i=Reflect.apply(n,this,[i,o,s,this])}return i}toSorted(t){const n=[...this.entries()].sort(t);return new lr(n)}toReversed(){const t=new lr;for(let n=this.size-1;n>=0;n--){const r=this.keyAt(n),i=this.get(r);t.set(r,i)}return t}toSpliced(...t){const n=[...this.entries()];return n.splice(...t),new lr(n)}slice(t,n){const r=new lr;let i=this.size-1;if(t===void 0)return r;t<0&&(t=t+this.size),n!==void 0&&n>0&&(i=n-1);for(let s=t;s<=i;s++){const o=this.keyAt(s),a=this.get(o);r.set(o,a)}return r}every(t,n){let r=0;for(const i of this){if(!Reflect.apply(t,n,[i,r,this]))return!1;r++}return!0}some(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return!0;r++}return!1}};function Fa(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=xy(e,t);return n===-1?void 0:e[n]}Ge(Fa,"at");function xy(e,t){const n=e.length,r=dd(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Ge(xy,"toSafeIndex");function dd(e){return e!==e||e===0?0:Math.trunc(e)}Ge(dd,"toSafeInteger");function wT(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qc,setItemMap:Ge(()=>{},"setItemMap")}),o=Ge(({state:b,...w})=>b?(0,g.jsx)(l,{...w,state:b}):(0,g.jsx)(a,{...w}),"CollectionProvider");o.displayName=t;const a=Ge(b=>{const w=y();return(0,g.jsx)(l,{...b,state:w})},"CollectionInit");a.displayName=t+"Init";const l=Ge(b=>{const{scope:w,children:S,state:C}=b,T=m.useRef(null),[k,A]=m.useState(null),E=Ae(T,A),[R,O]=C;return m.useEffect(()=>{if(!k)return;const M=Sy(()=>{});return M.observe(k,{childList:!0,subtree:!0}),()=>{M.disconnect()}},[k]),(0,g.jsx)(i,{scope:w,itemMap:R,setItemMap:O,collectionRef:E,collectionRefObject:T,collectionElement:k,children:S})},"CollectionProviderImpl");l.displayName=t+"Impl";const c=e+"CollectionSlot",u=Xi(c),h=m.forwardRef((b,w)=>{const{scope:S,children:C}=b,T=s(c,S),k=Ae(w,T.collectionRef);return(0,g.jsx)(u,{ref:k,children:C})});h.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Xi(f),v=m.forwardRef((b,w)=>{const{scope:S,children:C,...T}=b,k=m.useRef(null),[A,E]=m.useState(null),R=Ae(w,k,E),{setItemMap:O}=s(f,S),M=m.useRef(T);by(M.current,T)||(M.current=T);const j=M.current;return m.useEffect(()=>{const N=j;return O(P=>A?P.has(A)?P.set(A,{...N,element:A}).toSorted(sh):(P.set(A,{...N,element:A}),P.toSorted(sh)):P),()=>{O(P=>!A||!P.has(A)?P:(P.delete(A),new qc(P)))}},[A,j,O]),(0,g.jsx)(p,{[d]:"",ref:R,children:C})});v.displayName=f;function y(){return m.useState(new qc)}Ge(y,"useInitCollection");function x(b){const{itemMap:w}=s(e+"CollectionConsumer",b);return w}return Ge(x,"useCollection"),[{Provider:o,Slot:h,ItemSlot:v},{createCollectionScope:r,useCollection:x,useInitCollection:y}]}Ge(wT,"createCollection");function by(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}Ge(by,"shallowEqual");function wy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ge(wy,"isElementPreceding");function sh(e,t){return!e[1].element||!t[1].element?0:wy(e[1].element,t[1].element)?-1:1}Ge(sh,"sortByDocumentPosition");function Sy(e){return new MutationObserver(t=>{for(const n of t)if(n.type==="childList"){e();return}})}Ge(Sy,"getChildListObserver");var ST=Object.defineProperty,fs=(e,t)=>ST(e,"name",{value:t,configurable:!0}),ky=!!(typeof window<"u"&&window.document&&window.document.createElement);function te(e,t,{checkForDefaultPrevented:n=!0}={}){return fs(function(i){if(e?.(i),n===!1||!i||!i.defaultPrevented)return t?.(i)},"handleEvent")}fs(te,"composeEventHandlers");function kT(e){if(!ky)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}fs(kT,"getOwnerWindow");function oh(e){if(!ky)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}fs(oh,"getOwnerDocument");function Cy(e,t=!1){const{activeElement:n}=oh(e);if(!n?.nodeName)return null;if(Ty(n)&&n.contentDocument)return Cy(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=oh(n).getElementById(r);if(i)return i}}return n}fs(Cy,"getActiveElement");function Ty(e){return e.tagName==="IFRAME"}fs(Ty,"isFrame");var Dt=globalThis?.document?m.useLayoutEffect:()=>{},CT=Object.defineProperty,TT=(e,t)=>CT(e,"name",{value:t,configurable:!0}),em=m[" useEffectEvent ".trim().toString()],tm=m[" useInsertionEffect ".trim().toString()];function Ay(e){if(typeof em=="function")return em(e);const t=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof tm=="function"?tm(()=>{t.current=e}):Dt(()=>{t.current=e}),m.useMemo(()=>((...n)=>t.current?.(...n)),[])}TT(Ay,"useEffectEvent");var AT=Object.defineProperty,Bo=(e,t)=>AT(e,"name",{value:t,configurable:!0}),RT=m[" useInsertionEffect ".trim().toString()]||Dt;function Vo({prop:e,defaultProp:t,onChange:n=Bo(()=>{},"onChange"),caller:r}){const[i,s,o]=Ry({defaultProp:t,onChange:n}),a=e!==void 0;return[a?e:i,m.useCallback(c=>{if(a){const u=My(c)?c(e):c;u!==e&&o.current?.(u)}else s(c)},[a,e,s,o])]}Bo(Vo,"useControllableState");function Ry({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),i=m.useRef(n),s=m.useRef(t);return RT(()=>{s.current=t},[t]),m.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}Bo(Ry,"useUncontrolledState");function My(e){return typeof e=="function"}Bo(My,"isFunction");var nm=Symbol("RADIX:SYNC_STATE");function MT(e,t,n,r){const{prop:i,defaultProp:s,onChange:o,caller:a}=t,l=i!==void 0,c=Ay(o),u=[{...n,state:s}];r&&u.push(r);const[h,f]=m.useReducer((y,x)=>{if(x.type===nm)return{...y,state:x.state};const b=e(y,x);return l&&!Object.is(b.state,y.state)&&c(b.state),b},...u),d=h.state,p=m.useRef(d);m.useEffect(()=>{p.current!==d&&(p.current=d,l||c(d))},[d,p,l]);const v=m.useMemo(()=>i!==void 0?{...h,state:i}:h,[h,i]);return m.useEffect(()=>{l&&!Object.is(i,h.state)&&f({type:nm,state:i})},[i,h.state,l]),[v,f]}Bo(MT,"useControllableStateReducer");var PT=Object.defineProperty,er=(e,t)=>PT(e,"name",{value:t,configurable:!0});function Py(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}er(Py,"useStateMachine");var Nn=er(e=>{const{present:t,children:n}=e,r=Ey(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=Oy(r.ref,Iy(i));return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:s}):null},"Presence");function Ey(e){const[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),s=m.useRef("none"),o=m.useRef(void 0),[a,l]=Py(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{a==="mounted"?(s.current=o.current??Ai(r.current),o.current=void 0):s.current="none"},[a]),Dt(()=>{const c=r.current,u=i.current;if(u!==e){const h=s.current,f=Ai(c);e?(o.current=f,l("MOUNT")):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Dt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,h=er(d=>{const p=Ai(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},"handleAnimationEnd"),f=er(d=>{d.target===t&&(s.current=Ai(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{if(c){const u=getComputedStyle(c);r.current=u,o.current=Ai(u)}else r.current=null;n(c)},[])}}er(Ey,"usePresence");function ah(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}er(ah,"setRef");function Oy(...e){const t=m.useRef(e);return t.current=e,m.useCallback(n=>{const r=t.current;let i=!1;const s=r.map(o=>{const a=ah(o,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let o=0;o<s.length;o++){const a=s[o];typeof a=="function"?a():ah(r[o],null)}}},[])}er(Oy,"useStableComposedRefs");function Ai(e){return e?.animationName||"none"}er(Ai,"getAnimationName");function Iy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}er(Iy,"getElementRef");var ET=Object.defineProperty,OT=(e,t)=>ET(e,"name",{value:t,configurable:!0}),IT=m[" useId ".trim().toString()]||(()=>{}),DT=0;function ni(e){const[t,n]=m.useState(IT());return Dt(()=>{e||n(r=>r??String(DT++))},[e]),e||(t?`radix-${t}`:"")}OT(ni,"useId");var NT=Object.defineProperty,LT=(e,t)=>NT(e,"name",{value:t,configurable:!0}),jT=m.createContext(void 0);function tc(e){const t=m.useContext(jT);return e||t||"ltr"}LT(tc,"useDirection");var _T=Object.defineProperty,BT=(e,t)=>_T(e,"name",{value:t,configurable:!0});function Qe(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...n)=>t.current?.(...n)),[])}BT(Qe,"useCallbackRef");var VT=Object.defineProperty,Ke=(e,t)=>VT(e,"name",{value:t,configurable:!0}),lh="dismissableLayer.update",FT="dismissableLayer.pointerDownOutside",zT="dismissableLayer.focusOutside",rm,Dy=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ny=m.forwardRef(Ke(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=t,h=m.useContext(Dy),[f,d]=m.useState(null),p=f?.ownerDocument??globalThis?.document,[,v]=m.useState({}),y=Ae(n,d),x=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),w=b?x.indexOf(b):-1,S=f?x.indexOf(f):-1,C=h.layersWithOutsidePointerEventsDisabled.size>0,T=S>=w,k=m.useRef(!1),A=Ly(M=>{o?.(M),l?.(M),M.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(M=>{if(!(M instanceof Node))return!1;const j=[...h.branches].some(N=>N.contains(M));return T&&!j},[h.branches,T])}),E=jy(M=>{if(i&&k.current)return;const j=M.target;[...h.branches].some(N=>N.contains(j))||(a?.(M),l?.(M),M.defaultPrevented||c?.())},p),R=f?S===x.length-1:!1,O=Qe(M=>{M.key==="Escape"&&(s?.(M),!M.defaultPrevented&&c&&(M.preventDefault(),c()))});return m.useEffect(()=>{if(R)return p.addEventListener("keydown",O,{capture:!0}),()=>p.removeEventListener("keydown",O,{capture:!0})},[p,R,O]),m.useEffect(()=>{if(f)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(rm=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(f)),h.layers.add(f),ch(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(f),h.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=rm))}},[f,p,r,h]),m.useEffect(()=>()=>{f&&(h.layers.delete(f),h.layersWithOutsidePointerEventsDisabled.delete(f),ch())},[f,h]),m.useEffect(()=>{const M=Ke(()=>v({}),"handleUpdate");return document.addEventListener(lh,M),()=>document.removeEventListener(lh,M)},[]),(0,g.jsx)(_e.div,{...u,ref:y,style:{pointerEvents:C?T?"auto":"none":void 0,...t.style},onFocusCapture:te(t.onFocusCapture,E.onFocusCapture),onBlurCapture:te(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:te(t.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function $T(){const e=m.useContext(Dy),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ke($T,"useDismissableLayerSurface");var HT=Ke(()=>!0,"IS_TRUE");function Ly(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=HT}=t,a=Qe(e),l=m.useRef(!1),c=m.useRef(!1),u=m.useRef(new Map),h=m.useRef(()=>{});return m.useEffect(()=>{function f(){c.current=!1,i.current=!1,u.current.clear()}Ke(f,"resetOutsideInteraction");function d(){return Array.from(u.current.values()).some(Boolean)}Ke(d,"isOutsideInteractionIntercepted");function p(w){if(!c.current)return;const S=w.target;S instanceof Node&&[...s].some(C=>C.contains(S))||u.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{c.current&&h.current()},0)}Ke(p,"handleInteractionCapture");function v(w){c.current&&u.current.set(w.type,!1)}Ke(v,"handleInteractionBubble");const y=Ke(w=>{if(w.target&&!l.current){let S=function(){n.removeEventListener("click",h.current);const T=d();f(),T||pd(FT,a,C,{discrete:!0})};if(Ke(S,"handleAndDispatchPointerDownOutsideEvent"),!o(w.target)){n.removeEventListener("click",h.current),f(),l.current=!1;return}const C={originalEvent:w};c.current=!0,i.current=r&&w.button===0,u.current.clear(),!r||w.button!==0?S():(n.removeEventListener("click",h.current),h.current=S,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),f();l.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of x)n.addEventListener(w,p,!0),n.addEventListener(w,v);const b=window.setTimeout(()=>{n.addEventListener("pointerdown",y)},0);return()=>{window.clearTimeout(b),n.removeEventListener("pointerdown",y),n.removeEventListener("click",h.current);for(const w of x)n.removeEventListener(w,p,!0),n.removeEventListener(w,v)}},[n,a,r,i,s,o]),{onPointerDownCapture:Ke(()=>l.current=!0,"onPointerDownCapture")}}Ke(Ly,"usePointerDownOutside");function jy(e,t=globalThis?.document){const n=Qe(e),r=m.useRef(!1);return m.useEffect(()=>{const i=Ke(s=>{s.target&&!r.current&&pd(zT,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:Ke(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ke(()=>r.current=!1,"onBlurCapture")}}Ke(jy,"useFocusOutside");function ch(){const e=new CustomEvent(lh);document.dispatchEvent(e)}Ke(ch,"dispatchUpdate");function pd(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?hd(i,s):i.dispatchEvent(s)}Ke(pd,"handleAndDispatchCustomEvent");var WT=Object.defineProperty,ht=(e,t)=>WT(e,"name",{value:t,configurable:!0}),Uc="focusScope.autoFocusOnMount",Kc="focusScope.autoFocusOnUnmount",im={bubbles:!1,cancelable:!0},qT=m.forwardRef(ht(function(t,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=t,[l,c]=m.useState(null),u=Qe(s),h=Qe(o),f=m.useRef(null),d=Ae(n,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(i){let y=function(S){if(p.paused||!l)return;const C=S.target;l.contains(C)?f.current=C:Vn(f.current,{select:!0})},x=function(S){if(p.paused||!l)return;const C=S.relatedTarget;C!==null&&(l.contains(C)||Vn(f.current,{select:!0}))},b=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Vn(l)};ht(y,"handleFocusIn"),ht(x,"handleFocusOut"),ht(b,"handleMutations"),document.addEventListener("focusin",y),document.addEventListener("focusout",x);const w=new MutationObserver(b);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),w.disconnect()}}},[i,l,p.paused]),m.useEffect(()=>{if(l){sm.add(p);const y=document.activeElement;if(!l.contains(y)){const x=new CustomEvent(Uc,im);l.addEventListener(Uc,u),l.dispatchEvent(x),x.defaultPrevented||(_y($y(md(l)),{select:!0}),document.activeElement===y&&Vn(l))}return()=>{l.removeEventListener(Uc,u),setTimeout(()=>{const x=new CustomEvent(Kc,im);l.addEventListener(Kc,h),l.dispatchEvent(x),x.defaultPrevented||Vn(y??document.body,{select:!0}),l.removeEventListener(Kc,h),sm.remove(p)},0)}}},[l,u,h,p]);const v=m.useCallback(y=>{if(!r&&!i||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,b=document.activeElement;if(x&&b){const w=y.currentTarget,[S,C]=By(w);S&&C?!y.shiftKey&&b===C?(y.preventDefault(),r&&Vn(S,{select:!0})):y.shiftKey&&b===S&&(y.preventDefault(),r&&Vn(C,{select:!0})):b===w&&y.preventDefault()}},[r,i,p.paused]);return(0,g.jsx)(_e.div,{tabIndex:-1,...a,ref:d,onKeyDown:v})},"FocusScope"));function _y(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vn(r,{select:t}),document.activeElement!==n)return}ht(_y,"focusFirst");function By(e){const t=md(e);return[uh(t,e),uh(t.reverse(),e)]}ht(By,"getTabbableEdges");function md(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ht(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}ht(md,"getTabbableCandidates");function uh(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Vy(r,{upTo:t})))return r}ht(uh,"findVisible");function Vy(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ht(Vy,"isHidden");function Fy(e){return e instanceof HTMLInputElement&&"select"in e}ht(Fy,"isSelectableInput");function Vn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fy(e)&&t&&e.select()}}ht(Vn,"focus");var sm=zy();function zy(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=hh(e,t),e.unshift(t)},remove(t){e=hh(e,t),e[0]?.resume()}}}ht(zy,"createFocusScopesStack");function hh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ht(hh,"arrayRemove");function $y(e){return e.filter(t=>t.tagName!=="A")}ht($y,"removeLinks");var UT=Object.defineProperty,KT=(e,t)=>UT(e,"name",{value:t,configurable:!0}),Hy=m.forwardRef(KT(function(t,n){const{container:r,...i}=t,[s,o]=m.useState(!1);Dt(()=>o(!0),[]);const a=r||s&&globalThis?.document?.body;return a?_o.createPortal((0,g.jsx)(_e.div,{...i,ref:n}),a):null},"Portal")),GT=Object.defineProperty,gd=(e,t)=>GT(e,"name",{value:t,configurable:!0}),sa=0,mi=null;function QT(e){return vd(),e.children}gd(QT,"FocusGuards");function vd(){m.useEffect(()=>{mi||(mi={start:fh(),end:fh()});const{start:e,end:t}=mi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),sa++,()=>{sa===1&&(mi?.start.remove(),mi?.end.remove(),mi=null),sa=Math.max(0,sa-1)}},[])}gd(vd,"useFocusGuards");function fh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}gd(fh,"createFocusGuard");var bn=function(){return bn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},bn.apply(this,arguments)};function Wy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function XT(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var za="right-scroll-bar-position",$a="width-before-scroll-bar",YT="with-scroll-bars-hidden",JT="--removed-body-scroll-bar-size";function Gc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ZT(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var eA=typeof window<"u"?m.useLayoutEffect:m.useEffect,om=new WeakMap;function tA(e,t){var n=ZT(t||null,function(r){return e.forEach(function(i){return Gc(i,r)})});return eA(function(){var r=om.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(a){s.has(a)||Gc(a,null)}),s.forEach(function(a){i.has(a)||Gc(a,o)})}om.set(n,e)},[e]),n}function nA(e){return e}function rA(e,t){t===void 0&&(t=nA);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(i),s=n}var a=function(){var c=s;s=[],c.forEach(i)},l=function(){return Promise.resolve().then(a)};l(),n={push:function(c){s.push(c),l()},filter:function(c){return s=s.filter(c),n}}}}}function iA(e){e===void 0&&(e={});var t=rA(null);return t.options=bn({async:!0,ssr:!1},e),t}var qy=function(e){var t=e.sideCar,n=Wy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,bn({},n))};qy.isSideCarExport=!0;function sA(e,t){return e.useMedium(t),qy}var Uy=iA(),Qc=function(){},nc=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Qc,onWheelCapture:Qc,onTouchMoveCapture:Qc}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,h=e.shards,f=e.sideCar,d=e.noRelative,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=Wy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,T=tA([n,t]),k=bn(bn({},S),i);return m.createElement(m.Fragment,null,u&&m.createElement(C,{sideCar:Uy,removeScrollBar:c,shards:h,noRelative:d,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?m.cloneElement(m.Children.only(a),bn(bn({},k),{ref:T})):m.createElement(b,bn({},k,{className:l,ref:T}),a))});nc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nc.classNames={fullWidth:$a,zeroRight:za};var am,oA=function(){if(am)return am;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=oA();return t&&e.setAttribute("nonce",t),e}function lA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cA(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var uA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=aA())&&(lA(t,n),cA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hA=function(){var e=uA();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ky=function(){var e=hA(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},fA={left:0,top:0,right:0,gap:0},Xc=function(e){return parseInt(e||"",10)||0},dA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Xc(n),Xc(r),Xc(i)]},pA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fA;var t=dA(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},mA=Ky(),Qs="data-scroll-locked",gA=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat(YT,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -134,4 +134,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error
134
134
 
135
135
  `):null}function K5({className:e,children:t,...n}){return(0,g.jsxs)(lE,{"data-slot":"scroll-area",className:X("relative",e),...n,children:[(0,g.jsx)(cE,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,g.jsx)(G5,{}),(0,g.jsx)(uE,{})]})}function G5({className:e,orientation:t="vertical",...n}){return(0,g.jsx)(YP,{"data-slot":"scroll-area-scrollbar",orientation:t,className:X("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:(0,g.jsx)(rE,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Q5=500,X5={ok:"border-success/30 bg-success/10 text-success",error:"border-destructive/30 bg-destructive/10 text-destructive",unknown:"border-border/50 bg-muted/40 text-muted-foreground"};function FC(e){switch(e){case"left_click":return"Click";case"double_click":return"Double-click";case"right_click":return"Right-click";case"mouse_move":return"Move";case"type":return"Type";case"key":return"Key";case"scroll":return"Scroll";case"wait":return"Wait";case"screenshot":return"Assert";default:return e}}function us(e){const t=FC(e.action),n=e.locatorLabel?.trim();return n?`Interact · ${t} ${n}`:`Interact · ${t}`}function ec(e){return e.assertion?e.assertion.passed?"ok":"error":e.ok===!0?"ok":e.ok===!1?"error":"unknown"}function Ls(e){return`${e.toolCallId}:${e.stepIndex}`}function Y5(e){if(!e)return[];const t=[];return typeof e.durationMs=="number"&&e.durationMs>0&&t.push({key:"duration",label:J5(e.durationMs),...typeof e.distinctFrames=="number"?{title:`${e.distinctFrames.toLocaleString()} distinct frames — identical frames are dropped, so an idle page costs none`}:{}}),typeof e.fps=="number"&&e.fps>0&&t.push({key:"fps",label:`${e.fps} fps`}),t}function J5(e){const t=Math.round(e/1e3),n=t%60,r=Math.floor(t/60)%60,i=Math.floor(t/3600),s=String(r).padStart(i>0?2:1,"0");return i>0?`${i}:${s}:${String(n).padStart(2,"0")}`:`${s}:${String(n).padStart(2,"0")}`}function zC(e){return typeof e=="string"&&e.length>0?e:null}function IW(e){return(e.widgetRenderObservations?.length??0)>0||(e.browserInteractionSteps?.length??0)>0||zC(e.videoUrl)!==null}function Z5(e){return e==="ok"?"OK":e==="error"?"Failed":"Unknown"}function $C({step:e,leading:t,className:n}){const r=ec(e),i=e.widgetToolCalls??[],s=e.coordinateX!=null&&e.coordinateY!=null?`(${e.coordinateX}, ${e.coordinateY})`:null;return(0,g.jsxs)("div",{"data-testid":"browser-step-detail",className:X("flex flex-col gap-4",n),children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[t,(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:us(e)}),(0,g.jsxs)("p",{className:"text-xs text-muted-foreground",children:["App interaction · ",e.elapsedMs,"ms",s?` · ${s}`:""]})]}),(0,g.jsx)("span",{className:X("inline-flex shrink-0 items-center rounded-full border px-2 py-0.5 text-[11px] font-medium",X5[r]),children:Z5(r)})]}),e.assertion&&!e.assertion.passed&&e.assertion.reason?(0,g.jsx)("p",{className:"text-xs text-destructive",children:e.assertion.reason}):null,e.screenshotUrl?(0,g.jsx)(xC,{src:e.screenshotUrl,alt:us(e),className:"max-h-72 w-full rounded-md border border-border/50 object-contain"}):null,i.length>0?(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Widget tool calls"}),i.map((o,a)=>(0,g.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border/50 px-2.5 py-1.5 text-xs",children:[(0,g.jsx)("span",{className:X("inline-block h-1.5 w-1.5 shrink-0 rounded-full",o.ok?"bg-success":"bg-destructive"),"aria-hidden":!0}),(0,g.jsx)("span",{className:"font-mono text-foreground",children:o.name}),o.error?(0,g.jsx)("span",{className:"truncate text-destructive",children:o.error}):null]},`${o.name}-${a}`))]}):null,e.followUps&&e.followUps.length>0?(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Sent message to chat"}),e.followUps.map((o,a)=>(0,g.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border/50 px-2.5 py-1.5 text-xs",children:[(0,g.jsx)("span",{"aria-hidden":!0,children:"↳"}),(0,g.jsx)("span",{className:"truncate text-foreground",children:o})]},a))]}):null]})}function eH(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,"0")}`}function tH(e,t){let n=null;for(const r of e)if(r.videoOffsetMs!=null)if(r.videoOffsetMs<=t)n=r;else break;return n}function DW({steps:e,videoUrl:t,videoMeta:n,isRunning:r=!1,className:i}){const s=(0,m.useRef)(null),[o,a]=(0,m.useState)(null),[l,c]=(0,m.useState)(null),u=(0,m.useRef)(null),[h,f]=(0,m.useState)(!1),d=zC(t),p=(0,m.useMemo)(()=>Y5(n),[n]),v=(0,m.useMemo)(()=>[...e].sort((k,A)=>(k.videoOffsetMs??Number.POSITIVE_INFINITY)-(A.videoOffsetMs??Number.POSITIVE_INFINITY)||k.promptIndex-A.promptIndex||k.ts-A.ts),[e]),y=o??l??null,x=(0,m.useMemo)(()=>v.find(k=>Ls(k)===y)??null,[v,y]),b=d!=null&&!h,w=v.some(k=>k.screenshotUrl),S=(0,m.useCallback)(k=>{a(Ls(k));const A=s.current;if(!A||!b||k.videoOffsetMs==null)return;const E=k.videoOffsetMs/1e3;u.current=E,A.currentTime=E},[b]),C=(0,m.useCallback)(()=>{u.current=null},[]),T=(0,m.useCallback)(()=>{const k=s.current;if(!k)return;const A=tH(v,k.currentTime*1e3);if(c(A?Ls(A):null),u.current==null){if(o!=null){const E=v.find(R=>Ls(R)===o);if(E?.videoOffsetMs!=null){const R=E.videoOffsetMs-k.currentTime*1e3;if(R>0&&R<Q5)return}}a(null)}},[v,o]);return(0,m.useEffect)(()=>{f(!1)},[t]),v.length===0&&!d?(0,g.jsx)("div",{className:"flex items-center justify-center rounded-md border border-dashed border-border/40 py-8 text-xs text-muted-foreground","data-testid":"browser-filmstrip-empty",children:r?"Finalizing replay…":"No app interactions were recorded."}):(0,g.jsxs)("section",{className:X("flex min-w-0 flex-col gap-3",i),"data-testid":"browser-step-filmstrip",children:[(0,g.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,g.jsxs)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Replay",(0,g.jsx)("span",{className:"ml-1.5 font-normal normal-case text-muted-foreground/70",children:"screen recording of the app interactions in this run"})]}),d&&!h&&(p.length>0||n?.truncated)?(0,g.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground","data-testid":"browser-replay-video-meta",children:[p.map(k=>(0,g.jsx)("span",{title:k.title,children:k.label},k.key)),n?.truncated?(0,g.jsx)("span",{className:"rounded-sm border border-warning/30 bg-warning/10 px-1.5 py-px font-medium text-warning-foreground","data-testid":"browser-replay-truncated-badge",title:"The recorder stopped at its size limit, so this video covers the beginning of the run and not the end of it.",children:"Stopped at the size limit"}):null]}):null,d&&!h?(0,g.jsx)("video",{ref:s,src:d,controls:!0,preload:"metadata",onTimeUpdate:T,onSeeked:C,onError:()=>f(!0),className:"w-full rounded-md border border-border/60 bg-black","data-testid":"browser-replay-video"}):(0,g.jsx)("p",{className:"rounded-md border border-dashed border-border/50 bg-muted/20 px-3 py-2 text-[11px] text-muted-foreground","data-testid":"browser-replay-video-unavailable",children:r?"Finalizing replay — the recording is written when the run ends.":h?w?"Recording failed to load — screenshots preserved.":"Recording failed to load, and no screenshots were captured.":w?"Video unavailable — screenshots preserved.":"Partial capture — no recording, and no screenshots survived."})]}),v.length>0?(0,g.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,g.jsx)("div",{className:"flex min-w-0 gap-2 overflow-x-auto pb-1","data-testid":"browser-filmstrip-track",children:v.map(k=>{const A=Ls(k),E=ec(k),R=A===y;return(0,g.jsxs)("button",{type:"button",onClick:()=>S(k),"aria-pressed":R,title:us(k),"data-testid":"browser-filmstrip-frame","data-step-key":A,"data-active":R?"true":"false",className:X("flex w-28 shrink-0 flex-col gap-1 rounded-md border p-1 text-left transition-colors",R?"border-primary bg-primary/5":"border-border/50 hover:border-border"),children:[k.screenshotUrl?(0,g.jsx)(xC,{src:k.screenshotUrl,alt:us(k),loading:"lazy",className:"h-16 w-full rounded-sm border border-border/40 bg-background object-cover object-top"}):(0,g.jsx)("div",{className:"flex h-16 w-full items-center justify-center rounded-sm border border-dashed border-border/50 bg-muted/20 text-[10px] text-muted-foreground",children:"No frame"}),(0,g.jsx)("span",{className:"truncate text-[10px] font-medium text-foreground",children:FC(k.action)}),(0,g.jsx)("span",{className:X("truncate text-[10px]",E==="error"?"text-destructive":"text-muted-foreground"),children:k.videoOffsetMs!=null?eH(k.videoOffsetMs):`turn ${k.promptIndex+1}`})]},A)})}),x?(0,g.jsx)($C,{step:x,className:"rounded-lg bg-muted/5 px-4 py-4"}):(0,g.jsx)("p",{className:"px-1 text-[11px] text-muted-foreground",children:"Select a frame to see the interaction that produced it."})]}):null]})}var nH={[-32700]:"Parse error",[-32600]:"Invalid request",[-32601]:"Method not found",[-32602]:"Invalid params",[-32603]:"Internal error",[-32e3]:"Connection closed",[-32001]:"Request timeout",[-32042]:"URL elicitation required"};function rH(e){const t=nH[e];return t?`${e} · ${t}`:String(e)}var iH=xr({id:ve(),parentId:ve().optional(),name:ve(),category:xl(["step","llm","tool","error","connection","discovery"]),startMs:ct(),endMs:ct(),promptIndex:ct().optional(),stepIndex:ct().optional(),authoredStepId:ve().optional(),status:xl(["ok","error"]).optional(),toolCallId:ve().optional(),toolName:ve().optional(),serverId:ve().optional(),connectionId:ve().optional(),modelId:ve().optional(),inputTokens:ct().optional(),outputTokens:ct().optional(),totalTokens:ct().optional(),messageStartIndex:ct().optional(),messageEndIndex:ct().optional(),finishReason:ve().optional(),provider:ve().optional(),responseId:ve().optional(),responseTimestamp:ve().optional(),ttfcMs:ct().optional(),mcpErrorCode:ct().optional(),outputSource:rh([dr("narration"),dr("evidence"),dr("reconstructed")]).optional(),wireCorroborated:Ue().optional(),evidenceRequestId:ve().optional(),evidenceStatus:rh([dr("complete"),dr("incomplete")]).optional()}),Ti=xr({toolName:ve(),arguments:Va(ve(),vy())}),sH=xr({promptIndex:ct(),prompt:ve(),expectedToolCalls:yn(Ti),actualToolCalls:yn(Ti),expectedOutput:ve().optional(),passed:Ue(),missing:yn(Ti),unexpected:yn(Ti),argumentMismatches:yn(xr({expected:Ti,actual:Ti,mismatchedArguments:yn(ve())}))}),oH=xr({toolCallId:ve(),toolName:ve(),protocol:rh([dr("mcp-apps"),dr("openai-apps")]),serverId:ve(),resourceUri:ve().optional(),toolMetadata:Va(ve(),Wc()),widgetCsp:Va(ve(),Wc()).nullable().optional(),widgetPermissions:Va(ve(),Wc()).nullable().optional(),widgetPermissive:Ue().optional(),prefersBorder:Ue().optional(),widgetHtmlBlobId:ve().optional(),widgetHtmlUrl:ve().nullable().optional(),injectedOpenAiCompat:Ue().optional(),injectedOpenAiCompatCapabilities:xr({callTool:Ue().optional(),sendFollowUpMessage:Ue().optional(),setWidgetState:Ue().optional(),requestDisplayMode:xl(["all","fullscreen-only","none"]).optional(),notifyIntrinsicHeight:Ue().optional(),openExternal:Ue().optional(),setOpenInAppUrl:Ue().optional(),requestModal:Ue().optional(),uploadFile:Ue().optional(),selectFiles:Ue().optional(),getFileDownloadUrl:Ue().optional(),requestCheckout:Ue().optional(),requestClose:Ue().optional()}).optional()}),aH=xr({source:xl(["hosted","widget"]),fps:ct().optional(),durationMs:ct().optional(),distinctFrames:ct().optional(),truncated:Ue().optional()}),NW=xr({traceVersion:dr(1),messages:yn(vy()),widgetSnapshots:yn(oH).optional(),spans:yn(iH).optional(),prompts:yn(sH).optional(),videoBlobId:ve().optional(),videoMeta:aH.optional()}),lH=["all","connection","discovery","llm","tool","error"];function eh(e){switch(e){case"all":return"All";case"connection":return"Connect";case"discovery":return"Discovery";case"llm":return"LLM";case"tool":return"Tool";case"error":return"Error"}}function cH({filter:e,onFilterChange:t,isFullyExpanded:n,expandDisabled:r,onToggleExpandAll:i,zoomControls:s,showBottomBorder:o=!0}){return(0,g.jsxs)("div",{className:X("flex min-h-7 min-w-0 flex-1 flex-row flex-nowrap items-center gap-2 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",o&&"border-b border-border/30 pb-2"),children:[(0,g.jsxs)(xb,{children:[(0,g.jsx)(bb,{asChild:!0,children:(0,g.jsxs)(Nt,{type:"button",variant:"outline",size:"sm",className:"h-7 shrink-0 gap-1.5 border-border/50 px-2 text-[10px] font-medium text-foreground","aria-label":`Filter timeline rows: ${eh(e)}`,children:[(0,g.jsx)(mI,{className:"size-3.5 shrink-0 opacity-80","aria-hidden":!0}),eh(e)]})}),(0,g.jsx)(wb,{align:"start",className:"min-w-[8rem]",children:(0,g.jsx)(KI,{value:e,onValueChange:a=>t(a),children:lH.map(a=>(0,g.jsx)(GI,{value:a,className:"text-xs",children:eh(a)},a))})})]}),(0,g.jsx)(Nt,{type:"button",variant:"outline",size:"icon",disabled:r,className:"h-7 w-7 shrink-0 border-border/50 text-muted-foreground hover:text-foreground disabled:opacity-40",title:n?"Collapse all":"Expand all","aria-label":n?"Collapse all":"Expand all","aria-pressed":n,onClick:i,children:n?(0,g.jsx)(NI,{className:"size-3.5",strokeWidth:2,"aria-hidden":!0}):(0,g.jsx)(aI,{className:"size-3.5",strokeWidth:2,"aria-hidden":!0})}),s?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("span",{className:"bg-border hidden h-3 w-px shrink-0 md:block","aria-hidden":!0}),(0,g.jsx)("div",{className:"flex shrink-0 items-center gap-0.5",children:s})]}):null]})}var ly=[0,25,50,75,100],uH=54,hH=120;function fH(e){if(!Number.isFinite(e))return[0,100];if(e<=0)return[0,100];const t=Math.max(2,Math.floor(e/uH));return t>=ly.length?[...ly]:t<=2?[0,100]:t===3?[0,50,100]:[0,25,75,100]}function dH(e){return e<=0?"left-0 top-1/2 -translate-x-0 -translate-y-1/2 text-left":e>=100?"left-0 top-1/2 -translate-x-full -translate-y-1/2 text-right":"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center"}function cy(e){return e<=0?vl(0):`${vl(0)}–${vl(e)}`}function pH(e){const t=e.filter(l=>l.category==="llm");let n=0,r=0,i=0,s=0,o=0,a=0;for(const l of t)typeof l.inputTokens=="number"&&(n+=l.inputTokens,r++),typeof l.outputTokens=="number"&&(i+=l.outputTokens,s++),typeof l.totalTokens=="number"&&(o+=l.totalTokens,a++);return{...r?{inputTokens:n}:{},...s?{outputTokens:i}:{},...a?{totalTokens:o}:{}}}function Fc(e,t){return t}function uy(e){switch(e){case"connection":return-2;case"discovery":return-1;case"step":return 0;case"llm":return 1;case"tool":return 2;case"error":return 3;default:return Fc(e,9)}}function mH(e,t){if(e.startMs!==t.startMs)return e.startMs-t.startMs;const n=uy(e.category)-uy(t.category);return n!==0?n:e.endMs!==t.endMs?e.endMs-t.endMs:e.name.localeCompare(t.name)}function gH(e,t){return typeof e!="number"||t<50?null:e/(t/1e3)}function co(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?1:2)}s`:`${Math.round(e)}ms`}function vl(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`}function Kn(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Lo(e){const t=e.toolName??e.name;return typeof t=="string"&&t.trim()?t:void 0}function ta(e){return Array.isArray(e.content)?e.content.filter(t=>Kn(t)&&typeof t.type=="string"):typeof e.content=="string"?[{type:"text",text:e.content}]:[]}function HC(e){if(e==null)return"None";if(typeof e=="string")return e.length>180?`${e.slice(0,177)}...`:e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`${e.length} item${e.length===1?"":"s"}`;if(Kn(e)){const t=Object.keys(e);return t.length>0?`{ ${t.slice(0,4).join(", ")}${t.length>4?", ...":""} }`:"{}"}return String(e)}function vH(e){const t=ta(e);if(t.length===0)return typeof e.content=="string"?e.content:"No content";const n=t.slice(0,3).map(r=>r.type==="text"&&typeof r.text=="string"?r.text:r.type==="tool-call"?`Tool call: ${Lo(r)??"Tool"}`:r.type==="tool-result"?`Tool result: ${Lo(r)??"Tool"}`:typeof r.type=="string"?r.type:"content").join(" | ");return n.length>220?`${n.slice(0,217)}...`:n}function yH(e){return!Kn(e)||!("type"in e)||!("value"in e)?e:e.value}function xH(e){return e.result!==void 0?e.result:yH(e.output)}function bH(e){const t=xH(e);if(typeof e.error=="string"&&e.error.trim())return e.error.trim();if(Kn(e.error)&&typeof e.error.message=="string")return e.error.message;if(Kn(e.output)&&e.output.type==="error-text")return typeof e.output.value=="string"?e.output.value:"Tool error";if(Kn(e.result)&&e.result.isError===!0||Kn(e.output)&&Kn(e.output.value)&&e.output.value.isError===!0||e.isError===!0)return Zu(t)??"Tool error"}function zc(e,t,n){if(!t&&!n)return{};let r,i,s;for(const o of e)for(const a of ta(o)){const l=typeof t=="string"&&a.toolCallId===t,c=!l&&typeof n=="string"&&Lo(a)===n;if(!(!l&&!c)&&(a.type==="tool-call"&&(r=a.input??a.parameters??a.args),a.type==="tool-result")){i=a.result??(Kn(a.output)&&"value"in a.output?a.output.value:a.output);const u=bH(a);u&&(s=u)}}return{input:r,output:i,errorText:s}}function Fi(e,t){return e.category==="error"||e.status==="error"?!0:e.category==="tool"?!!zc(t,e.toolCallId,e.toolName??e.name).errorText:!1}function bs(e,t){if(typeof e!="number"&&typeof t!="number")return;const n=e??t??0,r=t??e??n;return{startIndex:Math.min(n,r),endIndex:Math.max(n,r)}}function wH(e){return bs(e.messageStartIndex,e.messageEndIndex)}function SH(e){return bs(e.span.messageStartIndex,e.span.messageEndIndex)}function WC(e){if(!e)return[];const t=[];for(let n=e.startIndex;n<=e.endIndex;n+=1)t.push(n);return t}function qC(e,t,n){if(t)for(let r=t.startIndex;r<=t.endIndex;r+=1){const i=e[r];if(i&&n(i))return r}}function Xp(e,t,n){if(!e.length)return;const r=bs(t,n);if(!r){const s=e.findIndex(o=>o.role==="user");return s>=0?s:void 0}const i=qC(e,r,s=>s.role==="user");if(typeof i=="number")return i;if(!(r.startIndex>=e.length)&&r.startIndex>0)for(let s=r.startIndex-1;s>=0;s-=1){const o=e[s];if(o){if(o.role==="user")return s;if(o.role==="assistant")break}}}function kH(e,t){if(e.kind==="prompt")return"trace-waterfall-bar-prompt";if(e.kind==="interaction")return e.status==="error"?"trace-waterfall-bar-error":"trace-waterfall-bar-tool";if(e.kind==="span"&&t)return"trace-waterfall-bar-error";if(e.kind!=="span")return"trace-waterfall-bar-step";const n=e.span.category;switch(n){case"llm":return"trace-waterfall-bar-llm";case"tool":return"trace-waterfall-bar-tool";case"step":case"connection":case"discovery":return"trace-waterfall-bar-step";case"error":return"trace-waterfall-bar-error";default:return Fc(n,"trace-waterfall-bar-step")}}function CH(e){switch(e){case"prompt":return"trace-waterfall-glyph-prompt";case"step":return"trace-waterfall-glyph-step";case"llm":return"trace-waterfall-glyph-llm";case"tool":case"interaction":return"trace-waterfall-glyph-tool";case"error":return"trace-waterfall-glyph-error";case"connection":case"discovery":return"trace-waterfall-glyph-step";default:return Fc(e,"text-muted-foreground")}}function TH(e,t){if(e.kind==="prompt")return"trace-waterfall-row-accent-prompt";if(e.kind==="interaction")return e.status==="error"?"trace-waterfall-row-accent-error":"trace-waterfall-row-accent-tool";const n=t?"error":e.span.category;switch(n){case"llm":return"trace-waterfall-row-accent-llm";case"tool":return"trace-waterfall-row-accent-tool";case"error":return"trace-waterfall-row-accent-error";case"step":case"connection":case"discovery":return"trace-waterfall-row-accent-step";default:return Fc(n,"border-l-muted-foreground")}}function AH(e){const t=new Map;for(const n of e){const r=typeof n.promptIndex=="number"?n.promptIndex:0,i=t.get(r);i?i.push(n):t.set(r,[n])}return[...t.entries()].sort(([n],[r])=>n-r).map(([n,r])=>{const i=new Map;r.forEach(c=>{i.set(c.id,{span:c,children:[]})});const s=[];r.forEach(c=>{const u=i.get(c.id),h=typeof c.parentId=="string"?i.get(c.parentId):void 0;if(h){h.children.push(u);return}s.push(u)});const o=c=>{c.sort((u,h)=>mH(u.span,h.span)),c.forEach(u=>o(u.children))};o(s);const a=r.flatMap(c=>{const u=[];return typeof c.messageStartIndex=="number"&&u.push(c.messageStartIndex),typeof c.messageEndIndex=="number"&&u.push(c.messageEndIndex),u}),l={step:0,llm:0,tool:0,error:0,connection:0,discovery:0};for(const c of r)c.category in l&&l[c.category]++;return{key:`prompt-${n}`,promptIndex:n,label:`Prompt ${n+1}`,spans:r,roots:s,startMs:Math.min(...r.map(c=>c.startMs)),endMs:Math.max(...r.map(c=>c.endMs)),messageStartIndex:a.length>0?Math.min(...a):void 0,messageEndIndex:a.length>0?Math.max(...a):void 0,counts:l}})}function hy(e){const t=new Set;function n(r){for(const i of r)i.span.category==="step"&&i.children.length>0&&t.add(i.span.id),n(i.children)}for(const r of e)n(r.roots);return t}function th(e){return{role:e.role,content:e.content}}function UC(e,t,n){const r=bs(t,n);if(!r)return[];const i=e.slice(r.startIndex,r.endIndex+1);if(i.length===0)return[];let s=-1;for(let a=0;a<i.length;a++)if(i[a].role==="assistant"){s=a;break}if(s<0)return e.slice(0,r.endIndex+1);const o=r.startIndex+s;return o===0?[]:e.slice(0,o)}function RH(e,t,n){const r=bs(t,n);if(!r)return{input:null,output:null};const i=e.slice(r.startIndex,r.endIndex+1);if(i.length===0)return{input:[],output:null};let s=-1;for(let l=i.length-1;l>=0;l-=1)if(i[l].role==="assistant"){s=l;break}if(s<0)return{input:i.map(th),output:null};const o=UC(e,t,n),a=i[s];return{input:o.length>0?o.map(th):null,output:th(a)}}var MH=96;function Yt(e,t=MH){const n=e.replace(/\s+/g," ").trim();return n.length<=t?n:`${n.slice(0,t-1)}…`}function jo(e){return typeof e.content=="string"?e.content.trim():ta(e).map(t=>t.type==="text"&&typeof t.text=="string"?t.text.trim():"").filter(Boolean).join(" ")}function PH(e){const t=ta(e),n=[];for(const r of t)r.type==="tool-call"&&n.push(Lo(r)??"tool");return n}function EH(e,t){if(!e.length)return;const n=UC(e,t.messageStartIndex,t.messageEndIndex);if(n.length!==0){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i.role==="user"){const s=jo(i);if(s)return Yt(s)}}for(const r of n)if(r.role==="system"){const i=jo(r);if(i)return Yt(i)}for(let r=n.length-1;r>=0;r--){const i=n[r];if(i.role==="tool"){const s=vH(i);if(s&&s!=="No content")return Yt(s)}}}}function OH(e,t){if(!e.length)return;const n=bs(t.messageStartIndex,t.messageEndIndex);if(!n)return;const r=e.slice(n.startIndex,n.endIndex+1);for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.role!=="assistant")continue;const o=jo(s);if(o)return{kind:"text",preview:Yt(o)};const a=PH(s);if(a.length>0)return{kind:"tools",preview:Yt(`Calling ${a.join(", ")}`)}}}function IH(e,t,n){const r=Xp(e,t,n);if(typeof r!="number")return;const i=jo(e[r]);return i?Yt(i):void 0}function DH(e,t,n){const r=Xp(e,t,n);if(typeof r=="number")return jo(e[r])||void 0}function fy(e,t){if(typeof t.toolCallId=="string"&&e.toolCallId===t.toolCallId)return!0;const n=t.toolName?.trim()||t.name?.trim();return!!(n&&Lo(e)===n)}function NH(e,t,n){if(n)for(let r=n.startIndex;r<=n.endIndex;r+=1){const i=e[r];if(!i)continue;const s=ta(i);if(s.some(o=>o.type==="tool-call"&&fy(o,t))||s.some(o=>o.type==="tool-result"&&fy(o,t)))return r}}function LH(e,t){const n=Xp(t,e.messageStartIndex,e.messageEndIndex);if(typeof n=="number")return{focusSourceIndex:n,highlightSourceIndices:[n]};const r=WC(wH(e));if(r.length!==0)return{focusSourceIndex:r[0],highlightSourceIndices:r}}function jH(e,t){const n=SH(e),r=WC(n);if(r.length===0)return;const i=qC(t,n,s=>s.role==="assistant");return{focusSourceIndex:(e.span.category==="tool"?NH(t,e.span,n):void 0)??i??r[0],highlightSourceIndices:r}}function _H(e,t){const n=zc(e,t.toolCallId,t.toolName??t.name);if(n.input==null)return;const r=HC(n.input);if(!(!r||r==="None"))return Yt(r)}function hs({category:e,size:t="sm"}){const n=X(t==="lg"?"h-5 w-5 shrink-0":"h-3.5 w-3.5 shrink-0",CH(e));switch(e){case"prompt":return(0,g.jsx)(VI,{className:n,"aria-hidden":!0});case"llm":return(0,g.jsx)(XO,{className:n,"aria-hidden":!0});case"tool":return(0,g.jsx)(zI,{className:n,"aria-hidden":!0});case"interaction":return(0,g.jsx)(AI,{className:n,"aria-hidden":!0});case"error":return(0,g.jsx)(tI,{className:n,"aria-hidden":!0});case"connection":case"discovery":case"step":return(0,g.jsx)(_m,{className:n,"aria-hidden":!0});default:return(0,g.jsx)(_m,{className:n,"aria-hidden":!0})}}function BH(e,t){const n=t.promptIndex,r=t.stepIndex;if(typeof n!="number"||typeof r!="number")return{};const i=e.find(s=>s.category==="llm"&&s.promptIndex===n&&s.stepIndex===r);return i?{...typeof i.inputTokens=="number"?{inputTokens:i.inputTokens}:{},...typeof i.outputTokens=="number"?{outputTokens:i.outputTokens}:{},...typeof i.totalTokens=="number"?{totalTokens:i.totalTokens}:{}}:{}}function VH(e,t){if(e.kind==="prompt")return{inputTokens:e.aggregatedInputTokens,outputTokens:e.aggregatedOutputTokens,totalTokens:e.aggregatedTotalTokens};if(e.kind==="interaction")return{};const n={inputTokens:e.span.inputTokens,outputTokens:e.span.outputTokens,totalTokens:e.span.totalTokens};if(typeof n.inputTokens=="number"||typeof n.outputTokens=="number"||typeof n.totalTokens=="number"||!t?.length||e.span.category!=="llm"&&e.span.category!=="step")return n;const r=BH(t,e.span);return typeof r.inputTokens=="number"||typeof r.outputTokens=="number"||typeof r.totalTokens=="number"?r:n}function nh(e){return typeof e=="number"?e.toLocaleString():"—"}function dy(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toLocaleString():"—"}function FH({traceStartedAtMs:e,traceEndedAtMs:t,traceDurationMs:n}){return typeof e=="number"&&Number.isFinite(e)?e:typeof t=="number"&&Number.isFinite(t)?t-n:null}function cd(e,t){const{span:n,promptIndex:r}=e,i=n.modelId?.trim()?Yt(n.modelId.trim(),56):void 0,s=n.name?.trim()??"";if(n.category==="step"){const o=typeof n.stepIndex=="number"?n.stepIndex+1:void 0,a=typeof o=="number"?`Step ${o}`:s||"Step",l=typeof o=="number"&&(s===`Step ${o}`||s.toLowerCase()===`step ${o}`),c=s&&!l?Yt(s,64):a,u=EH(t,n);return u?{title:c,subtitle:u}:i?{title:c,subtitle:i}:{title:c,subtitle:`Prompt ${r+1}`}}if(n.category==="llm"){const o=OH(t,n),a=!s||/^assistant$/i.test(s)||/^llm$/i.test(s)||/^model$/i.test(s)||s==="Model response"||/·\s*response$/i.test(s)?"Agent":Yt(s,64);return o?.kind==="text"?{title:`${a}: "${o.preview}"`,subtitle:i}:o?.kind==="tools"?{title:`${a} · ${o.preview}`,subtitle:i}:{title:a,subtitle:i}}if(n.category==="tool"){const o=`Tool · ${(n.toolName??n.name).trim()||"tool"}`,a=_H(t,n),l=!a||a==="{}"||a==="None";if(a&&!l)return{title:o,subtitle:a};if(l){const c=zc(t,n.toolCallId,n.toolName??n.name);if(c.output!=null){const u=HC(c.output);if(u&&u!=="None"&&u!=="{}")return{title:o,subtitle:Yt(u)}}}return typeof n.stepIndex=="number"?{title:o,subtitle:i?`${i} · step ${n.stepIndex+1}`:`step ${n.stepIndex+1}`}:{title:o,subtitle:i}}return{title:n.name,subtitle:typeof n.stepIndex=="number"?i?`${i} · step ${n.stepIndex+1}`:`step ${n.stepIndex+1}`:i}}function ud(e){const t=e.kind==="span"?e.span.startMs:e.startMs,n=e.kind==="span"?e.span.endMs:e.endMs;return{startMs:t,endMs:n,durationMs:n-t}}function zH({format:e,onFormatChange:t}){return(0,g.jsx)("div",{className:"flex flex-wrap gap-1",children:["plain","markdown"].map(n=>(0,g.jsx)(Nt,{type:"button",size:"sm",variant:e===n?"secondary":"outline",className:"h-7 text-[10px] capitalize",onClick:()=>t(n),children:n==="plain"?"Plain":"Markdown"},n))})}function py({value:e}){const[t,n]=(0,m.useState)("plain");return(0,m.useEffect)(()=>{typeof e=="string"&&n("plain")},[e]),e==null?(0,g.jsx)("div",{className:"rounded-md border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground",children:"None"}):typeof e=="string"?(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(zH,{format:t,onFormatChange:n}),t==="markdown"?(0,g.jsx)("div",{className:"max-h-44 overflow-auto rounded-md border border-border/60 bg-muted/10 p-3 text-xs leading-relaxed text-foreground",children:(0,g.jsx)(mC,{content:e})}):(0,g.jsx)("pre",{className:"max-h-44 overflow-auto rounded-md border border-border/60 bg-muted/20 p-3 text-xs whitespace-pre-wrap break-words",children:e})]}):(0,g.jsx)(Z$,{value:e,containerClassName:"max-h-56 rounded-md border border-border/60 bg-background"})}function $H({row:e}){return(0,g.jsx)("div",{"data-testid":"trace-detail-pane",className:"min-h-[280px] rounded-lg bg-muted/5 px-5 py-5",children:(0,g.jsx)($C,{step:e.step,leading:(0,g.jsx)(hs,{category:"interaction",size:"lg"})})})}function my(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function HH(e){return e.engine==="harness"?e.harness?my(e.harness):"Harness":e.engine==="emulated"?"Emulated":e.harness?my(e.harness):"Unknown"}function WH({row:e,transcriptMessages:t,onRevealInTranscript:n,turnRuntimeByPromptIndex:r}){if(!e)return(0,g.jsxs)("div",{"data-testid":"trace-detail-pane",className:"flex min-h-[280px] flex-col items-center justify-center gap-3 rounded-lg bg-muted/5 px-6 py-12 text-center",children:[(0,g.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-full border border-border/50 bg-background shadow-sm",children:(0,g.jsx)(dI,{className:"h-7 w-7 text-muted-foreground","aria-hidden":!0})}),(0,g.jsxs)("div",{className:"space-y-1",children:[(0,g.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No span selected"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:"Click a row or use arrow keys"})]})]});if(e.kind==="interaction")return(0,g.jsx)($H,{row:e});const i=e.kind==="prompt"?LH(e,t):jH(e,t),s=e.kind==="span"?zc(t,e.span.toolCallId,e.span.toolName??e.span.name):{},{durationMs:o}=ud(e),a=e.kind==="span"?cd(e,t):null,l=e.kind==="prompt"?e.label:a.title,c=e.kind==="prompt"?e.hasAnyFailure?"error":"ok":Fi(e.span,t)?"error":"ok",u=e.kind==="prompt"?"prompt":e.span.category==="tool"&&Fi(e.span,t)?"error":e.span.category,h=r?.get(e.promptIndex),f=e.kind==="span"&&(e.span.category==="llm"||e.span.category==="step")?RH(t,e.span.messageStartIndex,e.span.messageEndIndex):{input:null,output:null},d=e.kind==="span"&&e.span.category==="tool"&&(!!e.span.toolCallId||!!(e.span.toolName?.trim()||e.span.name?.trim())),p=e.kind==="prompt"?null:d?s.input:e.kind==="span"&&(e.span.category==="llm"||e.span.category==="step")?f.input:(e.kind==="span"&&e.span.category==="error",null),v=e.kind==="prompt"?null:d?s.output:e.kind==="span"&&(e.span.category==="llm"||e.span.category==="step")?f.output:e.kind==="span"&&e.span.category==="error"?e.span.name:null,y=e.kind==="prompt"?DH(t,e.messageStartIndex,e.messageEndIndex):void 0,x=e.kind==="span"&&(typeof e.span.inputTokens=="number"||typeof e.span.outputTokens=="number"||typeof e.span.totalTokens=="number"),b=e.kind==="prompt"&&(typeof e.aggregatedInputTokens=="number"||typeof e.aggregatedOutputTokens=="number"||typeof e.aggregatedTotalTokens=="number"),w=e.kind==="span"&&s.errorText?s.errorText:null,S=!!(i&&n);return(0,g.jsxs)("div",{"data-testid":"trace-detail-pane",className:"space-y-4 bg-background p-4",children:[(0,g.jsxs)("div",{className:X("border-b border-border/40 pb-3",S?"flex flex-col gap-3 min-[400px]:flex-row min-[400px]:items-start":""),children:[(0,g.jsxs)("div",{className:X("flex gap-3",S?"min-w-0 min-[400px]:flex-1":""),children:[(0,g.jsx)("div",{className:"shrink-0 pt-0.5",children:e.kind==="prompt"?(0,g.jsx)(hs,{category:"prompt",size:"lg"}):(0,g.jsx)(hs,{category:u,size:"lg"})}),(0,g.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,g.jsx)("h3",{className:"text-sm font-bold leading-tight text-foreground",children:l}),h?(0,g.jsxs)(Sb,{className:"border-border/60 bg-muted/30 px-1.5 py-0 text-[10px] font-medium text-muted-foreground","data-testid":"trace-turn-runtime-badge",title:h.engine==="harness"?"This turn ran through the harness adapter.":h.engine==="emulated"?"This turn ran through MCPJam's emulated chat engine.":h.harness?"This turn ran through the harness adapter.":"Runtime engine was not recorded for this turn.",children:["Engine: ",HH(h)]}):null,c==="error"?(0,g.jsx)("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full bg-destructive",title:"Error","aria-label":"Error"}):null]}),(0,g.jsxs)("div",{className:"text-xs tabular-nums text-muted-foreground",children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:co(o)}),e.kind==="prompt"&&b?(0,g.jsxs)(g.Fragment,{children:[typeof e.aggregatedInputTokens=="number"?` · ${e.aggregatedInputTokens} in`:"",typeof e.aggregatedOutputTokens=="number"?` → ${e.aggregatedOutputTokens} out`:"",typeof e.aggregatedTotalTokens=="number"?` (${e.aggregatedTotalTokens} total)`:""]}):e.kind==="span"&&x?(0,g.jsxs)(g.Fragment,{children:[typeof e.span.inputTokens=="number"?` · ${e.span.inputTokens} in`:"",typeof e.span.outputTokens=="number"?` → ${e.span.outputTokens} out`:"",typeof e.span.totalTokens=="number"?` (${e.span.totalTokens} total)`:""]}):null]}),e.kind==="span"?(()=>{const C=e.span,T=C.category==="llm"?gH(C.outputTokens,o):null,k=[];return C.provider&&k.push({label:"Provider",value:C.provider}),C.finishReason&&k.push({label:"Finish",value:C.finishReason}),typeof C.ttfcMs=="number"&&k.push({label:"TTFC",value:co(C.ttfcMs)}),T!==null&&k.push({label:"Throughput",value:`${T.toFixed(1)} tok/s`}),C.responseId&&k.push({label:"Response ID",value:C.responseId}),k.length===0?null:(0,g.jsx)("div",{"data-testid":"trace-span-metadata",className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:k.map(A=>(0,g.jsxs)("span",{className:"truncate",children:[(0,g.jsxs)("span",{className:"text-muted-foreground/70",children:[A.label,":"," "]}),(0,g.jsx)("span",{className:"font-medium text-foreground",children:A.value})]},A.label))})})():null]})]}),S?(0,g.jsx)("div",{className:"flex min-w-0 min-[400px]:flex-1 min-[400px]:justify-end min-[400px]:pt-0.5",children:(0,g.jsxs)(Nt,{type:"button",size:"sm",variant:"outline",className:"w-full shrink-0 justify-center whitespace-nowrap min-[400px]:w-auto",onClick:()=>{i&&n&&n(i)},children:[(0,g.jsx)(bI,{className:"h-3.5 w-3.5"}),"Reveal in Chat"]})}):null]}),e.kind==="prompt"&&y?(0,g.jsx)("div",{className:"min-h-0 max-h-[min(60vh,28rem)] flex-1 overflow-auto rounded-md border border-border/50 bg-muted/10 px-3 py-2 text-xs leading-relaxed text-foreground",children:y}):null,e.kind==="span"?(0,g.jsxs)("div",{className:"space-y-4",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Input"}),(0,g.jsx)(py,{value:p??void 0})]}),(0,g.jsxs)("div",{className:X("space-y-2",e.span.category==="error"||w?"rounded-md border border-destructive/50 bg-destructive/50 p-2":""),children:[(0,g.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Output"}),(0,g.jsx)(py,{value:v??void 0}),w?(0,g.jsx)("pre",{className:"max-h-40 overflow-auto rounded-md border border-destructive/50 bg-destructive/50 p-3 text-xs whitespace-pre-wrap break-words text-foreground",children:w}):null,typeof e.span.mcpErrorCode=="number"?(0,g.jsxs)("div",{"data-testid":"trace-mcp-error-code",className:"text-[11px] tabular-nums text-muted-foreground",title:"MCP-layer error code. -32602/-32601 etc. are server JSON-RPC errors; -32000 (connection closed) / -32001 (request timeout) are transport/client failures, not server faults.",children:[(0,g.jsx)("span",{className:"text-muted-foreground/70",children:"MCP error: "}),(0,g.jsx)("span",{className:"font-medium text-foreground",children:rH(e.span.mcpErrorCode)})]}):null]})]}):null]})}function LW({recordedSpans:e,interactionSteps:t,estimatedDurationMs:n,transcriptMessageCount:r=0,transcriptMessages:i=[],traceStartedAtMs:s=null,traceEndedAtMs:o=null,onRevealInTranscript:a,hideToolbar:l=!1,timelineFilter:c,onTimelineFilterChange:u,expandedPromptIds:h,onExpandedPromptIdsChange:f,expandedStepIds:d,onExpandedStepIdsChange:p,viewportMaxMs:v,turnRuntimeByPromptIndex:y,fillContent:x=!1}){const b=Gj(),w=e&&e.length>0?"recorded":(n??0)>0?"estimated":"none",S=(0,m.useMemo)(()=>e?.length?AH(e):[],[e]),C=(0,m.useMemo)(()=>{const D=new Map;for(const ee of t??[]){const ce=D.get(ee.toolCallId);ce?ce.push(ee):D.set(ee.toolCallId,[ee])}for(const ee of D.values())ee.sort((ce,Ce)=>ce.stepIndex-Ce.stepIndex);return D},[t]),T=e?.length?e.reduce((D,ee)=>Math.max(D,ee.endMs),1):Math.max(n??0,1),k=(0,m.useMemo)(()=>e?.map(D=>`${D.id}:${D.startMs}:${D.endMs}`).join("|")??w,[w,e]),[A,E]=(0,m.useState)(1);(0,m.useEffect)(()=>{v===void 0&&E(T)},[T,k,v]);const R=Math.max(1,v!==void 0?v:A),O=Math.max(1,Math.round(T/50)),M=(0,m.useMemo)(()=>FH({traceStartedAtMs:s,traceEndedAtMs:o,traceDurationMs:T}),[T,o,s]),[j,N]=(0,m.useState)("all"),P=c!==void 0?c:j,L=u??N,[B,H]=(0,m.useState)(new Set),[V,I]=(0,m.useState)(new Set),ne=h!==void 0?h:B,re=f??H,_=d!==void 0?d:V,U=p??I,[K,G]=(0,m.useState)(null),[$,J]=(0,m.useState)(null),[ae,he]=(0,m.useState)(null),se=(0,m.useRef)(null),Ye=(0,m.useRef)(null),[Le,rt]=(0,m.useState)(-1);(0,m.useLayoutEffect)(()=>{const D=Ye.current;if(!D)return;const ee=()=>{const Ce=D.getBoundingClientRect().width;rt(Number.isFinite(Ce)?Ce:0)};if(ee(),typeof ResizeObserver>"u")return;const ce=new ResizeObserver(ee);return ce.observe(D),()=>ce.disconnect()},[]);const qe=(0,m.useMemo)(()=>fH(Le),[Le]),gt=(0,m.useMemo)(()=>qe.length!==2?!1:Le<0||Le===0?!0:Le<hH,[Le,qe]);(0,m.useEffect)(()=>{l||(H(new Set(S.map(D=>D.key))),I(hy(S)))},[l,S]);const Me=(0,m.useMemo)(()=>{if(w!=="recorded")return[];const D=[],ee=new Set;function ce(ie){return P==="all"?!0:P==="error"?Fi(ie,i):ie.category===P}function Ce(ie,kt,st){const ln=ie.span.category==="step",Ct=ln?st:st+1,cn=ie.children.map(Tt=>Ce(Tt,kt,Ct)),Ss=cn.flatMap(Tt=>Tt.rows),ks=cn.some(Tt=>Tt.hasVisibleContent);if(ln)return{hasVisibleContent:ks||ie.children.length>0,rows:Ss};if(ie.span.category==="llm"&&typeof ie.span.totalTokens!="number"&&typeof ie.span.inputTokens!="number"&&typeof ie.span.outputTokens!="number"&&ie.span.endMs-ie.span.startMs<50)return{hasVisibleContent:!1,rows:[]};const Ln=ie.span.toolCallId,Cs=ie.span.category==="tool"&&!!Ln&&!ee.has(Ln);Cs&&Ln&&ee.add(Ln);const ra=Cs&&Ln?(C.get(Ln)??[]).filter(Tt=>P==="all"||P==="tool"?!0:P==="error"?ec(Tt)==="error":!1).map((Tt,$c)=>({kind:"interaction",key:`interaction-${ie.span.id}-${Tt.stepIndex}-${$c}`,promptIndex:kt,depth:st+1,step:Tt,startMs:ie.span.startMs,endMs:ie.span.endMs,status:ec(Tt)})):[];if(!(ce(ie.span)||ks||ra.length>0))return{hasVisibleContent:ks,rows:Ss};const Ts={kind:"span",key:ie.span.id,promptIndex:kt,depth:st,span:ie.span,hasChildren:ie.children.length>0,isExpanded:_.has(ie.span.id)};return{hasVisibleContent:!0,rows:[Ts,...Ts.hasChildren&&Ts.isExpanded?Ss:[],...ra]}}for(const ie of S){const kt=ie.roots.map(cn=>Ce(cn,ie.promptIndex,0)).flatMap(cn=>cn.rows);if(!(kt.length>0||P==="all"&&ie.spans.length>0))continue;const st=ie.spans.some(cn=>Fi(cn,i)),ln=IH(i,ie.messageStartIndex,ie.messageEndIndex),Ct=pH(ie.spans);D.push({kind:"prompt",key:ie.key,promptIndex:ie.promptIndex,label:ie.label,conversationLabel:ln?`User: "${ln}"`:void 0,startMs:ie.startMs,endMs:ie.endMs,messageStartIndex:ie.messageStartIndex,messageEndIndex:ie.messageEndIndex,counts:ie.counts,hasAnyFailure:st,isExpanded:ne.has(ie.key),aggregatedInputTokens:Ct.inputTokens,aggregatedOutputTokens:Ct.outputTokens,aggregatedTotalTokens:Ct.totalTokens}),ne.has(ie.key)&&D.push(...kt)}return D},[ne,_,P,S,C,w,i]),it=(0,m.useMemo)(()=>hy(S),[S]),Nr=(0,m.useMemo)(()=>{if(S.length===0)return!1;for(const D of S)if(!ne.has(D.key))return!1;for(const D of it)if(!_.has(D))return!1;return!0},[S,ne,_,it]);(0,m.useEffect)(()=>{if(Me.length===0){G(null);return}(!K||!Me.some(D=>D.key===K))&&G(Me[0].key)},[Me,K]);const ws=Me.find(D=>D.key===K),me=$?Me.find(D=>D.key===$):void 0,Y=$?Me.findIndex(D=>D.key===$):-1;(0,m.useEffect)(()=>{$&&!Me.some(D=>D.key===$)&&(J(null),he(null),se.current=null)},[$,Me]);const ye=(0,m.useCallback)(D=>{const ee=(D.querySelector('[data-testid="trace-row-glyph"]')??D).getBoundingClientRect();return{anchorX:ee.left+ee.width/2,anchorY:ee.top,anchorBottom:ee.bottom}},[]);(0,m.useEffect)(()=>{if(!$)return;const D=()=>{const ee=se.current;ee&&he(ye(ee))};return window.addEventListener("scroll",D,!0),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",D)}},[$,ye]);const je=(0,m.useMemo)(()=>{if(!me)return null;const{startMs:D,endMs:ee}=ud(me),ce=me.kind==="span"&&Fi(me.span,i),Ce=me.kind==="span"?cd(me,i):null,ie=me.kind==="prompt"?me.conversationLabel??me.label:me.kind==="interaction"?us(me.step):Ce.title,kt=VH(me,e),st=me.kind==="prompt"?"prompt":me.kind==="interaction"?"interaction":me.span.category==="tool"&&ce?"error":me.span.category;return{label:ie,spanShowsFailure:ce,tokenStats:kt,rowStartTimestamp:M!==null?M+D:null,rowEndTimestamp:M!==null?M+ee:null,glyphCategory:st}},[me,e,M,i]),na=(0,m.useCallback)(D=>{if(Me.length===0)return;const ee=Me.findIndex(ce=>ce.key===K);if(D.key==="ArrowDown"){D.preventDefault();const ce=ee<0?0:Math.min(Me.length-1,ee+1);G(Me[ce].key);return}if(D.key==="ArrowUp"){D.preventDefault();const ce=ee<=0?0:ee-1;G(Me[ce].key);return}if(D.key==="Enter"&&ee>=0){const ce=Me[ee];if(ce.kind==="prompt"){D.preventDefault();const Ce=new Set(ne);Ce.has(ce.key)?Ce.delete(ce.key):Ce.add(ce.key),re(Ce);return}if(ce.kind==="span"&&ce.hasChildren){D.preventDefault();const Ce=new Set(_);Ce.has(ce.key)?Ce.delete(ce.key):Ce.add(ce.key),U(Ce)}}},[ne,_,Me,K,re,U]);if(w==="none")return(0,g.jsx)("div",{className:"text-xs text-muted-foreground",children:"No timing data recorded for this iteration."});if(w==="estimated")return(0,g.jsxs)("div",{className:"space-y-3",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(Sb,{className:"border-warning/50 bg-warning/50 text-foreground",children:"Estimated total only"}),(0,g.jsx)("span",{className:"text-xs text-muted-foreground",children:co(n??0)})]}),(0,g.jsxs)("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[(0,g.jsx)("p",{children:"Per-step timing was not recorded for this run."}),r>0?(0,g.jsxs)("p",{children:["Conversation detail is in the Chat tab. Open"," ",(0,g.jsx)("span",{className:"font-medium text-foreground/80",children:"Raw"})," to inspect the stored trace and confirm whether a"," ",(0,g.jsx)("code",{className:"rounded border border-border/50 bg-muted/40 px-1 py-px font-mono text-[10px] text-foreground/90",children:"spans"})," ","array exists; only new runs that persist spans show a per-step timeline here."]}):null]})]});const vt=v===void 0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(Nt,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7 border-border/50",title:"Zoom in timeline","aria-label":"Zoom in timeline",disabled:A<=O,onClick:()=>E(D=>Math.max(O,Math.round(D*.8))),children:(0,g.jsx)(EI,{className:"size-3.5","aria-hidden":!0})}),(0,g.jsx)(Nt,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7 border-border/50",title:"Zoom out timeline","aria-label":"Zoom out timeline",disabled:A>=T*4,onClick:()=>E(D=>Math.min(T*4,Math.round(D*1.25))),children:(0,g.jsx)(CI,{className:"size-3.5","aria-hidden":!0})})]}):null;return(0,g.jsxs)("div",{className:X("space-y-2",x&&"flex min-h-0 flex-1 flex-col"),children:[l?null:(0,g.jsxs)("div",{className:x?"shrink-0":void 0,children:[(0,g.jsx)(cH,{filter:P,onFilterChange:L,isFullyExpanded:Nr,expandDisabled:S.length===0,zoomControls:vt,onToggleExpandAll:()=>{Nr?(re(new Set),U(new Set)):(re(new Set(S.map(D=>D.key))),U(new Set(it)))}}),(0,g.jsx)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 px-1 text-xs text-muted-foreground",children:[{label:"User",cls:"trace-waterfall-bar-prompt"},{label:"Connect",cls:"trace-waterfall-bar-step"},{label:"Discovery",cls:"trace-waterfall-bar-step"},{label:"LLM",cls:"trace-waterfall-bar-llm"},{label:"Tool",cls:"trace-waterfall-bar-tool"},{label:"Step",cls:"trace-waterfall-bar-step"},{label:"Error",cls:"trace-waterfall-bar-error"}].map(({label:D,cls:ee})=>(0,g.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,g.jsx)("span",{className:X("h-2 w-2.5 rounded-sm",ee)}),D]},D))})]}),(0,g.jsx)("div",{className:X("@container/trace-timeline min-w-0",x&&"flex min-h-0 flex-1 flex-col"),children:(0,g.jsxs)($5,{direction:"vertical",className:X("rounded-lg border border-border/50 bg-background",x?"min-h-0 flex-1 overflow-hidden":"min-h-[min(25rem,calc(100dvh-8rem))]"),style:x?void 0:{height:"auto"},children:[(0,g.jsx)(ld,{defaultSize:65,minSize:0,className:"min-h-0 min-w-0 overflow-hidden",children:(0,g.jsx)(K5,{className:X(x?"h-full min-h-0 overflow-hidden":"max-h-[calc(100vh-8rem)] min-h-0"),children:(0,g.jsx)("div",{tabIndex:0,role:"region","aria-label":"Trace timeline. Use arrow keys to change selection, Enter to expand.",onKeyDown:na,className:"relative min-h-0 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:(0,g.jsxs)("div",{className:"grid pr-4",style:{gridTemplateColumns:"minmax(140px, 260px) minmax(0, 1fr) minmax(5.25rem, max-content)",gridTemplateRows:`auto repeat(${Me.length}, minmax(48px, auto))`},children:[(0,g.jsx)("div",{className:"sticky top-0 z-20 border-b border-border/50 bg-background/95 px-4 py-1.5 backdrop-blur",style:{gridColumn:"1 / 3",gridRow:1},children:(0,g.jsxs)("div",{className:"flex min-h-6 min-w-0 items-center gap-3",children:[(0,g.jsx)("div",{className:"shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Trace"}),(0,g.jsx)("div",{className:"min-h-6 min-w-0 flex-1",children:(0,g.jsx)("div",{ref:Ye,className:"relative h-6 min-w-0",children:gt?(0,g.jsx)("div",{className:"flex h-full min-w-0 items-center justify-center",children:(0,g.jsx)("span",{className:"min-w-0 max-w-full truncate text-center text-[10px] tabular-nums text-muted-foreground",title:cy(R),children:cy(R)})}):qe.map(D=>{const ee=D>=100?"100%":`${D}%`;return(0,g.jsx)("div",{className:"pointer-events-none absolute inset-y-0",style:{left:ee},children:(0,g.jsx)("div",{className:X("absolute text-[10px] tabular-nums text-muted-foreground",dH(D)),children:vl(R*D/100)})},D)})})})]})}),(0,g.jsx)("div",{className:"sticky top-0 z-20 flex min-h-0 items-center border-b border-l border-border/50 bg-background/95 px-3 py-1.5 pl-4 backdrop-blur",style:{gridColumn:3,gridRow:1},children:(0,g.jsxs)("div",{className:"flex h-6 w-full min-w-0 items-center justify-start gap-1.5",children:[(0,g.jsx)(jm,{className:"size-3 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,g.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Latency"})]})}),Me.length>0?(0,g.jsx)("div",{className:"pointer-events-none relative z-0 bg-transparent",style:{gridColumn:2,gridRow:`2 / ${Me.length+2}`},children:qe.map(D=>(0,g.jsx)("div",{className:"absolute top-0 bottom-0 w-px bg-border/40",style:{left:D>=100?"100%":`${D}%`}},D))}):null,Me.map((D,ee)=>{const ce=D.key===K,{startMs:Ce,endMs:ie,durationMs:kt}=ud(D),st=Ce/R*100,ln=Math.max((ie-Ce)/R*100,.45),Ct=D.kind==="span"&&Fi(D.span,i),cn=D.kind==="prompt"?"prompt":D.kind==="interaction"?"interaction":D.span.category==="tool"&&Ct?"error":D.span.category,Ss=D.kind==="interaction"&&D.status==="error",ks=D.kind==="span"?cd(D,i):null,Ln=D.kind==="prompt"?D.conversationLabel??D.label:D.kind==="interaction"?us(D.step):ks.title,Cs=co(kt),ra=D.kind==="prompt"?!0:D.kind==="interaction"?!1:D.hasChildren||D.span.category==="llm",Ts=ee+2,Tt=TH(D,Ct),$c=kH(D,Ct),Yp=()=>{qI("trace_span_clicked",{location:"trace_timeline",span_kind:D.kind}),G(D.key)},Hc=At=>{At.stopPropagation(),Yp()},KC=ce?X("bg-transparent",Tt):"border-l-transparent bg-background group-hover:bg-muted/20 hover:bg-muted/20",Jp=ce?"bg-transparent":"bg-background group-hover:bg-muted/20 hover:bg-muted/20";return(0,g.jsxs)(cS.div,{"data-testid":"trace-row","data-state":ce?"selected":void 0,onClick:Yp,onMouseEnter:At=>{J(D.key);const Rt=At.currentTarget;se.current=Rt,he(ye(Rt))},onMouseLeave:()=>{J(At=>At===D.key?null:At),he(null),se.current=null},onFocus:At=>{J(D.key);const Rt=At.currentTarget;se.current=Rt,he(ye(Rt))},onBlur:At=>{At.currentTarget.contains(At.relatedTarget)||(J(Rt=>Rt===D.key?null:Rt),he(null),se.current=null)},initial:b||ee>=20?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:b||ee>=20?{duration:0}:{duration:.15,delay:ee*.03+.05,ease:[.16,1,.3,1]},style:{gridColumn:"1 / 4",gridRow:Ts,display:"grid",gridTemplateColumns:"subgrid"},className:X("group min-h-0 min-w-0 cursor-pointer items-stretch",ce&&"trace-waterfall-row-selected ring-1 ring-inset ring-ring/40"),children:[(0,g.jsxs)("div",{className:X("flex items-center gap-2 border-b border-border/40 px-4 py-2 transition-all duration-150 border-l-2",KC),children:[(0,g.jsx)("div",{className:"flex shrink-0 items-center",style:{paddingLeft:D.kind==="prompt"?0:D.depth*16},children:ra?(0,g.jsx)("button",{type:"button",className:"mr-1 inline-flex h-5 w-5 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted/30 hover:text-foreground",onClick:At=>{if(At.stopPropagation(),D.kind==="prompt"){const ia=new Set(ne);ia.has(D.key)?ia.delete(D.key):ia.add(D.key),re(ia);return}const Rt=new Set(_);Rt.has(D.key)?Rt.delete(D.key):Rt.add(D.key),U(Rt)},"aria-label":D.kind==="prompt"?`${D.isExpanded?"Collapse":"Expand"} ${D.label}`:`${"isExpanded"in D&&D.isExpanded?"Collapse":"Expand"} ${Ln}`,children:"isExpanded"in D&&D.isExpanded?(0,g.jsx)(yb,{className:"h-3.5 w-3.5"}):(0,g.jsx)(Zi,{className:"h-3.5 w-3.5"})}):(0,g.jsx)("span",{className:"mr-1 h-5 w-5"})}),(0,g.jsx)("button",{type:"button","data-testid":"trace-row-label-button",className:"min-w-0 flex-1 text-left",onClick:Hc,children:(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,g.jsx)("span",{"data-testid":"trace-row-glyph",className:"inline-flex shrink-0 items-center",children:D.kind==="prompt"?(0,g.jsx)(hs,{category:"prompt"}):(0,g.jsx)(hs,{category:cn})}),(0,g.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:Ln}),D.kind==="prompt"&&D.hasAnyFailure?(0,g.jsx)("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full bg-destructive",title:"Contains errors","aria-label":"Contains errors"}):null,D.kind==="span"&&Ct||Ss?(0,g.jsx)("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full bg-destructive",title:"Error","aria-label":"Error"}):null]})})]}),(0,g.jsx)("button",{type:"button","data-testid":"trace-row-bar-hit","data-state":ce?"selected":void 0,className:X("relative z-[1] flex min-h-[48px] w-full items-center overflow-hidden border-b border-border/40 border-l-2 border-l-transparent px-4 py-2 text-left transition-all duration-150",Jp),"aria-label":`Select on timeline (${co(kt)})`,onClick:Hc,children:(0,g.jsx)("div",{"data-testid":D.kind==="span"&&Ct?"trace-row-bar-error":"trace-row-bar",className:X("absolute top-1/2 z-[1] h-4 min-w-0 -translate-y-1/2 rounded-[3px] transition-[left,width] duration-150",$c),style:{left:`${st}%`,width:`max(${ln}%, 3px)`}})}),(0,g.jsxs)("button",{type:"button","data-testid":"trace-row-duration-hit","data-state":ce?"selected":void 0,className:X("flex min-h-[48px] items-center justify-start gap-1.5 whitespace-nowrap border-b border-l border-border/40 px-3 py-2 pl-4 text-[11px] tabular-nums text-muted-foreground transition-all duration-150",Jp),"aria-label":`Select row duration (${Cs})`,onClick:Hc,children:[(0,g.jsx)(jm,{className:"size-3 shrink-0 opacity-80","aria-hidden":!0}),Cs]})]},D.key)})]})})})}),(0,g.jsx)(H5,{withHandle:!0}),(0,g.jsx)(ld,{defaultSize:35,minSize:20,className:"min-h-0 min-w-0 overflow-hidden",children:(0,g.jsx)("div",{"data-testid":"trace-timeline-detail-sticky",className:"h-full min-h-0 min-w-0 max-h-full overflow-y-auto",children:(0,g.jsx)(WH,{row:ws,transcriptMessages:i,onRevealInTranscript:a,turnRuntimeByPromptIndex:y})})})]})}),me&&je&&ae?(0,g.jsx)(qH,{hoverPos:ae,info:je,placement:Y===0?"bottom":"top",reduceMotion:b??!1,rowKey:me.key}):null]})}function qH({hoverPos:e,info:t,placement:n,reduceMotion:r,rowKey:i}){if(typeof document>"u")return null;const s=304,o=12,a=8,l=s/2,c=typeof window<"u"?window.innerWidth:e.anchorX+l+o,u=164,h=Math.max(u,c-l-o),f=Math.min(Math.max(e.anchorX,u),h),d={position:"fixed",top:n==="top"?e.anchorY-a:e.anchorBottom+a,left:f,transform:n==="top"?"translate(-50%, -100%)":"translateX(-50%)",zIndex:9999};return(0,_o.createPortal)((0,g.jsx)("div",{className:"pointer-events-none",style:d,children:(0,g.jsx)(cS.div,{"data-placement":n,"data-testid":"trace-row-hover-content",initial:r?!1:{opacity:0,y:6,filter:"blur(2px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.16,ease:[.16,1,.3,1]},className:"w-[19rem] overflow-hidden rounded-md border border-border/60 bg-popover text-popover-foreground shadow-xl",children:(0,g.jsxs)("div",{"data-testid":"trace-row-hover-card",className:"space-y-3 p-3",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,g.jsx)(hs,{category:t.glyphCategory}),(0,g.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs font-semibold text-popover-foreground",children:t.label})]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-popover-foreground/65",children:"Time"}),(0,g.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-3",children:[(0,g.jsx)("span",{className:"shrink-0 text-popover-foreground/70",children:"Start"}),(0,g.jsx)("span",{"data-testid":"trace-row-hover-start",className:"min-w-0 text-right font-medium text-popover-foreground tabular-nums",children:dy(t.rowStartTimestamp)})]}),(0,g.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-3",children:[(0,g.jsx)("span",{className:"shrink-0 text-popover-foreground/70",children:"End"}),(0,g.jsx)("span",{"data-testid":"trace-row-hover-end",className:"min-w-0 text-right font-medium text-popover-foreground tabular-nums",children:dy(t.rowEndTimestamp)})]})]})]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-popover-foreground/65",children:"Tokens"}),(0,g.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-3",children:[(0,g.jsx)("span",{className:"shrink-0 text-popover-foreground/70",children:"Input"}),(0,g.jsx)("span",{"data-testid":"trace-row-hover-input-tokens",className:"min-w-0 text-right font-medium text-popover-foreground tabular-nums",children:nh(t.tokenStats.inputTokens)})]}),(0,g.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-3",children:[(0,g.jsx)("span",{className:"shrink-0 text-popover-foreground/70",children:"Output"}),(0,g.jsx)("span",{"data-testid":"trace-row-hover-output-tokens",className:"min-w-0 text-right font-medium text-popover-foreground tabular-nums",children:nh(t.tokenStats.outputTokens)})]}),(0,g.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-3",children:[(0,g.jsx)("span",{className:"shrink-0 text-popover-foreground/70",children:"Total"}),(0,g.jsx)("span",{"data-testid":"trace-row-hover-total-tokens",className:"min-w-0 text-right font-medium text-popover-foreground tabular-nums",children:nh(t.tokenStats.totalTokens)})]})]})]})]})},i)}),document.body)}export{GI as $,qT as $t,y_ as A,be as At,Se as B,Ux as Bt,c5 as C,rI as Ct,J$ as D,Ji as Dt,Z$ as E,yb as Et,Gj as F,NO as Ft,Sb as G,vx as Gt,ZI as H,vM as Ht,cS as I,rW as It,sW as J,Zy as Jt,vc as K,Cd as Kt,BL as L,LO as Lt,Hr as M,nW as Mt,Qj as N,tW as Nt,K$ as O,XO as Ot,$r as P,iW as Pt,KI as Q,Hy as Qt,Qw as R,ft as Rt,EW as S,jm as St,mC as T,Zi as Tt,YI as U,kx as Ut,Vd as V,yM as Vt,kb as W,gx as Wt,UI as X,Yy as Xt,wb as Y,LA as Yt,oW as Z,vd as Zt,$5 as _,mI as _t,cH as a,Nn as an,qI as at,PW as b,cI as bt,DW as c,te as cn,VI as ct,K5 as d,mT as dn,EI as dt,Ny as en,aW as et,G5 as f,_e as fn,MI as ft,ld as g,yI as gt,H5 as h,SI as ht,fH as i,ni as in,bb as it,zr as j,FO as jt,k_ as k,GO as kt,IW as l,fd as ln,_I as lt,Ns as m,CI as mt,AH as n,Qe as nn,uW as nt,iH as o,Vo as on,Bm as ot,OW as p,AI as pt,xb as q,lc as qt,hy as r,tc as rn,cW as rt,aH as s,Dt as sn,zI as st,LW as t,$T as tn,lW as tt,zC as u,rr as un,gc as ut,xC as v,dI as vt,RW as w,tI as wt,i5 as x,$i as xt,MW as y,hI as yt,iN as z,Bd as zt};
136
136
 
137
- //# sourceMappingURL=trace-timeline-D2HsPXC-.js.map
137
+ //# sourceMappingURL=trace-timeline-2WCodaTP.js.map
@@ -1 +1 @@
1
- import{t as a}from"./trace-timeline-D2HsPXC-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.12.0"};var d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="4e655de5-a2bc-40b9-afc2-9c4107167b00",e._sentryDebugIdIdentifier="sentry-dbid-4e655de5-a2bc-40b9-afc2-9c4107167b00")}catch{}})();export{a as TraceTimeline};
1
+ import{t as a}from"./trace-timeline-2WCodaTP.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.12.1"};var d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="4e655de5-a2bc-40b9-afc2-9c4107167b00",e._sentryDebugIdIdentifier="sentry-dbid-4e655de5-a2bc-40b9-afc2-9c4107167b00")}catch{}})();export{a as TraceTimeline};
@@ -1,3 +1,3 @@
1
- (function(){try{var g=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};g.SENTRY_RELEASE={id:"3.12.0"};var w=new g.Error().stack;w&&(g._sentryDebugIds=g._sentryDebugIds||{},g._sentryDebugIds[w]="3a73e22f-747b-4425-ad4a-15abe56be946",g._sentryDebugIdIdentifier="sentry-dbid-3a73e22f-747b-4425-ad4a-15abe56be946")}catch{}})();(function(){typeof[].at!="function"&&Object.defineProperty(Array.prototype,"at",{value(e){const t=this.length;let n=Math.trunc(e)||0;return 0>n&&(n+=t),0>n||n>=t?void 0:this[n]},writable:!0,enumerable:!1,configurable:!0});const g="u">typeof window?window:void 0,w="u">typeof globalThis?globalThis:g;w!=null&&w.XMLHttpRequest&&new w.XMLHttpRequest;const C=typeof globalThis<"u"?globalThis:g;C&&typeof self>"u"&&(C.self=C),C&&typeof File>"u"&&(C.File=function(){});const T=g??{};function S(e){return S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(e)}function at(e,t,n){return(t=(function(i){var o=(function(r){if(S(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var c=a.call(r,"string");if(S(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(i);return S(o)=="symbol"?o:o+""})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function F(e){for(var t=1;arguments.length>t;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(i){at(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}let X=-1;const L=()=>X,k=e=>{addEventListener("pageshow",t=>{t.persisted&&(X=t.timeStamp,e(t))},!0)},p=(e,t,n,i)=>{let o,r;return a=>{var c;t.value>=0&&(a||i)&&(r=t.value-((c=o)!==null&&c!==void 0?c:0),(r||o===void 0)&&(o=t.value,t.delta=r,t.rating=((u,l)=>u>l[1]?"poor":u>l[0]?"needs-improvement":"good")(t.value,n),e(t)))}},R=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},$=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},M=()=>{var e,t;return(e=(t=$())===null||t===void 0?void 0:t.activationStart)!==null&&e!==void 0?e:0};let P=-1;const Y=new Set,G=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,D=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Y)t();isFinite(P)||(P=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",D,!0))}},O=(e=!1)=>{if(e&&(P=1/0),0>P){var t;const n=M(),i=document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").find(o=>o.name==="hidden"&&o.startTime>=n))===null||t===void 0?void 0:t.startTime;P=i??G(),addEventListener("visibilitychange",D,!0),addEventListener("prerenderingchange",D,!0),k(()=>{setTimeout(()=>{P=G()})})}return{get firstHiddenTime(){return P},onHidden(n){Y.add(n)}}},b=(e,t=-1,n,i=0,o,r,a)=>{const c=$(),u=c?.navigationId||0;let l="navigate";return n?l=n:0>L()?c&&(document.prerendering||M()>0?l="prerender":document.wasDiscarded?l="restore":c.type&&(l=c.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:l,navigationId:i||u,navigationInteractionId:o,navigationURL:r||c?.name,navigationStartTime:a||0}},J=new WeakMap;function j(e,t){let n=J.get(t);return n||(n=new WeakMap,J.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var rt=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(e.hadRecentInput)return;const n=this.o[0],i=this.o.at(-1);this.i&&n&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-n.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),(t=this.t)===null||t===void 0||t.call(this,e)}};const _=(e,t,n={})=>{try{const i=e.filter(o=>PerformanceObserver.supportedEntryTypes.includes(o));if(i.length>0){const o=new PerformanceObserver(r=>{queueMicrotask(()=>{const a=r.getEntries();i.length>1&&a.sort((c,u)=>c.startTime+c.duration-(u.startTime+u.duration)),t(a)})});for(const r of i)o.observe(F({type:r,buffered:!0},n));return o}}catch{}},A=e=>{var t,n;return((t=globalThis.PerformanceObserver)===null||t===void 0||(t=t.supportedEntryTypes)===null||t===void 0?void 0:t.includes("soft-navigation"))&&typeof((n=globalThis.PerformanceSoftNavigation)===null||n===void 0||(n=n.prototype)===null||n===void 0?void 0:n.getLargestInteractionContentfulPaint)=="function"&&e&&e.reportSoftNavs},K=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const n=e.keys().next().value;n!==void 0&&e.delete(n)}},Q=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var st=class{constructor(){this.l=void 0}};const W=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},q=[1800,3e3],Z=(e,t={})=>{const n=A(t);W(()=>{const i=j(t,st),o=O();let r,a=b("FCP");const c=_(["paint"],u=>{for(const l of u)l.name==="first-contentful-paint"&&(c.disconnect(),o.firstHiddenTime>l.startTime&&(a.value=Math.max(l.startTime-M(),0),a.entries.push(l),a.navigationId=l.navigationId||a.navigationId,r(!0)))});c&&(r=p(e,a,q,t.reportAllChanges),k(u=>{a=b("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,L()),r=p(e,a,q,t.reportAllChanges),R(()=>{a.value=performance.now()-u.timeStamp,r(!0)})})),n&&_(["soft-navigation"],u=>{u.forEach(l=>{i.l&&l.navigationId&&K(i.l,l);const m=Math.max((l.presentationTime||l.paintTime||0)-l.startTime,0);a=b("FCP",m,"soft-navigation",l.navigationId,l.interactionId,l.name,l.startTime),r=p(e,a,q,t.reportAllChanges),r(!0)})},t)})},tt=[.1,.25];let et=0,N=1/0,x=0;const lt=e=>{for(const t of e)t.interactionId&&(N=Math.min(N,t.interactionId),x=Math.max(x,t.interactionId),et=x?(x-N)/7+1:0)};let B;const nt=()=>{var e;return B?et:(e=performance.interactionCount)!==null&&e!==void 0?e:0};var ct=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return nt()-this.u}M(){this.u=nt(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||n!==-1||e!=="soft-navigation"&&e!=="back-forward-cache"?this.v[n]:{P:8,id:-1,entries:[]}}h(e){var t;if((t=this.p)===null||t===void 0||t.call(this,e),!e.interactionId)return;const n=this.v.at(-1);let i=this.m.get(e.interactionId);if(i||10>this.v.length||e.duration>n.P){var o;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.m.set(i.id,i),this.v.push(i)),this.v.sort((r,a)=>a.P-r.P),this.v.length>10){const r=this.v.splice(10);for(const a of r)this.m.delete(a.id)}(o=this.T)===null||o===void 0||o.call(this,i)}}};const it=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState==="hidden")e();else{const o=Q(e);let r=-1;const a=()=>{i(r),o()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",a,{capture:!0}),o()},{timeout:t})}},ot=[200,500];var dt=class{constructor(){this.p=void 0,this.l=void 0}h(e){var t;(t=this.p)===null||t===void 0||t.call(this,e)}};const U=[2500,4e3],H={onLCP(e,t={}){let n=!1;const i=A(t);W(()=>{let o,r=O(),a=b("LCP");const c=j(t,dt),u=(s,v,d,h,y)=>{a=b("LCP",-1,s,v,d,h,y),o=p(e,a,U,t.reportAllChanges),n=!1,s==="soft-navigation"&&(r=O(!0))},l=s=>{var v;c.l&&s.navigationId&&K(c.l,s),n||o(!0),u("soft-navigation",s.navigationId,s.interactionId,s.name,s.startTime);const d=(v=s.getLargestInteractionContentfulPaint)===null||v===void 0?void 0:v.call(s);d&&m([d])},m=s=>{t.reportAllChanges||i||(s=s.slice(-1));for(const d of s){if(!d)continue;if(d.entryType==="soft-navigation"){l(d);continue}let h=0,y=[],V=d.startTime;if(d.entryType==="largest-contentful-paint")h=Math.max(d.startTime-M(),0),c.h(d),y=[d];else if(d.entryType==="interaction-contentful-paint"){var v;const E=d;if(!a.navigationId||"interactionId"in E&&E.interactionId!=a.navigationInteractionId)continue;V=((v=E.largestContentfulPaint)===null||v===void 0?void 0:v.renderTime)||0,h=Math.max(V-d.startTime,0),E.largestContentfulPaint&&(c.h(E.largestContentfulPaint),y=[E.largestContentfulPaint])}r.firstHiddenTime>V&&(a.value=h,a.entries=y,o())}},I=["largest-contentful-paint"];i&&I.push("interaction-contentful-paint","soft-navigation");const f=_(I,m);if(f){o=p(e,a,U,t.reportAllChanges);const s=["keydown","click","visibilitychange"],v=d=>{if(d.isTrusted&&!n){const h=a.id;it(()=>{if(!n){if(!i){f.disconnect();for(const y of s)removeEventListener(y,v,{capture:!0})}h===a.id&&(n=!0,o(!0))}})}};for(const d of s)addEventListener(d,v,{capture:!0});k(d=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,L()),o=p(e,a,U,t.reportAllChanges),R(()=>{a.value=performance.now()-d.timeStamp,n=!0,o(!0)})})}})},onCLS(e,t={}){const n=O();Z(Q(()=>{let i,o=b("CLS",0);const r=j(t,rt),a=(f,s,v,d,h)=>{o=b("CLS",0,f,s,v,d,h),r.i=0,i=p(e,o,tt,t.reportAllChanges)},c=(f=!1)=>{r.i>o.value&&(o.value=r.i,o.entries=r.o),i(f)},u=f=>{c(!0),a("soft-navigation",f.navigationId,f.interactionId,f.name,f.startTime)},l=f=>{for(const s of f)s.entryType!=="soft-navigation"?r.h(s):u(s);c()},m=["layout-shift"];A(t)&&m.push("soft-navigation");const I=_(m,l);I&&(i=p(e,o,tt,t.reportAllChanges),n.onHidden(()=>{l(I.takeRecords()),i(!0)}),k(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,L()),R(i)}),setTimeout(i))}))},onFCP:Z,onINP(e,t={}){if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=O();W(()=>{var i;"interactionCount"in performance||B||(B=_(["event"],lt,{durationThreshold:0}));let o,r=b("INP");const a=j(t,ct),c=(s,v,d,h,y)=>{a.M(),r=b("INP",-1,s,v,d,h,y),o=p(e,r,ot,t.reportAllChanges)},u=()=>{const s=a.L(r.navigationType);s&&s.P!==r.value&&(r.value=s.P,r.entries=s.entries,o())},l=s=>{u(),o(!0),c("soft-navigation",s.navigationId,s.interactionId,s.name,s.startTime)},m=(s,v=!1)=>{it(()=>{for(const d of s)d.entryType!=="soft-navigation"?a.h(d):l(d);u(),v&&o(!0)})},I=["event","first-input"];A(t)&&I.push("soft-navigation");const f=_(I,m,F(F({},t),{},{durationThreshold:(i=t.durationThreshold)!==null&&i!==void 0?i:40}));o=p(e,r,ot,t.reportAllChanges),f&&(n.onHidden(()=>{m(f.takeRecords(),!0)}),k(()=>{c("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,L())}))})}};T.__PosthogExtensions__=T.__PosthogExtensions__||{},T.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=T.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},T.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=H,T.__PosthogExtensions__.postHogWebVitalsCallbacks=H,T.postHogWebVitalsCallbacks=H,T.__PosthogExtensions__.loadWebVitalsCallbacks=()=>H})();
1
+ (function(){try{var g=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};g.SENTRY_RELEASE={id:"3.12.1"};var w=new g.Error().stack;w&&(g._sentryDebugIds=g._sentryDebugIds||{},g._sentryDebugIds[w]="3a73e22f-747b-4425-ad4a-15abe56be946",g._sentryDebugIdIdentifier="sentry-dbid-3a73e22f-747b-4425-ad4a-15abe56be946")}catch{}})();(function(){typeof[].at!="function"&&Object.defineProperty(Array.prototype,"at",{value(e){const t=this.length;let n=Math.trunc(e)||0;return 0>n&&(n+=t),0>n||n>=t?void 0:this[n]},writable:!0,enumerable:!1,configurable:!0});const g="u">typeof window?window:void 0,w="u">typeof globalThis?globalThis:g;w!=null&&w.XMLHttpRequest&&new w.XMLHttpRequest;const C=typeof globalThis<"u"?globalThis:g;C&&typeof self>"u"&&(C.self=C),C&&typeof File>"u"&&(C.File=function(){});const T=g??{};function S(e){return S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(e)}function at(e,t,n){return(t=(function(i){var o=(function(r){if(S(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var c=a.call(r,"string");if(S(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(i);return S(o)=="symbol"?o:o+""})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function F(e){for(var t=1;arguments.length>t;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(i){at(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}let X=-1;const L=()=>X,k=e=>{addEventListener("pageshow",t=>{t.persisted&&(X=t.timeStamp,e(t))},!0)},p=(e,t,n,i)=>{let o,r;return a=>{var c;t.value>=0&&(a||i)&&(r=t.value-((c=o)!==null&&c!==void 0?c:0),(r||o===void 0)&&(o=t.value,t.delta=r,t.rating=((u,l)=>u>l[1]?"poor":u>l[0]?"needs-improvement":"good")(t.value,n),e(t)))}},R=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},$=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},M=()=>{var e,t;return(e=(t=$())===null||t===void 0?void 0:t.activationStart)!==null&&e!==void 0?e:0};let P=-1;const Y=new Set,G=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,D=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Y)t();isFinite(P)||(P=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",D,!0))}},O=(e=!1)=>{if(e&&(P=1/0),0>P){var t;const n=M(),i=document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").find(o=>o.name==="hidden"&&o.startTime>=n))===null||t===void 0?void 0:t.startTime;P=i??G(),addEventListener("visibilitychange",D,!0),addEventListener("prerenderingchange",D,!0),k(()=>{setTimeout(()=>{P=G()})})}return{get firstHiddenTime(){return P},onHidden(n){Y.add(n)}}},b=(e,t=-1,n,i=0,o,r,a)=>{const c=$(),u=c?.navigationId||0;let l="navigate";return n?l=n:0>L()?c&&(document.prerendering||M()>0?l="prerender":document.wasDiscarded?l="restore":c.type&&(l=c.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:l,navigationId:i||u,navigationInteractionId:o,navigationURL:r||c?.name,navigationStartTime:a||0}},J=new WeakMap;function j(e,t){let n=J.get(t);return n||(n=new WeakMap,J.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var rt=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(e.hadRecentInput)return;const n=this.o[0],i=this.o.at(-1);this.i&&n&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-n.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),(t=this.t)===null||t===void 0||t.call(this,e)}};const _=(e,t,n={})=>{try{const i=e.filter(o=>PerformanceObserver.supportedEntryTypes.includes(o));if(i.length>0){const o=new PerformanceObserver(r=>{queueMicrotask(()=>{const a=r.getEntries();i.length>1&&a.sort((c,u)=>c.startTime+c.duration-(u.startTime+u.duration)),t(a)})});for(const r of i)o.observe(F({type:r,buffered:!0},n));return o}}catch{}},A=e=>{var t,n;return((t=globalThis.PerformanceObserver)===null||t===void 0||(t=t.supportedEntryTypes)===null||t===void 0?void 0:t.includes("soft-navigation"))&&typeof((n=globalThis.PerformanceSoftNavigation)===null||n===void 0||(n=n.prototype)===null||n===void 0?void 0:n.getLargestInteractionContentfulPaint)=="function"&&e&&e.reportSoftNavs},K=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const n=e.keys().next().value;n!==void 0&&e.delete(n)}},Q=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var st=class{constructor(){this.l=void 0}};const W=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},q=[1800,3e3],Z=(e,t={})=>{const n=A(t);W(()=>{const i=j(t,st),o=O();let r,a=b("FCP");const c=_(["paint"],u=>{for(const l of u)l.name==="first-contentful-paint"&&(c.disconnect(),o.firstHiddenTime>l.startTime&&(a.value=Math.max(l.startTime-M(),0),a.entries.push(l),a.navigationId=l.navigationId||a.navigationId,r(!0)))});c&&(r=p(e,a,q,t.reportAllChanges),k(u=>{a=b("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,L()),r=p(e,a,q,t.reportAllChanges),R(()=>{a.value=performance.now()-u.timeStamp,r(!0)})})),n&&_(["soft-navigation"],u=>{u.forEach(l=>{i.l&&l.navigationId&&K(i.l,l);const m=Math.max((l.presentationTime||l.paintTime||0)-l.startTime,0);a=b("FCP",m,"soft-navigation",l.navigationId,l.interactionId,l.name,l.startTime),r=p(e,a,q,t.reportAllChanges),r(!0)})},t)})},tt=[.1,.25];let et=0,N=1/0,x=0;const lt=e=>{for(const t of e)t.interactionId&&(N=Math.min(N,t.interactionId),x=Math.max(x,t.interactionId),et=x?(x-N)/7+1:0)};let B;const nt=()=>{var e;return B?et:(e=performance.interactionCount)!==null&&e!==void 0?e:0};var ct=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return nt()-this.u}M(){this.u=nt(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||n!==-1||e!=="soft-navigation"&&e!=="back-forward-cache"?this.v[n]:{P:8,id:-1,entries:[]}}h(e){var t;if((t=this.p)===null||t===void 0||t.call(this,e),!e.interactionId)return;const n=this.v.at(-1);let i=this.m.get(e.interactionId);if(i||10>this.v.length||e.duration>n.P){var o;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.m.set(i.id,i),this.v.push(i)),this.v.sort((r,a)=>a.P-r.P),this.v.length>10){const r=this.v.splice(10);for(const a of r)this.m.delete(a.id)}(o=this.T)===null||o===void 0||o.call(this,i)}}};const it=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState==="hidden")e();else{const o=Q(e);let r=-1;const a=()=>{i(r),o()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",a,{capture:!0}),o()},{timeout:t})}},ot=[200,500];var dt=class{constructor(){this.p=void 0,this.l=void 0}h(e){var t;(t=this.p)===null||t===void 0||t.call(this,e)}};const U=[2500,4e3],H={onLCP(e,t={}){let n=!1;const i=A(t);W(()=>{let o,r=O(),a=b("LCP");const c=j(t,dt),u=(s,v,d,h,y)=>{a=b("LCP",-1,s,v,d,h,y),o=p(e,a,U,t.reportAllChanges),n=!1,s==="soft-navigation"&&(r=O(!0))},l=s=>{var v;c.l&&s.navigationId&&K(c.l,s),n||o(!0),u("soft-navigation",s.navigationId,s.interactionId,s.name,s.startTime);const d=(v=s.getLargestInteractionContentfulPaint)===null||v===void 0?void 0:v.call(s);d&&m([d])},m=s=>{t.reportAllChanges||i||(s=s.slice(-1));for(const d of s){if(!d)continue;if(d.entryType==="soft-navigation"){l(d);continue}let h=0,y=[],V=d.startTime;if(d.entryType==="largest-contentful-paint")h=Math.max(d.startTime-M(),0),c.h(d),y=[d];else if(d.entryType==="interaction-contentful-paint"){var v;const E=d;if(!a.navigationId||"interactionId"in E&&E.interactionId!=a.navigationInteractionId)continue;V=((v=E.largestContentfulPaint)===null||v===void 0?void 0:v.renderTime)||0,h=Math.max(V-d.startTime,0),E.largestContentfulPaint&&(c.h(E.largestContentfulPaint),y=[E.largestContentfulPaint])}r.firstHiddenTime>V&&(a.value=h,a.entries=y,o())}},I=["largest-contentful-paint"];i&&I.push("interaction-contentful-paint","soft-navigation");const f=_(I,m);if(f){o=p(e,a,U,t.reportAllChanges);const s=["keydown","click","visibilitychange"],v=d=>{if(d.isTrusted&&!n){const h=a.id;it(()=>{if(!n){if(!i){f.disconnect();for(const y of s)removeEventListener(y,v,{capture:!0})}h===a.id&&(n=!0,o(!0))}})}};for(const d of s)addEventListener(d,v,{capture:!0});k(d=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,L()),o=p(e,a,U,t.reportAllChanges),R(()=>{a.value=performance.now()-d.timeStamp,n=!0,o(!0)})})}})},onCLS(e,t={}){const n=O();Z(Q(()=>{let i,o=b("CLS",0);const r=j(t,rt),a=(f,s,v,d,h)=>{o=b("CLS",0,f,s,v,d,h),r.i=0,i=p(e,o,tt,t.reportAllChanges)},c=(f=!1)=>{r.i>o.value&&(o.value=r.i,o.entries=r.o),i(f)},u=f=>{c(!0),a("soft-navigation",f.navigationId,f.interactionId,f.name,f.startTime)},l=f=>{for(const s of f)s.entryType!=="soft-navigation"?r.h(s):u(s);c()},m=["layout-shift"];A(t)&&m.push("soft-navigation");const I=_(m,l);I&&(i=p(e,o,tt,t.reportAllChanges),n.onHidden(()=>{l(I.takeRecords()),i(!0)}),k(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,L()),R(i)}),setTimeout(i))}))},onFCP:Z,onINP(e,t={}){if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=O();W(()=>{var i;"interactionCount"in performance||B||(B=_(["event"],lt,{durationThreshold:0}));let o,r=b("INP");const a=j(t,ct),c=(s,v,d,h,y)=>{a.M(),r=b("INP",-1,s,v,d,h,y),o=p(e,r,ot,t.reportAllChanges)},u=()=>{const s=a.L(r.navigationType);s&&s.P!==r.value&&(r.value=s.P,r.entries=s.entries,o())},l=s=>{u(),o(!0),c("soft-navigation",s.navigationId,s.interactionId,s.name,s.startTime)},m=(s,v=!1)=>{it(()=>{for(const d of s)d.entryType!=="soft-navigation"?a.h(d):l(d);u(),v&&o(!0)})},I=["event","first-input"];A(t)&&I.push("soft-navigation");const f=_(I,m,F(F({},t),{},{durationThreshold:(i=t.durationThreshold)!==null&&i!==void 0?i:40}));o=p(e,r,ot,t.reportAllChanges),f&&(n.onHidden(()=>{m(f.takeRecords(),!0)}),k(()=>{c("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,L())}))})}};T.__PosthogExtensions__=T.__PosthogExtensions__||{},T.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=T.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},T.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=H,T.__PosthogExtensions__.postHogWebVitalsCallbacks=H,T.postHogWebVitalsCallbacks=H,T.__PosthogExtensions__.loadWebVitalsCallbacks=()=>H})();
2
2
 
3
- //# sourceMappingURL=web-vitals-CdUasvTy.js.map
3
+ //# sourceMappingURL=web-vitals-DdK10Etm.js.map
@@ -12,12 +12,12 @@
12
12
  rel="stylesheet"
13
13
  />
14
14
  <title>MCPJam Inspector</title>
15
- <script type="module" crossorigin src="/assets/index-foMfZA46.js"></script>
16
- <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C3dIJScy.js">
17
- <link rel="modulepreload" crossorigin href="/assets/failed-request-tracker-mpVBJT24.js">
18
- <link rel="modulepreload" crossorigin href="/assets/preload-helper-CzPH2rtr.js">
19
- <link rel="modulepreload" crossorigin href="/assets/OAuthDesktopReturnNotice-iYC9JwKS.js">
20
- <link rel="modulepreload" crossorigin href="/assets/button-BPKzBERq.js">
15
+ <script type="module" crossorigin src="/assets/index-pxVGER4l.js"></script>
16
+ <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-DeZZUx0l.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/failed-request-tracker-DyZB_Nfp.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/preload-helper-DsxBH8kv.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/OAuthDesktopReturnNotice-DrCSUffX.js">
20
+ <link rel="modulepreload" crossorigin href="/assets/button-DQ9bR46C.js">
21
21
  <link rel="stylesheet" crossorigin href="/assets/OAuthDesktopReturnNotice-BeDakGgb.css">
22
22
  </head>
23
23
  <body>
@@ -37,7 +37,7 @@ function resolveEnvironment() {
37
37
  }
38
38
  return "dev";
39
39
  }
40
- var BAKED_VERSION = "3.12.0";
40
+ var BAKED_VERSION = "3.12.1";
41
41
  function blankToNull(value) {
42
42
  return value === void 0 || value.trim() === "" ? null : value;
43
43
  }
@@ -2874,4 +2874,4 @@ export {
2874
2874
  installRuntimePack,
2875
2875
  reportLocalHarnessRuntimeStatusInBackground
2876
2876
  };
2877
- //# sourceMappingURL=chunk-RGDNQUHE.js.map
2877
+ //# sourceMappingURL=chunk-R5EHY55H.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  installRuntimePack,
3
3
  readRuntimeInstallStatus
4
- } from "./chunk-RGDNQUHE.js";
4
+ } from "./chunk-R5EHY55H.js";
5
5
  import "./chunk-PZ5AY32C.js";
6
6
 
7
7
  // server/harness-install-cli.ts
@@ -35,7 +35,7 @@ import {
35
35
  supportsOwnershipProof,
36
36
  terminateOwnedProcess,
37
37
  terminateOwnedProcessGroup
38
- } from "./chunk-RGDNQUHE.js";
38
+ } from "./chunk-R5EHY55H.js";
39
39
  import {
40
40
  ALLOWED_HOSTS,
41
41
  BROWSER_CONSENT_HEADER,
@@ -2257,6 +2257,18 @@ __export(evaluate_exports, {
2257
2257
  finalMessageEndsWithQuestion: () => finalMessageEndsWithQuestion
2258
2258
  });
2259
2259
 
2260
+ // ../evaluators/dist/chunk-I4CRERJV.js
2261
+ var PROBE = "__predicate_arg_probe__";
2262
+ function argMatch(matcher, actualArgs) {
2263
+ const argumentMatching = matcher.argumentMatching ?? "partial";
2264
+ const result = evaluateToolCalls(
2265
+ [{ toolName: PROBE, arguments: matcher.args ?? {} }],
2266
+ [{ toolName: PROBE, arguments: actualArgs ?? {} }],
2267
+ { argumentMatching }
2268
+ );
2269
+ return result.passed;
2270
+ }
2271
+
2260
2272
  // ../evaluators/dist/chunk-PYTZA5U2.js
2261
2273
  import { Validator } from "@cfworker/json-schema";
2262
2274
  var DRAFT_2020_12_URIS = /* @__PURE__ */ new Set([
@@ -2331,19 +2343,7 @@ function validateAgainstSchema(schema, instance) {
2331
2343
  }
2332
2344
  }
2333
2345
 
2334
- // ../evaluators/dist/chunk-I4CRERJV.js
2335
- var PROBE = "__predicate_arg_probe__";
2336
- function argMatch(matcher, actualArgs) {
2337
- const argumentMatching = matcher.argumentMatching ?? "partial";
2338
- const result = evaluateToolCalls(
2339
- [{ toolName: PROBE, arguments: matcher.args ?? {} }],
2340
- [{ toolName: PROBE, arguments: actualArgs ?? {} }],
2341
- { argumentMatching }
2342
- );
2343
- return result.passed;
2344
- }
2345
-
2346
- // ../evaluators/dist/chunk-YNFR3VPW.js
2346
+ // ../evaluators/dist/chunk-BIKNSDDD.js
2347
2347
  var MAX_VALUE_CHARS = 200;
2348
2348
  var MAX_ERROR_MSG_CHARS = 200;
2349
2349
  var MAX_ITEMS_SHOWN = 3;
@@ -3814,7 +3814,7 @@ __export(predicate_scorer_exports, {
3814
3814
  predicateScorer: () => predicateScorer
3815
3815
  });
3816
3816
 
3817
- // ../evaluators/dist/chunk-LICJIDQY.js
3817
+ // ../evaluators/dist/chunk-DOG7TBJQ.js
3818
3818
  function assertLocallyEvaluable(predicate) {
3819
3819
  if (!requiresRenderObservations(predicate.type)) return;
3820
3820
  throw new Error(
@@ -3892,7 +3892,7 @@ function toEvaluatorRawOutcome(outcome) {
3892
3892
  };
3893
3893
  }
3894
3894
 
3895
- // ../evaluators/dist/chunk-K67IGSPF.js
3895
+ // ../evaluators/dist/chunk-5CFTXLA2.js
3896
3896
  function assertLocallyEvaluable2(rule) {
3897
3897
  if (!requiresRenderObservations(rule.type)) return;
3898
3898
  throw new Error(
@@ -26544,7 +26544,7 @@ var noopPosthog = {
26544
26544
  var posthog = isTelemetryDisabled ? noopPosthog : new PostHog("phc_dTOPniyUNU2kD8Jx8yHMXSqiZHM8I91uWopTMX6EBE9", {
26545
26545
  host: "https://us.i.posthog.com"
26546
26546
  });
26547
- var SDK_VERSION = "8.16.0";
26547
+ var SDK_VERSION = "8.16.1";
26548
26548
  var SDK_RELEASE = `@mcpjam/sdk@${SDK_VERSION}`;
26549
26549
  var CAPTURED_ERROR_SYMBOL = Symbol.for("@mcpjam/sdk/captured-eval-error");
26550
26550
  init_internal();
@@ -26555,7 +26555,7 @@ init_eval_tool_execution();
26555
26555
  init_internal();
26556
26556
  init_internal();
26557
26557
  function readSdkVersion() {
26558
- return "8.16.0";
26558
+ return "8.16.1";
26559
26559
  }
26560
26560
  var DEFAULT_PLATFORM_USER_AGENT = `mcpjam-sdk/${readSdkVersion()}`;
26561
26561
  init_HostRunner();
@@ -84108,7 +84108,7 @@ var NEGATIVE_TEST_MODE_DETAILS = {
84108
84108
  }
84109
84109
  };
84110
84110
  function readSdkVersion2() {
84111
- return "8.16.0";
84111
+ return "8.16.1";
84112
84112
  }
84113
84113
  var CONFORMANCE_CHECKER_VERSION2 = readSdkVersion2();
84114
84114
  var MUST_POINTS2 = 95;
@@ -148270,6 +148270,14 @@ function stringifyForModel(value) {
148270
148270
  return String(value);
148271
148271
  }
148272
148272
  }
148273
+ var FENCE_MARKER_PATTERN = /(?:end[_\-\u200b-\u200d\u2060]*)?mcpjam[_\-\u200b-\u200d\u2060]*tool[_\-\u200b-\u200d\u2060]*output/gi;
148274
+ var REMOVED_FENCE_MARKER = "[fence marker removed]";
148275
+ function withoutFenceMarkers(text2) {
148276
+ return text2.replace(FENCE_MARKER_PATTERN, REMOVED_FENCE_MARKER);
148277
+ }
148278
+ function contentPartWithoutFenceMarkers(part) {
148279
+ return isRecord27(part) && part.type === "text" && typeof part.text === "string" ? { ...part, text: withoutFenceMarkers(part.text) } : part;
148280
+ }
148273
148281
  function fenceToolOutput(output, fence) {
148274
148282
  if (!isRecord27(output)) return output;
148275
148283
  const head = fence.label ? `${fence.label}
@@ -148277,16 +148285,19 @@ ${fence.open}` : fence.open;
148277
148285
  switch (output.type) {
148278
148286
  case "text":
148279
148287
  case "error-text":
148280
- return typeof output.value === "string" ? { ...output, value: `${head}
148281
- ${output.value}
148282
- ${fence.close}` } : output;
148288
+ return typeof output.value === "string" ? {
148289
+ ...output,
148290
+ value: `${head}
148291
+ ${withoutFenceMarkers(output.value)}
148292
+ ${fence.close}`
148293
+ } : output;
148283
148294
  case "json":
148284
148295
  case "error-json":
148285
148296
  return {
148286
148297
  ...output,
148287
148298
  type: output.type === "json" ? "text" : "error-text",
148288
148299
  value: `${head}
148289
- ${stringifyForModel(output.value)}
148300
+ ${withoutFenceMarkers(stringifyForModel(output.value))}
148290
148301
  ${fence.close}`
148291
148302
  };
148292
148303
  case "content":
@@ -148294,7 +148305,7 @@ ${fence.close}`
148294
148305
  ...output,
148295
148306
  value: [
148296
148307
  { type: "text", text: head },
148297
- ...output.value,
148308
+ ...output.value.map(contentPartWithoutFenceMarkers),
148298
148309
  { type: "text", text: fence.close }
148299
148310
  ]
148300
148311
  } : output;
@@ -156724,7 +156735,7 @@ function platformRefusalHint(refusal) {
156724
156735
  return refusal.canTopUp === false ? `${when} This is a usage limit: topping up credits does not lift it.` : when;
156725
156736
  }
156726
156737
  function readSdkVersion3() {
156727
- return "8.16.0";
156738
+ return "8.16.1";
156728
156739
  }
156729
156740
  var DEFAULT_PLATFORM_API_BASE_URL = "https://app.mcpjam.com/api/v1";
156730
156741
  function resolvePlatformRequestUrl(spec) {
@@ -263629,10 +263640,14 @@ function frozenToolEvidenceMissing(row2, missing) {
263629
263640
  return missing ?? (!Array.isArray(row2.expectedToolCalls) || typeof row2.isNegativeTest !== "boolean" ? "Frozen tool expectations or test polarity are unavailable" : void 0);
263630
263641
  }
263631
263642
  function hostedToolScorersDeclared(row2) {
263643
+ if (row2.isNegativeTest === true) return false;
263644
+ if (Array.isArray(row2.expectedToolCalls) && row2.expectedToolCalls.length === 0) {
263645
+ return false;
263646
+ }
263632
263647
  if (!Array.isArray(row2.expectedToolCalls) || typeof row2.isNegativeTest !== "boolean") {
263633
263648
  return void 0;
263634
263649
  }
263635
- return !row2.isNegativeTest && row2.expectedToolCalls.length > 0;
263650
+ return true;
263636
263651
  }
263637
263652
  function toolCallDifference(row2, context, evaluatorId, next) {
263638
263653
  context.seen.add(evaluatorId);