@tangle-network/sandbox-cli 0.21.27 → 0.21.28

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 (70) hide show
  1. package/dist/graph-viewer/{Analytics-DocMpB6T.js → Analytics-DFWW8Phh.js} +260 -275
  2. package/dist/graph-viewer/Checks-qgqV4xgV.js +155 -0
  3. package/dist/graph-viewer/{Conversations-CISiWrR9.js → Conversations-CGB45kpj.js} +112 -80
  4. package/dist/graph-viewer/{Files-Dh8p_Fpw.js → Files-DtZhf0ii.js} +121 -106
  5. package/dist/graph-viewer/LiveRun-C21wUKAY.js +210 -0
  6. package/dist/graph-viewer/Overview-BjeLsA2I.js +506 -0
  7. package/dist/graph-viewer/{RunPage-nJwCsArn.js → RunPage-CkkcBEUe.js} +22 -22
  8. package/dist/graph-viewer/{Timeline-bPjhV3il.js → Timeline-C2Xolk0t.js} +84 -84
  9. package/dist/graph-viewer/{Today-pebCsPJ1.js → Today-BVVDtSVN.js} +65 -58
  10. package/dist/graph-viewer/Topology-DO5XX8e4.js +545 -0
  11. package/dist/graph-viewer/{Traces-C5x2UvJh.js → Traces-BhMxjNgw.js} +79 -52
  12. package/dist/graph-viewer/{WallPages-DSmRm2v3.js → WallPages-4d9QUZDq.js} +3 -3
  13. package/dist/graph-viewer/index.js +103 -102
  14. package/dist/graph-viewer/{lazy-pages-CpmkG5o2.js → lazy-pages-DM0cZM10.js} +4 -4
  15. package/dist/graph-viewer/{record-part-Cx9GDQeo.js → record-part-CZal_IMH.js} +382 -352
  16. package/dist/graph-viewer/report-viewer.js +7 -7
  17. package/dist/graph-viewer/styles.css +596 -284
  18. package/dist/graph-viewer/{ui-CEhDqce8.js → ui-D8QZRsC3.js} +143 -111
  19. package/dist/graph-viewer/viewer/{AgentGraphCanvas-D7jjAE6i-DecKyUGA.js → AgentGraphCanvas-CMdOlSlh-4EervjeC.js} +54 -48
  20. package/dist/graph-viewer/viewer/{Analytics-CtKucZjs.js → Analytics-DD__nbLm.js} +203 -218
  21. package/dist/graph-viewer/viewer/{AnswerStrip-DsI9aF-i.js → AnswerStrip-CGUyXuYH.js} +2 -2
  22. package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +156 -0
  23. package/dist/graph-viewer/viewer/{Conversations-DQBCyko6.js → Conversations-C1n0EBBd.js} +124 -92
  24. package/dist/graph-viewer/viewer/{Files-B-g25gSO.js → Files-Cjr7NMU_.js} +63 -48
  25. package/dist/graph-viewer/viewer/{LiveRun-BMQnTpTZ.js → LiveRun-uPTkPSjo.js} +1223 -1164
  26. package/dist/graph-viewer/viewer/{Outputs-DXnN1wEQ.js → Outputs-CumGyjQo.js} +6 -6
  27. package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +507 -0
  28. package/dist/graph-viewer/viewer/{RunPage-ChipoSdO.js → RunPage-DZlBW7Va.js} +28 -28
  29. package/dist/graph-viewer/viewer/{Scores-CjriXjf_.js → Scores-ZS16yk0n.js} +3 -3
  30. package/dist/graph-viewer/viewer/{Timeline-DzEzobA0.js → Timeline-BnK6-yBR.js} +24 -24
  31. package/dist/graph-viewer/viewer/{Today-DLHe_wTA.js → Today-a_-oNigi.js} +69 -62
  32. package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +546 -0
  33. package/dist/graph-viewer/viewer/{Traces-BWBulSPE.js → Traces-C0IGk0L4.js} +75 -48
  34. package/dist/graph-viewer/viewer/{WallPages-Crj-qPoK.js → WallPages-CzWpyIfp.js} +8 -8
  35. package/dist/graph-viewer/viewer/{WorkflowGraph-DYsP_Kcg-C0O7M5iH.js → WorkflowGraph-DZ3xejKE-jRXKeSrg.js} +6 -6
  36. package/dist/graph-viewer/viewer/{agent-timeline-C-UIhXgu.js → agent-timeline-Cs9Qbpvo.js} +437 -425
  37. package/dist/graph-viewer/viewer/{bot-Bivadvxn.js → bot-D6Nrej7Z.js} +1 -1
  38. package/dist/graph-viewer/viewer/{chevron-right-WW7tFY6B.js → chevron-right-D_5IKLxu.js} +1 -1
  39. package/dist/graph-viewer/viewer/{createLucideIcon-Z6KTw8ff.js → createLucideIcon-yH0cxLMy.js} +1 -1
  40. package/dist/graph-viewer/viewer/{data-azhapQrS.js → data-CkWfWr7i.js} +1 -1
  41. package/dist/graph-viewer/viewer/{dist-CyOc-K4O.js → dist-C1-7EfoW.js} +3 -3
  42. package/dist/graph-viewer/viewer/{file-text-B34N7Soo.js → file-text-m7a3piQF.js} +1 -1
  43. package/dist/graph-viewer/viewer/{final-output-Db2D9cMT.js → final-output-kwY11u9X.js} +1 -1
  44. package/dist/graph-viewer/viewer/{highlights-Bgg6O5ub.js → highlights-Btsi5OXl.js} +2 -2
  45. package/dist/graph-viewer/viewer/{jsx-runtime-BSzbUOFc.js → jsx-runtime-DQWyJOhv.js} +1 -1
  46. package/dist/graph-viewer/viewer/{lazy-pages-fgtpXQ00.js → lazy-pages-BowaGsg-.js} +6 -6
  47. package/dist/graph-viewer/viewer/{markdown-BpJEJUTW.js → markdown-CX_sVrXB.js} +17 -17
  48. package/dist/graph-viewer/viewer/{model-brand-bTcMjQtB-C9bHPsPk.js → model-brand-bTcMjQtB-fagiBQam.js} +3 -3
  49. package/dist/graph-viewer/viewer/{page-header-C6YCPkzJ.js → page-header-Brq611fd.js} +3 -3
  50. package/dist/graph-viewer/viewer/{popover-DrLB9iar.js → popover-CvOAjlnk.js} +4 -4
  51. package/dist/graph-viewer/viewer/{react-CisnW4fB.js → react-CY3IbSNO.js} +24 -24
  52. package/dist/graph-viewer/viewer/{react-dom-C5NDYQCD.js → react-dom-t1L4_-il.js} +1 -1
  53. package/dist/graph-viewer/viewer/{record-part-d0gKKrMI.js → record-part-D3_Anfpe.js} +455 -425
  54. package/dist/graph-viewer/viewer/{segmented-control-ChhLMa6h.js → segmented-control-BaJmvTNd.js} +39 -39
  55. package/dist/graph-viewer/viewer/{shiki-BwlTRTY6.js → shiki-Qnby7Sh6.js} +2 -2
  56. package/dist/graph-viewer/viewer/{stream-tokenizer-CaVb21TO.js → stream-tokenizer-CWtnjmRd.js} +1 -1
  57. package/dist/graph-viewer/viewer/{terminal-BxRacTx0.js → terminal-83J_I4Ne.js} +1 -1
  58. package/dist/graph-viewer/viewer/{themes-BxrCCwH5.js → themes-1i1fzpRk.js} +1 -1
  59. package/dist/graph-viewer/viewer/{ui-DZiGjPwl.js → ui-C9b1rIUH.js} +222 -190
  60. package/dist/graph-viewer/viewer/{workspace-DalRxssx.js → workspace-CekmOBs3.js} +76 -76
  61. package/dist/graph-viewer/viewer/{x-B_F8B4lq.js → x-DOc2URqZ.js} +1 -1
  62. package/dist/graph-viewer/workspace-viewer.js +103 -102
  63. package/package.json +5 -5
  64. package/dist/graph-viewer/Checks-CbnY4tuh.js +0 -113
  65. package/dist/graph-viewer/LiveRun-C-yKwkKs.js +0 -190
  66. package/dist/graph-viewer/Overview-BaXPdCFC.js +0 -477
  67. package/dist/graph-viewer/Topology-CyhuK6XW.js +0 -550
  68. package/dist/graph-viewer/viewer/Checks-DZTgeYlV.js +0 -114
  69. package/dist/graph-viewer/viewer/Overview-u7-8-rGx.js +0 -478
  70. package/dist/graph-viewer/viewer/Topology-Dsmuu27J.js +0 -551
@@ -359,7 +359,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
359
359
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=uy,c=!sb.jitless,l=c&&dy.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?LS([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function BS(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!jy(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Iy(e,r,cb())))}),t)}var VS=G(`$ZodUnion`,(e,t)=>{Lx.init(e,t),Zy(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Zy(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Zy(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Zy(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Zv(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>BS(t,r,e,i)):BS(o,r,e,i)}}),HS=G(`$ZodIntersection`,(e,t)=>{Lx.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>WS(e,t,n)):WS(e,i,a)}});function US(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fy(e)&&fy(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=US(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=US(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function WS(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=US(t.value,n.value);if(!c.valid){if(jy(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var GS=G(`$ZodRecord`,(e,t)=>{Lx.init(e,t);let n=sb.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!fy(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Iy(e,i,cb())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Ny(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ny(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&px.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Iy(e,i,cb())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Ny(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ny(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),KS=G(`$ZodEnum`,(e,t)=>{Lx.init(e,t);let n=Gv(t.entries),r=new Set(n);e._zod.values=r,Zy(e,`pattern`,e=>{let t=Gv(e.def.entries).filter(e=>my.has(typeof e));return RegExp(t.length?`^(${t.map(e=>hy(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qS=G(`$ZodLiteral`,(e,t)=>{Lx.init(e,t);let n=new Set(t.values);e._zod.values=n,Zy(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?hy(e):e?hy(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),JS=G(`$ZodTransform`,(e,t)=>{Lx.init(e,t),e._zod.optin=`optional`,sb.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ob(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ab;return n.value=i,n}});function YS(e,t){return e.value=t.issues.length?void 0:t.value,e}var XS=G(`$ZodOptional`,(e,t)=>{Lx.init(e,t),Zy(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Zy(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Zy(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Zv(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>YS(e,t)):YS(e,r)}return t.innerType._zod.run(e,n)}}),ZS=G(`$ZodExactOptional`,(e,t)=>{XS.init(e,t),Zy(e,`values`,e=>e.def.innerType._zod.values),Zy(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),QS=G(`$ZodNullable`,(e,t)=>{Lx.init(e,t),Zy(e,`optin`,e=>e.def.innerType._zod.optin),Zy(e,`optout`,e=>e.def.innerType._zod.optout),Zy(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Zv(t.source)}|null)$`):void 0}),Zy(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),$S=G(`$ZodDefault`,(e,t)=>{Lx.init(e,t),e._zod.optin=`defaulted`,Zy(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>eC(e,t)):eC(r,t)}});function eC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var tC=G(`$ZodPrefault`,(e,t)=>{Lx.init(e,t),e._zod.optin=`defaulted`,Zy(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),nC=G(`$ZodNonOptional`,(e,t)=>{Lx.init(e,t),Zy(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>rC(t,e)):rC(i,e)}});function rC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function iC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Iy(e,r,cb()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var aC=G(`$ZodCatch`,(e,t)=>{Lx.init(e,t),Zy(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Zy(e,`optout`,e=>e.def.innerType._zod.optout),Zy(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>iC(e,r,t,n)):iC(e,r,t,n)}}),oC=G(`$ZodPipe`,(e,t)=>{Lx.init(e,t),Zy(e,`values`,e=>e.def.in._zod.values),Zy(e,`optin`,e=>e.def.in._zod.optin),Zy(e,`optout`,e=>e.def.out._zod.optout),Zy(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>sC(e,t.in,n)):sC(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>sC(e,t.out,n)):sC(r,t.out,n)}});function sC(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var cC=G(`$ZodReadonly`,(e,t)=>{Lx.init(e,t),Zy(e,`propValues`,e=>e.def.innerType._zod.propValues),Zy(e,`values`,e=>e.def.innerType._zod.values),Zy(e,`optin`,e=>e.def.innerType?._zod?.optin),Zy(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(lC):lC(r)}});function lC(e){return e.memo||(e.value=Object.freeze(e.value)),e}var uC=G(`$ZodCustom`,(e,t)=>{_x.init(e,t),Lx.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>dC(t,n,r,e));dC(i,n,r,e)}});function dC(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Vy(e))}}var fC=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},pC=`~memo`,mC=[];function hC(e){return typeof e==`object`&&!!e}function gC(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var _C=new WeakMap,vC=0,yC=1,bC=2;function xC(e,t,n){let r=_C.get(e);if(r!==void 0)return r?bC:vC;if(t.has(e))return bC;t.add(e);let i=vC,a=e=>{if(i!==bC&&e?._zod){let r=xC(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=vC;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?yC:o.value?._zod?xC(o.value,t,n):vC;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=ey(c);s(e?o(e,!0):yC),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?xC(r,t,!1):yC);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),SC(e,i)}function SC(e,t){return t!==yC&&_C.set(e,t===bC),t}function CC(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var wC,TC=[],EC={alloc(e,t,n){let r=wC;if(!r)return n;wC=void 0;let i={value:n,issues:null};return r.set(t.value,i),TC.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&OC(n,e.value))throw new fC;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=xC(e,new Set,!1);if(i===vC)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===bC||r?n=!0:r=!0}let l=s.value;if(!hC(l))return t(s,c);let u=c[pC];u||(u={buckets:new WeakMap,backEdges:void 0},c[pC]=u);let d;i===c?d=a:(d=CC(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...gC(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;wC=d;let p=TC.length,m=t(s,c);wC=void 0;let h=TC.length>p?TC.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?gC(e.issues):mC),e)):(h&&(h.issues=m.issues.length?gC(m.issues):mC),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function DC(){return EC}function OC(e,t){let n=e[pC]?.backEdges;return n!==void 0&&hC(t)&&n.has(t)}var kC=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(By(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${vy(e.values[0])}`:`Invalid option: expected one of ${Kv(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Kv(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function AC(){return{localeError:kC()}}var jC,MC=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function NC(){return new MC}(jC=globalThis).__zod_globalRegistry??(jC.__zod_globalRegistry=NC());var PC=globalThis.__zod_globalRegistry;function FC(e){return e.checks&&=[...e.checks],e}function IC(e,t){return new e(FC({type:`string`,..._y(t)}))}function LC(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,..._y(t)})}function RC(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,..._y(t)})}function zC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,..._y(t)})}function BC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,..._y(t)})}function VC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,..._y(t)})}function HC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,..._y(t)})}function UC(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,..._y(t)})}function WC(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,..._y(t)})}function GC(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,..._y(t)})}function KC(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,..._y(t)})}function qC(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,..._y(t)})}function JC(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,..._y(t)})}function YC(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,..._y(t)})}function XC(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,..._y(t)})}function ZC(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,..._y(t)})}function QC(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,..._y(t)})}function $C(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,..._y(t)})}function ew(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,..._y(t)})}function tw(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,..._y(t)})}function nw(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,..._y(t)})}function rw(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,..._y(t)})}function iw(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,..._y(t)})}function aw(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,..._y(t)})}function ow(e,t){return new e({type:`string`,format:`date`,check:`string_format`,..._y(t)})}function sw(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,..._y(t)})}function cw(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,..._y(t)})}function lw(e,t){return new e(FC({type:`number`,checks:[],..._y(t)}))}function uw(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,..._y(t)})}function dw(e,t){return new e({type:`boolean`,..._y(t)})}function fw(e){return new e({type:`unknown`})}function pw(e,t){return new e({type:`never`,..._y(t)})}function mw(e,t){return new bx({check:`less_than`,..._y(t),value:e,inclusive:!1})}function hw(e,t){return new bx({check:`less_than`,..._y(t),value:e,inclusive:!0})}function gw(e,t){return new xx({check:`greater_than`,..._y(t),value:e,inclusive:!1})}function _w(e,t){return new xx({check:`greater_than`,..._y(t),value:e,inclusive:!0})}function vw(e,t){return new Sx({check:`multiple_of`,..._y(t),value:e})}function yw(e,t){return new wx({check:`max_length`,..._y(t),maximum:e})}function bw(e,t){return new Tx({check:`min_length`,..._y(t),minimum:e})}function xw(e,t){return new Ex({check:`length_equals`,..._y(t),length:e})}function Sw(e,t){return new Ox({check:`string_format`,format:`regex`,..._y(t),pattern:e})}function Cw(e){return new kx({check:`string_format`,format:`lowercase`,..._y(e)})}function ww(e){return new Ax({check:`string_format`,format:`uppercase`,..._y(e)})}function Tw(e,t){return new jx({check:`string_format`,format:`includes`,..._y(t),includes:e})}function Ew(e,t){return new Mx({check:`string_format`,format:`starts_with`,..._y(t),prefix:e})}function Dw(e,t){return new Nx({check:`string_format`,format:`ends_with`,..._y(t),suffix:e})}function Ow(e){return new Px({check:`overwrite`,tx:e})}function kw(e){return Ow(t=>t.normalize(e))}function Aw(){return Ow(e=>e.trim())}function jw(){return Ow(e=>e.toLowerCase())}function Mw(){return Ow(e=>e.toUpperCase())}function Nw(){return Ow(e=>cy(e))}function Pw(e,t,n){return new e({type:`array`,element:t,..._y(n)})}function Fw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,..._y(n)})}function Iw(e,t){let n=Lw(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Vy(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Vy(r))}},e(t.value,t)),t);return n}function Lw(e,t){let n=new _x({check:`custom`,..._y(t)});return n._zod.check=e,n}function Rw(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&$v(e,t,n[t]);return e}function zw(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??PC,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Bw(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Vw(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Vw(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Rw(o.schema,c),t.io===`input`&&Zw(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Hw(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Uw(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Hw(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Hw(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
360
360
 
361
361
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ww(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ww(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Gw=new Set([`type`,`properties`,`required`,`additionalProperties`]),Kw=[`oneOf`,`anyOf`];function qw(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Jw(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Gw.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??qw(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}$v(n,r,e.length===1?e[0]:Jw(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=qw(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Yw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Gw)if(t in e)return;let n=t.filter(e=>Kw.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Jw(t);else{let e=n[0],i=Kw.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Jw([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Rw(e,r))}function Xw(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Rw(i,s),Rw(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ww(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Yw(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Rw(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,$v(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:$w(t,`input`,e.processors),output:$w(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Zw(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Zw(r.element,n);if(r.type===`set`)return Zw(r.valueType,n);if(r.type===`lazy`)return Zw(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Zw(r.innerType,n);if(r.type===`intersection`)return Zw(r.left,n)||Zw(r.right,n);if(r.type===`record`||r.type===`map`)return Zw(r.keyType,n)||Zw(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Zw(r.in,n)||Zw(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Zw(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Zw(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Zw(e,n))return!0;return!!(r.rest&&Zw(r.rest,n))}return!1}var Qw=(e,t={})=>n=>{let r=zw({...n,processors:t});return Vw(e,r),Uw(r,e),Xw(r,e)},$w=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zw({...i??{},target:a,io:t,processors:n});return Vw(e,o),Uw(o,e),Xw(o,e)},eT=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},tT=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},nT=(e,t)=>{eT(e,`minimum`,t),tT(e,`maximum`,t)},rT=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},iT=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},aT=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},oT=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},sT=(e,t)=>eT(e,`minimum`,t.minimum),cT=(e,t)=>tT(e,`maximum`,t.maximum),lT=e=>(t,n)=>{oT(t,n.format);let[r,i]=e[n.format];eT(t,`minimum`,r),tT(t,`maximum`,i)},uT={greater_than:(e,t)=>eT(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>tT(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>rT(e,t.value),number_format:lT(by),bigint_format:lT(xy),min_length:sT,max_length:cT,length_equals:(e,t)=>nT(e,t.length),min_size:sT,max_size:cT,size_equals:(e,t)=>nT(e,t.size),string_format:(e,t)=>{oT(e,t.format),t.pattern&&iT(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>aT(e,t.mime)};function dT(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)uT[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&eT(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&eT(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&tT(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&tT(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&rT(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&aT(t,i.mime);for(let e of i.patterns??[])iT(t,e);return t}var fT={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},pT=new Map([[yS,tx],[xS,nx]]),mT=e=>pT.get(e)??e,hT=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=dT(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=fT[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(mT);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},gT=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=dT(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Bw(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},_T=(e,t,n,r)=>{n.type=`boolean`},vT=(e,t,n,r)=>{n.not={}},yT=(e,t,n,r)=>{let i=e._zod.def,a=Gv(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bT=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Bw(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Bw(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},xT=(e,t,n,r)=>{Bw(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ST=(e,t,n,r)=>{Bw(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},CT=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=dT(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Vw(a.element,t,{...r,path:[...r.path,`items`]})};function wT(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?wT(t.out):t.type===`catch`?wT(t.innerType):e._zod.optin}var TT=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Bw(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)$v(i.properties,e,Vw(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?wT(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Vw(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ET=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Vw(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},DT=(e,t,n,r)=>{let i=e._zod.def,a=Vw(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Vw(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function OT(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=OT(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>OT(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?px:fx).source),p):p}var kT=new WeakMap;function AT(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of kT.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=OT(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var jT=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=dT(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Vw(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)$v(i.patternProperties,mT(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Vw(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=kT.get(t);n||(n=[],kT.set(t,n),t.deferred.push(()=>AT(t))),n.push(e)}i.additionalProperties=Vw(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&wT(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},MT=(e,t,n,r)=>{let i=e._zod.def,a=Vw(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},NT=(e,t,n,r)=>{let i=e._zod.def;Vw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},PT=Symbol();function FT(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Bw(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),PT):JSON.parse(o)}var IT=(e,t,n,r)=>{let i=e._zod.def;Vw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=FT(i.defaultValue,e,t,n,r);o!==PT&&(n.default=o)},LT=(e,t,n,r)=>{let i=e._zod.def;Vw(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=FT(i.defaultValue,e,t,n,r);o!==PT&&(n._prefault=o)},RT=(e,t,n,r)=>{let i=e._zod.def;Vw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Bw(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},zT=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Vw(o,t,r);let s=t.seen.get(e);s.ref=o},BT=(e,t,n,r)=>{let i=e._zod.def;Vw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},VT=(e,t,n,r)=>{let i=e._zod.def;Vw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},HT=new WeakSet([Object.prototype,Error.prototype]);function UT(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var WT=G(`ZodError`,(e,t)=>{hb.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);HT.has(n)||(HT.add(n),UT(n,`format`,e=>t=>vb(e,t)),UT(n,`flatten`,e=>t=>_b(e,t)),UT(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,qv,2)}),UT(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,qv,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),GT=bb(WT),KT=xb(WT),qT=Sb(WT),JT=wb(WT),YT=Ab(WT),XT=jb(WT),ZT=Mb(WT),QT=Nb(WT),$T=Pb(WT),eE=Fb(WT),tE=Ib(WT),nE=Lb(WT);function rE(){sb.localeError||cb(AC())}function iE(){sb.memoizer||cb({memoizer:DC()})}var aE=G(`ZodType`,(e,t)=>(rE(),Lx.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(oy(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return gy(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(xD(e,t))},superRefine(e,t){return this.check(SD(e,t))},overwrite(e){return this.check(Ow(e))},optional(){return rD(this)},exactOptional(){return aD(this)},nullable(){return sD(this)},nullish(){return rD(sD(this))},nonoptional(e){return pD(this,e)},array(){return J(this)},or(e){return GE([this,e])},and(e){return qE(this,e)},transform(e){return _D(this,tD(e))},default(e){return lD(this,e)},prefault(e){return dD(this,e)},catch(e){return hD(this,e)},pipe(e){return _D(this,e)},readonly(){return yD(this)},describe(e){let t=this.clone();return PC.add(t,{description:e}),t},meta(...e){if(e.length===0)return PC.get(this);let t=this.clone();return PC.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Wy(this,`~standard`,{...Bx(this),jsonSchema:{input:$w(this,`input`),output:$w(this,`output`)}})},set"~standard"(e){Uy(this,`~standard`,e)},parse:function e(t,n){return GT(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await KT(this,t,n,{callee:e})},safeParse(e,t){return qT(this,e,t)},async safeParseAsync(e,t){return JT(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Uy(this,`spa`,e)},validate(e,t){return Db(this,e,t)},validateAsync(e,t){return kb(this,e,t)},encode:function e(t,n){return YT(this,t,n,{callee:e})},decode:function e(t,n){return XT(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ZT(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await QT(this,t,n,{callee:e})},safeEncode(e,t){return $T(this,e,t)},safeDecode(e,t){return eE(this,e,t)},async safeEncodeAsync(e,t){return tE(this,e,t)},async safeDecodeAsync(e,t){return nE(this,e,t)},toJSONSchema(e){return Qw(this,{})(e)},get description(){return PC.get(this)?.description},get _def(){return this._zod.def}}),oE=G(`_ZodString`,(e,t)=>{Vx.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hT(e,t,n,r)},Gy({format:e=>dT(e).format??null,minLength:e=>dT(e).minimum??null,maxLength:e=>dT(e).maximum??null},{regex(...e){return this.check(Sw(...e))},includes(...e){return this.check(Tw(...e))},startsWith(...e){return this.check(Ew(...e))},endsWith(...e){return this.check(Dw(...e))},min(...e){return this.check(bw(...e))},max(...e){return this.check(yw(...e))},length(...e){return this.check(xw(...e))},nonempty(...e){return this.check(bw(1,...e))},lowercase(e){return this.check(Cw(e))},uppercase(e){return this.check(ww(e))},trim(){return this.check(Aw())},normalize(...e){return this.check(kw(...e))},toLowerCase(){return this.check(jw())},toUpperCase(){return this.check(Mw())},slugify(){return this.check(Nw())}})),sE=G(`ZodString`,(e,t)=>{Vx.init(e,t),oE.init(e,t)},{email(e){return this.check(LC(pE,e))},url(e){return this.check(UC(gE,e))},jwt(e){return this.check(iw(ME,e))},emoji(e){return this.check(WC(vE,e))},guid(e){return this.check(RC(mE,e))},uuid(e){return this.check(zC(hE,e))},uuidv4(e){return this.check(BC(hE,e))},uuidv6(e){return this.check(VC(hE,e))},uuidv7(e){return this.check(HC(hE,e))},nanoid(e){return this.check(GC(yE,e))},cuid(e){return this.check(KC(bE,e))},cuid2(e){return this.check(qC(xE,e))},ulid(e){return this.check(JC(SE,e))},base64(e){return this.check(tw(kE,e))},base64url(e){return this.check(nw(AE,e))},xid(e){return this.check(YC(CE,e))},ksuid(e){return this.check(XC(wE,e))},ipv4(e){return this.check(ZC(TE,e))},ipv6(e){return this.check(QC(EE,e))},cidrv4(e){return this.check($C(DE,e))},cidrv6(e){return this.check(ew(OE,e))},e164(e){return this.check(rw(jE,e))},datetime(e){return this.check(aw(lE,e))},date(e){return this.check(ow(uE,e))},time(e){return this.check(sw(dE,e))},duration(e){return this.check(cw(fE,e))}});function K(e){return IC(sE,e)}var cE=G(`ZodStringFormat`,(e,t)=>{Hx.init(e,t),oE.init(e,t)}),lE=G(`ZodISODateTime`,(e,t)=>{sS.init(e,t),cE.init(e,t)}),uE=G(`ZodISODate`,(e,t)=>{cS.init(e,t),cE.init(e,t)}),dE=G(`ZodISOTime`,(e,t)=>{lS.init(e,t),cE.init(e,t)}),fE=G(`ZodISODuration`,(e,t)=>{uS.init(e,t),cE.init(e,t)}),pE=G(`ZodEmail`,(e,t)=>{Gx.init(e,t),cE.init(e,t)}),mE=G(`ZodGUID`,(e,t)=>{Ux.init(e,t),cE.init(e,t)}),hE=G(`ZodUUID`,(e,t)=>{Wx.init(e,t),cE.init(e,t)}),gE=G(`ZodURL`,(e,t)=>{$x.init(e,t),cE.init(e,t)});function _E(e){return UC(gE,e)}var vE=G(`ZodEmoji`,(e,t)=>{eS.init(e,t),cE.init(e,t)}),yE=G(`ZodNanoID`,(e,t)=>{tS.init(e,t),cE.init(e,t)}),bE=G(`ZodCUID`,(e,t)=>{nS.init(e,t),cE.init(e,t)}),xE=G(`ZodCUID2`,(e,t)=>{rS.init(e,t),cE.init(e,t)}),SE=G(`ZodULID`,(e,t)=>{iS.init(e,t),cE.init(e,t)}),CE=G(`ZodXID`,(e,t)=>{aS.init(e,t),cE.init(e,t)}),wE=G(`ZodKSUID`,(e,t)=>{oS.init(e,t),cE.init(e,t)}),TE=G(`ZodIPv4`,(e,t)=>{dS.init(e,t),cE.init(e,t)}),EE=G(`ZodIPv6`,(e,t)=>{mS.init(e,t),cE.init(e,t)}),DE=G(`ZodCIDRv4`,(e,t)=>{hS.init(e,t),cE.init(e,t)}),OE=G(`ZodCIDRv6`,(e,t)=>{_S.init(e,t),cE.init(e,t)}),kE=G(`ZodBase64`,(e,t)=>{bS.init(e,t),cE.init(e,t)}),AE=G(`ZodBase64URL`,(e,t)=>{CS.init(e,t),cE.init(e,t)}),jE=G(`ZodE164`,(e,t)=>{wS.init(e,t),cE.init(e,t)}),ME=G(`ZodJWT`,(e,t)=>{ES.init(e,t),cE.init(e,t)}),NE=G(`ZodNumber`,(e,t)=>{DS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gT(e,t,n,r),e.isFinite=!0},Gy({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=dT(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=dT(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=dT(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>dT(e).format??null},{gt(e,t){return this.check(gw(e,t))},gte(e,t){return this.check(_w(e,t))},min(e,t){return this.check(_w(e,t))},lt(e,t){return this.check(mw(e,t))},lte(e,t){return this.check(hw(e,t))},max(e,t){return this.check(hw(e,t))},int(e){return this.check(IE(e))},safe(e){return this.check(IE(e))},positive(e){return this.check(gw(0,e))},nonnegative(e){return this.check(_w(0,e))},negative(e){return this.check(mw(0,e))},nonpositive(e){return this.check(hw(0,e))},multipleOf(e,t){return this.check(vw(e,t))},step(e,t){return this.check(vw(e,t))},finite(){return this}}));function PE(e){return lw(NE,e)}var FE=G(`ZodNumberFormat`,(e,t)=>{OS.init(e,t),NE.init(e,t)});function IE(e){return uw(FE,e)}var LE=G(`ZodBoolean`,(e,t)=>{kS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_T(e,t,n,r)});function RE(e){return dw(LE,e)}var zE=G(`ZodUnknown`,(e,t)=>{AS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function q(){return fw(zE)}var BE=G(`ZodNever`,(e,t)=>{jS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vT(e,t,n,r)});function VE(e){return pw(BE,e)}var HE=G(`ZodArray`,(e,t)=>{iE(),NS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CT(e,t,n,r),e.element=t.element},{min(e,t){return this.check(bw(e,t))},nonempty(e){return this.check(bw(1,e))},max(e,t){return this.check(yw(e,t))},length(e,t){return this.check(xw(e,t))},unwrap(){return this.element}});function J(e,t){return Pw(HE,e,t)}var UE=G(`ZodObject`,(e,t)=>{iE(),zS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TT(e,t,n,r),Qy(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ZE(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(oy(this._zod.def,{catchall:e}))},passthrough(){return this.clone(oy(this._zod.def,{catchall:q()}))},loose(){return this.clone(oy(this._zod.def,{catchall:q()}))},strict(){return this.clone(oy(this._zod.def,{catchall:VE()}))},strip(){return this.clone(oy(this._zod.def,{catchall:void 0}))},extend(e){return Ty(this,e)},safeExtend(e){return Dy(this,e)},merge(e){return Oy(this,e)},pick(e){return Sy(this,e)},omit(e){return wy(this,e)},partial(...e){return ky(nD,this,e[0])},exactPartial(...e){return ky(iD,this,e[0],`exactPartial`)},required(...e){return Ay(fD,this,e[0])}});function Y(e,t){return new UE({type:`object`,shape:e??{},..._y(t)})}var WE=G(`ZodUnion`,(e,t)=>{VS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ET(e,t,n,r),e.options=t.options});function GE(e,t){return new WE({type:`union`,options:e,..._y(t)})}var KE=G(`ZodIntersection`,(e,t)=>{HS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DT(e,t,n,r)});function qE(e,t){return new KE({type:`intersection`,left:e,right:t})}var JE=G(`ZodRecord`,(e,t)=>{iE(),GS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jT(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function YE(e,t,n){return!t||!t._zod?new JE({type:`record`,keyType:K(),valueType:e,..._y(t)}):new JE({type:`record`,keyType:e,valueType:t,..._y(n)})}var XE=G(`ZodEnum`,(e,t)=>{KS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yT(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new XE({...t,checks:[],..._y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new XE({...t,checks:[],..._y(r),entries:i})}});function ZE(e,t){return new XE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,..._y(t)})}var QE=G(`ZodLiteral`,(e,t)=>{qS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bT(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $E(e,t){return new QE({type:`literal`,values:Array.isArray(e)?e:[e],..._y(t)})}var eD=G(`ZodTransform`,(e,t)=>{iE(),JS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ST(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ob(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Vy(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Vy(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function tD(e){return new eD({type:`transform`,transform:e})}var nD=G(`ZodOptional`,(e,t)=>{XS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rD(e){return new nD({type:`optional`,innerType:e})}var iD=G(`ZodExactOptional`,(e,t)=>{ZS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aD(e){return new iD({type:`optional`,innerType:e})}var oD=G(`ZodNullable`,(e,t)=>{QS.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sD(e){return new oD({type:`nullable`,innerType:e})}var cD=G(`ZodDefault`,(e,t)=>{$S.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lD(e,t){return new cD({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():py(t)}})}var uD=G(`ZodPrefault`,(e,t)=>{tC.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dD(e,t){return new uD({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():py(t)}})}var fD=G(`ZodNonOptional`,(e,t)=>{nC.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pD(e,t){return new fD({type:`nonoptional`,innerType:e,..._y(t)})}var mD=G(`ZodCatch`,(e,t)=>{aC.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hD(e,t){return new mD({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:eb(t)})}var gD=G(`ZodPipe`,(e,t)=>{oC.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zT(e,t,n,r),e.in=t.in,e.out=t.out});function _D(e,t){return new gD({type:`pipe`,in:e,out:t})}var vD=G(`ZodReadonly`,(e,t)=>{cC.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yD(e){return new vD({type:`readonly`,innerType:e})}var bD=G(`ZodCustom`,(e,t)=>{uC.init(e,t),aE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xT(e,t,n,r)});function xD(e,t={}){return Fw(bD,e,t)}function SD(e,t){return Iw(e,t)}function CD(e){return aw(lE,e)}var wD=ZE([`pass`,`attention`,`fail`,`neutral`]),TD=Y({key:K(),label:K(),tone:wD,icon:K(),at:K().nullable().optional(),reason:K().nullable().optional()}),ED=Y({name:K().nullable(),label:K(),state:ZE([`pass`,`fail`,`undecided`,`unrun`]),line:K().nullable().optional(),runs:PE().optional()}),DD=Y({release:K().nullable(),at:K().nullable().optional(),passed:PE(),total:PE(),steps:J(ED),workloads:Y({passed:PE().nullable().optional(),total:PE().nullable().optional()}).nullable().optional(),solved:RE(),checker:K().nullable().optional(),runId:K().optional(),sentence:K()}),OD=Y({role:K(),label:K()}),kD=Y({kind:K(),text:K(),sentence:K().optional(),cause:K().nullable().optional(),release:K().nullable().optional(),detail:K().optional(),actor:OD.optional(),owner:K().nullable().optional(),since:K().nullable().optional(),action:K().nullable().optional(),dispute:K().nullable().optional(),why:K().nullable().optional()}),AD=Y({days:J(K()),passed:J(PE().nullable()),total:PE(),best:PE(),movement:ZE([`moving`,`stuck`,`regressed`,`solved`]),since:K().nullable(),newest:Y({release:K(),passed:PE(),at:K().nullable()}),series:J(Y({release:K(),runId:K().nullable().optional(),at:K(),passed:PE()})).optional()}),jD=Y({value:PE(),kind:ZE([`measured`,`upper-bound`,`lower-bound`]),release:K().nullable().optional(),runId:K().nullable().optional(),at:K().nullable().optional(),size:K().nullable().optional(),reason:K().nullable().optional()}),MD=Y({metric:K(),label:K(),unit:K(),scale:ZE([`log`,`linear`]).nullable().optional(),direction:ZE([`up`,`down`]).nullable().optional(),target:Y({min:PE().nullable().optional(),max:PE().nullable().optional(),approx:PE().nullable().optional()}).nullable().optional(),stretch:Y({min:PE().nullable().optional(),max:PE().nullable().optional(),label:K().nullable().optional()}).nullable().optional(),latest:jD.nullable(),best:jD.nullable().optional(),ratio:Y({x:PE(),side:ZE([`short`,`met`,`past`])}).nullable().optional(),change:Y({from:PE(),to:PE(),since:K()}).nullable().optional()}),ND=Y({runId:K().nullable().optional(),text:K(),owner:K().nullable().optional(),actor:OD.optional(),options:J(Y({label:K(),command:K(),consequence:K().optional()})).optional(),since:K().nullable().optional(),href:K().nullable().optional()}),PD=Y({schema:$E(`agent-workspace.view.v1`),asOf:K(),status:TD,sentence:K(),blocker:kD.nullable(),progress:DD.nullable(),needsYou:J(ND),trend:AD.nullable().optional(),bars:J(MD).optional()}).catchall(q());Y({status:TD,sentence:K(),progress:DD.nullable(),runs:YE(K(),TD).nullable().optional(),blocker:kD.nullable().optional(),needsYou:J(ND).optional(),asOf:K().optional()}).catchall(q());var FD=CD({offset:!0}),ID=Y({at:FD.nullable().optional(),tag:K().nullable().optional(),commit:K().nullable().optional(),checker:K().nullable().optional(),verdict:K().nullable().optional(),line:K().nullable().optional(),score:Y({stage:K().nullable().optional(),reached:PE().nullable().optional(),of:PE().nullable().optional(),workloads:Y({passed:PE().nullable(),total:PE().nullable()}).nullable().optional()}).catchall(q()).nullable().optional()}).catchall(q()),LD=ZE([`calibrated`,`uncalibrated`,`nondeterministic`,`unknown`]),RD=Y({state:LD,stages:J(Y({name:K().nullable(),state:LD}).catchall(q())),source:K().nullable().optional(),unknown:K().nullable().optional()}).catchall(q());Y({latest:ID.nullable(),best:ID.nullable(),passes:J(Y({tag:K().nullable(),checker:K().nullable(),count:PE(),firstAt:FD,lastAt:FD}).catchall(q())).optional(),gate:ID.nullable().optional(),gateUnknown:Y({count:PE(),from:FD,to:FD,line:K().nullable(),tags:J(K()).optional()}).catchall(q()).nullable().optional(),headline:K().nullable().optional(),counts:Y({checks:PE(),known:PE(),solved:PE()}).partial().catchall(q()).nullable().optional(),checkerNames:J(Y({sha256:K(),label:K().nullable().optional(),ruling:K().nullable().optional(),current:RE().optional()}).catchall(q())).optional(),held:ID.extend({stages:J(K())}).nullable().optional(),calibration:RD.nullable().optional()}).catchall(q()),Y({id:K().nullable(),at:FD.nullable(),line:K().nullable(),state:ZE([`open`,`operator`,`upheld`,`rejected`,`undecided`]).nullable(),ruledAt:FD.nullable(),by:ZE([`referee`,`operator`]).nullable(),attempts:PE().int().nonnegative().nullable(),referees:J(Y({seat:K().nullable(),family:K().nullable(),verdict:ZE([`upheld`,`rejected`,`undecided`]).nullable()}).catchall(q())).optional()}).catchall(q());var X=PE().nullable(),Z=K().nullable(),zD=Y({passed:X,total:X}).catchall(q()).nullable(),BD=Y({kind:Z.optional(),provider:Z.optional(),model:Z.optional(),at:Z.optional(),error:Z.optional(),source:Z.optional()}).catchall(q()).nullable().optional(),VD=Y({class:K(),severity:ZE([`red`,`amber`]).or(K()),since:Z.optional(),evidence:Z.optional(),source:Z.optional(),owner:Z.optional(),cause:BD,also:J(Y({class:K(),since:Z.optional(),evidence:Z.optional(),source:Z.optional(),cause:BD}).catchall(q())).optional()}).catchall(q()),HD=Y({checker:Z.optional(),tag:Z.optional(),runId:Z.optional(),columnId:Z.optional(),verdict:Z.optional(),stage:Z.optional(),reached:X.optional(),of:X.optional(),workloads:zD.optional(),progress:X.optional(),line:Z.optional(),at:Z.optional(),count:X.optional(),firstAt:Z.optional(),lastAt:Z.optional(),supersededBy:Z.optional(),state:Z.optional()}).catchall(q()),UD=Y({sha256:K(),label:K(),firstAt:Z.optional(),runIds:J(K()).optional(),ruling:Y({at:Z,by:Z,verdict:Z,label:Z.optional(),reason:Z}).catchall(q()).nullable().optional(),current:RE().optional(),rows:X.optional()}).catchall(q()),WD=Y({value:PE(),columnId:Z.optional(),tag:Z.optional(),runId:Z.optional(),checker:Z.optional(),verdict:Z.optional(),comparable:RE().nullable().optional(),why:Z.optional(),short:Z.optional(),workloads:zD.optional()}).catchall(q()),GD=Y({id:K(),label:K(),unit:K(),scale:ZE([`log`,`linear`]).optional(),direction:ZE([`up`,`down`]).optional(),target:Y({min:X.optional(),max:X.optional(),approx:X.optional()}).catchall(q()).nullable().optional(),stretch:Y({min:X.optional(),max:X.optional(),label:Z.optional()}).catchall(q()).nullable().optional(),precondition:RE().optional(),best:WD.nullable().optional(),nearest:WD.nullable().optional(),missing:Y({why:K()}).nullable().optional()}).catchall(q()),KD=Y({path:Z.optional(),digest:Z.optional(),source:Z.optional(),condition:Z.optional(),checkCondition:Z.optional(),metrics:J(GD)}).catchall(q()),qD=J(Y({label:K(),at:Z.optional(),clause:Z.optional(),due:RE().optional(),measured:Y({publishedTags:X.optional(),bestStage:GE([K(),Y({reached:X.optional(),of:X.optional(),stage:Z.optional(),tag:Z.optional()}).catchall(q())]).nullable().optional(),checksOnCommit:X.optional()}).catchall(q()).nullable().optional()}).catchall(q())),JD=Y({status:K(),sentence:K(),current:HD.nullable().optional(),bestCurrent:HD.nullable().optional(),bestEver:HD.nullable().optional(),releases:Y({published:X,checked:X,withheld:X,superseded:X,passingCurrent:X,neverChecked:X,checker:Z,checkedCurrent:X,checkedCurrentTags:J(K()),neverCheckedCurrent:X,source:Z}).partial().catchall(q()).nullable().optional(),lastEnding:Y({runId:K(),run:Z.optional(),word:K(),glyph:Z.optional(),at:Z.optional(),reason:Z.optional(),startedAt:Z.optional(),wallHours:X.optional(),status:TD.optional(),blocker:VD.nullable().optional(),killCheckpoints:qD.optional()}).catchall(q()).nullable().optional(),cost:Y({apiEquivalentUsd:X.optional(),provenance:Z.optional(),priced:X.optional(),started:X.optional(),unpriced:J(K()).optional(),unmetered:J(K()).optional(),neverStarted:J(K()).optional(),seatNow:Y({seat:Z,kind:Z}).catchall(q()).nullable().optional(),billed:GE([K(),PE()]).nullable().optional()}).catchall(q()).nullable().optional()}).catchall(q()),YD=Y({runId:K(),run:Z.optional(),startedAt:Z.optional(),elapsedMs:X.optional(),word:Z.optional(),blocker:VD.nullable().optional(),killCheckpoints:qD.optional()}).catchall(q()),XD=Y({kind:K(),parentRun:Z.optional(),parentTag:Z.optional(),commit:Z.optional(),basis:Z.optional(),why:Z.optional()}).catchall(q()).nullable(),ZD=Y({groups:J(Y({runId:K(),label:K(),from:Z.optional(),to:Z.optional(),end:Y({kind:K(),glyph:Z.optional(),label:Z.optional()}).catchall(q()).nullable().optional(),checked:X.optional(),published:X.optional(),withheld:X.optional(),superseded:X.optional(),noTag:X.optional(),unscored:RE().optional(),lineage:XD.optional(),summary:Z.optional(),untagged:X.optional(),note:Z.optional(),calibration:RD.nullable().optional(),held:Y({stages:J(K()),label:Z.optional()}).catchall(q()).nullable().optional()}).catchall(q())),columns:J(Y({id:K(),runId:K(),tag:Z.optional(),commit:Z.optional(),order:PE().optional(),at:Z.optional(),state:Z.optional(),weight:X.optional(),tags:J(K()).optional(),label:Z.optional()}).catchall(q())),gaps:J(Y({afterColumnId:K(),hours:PE()}).catchall(q())).optional(),y:Y({label:Z.optional(),gridlines:J(Y({at:PE(),label:K()})).optional()}).catchall(q()).nullable().optional(),marks:J(Y({id:K(),columnId:K(),kind:K(),scope:Z.optional(),checker:Z.optional(),verdict:K(),progress:X,count:X.optional(),firstAt:Z.optional(),lastAt:Z.optional(),stage:Z.optional(),reached:X.optional(),of:X.optional(),workloads:zD.optional(),line:Z.optional(),source:Z.optional(),calibration:LD.nullable().optional()}).catchall(q())),strip:J(Y({columnId:Z.optional(),runId:K(),kind:K(),checker:Z.optional(),verdict:K(),count:X.optional(),firstAt:Z.optional(),lastAt:Z.optional(),line:Z.optional(),source:Z.optional(),calibration:LD.nullable().optional(),score:Y({stage:Z.optional(),reached:X.optional(),of:X.optional(),workloads:Y({passed:X.optional(),total:X.optional()}).nullable().optional()}).catchall(q()).nullable().optional()}).catchall(q())).optional(),rulings:J(Y({at:K(),dispute:Z.optional(),verdict:K(),by:Z.optional(),line:Z.optional(),reason:Z.optional(),newDigest:Z.optional(),checkerFrom:Z.optional(),checkerTo:Z.optional()}).catchall(q())).optional(),best:Z.optional(),bestEver:Z.optional()}).catchall(q()),QD=J(Y({metric:K(),points:J(Y({columnId:K(),value:PE(),verdict:Z.optional(),comparable:RE().nullable().optional(),note:Z.optional(),basis:Z.optional()}).catchall(q())),missing:Y({why:K()}).nullable().optional()}).catchall(q())),$D=Y({rows:J(Y({runId:K(),label:Z.optional(),lineage:XD.optional(),ending:Y({word:K(),glyph:Z.optional(),reason:Z.optional(),status:TD.optional()}).catchall(q()).nullable().optional(),startedAt:Z.optional(),settledAt:Z.optional(),wallHours:X.optional(),idleHours:X.optional(),agentHours:X.optional(),hoursByOutcome:YE(K(),PE()).nullable().optional(),triesByOutcome:YE(K(),PE()).nullable().optional(),outcomeBasis:Z.optional(),outcomeNotes:GE([K(),J(K()),YE(K(),K())]).nullable().optional(),open:Y({agent:Z.optional(),since:Z.optional(),hours:X.optional()}).catchall(q()).nullable().optional(),completedShare:X.optional(),contractBlockedShare:X.optional(),best:HD.nullable().optional(),cost:Y({apiUsd:X.optional(),provenance:Z.optional(),billedUsd:X.optional()}).catchall(q()).nullable().optional(),seat:Z.optional(),seatKind:Z.optional(),tokens:Y({in:X.optional(),out:X.optional(),cacheRead:X.optional(),known:X.optional()}).catchall(q()).nullable().optional(),agents:X.optional(),depth:X.optional(),model:Z.optional(),harness:Z.optional(),inputDiffers:Z.optional()}).catchall(q())),runsShown:X.optional(),runsTotal:X.optional(),page:X.optional(),olderSummary:Y({runs:PE(),endings:YE(K(),PE())}).catchall(q()).nullable().optional()}).catchall(q()),eO=Y({tag:K(),runId:K(),run:Z.optional(),columnId:Z.optional(),commit:Z.optional(),taggedAt:Z.optional(),firstCheckedAt:Z.optional(),state:Z.optional(),gate:Y({verdict:Z,count:X.optional(),line:Z.optional()}).catchall(q()).nullable().optional(),checks:YE(K(),Y({verdict:Z,count:X.optional(),progress:X.optional(),stage:Z.optional(),of:X.optional(),workloads:zD.optional()}).catchall(q())).optional(),metrics:YE(K(),q()).nullable().optional(),findings:J(K()).optional(),take:Y({enabled:RE(),why:Z.optional()}).catchall(q()).nullable().optional()}).catchall(q());Z.optional(),ZE([`verified`,`contradicted`,`mixed`,`undecided`,`unchecked`]).or(K()).optional(),Z.optional(),Z.optional(),J(Y({sha:K(),tag:Z.optional(),run:Z.optional(),verdict:Z.optional(),checker:Z.optional(),kind:Z.optional(),line:Z.optional(),at:Z.optional(),workloads:zD.optional(),reached:X.optional(),of:X.optional()}).catchall(q())).optional(),J(K()).optional(),Z.optional(),Y({text:K(),full:Z.optional(),source:Z.optional(),runId:Z.optional()}).catchall(q()).nullable().optional(),J(UD).optional(),KD.nullable().optional(),JD.nullable().optional(),YD.nullable().optional(),ZD.nullable().optional(),QD.nullable().optional(),$D.nullable().optional(),J(eO).nullable().optional(),PD.optional();var tO=e=>{if(!e)return null;let t=new Date(e);if(!Number.isFinite(t.valueOf()))return null;let n=t.toISOString();return`${n.slice(5,10)} ${n.slice(11,16)}Z`},nO={solved:`passed`,"not-solved":`no pass yet`,"contract-held":`contract held`,"contract-failed":`fails the contract`,undecided:`unverified`,held:`check passed; held`,superseded:`superseded`,"no-tag":`not checked`},rO={solved:`✓`,died:`□`,crashed:`□`,cancelled:`⊘`,stalled:`⏸`,live:`▶`,"never started":`·`,ended:`○`,attention:`▲`,lost:`△`,unknown:`◌`,fail:`■`},iO={published:`published`,withheld:`not published`,superseded:`superseded`,unknown:`state unknown`};iO.withheld,iO.withheld,nO[`not-solved`],nO.undecided;var aO=e=>e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:e<36e5?`${(e/6e4).toFixed(1)} min`:`${(e/36e5).toFixed(1)} h`,oO=(e,t,n,r)=>({axis:e,word:t,tone:n,shape:r}),sO=/operator|cancel/,cO=new Set([`failed`,`driver-failed`,`died`]),lO=864e5,uO=`Discovery operator`;function dO({endedAt:e,newerStarted:t,now:n=Date.now()}){let r=e?Date.parse(e):NaN;return t===!1&&Number.isFinite(r)&&n-r>=0&&n-r<lO}function fO(e){let{state:t,reason:n,stopCause:r,elapsedMs:i}=e,a=`${r??``} ${n??``}`;switch(t){case`running`:case`building`:case`live`:return oO(`run`,`Running${i!=null&&i>0?` ${aO(i)}`:``}`,`attention`,rO.live);case`winner`:case`solved`:return oO(`result`,`Passed`,`pass`,rO.solved);case`stalled`:return oO(`run`,`Stopped by Lab (stall)`,`neutral`,rO.stalled);case`cancelled`:case`operator-cancel`:return oO(`run`,`Stopped by operator`,`neutral`,rO.cancelled);case`budget-exhausted`:return oO(`run`,`Stopped by Lab (budget)`,`neutral`,rO.stalled);case`no-winner`:return/budget-exhausted/.test(a)?oO(`run`,`Stopped by Lab (budget)`,`neutral`,rO.stalled):/stall/.test(a)?oO(`run`,`Stopped by Lab (stall)`,`neutral`,rO.stalled):sO.test(a)?oO(`run`,`Stopped by operator`,`neutral`,rO.cancelled):oO(`run`,`Finished`,`neutral`,rO.ended);case`no-result-selected`:case`done`:case`complete`:return oO(`run`,`Finished`,`neutral`,rO.ended);case`abandoned`:return oO(`run`,`Ended`,`neutral`,rO.ended);case`never started`:case`never-started`:case`not-started`:return oO(`run`,`Not started`,`neutral`,rO[`never started`]);case`no-record`:case`missing`:case`legacy`:case`unknown`:case null:case void 0:return oO(`run`,`No record`,`neutral`,rO.unknown);default:if(cO.has(t)){let n=t===`driver-failed`?`Crashed (driver)`:`Crashed`;return dO(e)?oO(`run`,`${n} · act now: ${uO}`,`fail`,rO.fail):oO(`run`,n,`neutral`,rO.crashed)}return oO(`run`,t.replaceAll(`-`,` `),`neutral`,rO.ended)}}function pO(e){let{verdict:t,current:n=!0,checker:r,waiting:i=!1,passed:a,total:o,held:s}=e;if(t===`held`)return oO(`result`,`check passed; held: stages ${s?.length?s.join(`, `):`(not named)`} have no known-good fixture`,`neutral`,rO.unknown);let c=r?` ${n?``:`under `}${r}${n?``:` (retired)`}`:``,l=a!=null&&o?` · ${a}/${o}`:``;return t===`solved`||t===`contract-held`||t===`pass`||t===`met`?n?oO(`result`,`Passed${r?` ${r}`:``}`,`pass`,rO.solved):oO(`result`,`Passed${r?` ${r}`:``} (superseded)`,`neutral`,rO.ended):t===`undecided`||t===`inconclusive`||t===`error`||t==null||t===`unknown`?i?oO(`result`,`Unverified`,`attention`,rO.attention):oO(`result`,`Unverified${n?``:c}`,`neutral`,rO.unknown):t===`superseded`?oO(`result`,`Superseded`,`neutral`,rO.ended):t===`no-tag`?oO(`result`,`Not checked`,`neutral`,rO.unknown):oO(`result`,`No pass yet${n?``:c}${l}`,`neutral`,rO.ended)}function mO({cause:e,label:t,live:n,actNow:r=null}){switch(e){case`stopped`:return oO(`cause`,`Stopped by Lab or operator`,`neutral`,rO.cancelled);case`budget-exhausted`:return oO(`cause`,`Stopped by Lab (budget)`,`neutral`,rO.stalled);case`rate-limited`:return oO(`cause`,`Quota hit`,n?`attention`:`neutral`,n?rO.attention:rO.stalled);case`platform-lost`:return n?r?oO(`cause`,`Platform lost the turn · act now: ${r}`,`fail`,rO.lost):oO(`cause`,`Platform lost the turn`,`attention`,rO.lost):oO(`cause`,`Platform lost the turn`,`neutral`,rO.lost);default:return oO(`cause`,t??e.replaceAll(`-`,` `),`neutral`,rO.ended)}}function hO(e){switch(e.axis){case`run`:return fO(e);case`result`:return pO(e);case`alert`:return e.tone===`crit`||e.live&&e.severity===`red`?oO(`alert`,`act now`,`fail`,rO.fail):e.live&&e.severity?oO(`alert`,`Blocked`,`attention`,rO.attention):!e.live&&e.severity?oO(`alert`,`past`,`neutral`,rO.ended):oO(`alert`,e.tone===`info`?`cleared`:`not urgent`,`neutral`,rO.ended);case`agent`:return!e.live||e.status===`done`||e.status===`ended`?oO(`agent`,`Ended`,`neutral`,rO.ended):e.status===`down`?oO(`agent`,`Down · act now: ${uO}`,`fail`,rO.fail):e.status===`running`||e.status===`working`||!e.status?oO(`agent`,`Working`,`neutral`,rO.live):oO(`agent`,`Waiting`,`neutral`,rO.stalled);case`cause`:return mO(e);case`measure`:return e.side===`within`||e.side===`past`?oO(`measure`,e.side===`within`?`within the bar`:`past the bar`,`pass`,`●`):oO(`measure`,e.side===`short`?`short of the bar`:`no bar comparison`,`neutral`,`○`);case`release`:return e.state===`published`||!e.state?oO(`release`,`Published`,`neutral`,rO.ended):e.state===`withheld`?oO(`release`,`not published`,`neutral`,rO.ended):oO(`release`,e.state===`superseded`?`superseded`:`state unknown`,`neutral`,rO.unknown)}}var gO=e=>`${e.axis}:${e.word}:${e.tone}`,_O=e=>Date.parse(e);function vO(e,t=!1){let n=new Date(e);if(!Number.isFinite(n.valueOf()))return`Unknown time`;let r=n.toISOString();return`${t?r.slice(0,19).replace(`T`,` `):r.slice(11,19)} UTC`}var yO=e=>e.replace(/\s+/g,` `).trim(),bO=/\/(?:home|Users)\/[^/\s"'`]+(?:\/\.cache\/disco\/host\/[^/\s"'`]+(?:\/sessions\/[^/\s"'`]+)?)?(\/?)/g;function xO(e){return!e||!(e.includes(`/home/`)||e.includes(`/Users/`))?e:e.replace(bO,(e,t,n,r)=>{if(!e.includes(`/.cache/disco/host/`))return t?`~/`:`~`;let i=r[n+e.length];return t&&i!==void 0&&!/[\s"'`)]/.test(i)?``:`./`})}function SO(e){let t=e.detail,n=xO(t.publicText),r=xO(t.reasoning),i=t.publicToolCalls?.map(e=>e.input&&xO(e.input)!==e.input?{...e,input:xO(e.input)}:e);return n===t.publicText&&r===t.reasoning&&i?.every((e,n)=>e===t.publicToolCalls[n])!==!1?e:{...e,detail:{...t,...n===void 0?{}:{publicText:n},...r===void 0?{}:{reasoning:r},...i?{publicToolCalls:i}:{}}}}var CO=e=>new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}).format(e),wO=e=>e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`,TO=e=>e?.role??(e?.kind===`session`?`Session`:e?.kind===`finding`?`Finding`:`Agent`),EO=e=>e.detail.publicText??e.detail.recordedClaim??``,DO=(e,t)=>JSON.stringify([e,t]);function OO(e){let t=e.detail.publicToolCalls??[],n=new Map(t.map(e=>[e.id,e]));return[...new Set([...e.detail.toolCallIds??[],...t.map(e=>e.id)])].map(t=>n.get(t)??{id:t,name:e.detail.toolNames?.length===1?e.detail.toolNames[0]:`Tool call`})}var kO=e=>e.replace(/^[a-z0-9][\w.-]*-\d{8}[a-z]?:/i,``);function AO(e){if(e.input===void 0)return`args not captured`;try{let t=JSON.parse(e.input);if(t&&typeof t==`object`&&!Array.isArray(t)){let e=t;for(let t of[`command`,`cmd`,`filePath`,`file_path`,`path`,`query`,`question`,`pattern`,`url`,`pageId`,`title`,`task`,`prompt`,`message`])if(typeof e[t]==`string`&&e[t])return yO(kO(e[t]));let n=Object.values(e).filter(e=>[`string`,`number`,`boolean`].includes(typeof e));if(n.length)return yO(n.map(e=>kO(String(e))).join(` · `))}}catch{}return yO(e.input)}function jO(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=e=>t.get(e)?.agentId??e,r=e.nodes.filter(e=>e.kind!==`session`||!e.agentId),i=e.events.map(SO).sort((e,t)=>_O(e.at)-_O(t.at)),a=new Map(i.map(e=>[e.id,e])),o=new Map(e.events.map((e,t)=>[e.id,t])),s=new Map,c=new Map,l=new Map;for(let e of i){let t=n(e.node),r=s.get(t)??[];r.push(e),s.set(t,r);for(let t of OO(e)){let n=DO(e.node,t.id),r=l.get(n)??[];r.push({event:e,call:t}),l.set(n,r)}if(e.detail.toolCallId!==void 0){let t=DO(e.node,e.detail.toolCallId),n=c.get(t)??[];n.push(e),c.set(t,n)}}let u=i.map(e=>_O(e.at)),d=u[0]??0;return{nodes:t,canonical:n,actors:r,events:i,byEvent:a,recordedOrder:o,byActor:s,calls:l,results:c,start:d,end:i.reduce((e,t)=>Math.max(e,t.end?_O(t.end):_O(t.at)),u.at(-1)??d)}}function MO(e,t,n,r){return(r===`all`||r===`prompts`&&(e.detail.promptKind===`initial`||e.detail.promptKind===`steering`)||e.category===r||r===`findings`&&(e.kind===`finding-record`||e.detail.recordedClaim!==void 0))&&(!n||JSON.stringify({label:e.label,node:t.nodes.get(t.canonical(e.node)),detail:e.detail}).toLowerCase().includes(n))}function NO(e,t,n){let r=n.nodes.get(e.node);return{...e.source,runId:t.runId,at:e.at,observedNodeId:e.node,agentId:r?.kind===`agent`?r.id:r?.agentId??null,nativeSessionId:r?.nativeSessionId??null,joinBasis:r?.joinBasis??null,joinProof:r?.joinProof??null}}function PO(e,t){if(!e)return null;let n=[...new Set(t.nodes.filter(t=>t.agentId===e.id||t.id===e.id).map(e=>e.servedModel).filter(e=>!!e))];return n.length?`${n.join(`, `)} (served)`:e.model?`${e.model} (declared; served model unknown)`:null}function FO(e,t,n){let r=t.nodes.get(t.canonical(e.node)),i=e.detail.isError===!0||e.detail.responseStatus===`error`,a=e.detail.role??e.kind,o=e.label||a,s=[{kind:`header`,value:`${r?.label??e.node} · ${vO(e.at)}`,tone:`muted`}];if(_O(e.at)>n)return s.push({kind:`note`,value:`After the selected time. Select this event to advance.`}),{title:o,category:a,tone:i?`error`:`default`,sections:s};e.detail.isError&&s.push({kind:`status`,value:`Tool error`,tone:`error`}),e.detail.responseStatus===`error`&&s.push({kind:`status`,value:`Request failed`,tone:`error`});let c=EO(e);c&&s.push({kind:`body`,value:c.slice(0,200)+(c.length>200?`…`:``)});let l=OO(e);for(let e of l.slice(0,2))s.push({kind:`body`,label:e.name,value:AO(e).slice(0,160)});let u=e.detail.usage;if(u&&!e.detail.usageScope){let e=[];u.input!==void 0&&e.push(`↑ ${CO(u.input)}`),u.output!==void 0&&e.push(`↓ ${CO(u.output)}`),u.cacheRead!==void 0&&e.push(`⟳ ${CO(u.cacheRead)}`),u.cacheWrite!==void 0&&e.push(`→ ${CO(u.cacheWrite)}`),e.length&&s.push({kind:`usage`,value:e.join(` `),tone:`accent`})}let d=e.detail.durationMs;return typeof d==`number`&&s.push({kind:`status`,value:`⏱ ${d<1e3?`${d}ms`:`${(d/1e3).toFixed(1)}s`}`,tone:`muted`}),{title:o,category:a,tone:i?`error`:`default`,sections:s}}function IO({index:e,actor:t,cutoff:n,select:r}){let i=(0,b.useMemo)(()=>{let t=e.actors.filter(e=>e.kind!==`finding`),n=new Map(t.map(e=>[e.id,e])),r=new Map;for(let n of t){if(!n.parent)continue;let t=e.canonical(n.parent),i=r.get(t)??[];i.push(n),r.set(t,i)}let i=new Set,a=e=>i.has(e.id)?[]:(i.add(e.id),[{node:e,children:(r.get(e.id)??[]).flatMap(a)}]),o=t.filter(t=>!t.parent||!n.has(e.canonical(t.parent))).flatMap(a);for(let e of t)o.push(...a(e));return o},[e]),a=(i,o=!1)=>(0,A.jsx)(`ul`,{className:o?`graph-branch`:`graph-list`,children:i.map(({node:i,children:o})=>{let s=e.byActor.get(i.id)?.[0],c=i.start?_O(i.start):s?_O(s.at):void 0,l=c!==void 0&&c>n,u=i.end!==void 0&&_O(i.end)<=n,d=hO({axis:`agent`,status:i.status,live:!u}),f=l?`Not yet started`:u?i.status===`done`?`Finished`:i.status===`down`?`Stopped`:i.status??`Ended`:i.end?`Not yet settled`:`No terminal record`;return(0,A.jsxs)(`li`,{className:`graph-item`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`graph-node ${t===i.id?`selected`:``} ${l?`future`:``}`,"aria-label":`Read ${TO(i)} ${i.label} conversation. ${f}.`,"aria-pressed":t===i.id,"data-node":i.id,title:`${i.label}${i.assignment?` · ${i.assignment}`:``} · ${f}`,onClick:()=>r(i.id),children:[(0,A.jsx)(`span`,{className:`graph-state`,"data-status":gO(d),"aria-hidden":`true`,children:d.shape}),(0,A.jsxs)(`span`,{className:`graph-copy`,children:[(0,A.jsx)(`span`,{className:`graph-label`,children:i.label}),(0,A.jsxs)(`span`,{className:`graph-meta`,children:[TO(i),` · `,f]})]})]}),o.length>0&&a(o,!0)]},i.id)})});return(0,A.jsx)(`div`,{className:`graph-scroll`,"data-graph":!0,role:`group`,"aria-label":`Recorded agent hierarchy. Select an agent to read its conversation.`,children:i.length>0?a(i):(0,A.jsx)(`p`,{className:`axis-label`,children:`No agent topology was retained.`})})}function LO(e){try{return JSON.parse(e)}catch{return e}}function RO({text:e,resolveHref:t}){return(0,A.jsx)(`div`,{className:`activity-prose`,children:(0,A.jsx)(ic,{skipHtml:!0,remarkPlugins:[md],components:{a:({href:e,children:n})=>{let r=/^https?:\/\//i.test(e??``)?e:t?.(e??``);return r&&(/^https?:\/\//i.test(r)||/^\/(?!\/)/.test(r))?(0,A.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,children:n}):(0,A.jsx)(`span`,{children:n})},img:({alt:e})=>(0,A.jsx)(`span`,{children:e||`Image omitted`}),table:({children:e})=>(0,A.jsx)(`div`,{className:`rr-table-scroll`,children:(0,A.jsx)(`table`,{children:e})})},children:e})})}function zO({value:e,depth:t=0,field:n}){let[r,i]=(0,b.useState)(!1);if(e==null)return(0,A.jsx)(`span`,{className:`small`,children:`Not supplied`});if(typeof e==`string`){if(n&&/^(command|cmd|code|script|stdout|stderr)$/i.test(n))return(0,A.jsx)(`pre`,{className:`activity-code`,children:(0,A.jsx)(`code`,{children:e})});let r=t<3?LO(e):e;return typeof r==`string`?(0,A.jsx)(RO,{text:e}):(0,A.jsx)(zO,{value:r,depth:t+1})}if(typeof e!=`object`)return(0,A.jsx)(`span`,{children:String(e)});if(Array.isArray(e)){let n=r?e:e.slice(0,12);return(0,A.jsxs)(`div`,{className:`structured-items`,children:[n.map((e,n)=>(0,A.jsx)(`div`,{children:(0,A.jsx)(zO,{value:e,depth:t+1})},n)),e.length>n.length&&(0,A.jsxs)(`button`,{className:`ui-button`,onClick:()=>i(!0),children:[`Show all `,e.length,` items`]})]})}let a=e;if(a.type===`text`&&typeof a.text==`string`)return(0,A.jsx)(zO,{value:a.text,depth:t+1});let o=Object.entries(a),s=r?o:o.slice(0,16);return t>4?(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{children:`Nested data`}),(0,A.jsx)(`pre`,{children:JSON.stringify(e,null,2)})]}):(0,A.jsxs)(`dl`,{className:`structured-fields`,children:[s.map(([e,n])=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:e.replace(/([a-z])([A-Z])/g,`$1 $2`).replaceAll(`_`,` `)}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(zO,{value:n,depth:t+1,field:e})})]},e)),o.length>s.length&&(0,A.jsxs)(`button`,{className:`ui-button`,onClick:()=>i(!0),children:[`Show all `,o.length,` fields`]})]})}function BO({text:e,rawLabel:t=`Raw data`}){let n=LO(e);return(0,A.jsxs)(`div`,{className:`structured-content`,children:[(0,A.jsx)(zO,{value:n}),typeof n!=`string`&&(0,A.jsxs)(`details`,{className:`raw-data`,children:[(0,A.jsx)(`summary`,{children:t}),(0,A.jsx)(`pre`,{children:e})]})]})}function VO({items:e,keyOf:t,render:n,scroller:r,estimate:i=96,overscan:a=900,target:o}){let s=(0,b.useRef)(new Map),[c,l]=(0,b.useState)(0),[u,d]=(0,b.useState)({top:0,height:900}),f=(0,b.useRef)(null),p=(0,b.useRef)(new Map),m=(0,b.useRef)(0),h=e=>{!f.current&&typeof ResizeObserver<`u`&&(f.current=new ResizeObserver(e=>{let t=!1;for(let n of e){let e=p.current.get(n.target);if(!e)continue;let r=Math.ceil(n.borderBoxSize?.[0]?.blockSize??n.target.offsetHeight);r>0&&s.current.get(e)!==r&&(s.current.set(e,r),t=!0)}t&&!m.current&&(m.current=requestAnimationFrame(()=>{m.current=0,l(e=>e+1)}))})),f.current?.observe(e)};(0,b.useEffect)(()=>()=>{cancelAnimationFrame(m.current),f.current?.disconnect(),f.current=null,p.current.clear()},[]),(0,b.useEffect)(()=>{let e=r.current;if(!e)return;let t=0,n=()=>{t=0,d(t=>t.top===e.scrollTop&&t.height===e.clientHeight?t:{top:e.scrollTop,height:e.clientHeight})},i=()=>{t||=requestAnimationFrame(n)};n(),e.addEventListener(`scroll`,i,{passive:!0});let a=new ResizeObserver(i);return a.observe(e),()=>{cancelAnimationFrame(t),e.removeEventListener(`scroll`,i),a.disconnect()}},[r]);let g=(0,b.useMemo)(()=>{let n=new Float64Array(e.length+1),r=typeof i==`function`?i:()=>i;for(let i=0;i<e.length;i++)n[i+1]=n[i]+(s.current.get(t(e[i]))??r(e[i]));return n},[e,t,i,c]),_=t=>{let n=0,r=e.length;for(;n<r;){let e=n+r>>1;g[e+1]<=t?n=e+1:r=e}return n},v=Math.max(0,_(u.top-a)),y=Math.min(e.length,_(u.top+u.height+a)+1),x=(0,b.useCallback)((n,i)=>{let a=r.current,o=e.findIndex(e=>t(e)===n);if(!a||o<0)return!1;let s=g[o],c=g[o+1];return(i||s<a.scrollTop||c>a.scrollTop+a.clientHeight)&&(a.scrollTop=Math.max(0,s-8)),!0},[e,t,g,r]),S=(0,b.useRef)(null),C=(0,b.useRef)(new Map),w=()=>{let e=S.current;if(!e)return;if(performance.now()>e.until){S.current=null;return}if(!x(e.key,!0))return;let t=C.current.get(e.key);if(t?.isConnected){let e=t.getBoundingClientRect();(e.top<72||e.top>window.innerHeight-96)&&window.scrollBy({top:e.top-120})}};(0,b.useLayoutEffect)(()=>{S.current=o?{key:o,until:performance.now()+2e3}:null,w()},[o]),(0,b.useLayoutEffect)(w,[c,u,e]),(0,b.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{S.current=null};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`pointerdown`,t),e.addEventListener(`keydown`,t),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchstart`,t),e.removeEventListener(`pointerdown`,t),e.removeEventListener(`keydown`,t)}},[r]);let T=e=>t=>{if(!t){C.current.delete(e);return}C.current.set(e,t);for(let[n,r]of p.current)r===e&&n!==t&&(f.current?.unobserve(n),p.current.delete(n));p.current.has(t)||(p.current.set(t,e),h(t))};return(0,b.useEffect)(()=>{for(let e of[...p.current.keys()])e.isConnected||(f.current?.unobserve(e),p.current.delete(e))}),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{style:{height:g[v]},"aria-hidden":`true`}),e.slice(v,y).map((e,r)=>{let i=t(e);return(0,A.jsx)(`div`,{ref:T(i),className:`virtual-row`,children:n(e,v+r)},i)}),(0,A.jsx)(`div`,{style:{height:g[e.length]-g[y]},"aria-hidden":`true`})]})}var HO=`tangle-transcript-text text-[length:var(--transcript-font-size)] leading-[var(--transcript-line-height)]`;function UO(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=UO(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function WO(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=UO(e))&&(r&&(r+=` `),r+=t);return r}var GO=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},KO=(e,t)=>({classGroupId:e,validator:t}),qO=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),JO=`-`,YO=[],XO=`arbitrary..`,ZO=e=>{let t=ek(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return $O(e);let n=e.split(JO);return QO(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?GO(i,t):t:i||YO}return n[e]||YO}}},QO=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=QO(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(JO):e.slice(t).join(JO),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},$O=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?XO+r:void 0})(),ek=e=>{let{theme:t,classGroups:n}=e;return tk(n,t)},tk=(e,t)=>{let n=qO();for(let r in e){let i=e[r];nk(i,n,r,t)}return n},nk=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];rk(i,t,n,r)}},rk=(e,t,n,r)=>{if(typeof e==`string`){ik(e,t,n);return}if(typeof e==`function`){ak(e,t,n,r);return}ok(e,t,n,r)},ik=(e,t,n)=>{let r=e===``?t:sk(t,e);r.classGroupId=n},ak=(e,t,n,r)=>{if(ck(e)){nk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(KO(n,e))},ok=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];nk(o,sk(t,a),n,r)}},sk=(e,t)=>{let n=e,r=t.split(JO),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=qO(),n.nextPart.set(t,i)),n=i}return n},ck=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,lk=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},uk=`!`,dk=`:`,fk=[],pk=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),mk=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===dk){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(uk)?(c=s.slice(0,-1),l=!0):s.startsWith(uk)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return pk(t,l,c,u)};if(t){let e=t+dk,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):pk(fk,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},hk=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},gk=e=>({cache:lk(e.cacheSize),parseClassName:mk(e),sortModifiers:hk(e),postfixLookupClassGroupIds:_k(e),...ZO(e)}),_k=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},vk=/\s+/,yk=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(vk),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+uk:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},bk=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=xk(n))&&(i&&(i+=` `),i+=r);return i},xk=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=xk(e[r]))&&(n&&(n+=` `),n+=t);return n},Sk=(e,...t)=>{let n,r,i,a,o=o=>(n=gk(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=yk(e,n);return i(e,a),a};return a=o,(...e)=>a(bk(...e))},Ck=[],wk=e=>{let t=t=>t[e]||Ck;return t.isThemeGetter=!0,t.themeKey=e,t},Tk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ek=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dk=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ok=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ak=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,jk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nk=e=>Dk.test(e),Pk=e=>!!e&&!Number.isNaN(Number(e)),Fk=e=>!!e&&Number.isInteger(Number(e)),Ik=e=>e.endsWith(`%`)&&Pk(e.slice(0,-1)),Lk=e=>Ok.test(e),Rk=()=>!0,zk=e=>kk.test(e)&&!Ak.test(e),Bk=()=>!1,Vk=e=>jk.test(e),Hk=e=>Mk.test(e),Uk=e=>!Q(e)&&!$(e),Wk=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Gk=e=>oA(e,uA,Bk),Q=e=>Tk.test(e),Kk=e=>oA(e,dA,zk),qk=e=>oA(e,fA,Pk),Jk=e=>oA(e,mA,Rk),Yk=e=>oA(e,pA,Bk),Xk=e=>oA(e,cA,Bk),Zk=e=>oA(e,lA,Hk),Qk=e=>oA(e,hA,Vk),$=e=>Ek.test(e),$k=e=>sA(e,dA),eA=e=>sA(e,pA),tA=e=>sA(e,cA),nA=e=>sA(e,uA),rA=e=>sA(e,lA),iA=e=>sA(e,hA,!0),aA=e=>sA(e,mA,!0),oA=(e,t,n)=>{let r=Tk.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},sA=(e,t,n=!1)=>{let r=Ek.exec(e);return r?r[1]?t(r[1]):n:!1},cA=e=>e===`position`||e===`percentage`,lA=e=>e===`image`||e===`url`,uA=e=>e===`length`||e===`size`||e===`bg-size`,dA=e=>e===`length`,fA=e=>e===`number`,pA=e=>e===`family-name`,mA=e=>e===`number`||e===`weight`,hA=e=>e===`shadow`,gA=Sk(()=>{let e=wk(`color`),t=wk(`font`),n=wk(`text`),r=wk(`font-weight`),i=wk(`tracking`),a=wk(`leading`),o=wk(`breakpoint`),s=wk(`container`),c=wk(`spacing`),l=wk(`radius`),u=wk(`shadow`),d=wk(`inset-shadow`),f=wk(`text-shadow`),p=wk(`drop-shadow`),m=wk(`blur`),h=wk(`perspective`),g=wk(`aspect`),_=wk(`ease`),v=wk(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[Nk,`full`,`auto`,...w()],ee=()=>[Fk,`none`,`subgrid`,$,Q],E=()=>[`auto`,{span:[`full`,Fk,$,Q]},Fk,$,Q],te=()=>[Fk,`auto`,$,Q],ne=()=>[`auto`,`min`,`max`,`fr`,$,Q],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],D=()=>[`auto`,...w()],ae=()=>[Nk,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],oe=()=>[s,Nk,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],se=()=>[Nk,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,$,Q],ce=()=>[...b(),tA,Xk,{position:[$,Q]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,nA,Gk,{size:[$,Q]}],de=()=>[Ik,$k,Kk],fe=()=>[``,`none`,`full`,l,$,Q],pe=()=>[``,Pk,$k,Kk],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[Pk,Ik,tA,Xk],_e=()=>[``,`none`,m,$,Q],ve=()=>[`none`,Pk,$,Q],ye=()=>[`none`,Pk,$,Q],be=()=>[Pk,$,Q],xe=()=>[Nk,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Lk],breakpoint:[Lk],color:[Rk],container:[Lk],"drop-shadow":[Lk],ease:[`in`,`out`,`in-out`],font:[Uk],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Lk],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Lk],shadow:[Lk],spacing:[`px`,Pk],text:[Lk],"text-shadow":[Lk],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Nk,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[Wk],columns:[{columns:[Pk,`auto`,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Fk,`auto`,$,Q]}],basis:[{basis:[Nk,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Pk,Nk,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Pk,$,Q]}],shrink:[{shrink:[``,Pk,$,Q]}],order:[{order:[Fk,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ae()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...ae()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ae()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ae()]}],h:[{h:[`screen`,`lh`,...ae()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ae()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ae()]}],"font-size":[{text:[`base`,n,$k,Kk]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,aA,Jk]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ik,Q]}],"font-family":[{font:[eA,Yk,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Pk,`none`,$,qk]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[Pk,`from-font`,`auto`,$,Kk]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Pk,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Fk,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Fk,$,Q],radial:[``,$,Q],conic:[``,Fk,$,Q]},rA,Zk]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Pk,$,Q]}],"outline-w":[{outline:[``,Pk,$k,Kk]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`inner`,`none`,u,iA,Qk]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,iA,Qk]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Pk,Kk]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,iA,Qk]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Pk,$,Q]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Pk]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Pk]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:_e()}],brightness:[{brightness:[Pk,$,Q]}],contrast:[{contrast:[Pk,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,iA,Qk]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,Pk,$,Q]}],"hue-rotate":[{"hue-rotate":[Pk,$,Q]}],invert:[{invert:[``,Pk,$,Q]}],saturate:[{saturate:[Pk,$,Q]}],sepia:[{sepia:[``,Pk,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Pk,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Pk,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Pk,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pk,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Pk,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Pk,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Pk,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Pk,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Pk,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Pk,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Fk,$,Q]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[Pk,$k,Kk,qk]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function _A(...e){return gA(WO(e))}var vA=[`violet`,`orange`,`teal`,`blue`,`pink`,`brown`,`cyan`,`lime`],yA={violet:{surface:`border-[var(--tone-violet-border)] bg-[var(--tone-violet-bg)] text-[var(--tone-violet-text)]`,outline:`border-[var(--tone-violet-border)] bg-transparent text-[var(--tone-violet-text)]`,hover:`hover:bg-[var(--tone-violet-bg-hover)]`,selected:`border-[var(--tone-violet-border-selected)] bg-[var(--tone-violet-bg-selected)]`,icon:`text-[var(--tone-violet-icon)]`},orange:{surface:`border-[var(--tone-orange-border)] bg-[var(--tone-orange-bg)] text-[var(--tone-orange-text)]`,outline:`border-[var(--tone-orange-border)] bg-transparent text-[var(--tone-orange-text)]`,hover:`hover:bg-[var(--tone-orange-bg-hover)]`,selected:`border-[var(--tone-orange-border-selected)] bg-[var(--tone-orange-bg-selected)]`,icon:`text-[var(--tone-orange-icon)]`},teal:{surface:`border-[var(--tone-teal-border)] bg-[var(--tone-teal-bg)] text-[var(--tone-teal-text)]`,outline:`border-[var(--tone-teal-border)] bg-transparent text-[var(--tone-teal-text)]`,hover:`hover:bg-[var(--tone-teal-bg-hover)]`,selected:`border-[var(--tone-teal-border-selected)] bg-[var(--tone-teal-bg-selected)]`,icon:`text-[var(--tone-teal-icon)]`},blue:{surface:`border-[var(--tone-blue-border)] bg-[var(--tone-blue-bg)] text-[var(--tone-blue-text)]`,outline:`border-[var(--tone-blue-border)] bg-transparent text-[var(--tone-blue-text)]`,hover:`hover:bg-[var(--tone-blue-bg-hover)]`,selected:`border-[var(--tone-blue-border-selected)] bg-[var(--tone-blue-bg-selected)]`,icon:`text-[var(--tone-blue-icon)]`},pink:{surface:`border-[var(--tone-pink-border)] bg-[var(--tone-pink-bg)] text-[var(--tone-pink-text)]`,outline:`border-[var(--tone-pink-border)] bg-transparent text-[var(--tone-pink-text)]`,hover:`hover:bg-[var(--tone-pink-bg-hover)]`,selected:`border-[var(--tone-pink-border-selected)] bg-[var(--tone-pink-bg-selected)]`,icon:`text-[var(--tone-pink-icon)]`},brown:{surface:`border-[var(--tone-brown-border)] bg-[var(--tone-brown-bg)] text-[var(--tone-brown-text)]`,outline:`border-[var(--tone-brown-border)] bg-transparent text-[var(--tone-brown-text)]`,hover:`hover:bg-[var(--tone-brown-bg-hover)]`,selected:`border-[var(--tone-brown-border-selected)] bg-[var(--tone-brown-bg-selected)]`,icon:`text-[var(--tone-brown-icon)]`},cyan:{surface:`border-[var(--tone-cyan-border)] bg-[var(--tone-cyan-bg)] text-[var(--tone-cyan-text)]`,outline:`border-[var(--tone-cyan-border)] bg-transparent text-[var(--tone-cyan-text)]`,hover:`hover:bg-[var(--tone-cyan-bg-hover)]`,selected:`border-[var(--tone-cyan-border-selected)] bg-[var(--tone-cyan-bg-selected)]`,icon:`text-[var(--tone-cyan-icon)]`},lime:{surface:`border-[var(--tone-lime-border)] bg-[var(--tone-lime-bg)] text-[var(--tone-lime-text)]`,outline:`border-[var(--tone-lime-border)] bg-transparent text-[var(--tone-lime-text)]`,hover:`hover:bg-[var(--tone-lime-bg-hover)]`,selected:`border-[var(--tone-lime-border-selected)] bg-[var(--tone-lime-bg-selected)]`,icon:`text-[var(--tone-lime-icon)]`},neutral:{surface:`border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--text-secondary)]`,outline:`border-[var(--border-default)] bg-transparent text-[var(--text-secondary)]`,hover:`hover:bg-[color-mix(in_srgb,var(--surface-neutral-bg),var(--text-primary)_6%)]`,selected:`border-[var(--text-dim)] bg-[color-mix(in_srgb,var(--surface-neutral-bg),var(--text-primary)_12%)] text-[var(--text-primary)]`,icon:`text-[var(--text-dim)]`}};function bA(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return vA[(t>>>0)%vA.length]}var xA=`[transition:color_var(--motion-control),background-color_var(--motion-control),border-color_var(--motion-control),box-shadow_var(--motion-control),transform_var(--motion-control),scale_var(--motion-control),opacity_var(--motion-control)] motion-reduce:transition-none`,SA=`hover:border-[var(--ix-hover-border)] hover:shadow-[var(--ix-hover)] focus:not-focus-visible:border-[var(--ix-hover-border)] focus:not-focus-visible:shadow-[var(--ix-after)] active:border-[hsl(var(--hsl-ring))] active:shadow-[var(--ix-press)] focus-visible:shadow-none`,CA=`hover:bg-[var(--ix-hover-bg)] active:bg-[var(--ix-sel-bg)]`,wA=`bg-[var(--field-surface,var(--well))] border-[var(--field-border)] shadow-[var(--shadow-well)] hover:border-[var(--ix-hover-border)] hover:shadow-[var(--shadow-well),var(--ix-hover)]`,TA=`aria-pressed:bg-[var(--ix-sel-bg)] aria-pressed:text-[var(--accent-text)] aria-pressed:shadow-[inset_0_0_0_1px_var(--ix-sel-ring)] aria-checked:bg-[var(--ix-sel-bg)] aria-checked:text-[var(--accent-text)] aria-checked:shadow-[inset_0_0_0_1px_var(--ix-sel-ring)] aria-[current=page]:bg-[var(--ix-sel-bg)] aria-[current=page]:text-[var(--accent-text)] aria-[current=page]:shadow-[inset_0_0_0_1px_var(--ix-sel-ring)] data-[state=on]:bg-[var(--ix-sel-bg)] data-[state=on]:shadow-[inset_0_0_0_1px_var(--ix-sel-ring)] data-[state=active]:bg-[var(--ix-sel-bg)] data-[state=active]:text-[var(--accent-text)] data-[state=active]:shadow-[inset_0_0_0_1px_var(--ix-sel-ring)]`,EA=`hover:shadow-[inset_0_-2px_0_hsl(var(--hsl-ring)/0.4)] data-[state=active]:bg-[hsl(var(--hsl-ring)/0.07)] data-[state=active]:text-[var(--accent-text)] data-[state=active]:shadow-[inset_0_-2px_0_var(--ix-sel-ring)] aria-checked:bg-[hsl(var(--hsl-ring)/0.07)] aria-checked:text-[var(--accent-text)] aria-checked:shadow-[inset_0_-2px_0_var(--ix-sel-ring)]`,DA=`border-border ${xA} hover:border-[var(--border-strong)] focus:outline-hidden focus:border-[var(--focus-border)] focus:ring-3 focus:ring-[var(--focus-halo)]`;`${xA}${wA}`;var OA=`focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)]`,kA=`${OA} focus-visible:outline-offset-0`,AA=`${OA} focus-visible:-outline-offset-1 focus-visible:ring-inset`,jA=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function MA(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:jA(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var NA=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},PA=e=>{let t=NA(e);return t.charAt(0).toUpperCase()+t.slice(1)},FA=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),IA={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function LA(e){return e!=null}function RA(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??IA.width,a=e.size??e.height??IA.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?FA(...c):FA(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??IA[`stroke-width`])*Number(e.size??e.width??IA.width)/Number(t.size??t.width??IA.width):t.strokeWidth??IA[`stroke-width`];return[`svg`,{...Object.entries(IA).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&LA(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&LA(t.width)&&{[r(`width`)]:t.width},...`height`in t&&LA(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function zA(e,t={}){return RA(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var BA=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},VA=(0,b.createContext)({}),HA=()=>(0,b.useContext)(VA),UA=(0,b.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=HA()??{},y=!!c||BA(d),[x,S,C=[]]=zA(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:FA(v,s),hasA11yProp:y,attributes:d});return(0,b.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function WA(e,t=[],n=[]){let r=typeof e==`string`?MA(e,t,n):e,i=(0,b.forwardRef)(({className:e,...t},n)=>(0,b.createElement)(UA,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=PA(r.name)),i}var GA={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};GA.node;var KA=WA(GA),qA={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};qA.node;var JA=WA(qA),YA={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};YA.node;var XA=WA(YA),ZA={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};ZA.node;var QA=WA(ZA),$A={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};$A.node;var ej=WA($A),tj={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};tj.node;var nj=WA(tj),rj={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};rj.node;var ij=WA(rj),aj={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};aj.node;var oj=WA(aj),sj={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};sj.node;var cj=WA(sj),lj={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};lj.node;var uj=WA(lj),dj={name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]};dj.node;var fj=WA(dj),pj={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};pj.node;var mj=WA(pj),hj={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};hj.node;var gj=WA(hj),_j={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]};_j.node;var vj=WA(_j),yj={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};yj.node;var bj=WA(yj),xj={name:`file-search`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]};xj.node;var Sj=WA(xj),Cj={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Cj.node;var wj=WA(Cj),Tj={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Tj.node;var Ej=WA(Tj),Dj={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Dj.node;var Oj=WA(Dj),kj={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};kj.node;var Aj=WA(kj),jj={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};jj.node;var Mj=WA(jj),Nj={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};Nj.node;var Pj=WA(Nj),Fj={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Fj.node;var Ij=WA(Fj),Lj={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Lj.node;var Rj=WA(Lj),zj={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};zj.node;var Bj=WA(zj),Vj={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};Vj.node;var Hj=WA(Vj),Uj={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Uj.node;var Wj=WA(Uj),Gj={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Gj.node;var Kj=WA(Gj),qj={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};qj.node;var Jj=WA(qj),Yj={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Yj.node;var Xj=WA(Yj),Zj={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Zj.node;var Qj=WA(Zj),$j={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};$j.node;var eM=WA($j),tM={sm:`gap-1 px-2 text-xs [&_svg]:size-3`,md:`gap-1.5 px-2.5 text-sm [&_svg]:size-3.5`},nM={sm:{box:`items-start`,label:`py-[3px]`,icon:`h-[22px] items-center`},md:{box:`items-start`,label:`py-[3px]`,icon:`h-[26px] items-center`}},rM=b.forwardRef(({className:e,children:t,tone:n=`neutral`,emphasis:r=`soft`,size:i=`sm`,icon:a,onRemove:o,removeLabel:s,wrap:c=!1,...l},u)=>{let d=yA[n],f=s??(typeof t==`string`?`Remove ${t}`:`Remove`);return(0,A.jsxs)(`span`,{ref:u,className:_A(`inline-flex min-w-0 max-w-full shrink-0 rounded-md border font-medium`,tM[i],c?nM[i].box:[`items-center`,i===`sm`?`h-6`:`h-7`],r===`outline`?d.outline:d.surface,o&&(i===`sm`?`pr-0.5`:`pr-1`),e),...l,children:[a?(0,A.jsx)(`span`,{"aria-hidden":`true`,className:_A(`inline-flex shrink-0`,c&&nM[i].icon,d.icon),children:a}):null,c?(0,A.jsx)(`span`,{className:_A(`min-w-0 [overflow-wrap:anywhere]`,nM[i].label),children:t}):(0,A.jsx)(`span`,{className:`min-w-0 truncate`,title:typeof t==`string`?t:void 0,children:t}),o?(0,A.jsx)(`button`,{type:`button`,"aria-label":f,onClick:o,className:_A(`relative inline-flex shrink-0 items-center justify-center rounded-sm opacity-70 transition-[opacity,background-color] duration-150 ease-out hover:bg-[color-mix(in_srgb,currentColor_14%,transparent)] hover:opacity-100 before:absolute before:-inset-1.5 before:content-['']`,i===`sm`?`size-5`:`size-6`,c&&`mt-px`,kA),children:(0,A.jsx)(eM,{"aria-hidden":`true`})}):null]})});rM.displayName=`Tag`;var iM={xs:`size-5 rounded-[5px] text-[10px] [&_svg]:size-3`,sm:`size-6 rounded-md text-[11px] [&_svg]:size-3.5`,md:`size-8 rounded-md text-xs [&_svg]:size-4`,lg:`size-10 rounded-lg text-sm [&_svg]:size-5`,xl:`size-16 rounded-2xl text-xl [&_svg]:size-8`,"2xl":`size-20 rounded-2xl text-2xl [&_svg]:size-10`};function aM(e){let t=e.trim().split(/[\s._-]+/u).filter(Boolean);if(t.length===0)return``;let n=e=>Array.from(e)[0]??``;return(t.length===1?Array.from(t[0]).slice(0,2).join(``):n(t[0])+n(t[1])).toLocaleUpperCase()}var oM=b.forwardRef(({className:e,tone:t,size:n=`md`,src:r,icon:i,name:a,label:o,...s},c)=>{let[l,u]=b.useState(null),d=b.useRef(null);b.useEffect(()=>{let e=d.current;e?.complete&&e.naturalWidth===0&&r&&u(r)},[r]);let f=yA[t??(a?bA(a):`violet`)],p=!!r&&l!==r,m=a?aM(a):``;return(0,A.jsx)(`span`,{ref:c,role:o?`img`:void 0,"aria-label":o,"aria-hidden":!o||void 0,className:_A(`inline-flex shrink-0 select-none items-center justify-center overflow-hidden border font-semibold`,iM[n],p?`border-[var(--border-subtle)] bg-[var(--surface-neutral-bg)]`:f.surface,!p&&i?f.icon:null,e),...s,children:p?(0,A.jsx)(`img`,{ref:d,src:r,alt:``,className:`size-full object-cover`,onError:()=>u(r??null),draggable:!1}):i||m})});oM.displayName=`IconTile`;function sM(e,t){return e===void 0||e.id===t}function cM({author:e,className:t,...n}){return(0,A.jsxs)(`div`,{"data-message-author":``,className:_A(`flex min-w-0 max-w-full items-center gap-2`,t),...n,children:[(0,A.jsx)(oM,{size:`xs`,src:e.avatarUrl,name:e.name,tone:bA(e.id),className:`rounded-full`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground text-sm`,title:e.name,children:e.name}),e.role?(0,A.jsx)(rM,{size:`sm`,emphasis:`outline`,className:`max-w-[50%]`,children:e.role}):null]})}function lM({text:e}){return e.trim()?(0,A.jsxs)(`div`,{role:`note`,"aria-label":`Application note`,"data-synthetic-text":``,className:`min-w-0 rounded-md border border-dashed border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground`,children:[(0,A.jsx)(`div`,{className:`mb-1 font-medium`,children:`Application note`}),(0,A.jsx)(`div`,{className:`break-words whitespace-pre-wrap`,children:e})]}):null}function uM(e){let t=[],n=[],r=0,i=()=>{let e=n.join(`
362
- `);e.trim()&&t.push({index:r,synthetic:!1,text:e}),n=[]};return e.forEach((e,a)=>{e.type===`text`&&(e.synthetic?(i(),e.text.trim()&&t.push({index:a,synthetic:!0,text:e.text})):(n.length===0&&(r=a),n.push(e.text)))}),i(),t}function dM(e){return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function fM({children:e,align:t=`end`}){return(0,A.jsx)(`div`,{className:`flex flex-wrap items-center ${t===`end`?`justify-end`:`justify-start`} gap-1.5 text-xs text-muted-foreground`,children:e})}function pM({text:e,timestamp:t,actions:n}){return(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsxs)(`div`,{className:`group flex min-w-0 max-w-[78%] flex-col items-end gap-2`,children:[(0,A.jsxs)(`div`,{className:`relative w-full min-w-0 rounded-2xl bg-foreground px-4 py-3 text-background`,children:[t?(0,A.jsx)(`span`,{"data-user-message-time":``,className:`pointer-events-none absolute right-full top-1/2 mr-3 -translate-y-1/2 whitespace-nowrap text-[length:var(--font-size-xs)] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:dM(t)}):null,(0,A.jsx)(`div`,{className:`break-words whitespace-pre-wrap ${HO}`,children:e})]}),n?(0,A.jsx)(fM,{children:n}):null]})})}function mM({text:e,timestamp:t,actions:n,author:r}){return(0,A.jsx)(`div`,{className:`flex justify-start`,children:(0,A.jsxs)(`div`,{className:`group flex min-w-0 max-w-[78%] flex-col items-start gap-1.5`,children:[r?(0,A.jsx)(cM,{author:r}):null,(0,A.jsxs)(`div`,{className:`relative min-w-0 max-w-full rounded-2xl border border-border bg-card px-4 py-3 text-foreground`,children:[t?(0,A.jsx)(`span`,{"data-user-message-time":``,className:`pointer-events-none absolute left-full top-1/2 ml-3 -translate-y-1/2 whitespace-nowrap text-[length:var(--font-size-xs)] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:dM(t)}):null,(0,A.jsx)(`div`,{className:`break-words whitespace-pre-wrap ${HO}`,children:e})]}),n?(0,A.jsx)(fM,{align:`start`,children:n}):null]})})}var hM=(0,b.memo)(({message:e,parts:t,content:n,timestamp:r,actions:i,author:a,viewerId:o})=>{let s=sM(a,o)?void 0:a,c=(e,t,n=!0,i)=>s?(0,A.jsx)(mM,{text:e,timestamp:r,actions:t,author:n?s:void 0},i):(0,A.jsx)(pM,{text:e,timestamp:r,actions:t},i);if(n!=null)return n.trim()?c(n,i):null;let l=uM(t??[]);if(l.length===0)return null;if(l.length===1&&!l[0].synthetic)return c(l[0].text,i);let u=l.find(e=>!e.synthetic);return(0,A.jsxs)(`div`,{className:`space-y-2`,children:[l.map(e=>e.synthetic?(0,A.jsx)(lM,{text:e.text},e.index):c(e.text,void 0,e===u,e.index)),i?(0,A.jsx)(fM,{align:s?`start`:`end`,children:i}):null]})});hM.displayName=`UserMessage`;function gM(e){if(e<1e3)return`<1s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function _M(e){return e.replace(/```[^\n]*\n?([\s\S]*?)```/g,`$1`).replace(/`([^`]*)`/g,`$1`).replace(/!?\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[ \t]{0,3}(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/gm,``).replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,`$2`).replace(/(^|[^\w*])\*(?=\S)([^*\n]*?\S)\*(?![\w*])/g,`$1$2`).replace(/(^|[^\w])_(?=\S)([^_\n]*?\S)_(?!\w)/g,`$1$2`).replace(/~~(?=\S)([\s\S]*?\S)~~/g,`$1`)}function vM(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:n.slice(0,t).trim()+`...`}var yM=`tangle-text-shimmer`,bM=`tangle-text-shimmer-styles`,xM=`
362
+ `);e.trim()&&t.push({index:r,synthetic:!1,text:e}),n=[]};return e.forEach((e,a)=>{e.type===`text`&&(e.synthetic?(i(),e.text.trim()&&t.push({index:a,synthetic:!0,text:e.text})):(n.length===0&&(r=a),n.push(e.text)))}),i(),t}function dM(e){return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function fM({children:e,align:t=`end`}){return(0,A.jsx)(`div`,{className:`flex flex-wrap items-center ${t===`end`?`justify-end`:`justify-start`} gap-1.5 text-sm text-muted-foreground`,children:e})}function pM({text:e,timestamp:t,actions:n}){return(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsxs)(`div`,{className:`group flex min-w-0 max-w-[78%] flex-col items-end gap-2`,children:[(0,A.jsxs)(`div`,{className:`relative w-full min-w-0 rounded-2xl bg-foreground px-4 py-3 text-background`,children:[t?(0,A.jsx)(`span`,{"data-user-message-time":``,className:`pointer-events-none absolute right-full top-1/2 mr-3 -translate-y-1/2 whitespace-nowrap text-[length:var(--font-size-xs)] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:dM(t)}):null,(0,A.jsx)(`div`,{className:`break-words whitespace-pre-wrap ${HO}`,children:e})]}),n?(0,A.jsx)(fM,{children:n}):null]})})}function mM({text:e,timestamp:t,actions:n,author:r}){return(0,A.jsx)(`div`,{className:`flex justify-start`,children:(0,A.jsxs)(`div`,{className:`group flex min-w-0 max-w-[78%] flex-col items-start gap-1.5`,children:[r?(0,A.jsx)(cM,{author:r}):null,(0,A.jsxs)(`div`,{className:`relative min-w-0 max-w-full rounded-2xl border border-border bg-card px-4 py-3 text-foreground`,children:[t?(0,A.jsx)(`span`,{"data-user-message-time":``,className:`pointer-events-none absolute left-full top-1/2 ml-3 -translate-y-1/2 whitespace-nowrap text-[length:var(--font-size-xs)] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:dM(t)}):null,(0,A.jsx)(`div`,{className:`break-words whitespace-pre-wrap ${HO}`,children:e})]}),n?(0,A.jsx)(fM,{align:`start`,children:n}):null]})})}var hM=(0,b.memo)(({message:e,parts:t,content:n,timestamp:r,actions:i,author:a,viewerId:o})=>{let s=sM(a,o)?void 0:a,c=(e,t,n=!0,i)=>s?(0,A.jsx)(mM,{text:e,timestamp:r,actions:t,author:n?s:void 0},i):(0,A.jsx)(pM,{text:e,timestamp:r,actions:t},i);if(n!=null)return n.trim()?c(n,i):null;let l=uM(t??[]);if(l.length===0)return null;if(l.length===1&&!l[0].synthetic)return c(l[0].text,i);let u=l.find(e=>!e.synthetic);return(0,A.jsxs)(`div`,{className:`space-y-2`,children:[l.map(e=>e.synthetic?(0,A.jsx)(lM,{text:e.text},e.index):c(e.text,void 0,e===u,e.index)),i?(0,A.jsx)(fM,{align:s?`start`:`end`,children:i}):null]})});hM.displayName=`UserMessage`;function gM(e){if(e<1e3)return`<1s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function _M(e){return e.replace(/```[^\n]*\n?([\s\S]*?)```/g,`$1`).replace(/`([^`]*)`/g,`$1`).replace(/!?\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[ \t]{0,3}(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/gm,``).replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,`$2`).replace(/(^|[^\w*])\*(?=\S)([^*\n]*?\S)\*(?![\w*])/g,`$1$2`).replace(/(^|[^\w])_(?=\S)([^_\n]*?\S)_(?!\w)/g,`$1$2`).replace(/~~(?=\S)([\s\S]*?\S)~~/g,`$1`)}function vM(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:n.slice(0,t).trim()+`...`}var yM=`tangle-text-shimmer`,bM=`tangle-text-shimmer-styles`,xM=`
363
363
  @keyframes ${yM} {
364
364
  from { -webkit-mask-position: 150% center; mask-position: 150% center; }
365
365
  to { -webkit-mask-position: -50% center; mask-position: -50% center; }
@@ -539,12 +539,12 @@ XID_Start XIDS`.split(/\s/).map(e=>[sU(e),e])),qW=new Map([[`s`,LW(383)],[LW(383
539
539
  `).length,r=rK(t.path);return(0,A.jsxs)(iK,{icon:(0,A.jsx)(bj,{className:`h-4 w-4`}),title:`Write file`,description:t.path,meta:(0,A.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`+`,n,` line`,n===1?``:`s`]}),children:[e.state.status===`running`?(0,A.jsx)(sK,{label:`Writing file…`}):null,e.state.error?(0,A.jsx)(oK,{error:e.state.error}):null,(0,A.jsx)(BG,{code:t.content,language:r,className:`rounded-[var(--radius-md)]`,children:(0,A.jsx)(VG,{text:t.content})})]})});lK.displayName=`WriteFilePreview`;function uK(e){return typeof e==`string`&&e.trim()?e:void 0}function dK(e){if(typeof e==`string`){let[t,n,...r]=e.split(`:`),i=Number(n);return r.length>0&&Number.isFinite(i)?{path:t,line:i,text:r.join(`:`).trim()}:{path:`match`,text:e}}if(!e||typeof e!=`object`)return null;let t=e,n=uK(t.path)??uK(t.file)??uK(t.filePath)??`match`,r=t.line??t.lineNumber??t.line_number,i=typeof r==`number`?r:Number(r),a=uK(t.text)??uK(t.content)??uK(t.lineText)??uK(t.preview);return a?{path:n,line:Number.isFinite(i)?i:void 0,text:a}:null}function fK(e){if(!e||typeof e!=`object`)return;let t=e;return uK(t.pattern)??uK(t.query)}function pK(e){if(Array.isArray(e))return e.map(dK).filter(e=>e!==null);if(e&&typeof e==`object`){let t=e,n=[t.matches,t.results,t.output];for(let e of n)if(Array.isArray(e))return e.map(dK).filter(e=>e!==null)}return typeof e==`string`?e.split(`
540
540
  `).map(e=>e.trim()).filter(Boolean).map(dK).filter(e=>e!==null):[]}var mK=(0,b.memo)(({part:e})=>{let t=fK(e.state.input),n=(0,b.useMemo)(()=>pK(e.state.output),[e.state.output]),r=(0,b.useMemo)(()=>{let e=new Map;for(let t of n){let n=e.get(t.path)??[];n.push(t),e.set(t.path,n)}return[...e.entries()]},[n]);return(0,A.jsxs)(iK,{icon:(0,A.jsx)(Kj,{className:`h-4 w-4`}),title:t?`Search results for "${t}"`:`Search results`,description:n.length>0?`${n.length} match${n.length===1?``:`es`}`:void 0,children:[e.state.status===`running`?(0,A.jsx)(sK,{label:`Searching files…`}):null,e.state.error?(0,A.jsx)(oK,{error:e.state.error}):null,e.state.status===`completed`&&n.length===0?(0,A.jsx)(aK,{label:`No matching files or lines were returned.`}):null,r.map(([e,t])=>(0,A.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-border bg-muted/55`,children:[(0,A.jsx)(`div`,{className:`border-b border-border px-3 py-2 text-xs font-medium text-foreground`,children:e}),(0,A.jsx)(`div`,{className:`divide-y divide-border`,children:t.map((t,n)=>(0,A.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-3 px-3 py-2`,children:[(0,A.jsx)(`div`,{className:`pt-0.5 text-xs font-mono text-muted-foreground`,children:t.line??`·`}),(0,A.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap break-words text-xs font-mono text-foreground`,children:t.text})]},`${e}-${t.line??n}-${n}`))})]},e))]})});mK.displayName=`GrepResultsPreview`;function hK(e){return typeof e==`string`&&e.trim()?e:void 0}function gK(e){if(!e||typeof e!=`object`)return;let t=e;return hK(t.pattern)??hK(t.path)}function _K(e){if(Array.isArray(e))return e.map(e=>String(e)).filter(Boolean);if(e&&typeof e==`object`){let t=e,n=t.files??t.matches??t.paths??t.results;if(Array.isArray(n))return n.map(e=>typeof e==`string`?e:e&&typeof e==`object`?String(e.path??e.file??``):``).filter(Boolean)}return typeof e==`string`?e.split(`
541
541
  `).map(e=>e.trim()).filter(Boolean):[]}var vK=(0,b.memo)(({part:e})=>{let t=gK(e.state.input),n=(0,b.useMemo)(()=>_K(e.state.output),[e.state.output]);return(0,A.jsxs)(iK,{icon:(0,A.jsx)(Ej,{className:`h-4 w-4`}),title:t?`Files for ${t}`:`File results`,description:n.length>0?`${n.length} path${n.length===1?``:`s`}`:void 0,children:[e.state.status===`running`?(0,A.jsx)(sK,{label:`Collecting files…`}):null,e.state.error?(0,A.jsx)(oK,{error:e.state.error}):null,e.state.status===`completed`&&n.length===0?(0,A.jsx)(aK,{label:`No matching files were returned.`}):null,n.length>0?(0,A.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:n.map(e=>{let t=e.endsWith(`/`)?Ej:wj;return(0,A.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted/55 px-3 py-2`,children:[(0,A.jsx)(t,{className:`h-4 w-4 shrink-0 text-primary`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate text-xs font-mono text-foreground`,children:e})]},e)})}):null]})});vK.displayName=`GlobResultsPreview`;function yK(e){return typeof e==`string`&&e.trim()?e:void 0}function bK(e,t){if(e&&typeof e==`object`){let t=e,n=yK(t.query)??yK(t.url);if(n)return n}if(t&&typeof t==`object`)return yK(t.query)}function xK(e){if(!e||typeof e!=`object`)return null;let t=e,n=yK(t.title)??yK(t.name)??`Untitled result`,r=yK(t.url)??yK(t.link);return r?{title:n,url:r,snippet:yK(t.snippet)??yK(t.description)??yK(t.text)}:null}function SK(e){if(e&&typeof e==`object`){let t=e,n=t.results??t.items??t.output;if(Array.isArray(n))return n.map(xK).filter(e=>e!==null)}return Array.isArray(e)?e.map(xK).filter(e=>e!==null):[]}var CK=(0,b.memo)(({part:e})=>{let t=bK(e.state.input,e.state.output),n=(0,b.useMemo)(()=>SK(e.state.output),[e.state.output]);return(0,A.jsxs)(iK,{icon:(0,A.jsx)(Mj,{className:`h-4 w-4`}),title:t?`Web results for ${t}`:`Web results`,description:n.length>0?`${n.length} result${n.length===1?``:`s`}`:void 0,children:[e.state.status===`running`?(0,A.jsx)(sK,{label:`Searching the web…`}):null,e.state.error?(0,A.jsx)(oK,{error:e.state.error}):null,e.state.status===`completed`&&n.length===0?(0,A.jsx)(aK,{label:`No web results were returned.`}):null,(0,A.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,A.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`block rounded-[var(--radius-md)] border border-border bg-muted/55 px-3 py-3 transition-colors hover:border-[var(--border-strong)] hover:bg-accent/50 ${kA}`,children:[(0,A.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,A.jsx)(`div`,{className:`mt-1 truncate text-xs text-primary`,children:e.url}),e.snippet?(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:e.snippet}):null]},e.url))})]})});CK.displayName=`WebSearchPreview`;function wK(e){if(!e)return[];if(typeof e==`string`)return[e];if(Array.isArray(e))return e.map(e=>String(e)).filter(Boolean);if(typeof e==`object`){let t=e,n=t.questions??t.question??t.prompt;if(Array.isArray(n))return n.map(e=>String(e)).filter(Boolean);if(typeof n==`string`)return[n]}return[]}function TK(e){if(!e)return[];if(typeof e==`string`)return[e];if(Array.isArray(e))return e.map(e=>String(e)).filter(Boolean);if(typeof e==`object`){let t=e,n=t.answers??t.answer??t.response;if(Array.isArray(n))return n.map(e=>String(e)).filter(Boolean);if(typeof n==`string`)return[n]}return[]}var EK=(0,b.memo)(({part:e})=>{let t=(0,b.useMemo)(()=>wK(e.state.input),[e.state.input]),n=(0,b.useMemo)(()=>TK(e.state.output),[e.state.output]);return(0,A.jsxs)(iK,{icon:(0,A.jsx)(Bj,{className:`h-4 w-4`}),title:`Agent question`,description:t.length>1?`${t.length} questions require attention`:void 0,children:[e.state.status===`running`?(0,A.jsx)(sK,{label:`Waiting for an answer…`}):null,e.state.error?(0,A.jsx)(oK,{error:e.state.error}):null,t.length===0?(0,A.jsx)(aK,{label:`No question text was provided.`}):null,t.map((t,r)=>(0,A.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3`,children:[(0,A.jsxs)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[`Question `,r+1]}),(0,A.jsx)(`div`,{className:`mt-2 text-sm leading-relaxed text-foreground`,children:t}),(0,A.jsx)(`div`,{className:`mt-3 rounded-[var(--radius-sm)] border border-border bg-card px-3 py-2 text-sm text-foreground`,children:n[r]??(e.state.status===`completed`?`No answer recorded.`:`Awaiting answer`)})]},`${t}-${r}`))]})});EK.displayName=`QuestionPreview`;function DK(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}}function OK(e){let t=[e.state.input,e.state.output,e.state.metadata];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e,n=DK(t,`diff`,`patch`,`unifiedDiff`,`unified_diff`),r=DK(t,`oldString`,`old_string`,`before`,`previous`),i=DK(t,`newString`,`new_string`,`after`,`updated`),a=DK(t,`file_path`,`filePath`,`path`);if(n||r||i)return{path:a,diff:n,before:r,after:i}}return{}}var kK=(0,b.memo)(({part:e})=>{let t=OK(e);return(0,A.jsxs)(iK,{icon:(0,A.jsx)(Aj,{className:`h-4 w-4`}),title:t.path?`Changes for ${t.path}`:`File changes`,children:[e.state.status===`running`?(0,A.jsx)(sK,{label:`Computing changes…`}):null,e.state.error?(0,A.jsx)(oK,{error:e.state.error}):null,!t.diff&&!t.before&&!t.after?(0,A.jsx)(aK,{label:`No structured diff payload was provided.`}):null,t.diff?(0,A.jsx)(BG,{code:t.diff,language:`diff`,className:`rounded-[var(--radius-md)]`}):null,!t.diff&&t.before?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Before`}),(0,A.jsx)(BG,{code:t.before,language:`text`,className:`rounded-[var(--radius-md)]`})]}):null,!t.diff&&t.after?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`After`}),(0,A.jsx)(BG,{code:t.after,language:`text`,className:`rounded-[var(--radius-md)]`})]}):null]})});kK.displayName=`DiffPreview`;function AK({children:e,collapsedMaxPx:t=180,fadeClassName:n=`from-muted`,className:r,toggleClassName:i}){let[a,o]=(0,b.useState)(!1),[s,c]=(0,b.useState)(!1),l=(0,b.useRef)(null);(0,b.useEffect)(()=>{let e=l.current;if(!e)return;let n=()=>c(e.scrollHeight>t+4);if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t]);let u=s&&!a;return(0,A.jsxs)(`div`,{className:r,children:[(0,A.jsxs)(`div`,{ref:l,className:`relative overflow-hidden`,style:u?{maxHeight:t}:void 0,children:[e,u?(0,A.jsx)(`div`,{className:_A(`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent`,n)}):null]}),s?(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:_A(`mt-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground`,i),children:a?`Show less`:`Show more`}):null]})}var jK=`mx-3 mb-2`,MK={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,rs:`rust`,py:`python`,go:`go`,rb:`ruby`,json:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,md:`markdown`,css:`css`,scss:`scss`,html:`html`,sh:`bash`,bash:`bash`,zsh:`bash`,sql:`sql`,sol:`solidity`,proto:`protobuf`};function NK(e){if(!e)return;let t=e.split(`.`).pop()?.toLowerCase();return t?MK[t]:void 0}function PK(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}var FK=(0,b.memo)(({part:e})=>{let t=jM(e),{status:n,input:r,output:i,error:a}=e.state;if(t.displayVariant===`command`)return(0,A.jsx)(QG,{part:e,defaultExpanded:!0});if(t.displayVariant===`write-file`)return(0,A.jsx)(lK,{part:e});if(t.displayVariant===`grep`)return(0,A.jsx)(mK,{part:e});if(t.displayVariant===`glob`)return(0,A.jsx)(vK,{part:e});if(t.displayVariant===`web-search`)return(0,A.jsx)(CK,{part:e});if(t.displayVariant===`question`)return(0,A.jsx)(EK,{part:e});if(t.displayVariant===`diff`)return(0,A.jsx)(kK,{part:e});if(t.displayVariant===`read-file`)return(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card shadow-[var(--shadow-card)]`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-border bg-card px-3 py-2`,children:[(0,A.jsx)(`div`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-[var(--border-accent)] bg-muted text-primary`,children:(0,A.jsx)(wj,{className:`h-3.5 w-3.5`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Read file`}),t.targetPath?(0,A.jsx)(`span`,{className:`truncate text-xs font-mono text-muted-foreground`,children:t.targetPath}):null]})]}),(0,A.jsxs)(`div`,{className:`space-y-2 px-3 py-2.5`,children:[typeof i==`string`?(0,A.jsx)(BG,{code:i,language:NK(t.targetPath)??`text`,className:`rounded-[var(--radius-md)]`}):(0,A.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-dashed border-border bg-muted px-3 py-4 text-sm text-muted-foreground`,children:`No readable file content was returned.`}),a?(0,A.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-3 text-sm text-[var(--surface-danger-text)]`,children:a}):null]})]});let o=PK(r),s=PK(i);return(0,A.jsxs)(`div`,{className:`space-y-3`,children:[o&&(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-background px-3 py-2`,children:[(0,A.jsx)(JA,{className:`h-3 w-3 text-primary`}),(0,A.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:`Input`})]}),(0,A.jsx)(BG,{code:o,language:`json`,className:`rounded-none border-0`})]}),n===`completed`&&s&&(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-background px-3 py-2`,children:[(0,A.jsx)(KA,{className:`h-3 w-3 text-primary`}),(0,A.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:`Output`})]}),(0,A.jsx)(AK,{fadeClassName:`from-card`,toggleClassName:jK,children:(0,A.jsx)(BG,{code:s.length>2e3?s.slice(0,2e3)+`
542
- ...(truncated)`:s,language:`json`,className:`rounded-none border-0`})})]}),a&&(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--radius-lg)] border border-[var(--surface-danger-border)]`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-2`,children:[(0,A.jsx)(oj,{className:`h-3 w-3 text-[var(--surface-danger-text)]`}),(0,A.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-[var(--surface-danger-text)]`,children:`Error`})]}),(0,A.jsx)(AK,{fadeClassName:`from-[var(--surface-danger-bg)]`,toggleClassName:jK,children:(0,A.jsx)(`pre`,{className:`bg-[var(--surface-danger-bg)] p-3 text-xs font-mono whitespace-pre-wrap break-all text-[var(--surface-danger-text)]`,children:a})})]}),(n===`pending`||n===`running`)&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(Rj,{className:_A(`h-3 w-3 animate-spin text-primary`)}),`Running…`]})]})});FK.displayName=`ExpandedToolDetail`;var IK=Object.defineProperty,LK=(e,t)=>IK(e,`name`,{value:t,configurable:!0}),RK=!!(typeof window<`u`&&window.document&&window.document.createElement);function zK(e,t,{checkForDefaultPrevented:n=!0}={}){return LK(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}LK(zK,`composeEventHandlers`);function BK(e){if(!RK)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}LK(BK,`getOwnerWindow`);function VK(e){if(!RK)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}LK(VK,`getOwnerDocument`);function HK(e,t=!1){let{activeElement:n}=VK(e);if(!n?.nodeName)return null;if(UK(n)&&n.contentDocument)return HK(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=VK(n).getElementById(e);if(t)return t}}return n}LK(HK,`getActiveElement`);function UK(e){return e.tagName===`IFRAME`}LK(UK,`isFrame`);var WK=Object.defineProperty,GK=(e,t)=>WK(e,`name`,{value:t,configurable:!0});function KK(e,t){let n=b.createContext(t);n.displayName=e+`Context`;let r=GK(e=>{let{children:t,...r}=e,i=b.useMemo(()=>r,Object.values(r));return(0,A.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=b.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return GK(i,`useContext`),[r,i]}GK(KK,`createContext`);function qK(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=GK(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=b.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return GK(s,`useContext`),[o,s]}GK(r,`createContext`);let i=GK(()=>{let t=n.map(e=>b.createContext(e));return GK(function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,JK(i,...t)]}GK(qK,`createContextScope`);function JK(...e){let t=e[0];if(e.length===1)return t;let n=GK(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return GK(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}GK(JK,`composeContextScopes`);var YK=globalThis?.document?b.useLayoutEffect:()=>{},XK=Object.defineProperty,ZK=(e,t)=>XK(e,`name`,{value:t,configurable:!0}),QK=b.useEffectEvent,$K=b.useInsertionEffect;function eq(e){if(typeof QK==`function`)return QK(e);let t=b.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $K==`function`?$K(()=>{t.current=e}):YK(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}ZK(eq,`useEffectEvent`);var tq=Object.defineProperty,nq=(e,t)=>tq(e,`name`,{value:t,configurable:!0}),rq=b.useInsertionEffect||YK;function iq({prop:e,defaultProp:t,onChange:n=nq(()=>{},`onChange`),caller:r}){let[i,a,o]=aq({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,b.useCallback(t=>{if(s){let n=oq(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}nq(iq,`useControllableState`);function aq({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return rq(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nq(aq,`useUncontrolledState`);function oq(e){return typeof e==`function`}nq(oq,`isFunction`);var sq=Symbol(`RADIX:SYNC_STATE`);function cq(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=eq(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=b.useReducer((t,n)=>{if(n.type===sq)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=b.useRef(p);b.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=b.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return b.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:sq,state:i})},[i,d.state,c]),[h,f]}nq(cq,`useControllableStateReducer`);var lq=Object.defineProperty,uq=(e,t)=>lq(e,`name`,{value:t,configurable:!0});function dq(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}uq(dq,`setRef`);function fq(...e){return t=>{let n=!1,r=e.map(e=>{let r=dq(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dq(e[t],null)}}}}uq(fq,`composeRefs`);function pq(...e){return b.useCallback(fq(...e),e)}uq(pq,`useComposedRefs`);var mq=Object.defineProperty,hq=(e,t)=>mq(e,`name`,{value:t,configurable:!0});function gq(e){let t=b.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Eq(r),b.Children.forEach(r,e=>{if(Sq(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;wq(n)&&typeof Aq==`function`;)n=Aq(n._payload);a=yq(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=b.cloneElement(a,void 0,s):!o&&b.Children.count(r)===1&&b.isValidElement(r)&&(a=r);let c=a?xq(a):void 0,l=pq(n,c);if(!a){if(r||r===0)throw Error(o?kq(e):Oq(e));return r}let u=bq(i,a.props??{});return a.type!==b.Fragment&&(u.ref=n?l:c),b.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}hq(gq,`createSlot`);var _q=Symbol.for(`radix.slottable`);function vq(e){let t=hq(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_q,t}hq(vq,`createSlottable`);var yq=hq((e,t)=>`child`in e.props?b.isValidElement(t)?b.cloneElement(t,void 0,e.props.children(t.props.children)):null:b.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function bq(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Dq(a,i))}return{...e,...n}}hq(bq,`mergeProps`);function xq(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)}hq(xq,`getElementRef`);function Sq(e){return b.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_q}hq(Sq,`isSlottable`);var Cq=Symbol.for(`react.lazy`);function wq(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Cq&&`_payload`in e&&Tq(e._payload)}hq(wq,`isLazyComponent`);function Tq(e){return typeof e==`object`&&!!e&&`then`in e}hq(Tq,`isPromiseLike`);function Eq(e){let t=e;for(;wq(t)&&typeof Aq==`function`;)t=Aq(t._payload);return t}hq(Eq,`useUnwrappedLazy`);function Dq(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}hq(Dq,`concatAriaDescribedby`);var Oq=hq(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),kq=hq(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Aq=b.use,jq=u(_(),1),Mq=Object.defineProperty,Nq=(e,t)=>Mq(e,`name`,{value:t,configurable:!0}),Pq=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=gq(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fq(e,t){e&&jq.flushSync(()=>e.dispatchEvent(t))}Nq(Fq,`dispatchDiscreteCustomEvent`);var Iq=Object.defineProperty,Lq=(e,t)=>Iq(e,`name`,{value:t,configurable:!0});function Rq(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}Lq(Rq,`useStateMachine`);var zq=Lq(e=>{let{present:t,children:n}=e,r=Bq(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=Hq(r.ref,Wq(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null},`Presence`);function Bq(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),o=b.useRef(void 0),[s,c]=Rq(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{s===`mounted`?(a.current=o.current??Uq(r.current),o.current=void 0):a.current=`none`},[s]),YK(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Uq(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),YK(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Lq(a=>{let o=Uq(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Lq(e=>{e.target===t&&(a.current=Uq(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:b.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Uq(t)}else r.current=null;n(e)},[])}}Lq(Bq,`usePresence`);function Vq(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Lq(Vq,`setRef`);function Hq(...e){let t=b.useRef(e);return t.current=e,b.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vq(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vq(n[e],null)}}},[])}Lq(Hq,`useStableComposedRefs`);function Uq(e){return e?.animationName||`none`}Lq(Uq,`getAnimationName`);function Wq(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)}Lq(Wq,`getElementRef`);var Gq=Object.defineProperty,Kq=(e,t)=>Gq(e,`name`,{value:t,configurable:!0}),qq=b.useId||(()=>void 0),Jq=0;function Yq(e){let[t,n]=b.useState(qq());return YK(()=>{e||n(e=>e??String(Jq++))},[e]),e||(t?`radix-${t}`:``)}Kq(Yq,`useId`);var Xq=Object.defineProperty,Zq=(e,t)=>Xq(e,`name`,{value:t,configurable:!0}),Qq=`Collapsible`,[$q,eJ]=qK(Qq),[tJ,nJ]=$q(Qq),rJ=b.forwardRef(Zq(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=iq({prop:r,defaultProp:i??!1,onChange:o,caller:Qq});return(0,A.jsx)(tJ,{scope:n,disabled:a,contentId:Yq(),open:c,onOpenToggle:b.useCallback(()=>l(e=>!e),[l]),children:(0,A.jsx)(Pq.div,{"data-state":lJ(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),iJ=`CollapsibleTrigger`,aJ=b.forwardRef(Zq(function(e,t){let{__scopeCollapsible:n,...r}=e,i=nJ(iJ,n);return(0,A.jsx)(Pq.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":lJ(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:zK(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),oJ=`CollapsibleContent`,sJ=b.forwardRef(Zq(function(e,t){let{forceMount:n,...r}=e,i=nJ(oJ,e.__scopeCollapsible);return(0,A.jsx)(zq,{present:n||i.open,children:({present:e})=>(0,A.jsx)(cJ,{...r,ref:t,present:e})})},`CollapsibleContent`)),cJ=b.forwardRef(Zq(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=nJ(oJ,n),[s,c]=b.useState(r),l=b.useRef(null),u=pq(t,l),d=b.useRef(0),f=d.current,p=b.useRef(0),m=p.current,h=o.open||s,g=b.useRef(h),_=b.useRef(void 0);return b.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),YK(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,A.jsx)(Pq.div,{"data-state":lJ(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function lJ(e){return e?`open`:`closed`}Zq(lJ,`getState`);function uJ({status:e}){return e===`error`?(0,A.jsx)(`span`,{"data-run-row-status":`error`,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--surface-danger-text)]`}):null}var dJ={single:`rounded-[var(--radius-lg)]`,first:`rounded-t-[var(--radius-lg)] rounded-b-[var(--radius-sm)]`,middle:`rounded-[var(--radius-sm)]`,last:`rounded-t-[var(--radius-sm)] rounded-b-[var(--radius-lg)]`},fJ=`px-2 py-1`,pJ=`pl-[2.375rem]`;function mJ({icon:e,title:t,description:n,descriptionMono:r=!1,status:i=`idle`,durationMs:a,groupPosition:o=`single`,collapsedError:s,actions:c,open:l,onOpenChange:u,defaultOpen:d=!1,className:f,contentClassName:p,children:m}){let[h,g]=(0,b.useState)(d),_=l!==void 0,v=_?l:h,y=e=>{_||g(e),u?.(e)},x=i===`running`,S=m!=null;return(0,A.jsx)(rJ,{open:v,onOpenChange:y,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsxs)(`div`,{"data-run-row":``,"data-state":v?`open`:`closed`,className:_A(`group min-w-0 flex-1 overflow-hidden border transition-colors`,v?`border-border bg-[var(--md3-surface-container)]`:`border-transparent bg-transparent`,S&&!v&&`hover:bg-[var(--md3-surface-container)]`,dJ[o],f),children:[(0,A.jsx)(aJ,{asChild:!0,disabled:!S,children:(0,A.jsxs)(`button`,{type:`button`,className:_A(`flex w-full items-center gap-2 text-left`,fJ,S?`cursor-pointer`:`cursor-default`),children:[(0,A.jsxs)(`span`,{"aria-hidden":!0,className:`flex h-[1.375rem] w-[1.375rem] shrink-0 items-center justify-center text-muted-foreground`,children:[(0,A.jsx)(`span`,{"data-run-row-glyph":``,className:_A(`flex items-center justify-center`,S&&`group-hover:hidden`,v&&`hidden`),children:e}),S?(0,A.jsx)(ij,{"data-run-row-chevron":``,className:_A(`hidden h-3.5 w-3.5 transition-transform group-hover:block`,v&&`block rotate-90`)}):null]}),(0,A.jsx)(`span`,{className:_A(`shrink-0 whitespace-nowrap text-sm font-normal text-muted-foreground transition-colors group-hover:text-foreground`,v&&`text-foreground`),children:t}),n?(0,A.jsx)(`span`,{className:_A(`hidden min-w-0 flex-1 truncate text-sm text-muted-foreground transition-colors group-hover:text-foreground sm:inline`,r&&`font-mono`),children:n}):null,(0,A.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[!x&&a!=null?(0,A.jsx)(`span`,{"data-run-row-duration":``,className:`font-mono text-[10px] tabular-nums text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:gM(a)}):null,(0,A.jsx)(uJ,{status:i})]})]})}),s&&!v?(0,A.jsx)(`div`,{className:_A(`pb-1.5 pr-2 text-xs leading-snug text-[var(--surface-danger-text)]`,pJ),children:s}):null,S?(0,A.jsx)(sJ,{className:`overflow-hidden data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp`,children:(0,A.jsx)(`div`,{className:_A(`border-t border-border`,p),children:m})}):null]}),c?(0,A.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1.5 pt-1`,onClick:e=>e.stopPropagation(),children:c}):null]})})}var hJ={command:Xj,write:bj,read:Sj,search:Kj,edit:Wj,task:XA,web:Mj,todo:fj,other:Jj};function gJ(e){return e===`pending`||e===`running`?`running`:e===`error`?`error`:`success`}var _J=(0,b.memo)(({part:e,renderToolDetail:t,groupPosition:n=`single`,className:r,contentClassName:i,actions:a,title:o,description:s})=>{let c=jM(e),l=o??c.title,u=s??c.description,d=NM(e),f=e.state.time?.start,p=e.state.time?.end,m=f!=null&&p!=null?p-f:void 0,h=hJ[AM(e.tool)]??Jj,g=gJ(e.state.status);return(0,A.jsx)(mJ,{icon:(0,A.jsx)(h,{className:`h-3.5 w-3.5`}),title:g===`running`?(0,A.jsx)(wM,{children:l}):l,description:u,descriptionMono:!0,status:g,durationMs:m,groupPosition:n,collapsedError:d??void 0,actions:a,className:r,contentClassName:_A(`p-2`,i),children:t?.(e)??(0,A.jsx)(FK,{part:e})})});_J.displayName=`InlineToolItem`;function vJ(){return e=>{let t=e=>{e.type===`code`&&e.meta&&(e.data={...e.data,hProperties:{...e.data?.hProperties,dataMeta:e.meta}}),e.children?.forEach(t)};t(e)}}var yJ={ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,json:`json`,jsonc:`jsonc`,md:`markdown`,mdx:`mdx`,py:`python`,sh:`bash`,bash:`bash`,zsh:`bash`,yml:`yaml`,yaml:`yaml`,toml:`toml`,css:`css`,scss:`scss`,html:`html`,sql:`sql`,go:`go`,rs:`rust`,sol:`solidity`,rb:`ruby`,java:`java`,kt:`kotlin`,swift:`swift`,php:`php`,c:`c`,h:`c`,cpp:`cpp`,cs:`csharp`,graphql:`graphql`,gql:`graphql`,xml:`xml`,svg:`xml`,diff:`diff`,patch:`diff`},bJ=/^(?:\.{0,2}\/)?(?:[\w@.-]+\/)*[\w@.-]*\.[A-Za-z0-9]+$|^(?:[\w@.-]+\/)+[\w@.-]+$/;function xJ(e){let t=e.split(`/`).pop()??e;if(/^dockerfile$/i.test(t))return`dockerfile`;let n=t.includes(`.`)?t.split(`.`).pop()?.toLowerCase():void 0;return n?yJ[n]:void 0}function SJ(e,t){let n=/(?:^|\s)language-(\S+)/.exec(e??``)?.[1],r=n,i;if(n?.includes(`:`)?[r,i]=[n.slice(0,n.indexOf(`:`)),n.slice(n.indexOf(`:`)+1)]:n&&bJ.test(n)&&(n.includes(`/`)||xJ(n))&&(i=n,r=void 0),!i&&typeof t==`string`){let e=/(?:^|\s)(?:title|filename|file|name)=(?:"([^"]+)"|'([^']+)'|(\S+))/.exec(t),n=t.trim().split(/\s+/).find(e=>bJ.test(e));i=e?.[1]??e?.[2]??e?.[3]??n}return!r&&i&&(r=xJ(i)),{...r?{language:r}:{},...i?{filename:i}:{}}}var CJ=/^[(]?[-+−]?\s?[$€£¥₹]?\s?\d[\d,_ ]*(?:\.\d+)?\s?(?:%|[kKmMbB]|x|ms|s|h|pp)?[)]?$/;function wJ(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(wJ).join(``):``}function TJ(e){let t=[],n=[],r=(e,i)=>{for(let a of e.children)if(a.type===`element`){if(a.tagName===`tr`){let e=a.children.filter(e=>e.type===`element`&&(e.tagName===`th`||e.tagName===`td`)).map(e=>wJ(e).replace(/\s+/g,` `).trim());(i?t:n).push(e)}else r(a,i||a.tagName===`thead`)}};return r(e,!1),{header:t,body:n}}var EJ=32;function DJ(e){let t=Math.max(0,...e.map(e=>e.length));return Array.from({length:t},(t,n)=>{let r=e.map(e=>e[n]??``).filter(Boolean);return r.length>0&&r.every(e=>CJ.test(e))?`figure`:r.some(e=>e.length>EJ)?`long`:`short`})}function OJ(e){let t=/^[=+\-@\t\r]/.test(e)&&!CJ.test(e)?`'${e}`:e;return/[",\n\r]/.test(t)||t!==t.trim()?`"${t.replace(/"/g,`""`)}"`:t}function kJ(e){return e.map(e=>e.map(OJ).join(`,`)).join(`
543
- `)}var AJ=`[.tangle-prose_&]:table! [.tangle-prose_&]:m-0! [.tangle-prose_&]:overflow-visible! [.tangle-prose_&]:text-sm!`,jJ=`[.tangle-prose_&]:px-3! [.tangle-prose_&]:py-2! [.tangle-prose_&]:border-t-0! [.tangle-prose_&]:border-l-0!`,MJ=(0,b.createContext)([]),NJ=(0,b.createContext)(-1);function PJ({csv:e}){let[t,n]=(0,b.useState)(`idle`),r=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let i=(0,b.useCallback)(async()=>{r.current&&clearTimeout(r.current);try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}r.current=setTimeout(()=>n(`idle`),2e3)},[e]);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,onClick:i,className:_A(`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,kA),children:[t===`copied`?(0,A.jsx)(ej,{"aria-hidden":!0,className:`size-4 text-[var(--surface-success-text)]`}):(0,A.jsx)(mj,{"aria-hidden":!0,className:`size-4`}),t===`copied`?`Copied`:`Copy CSV`]}),(0,A.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:t===`copied`?`Table copied as CSV`:t===`failed`?`Copy failed`:``})]})}function FJ({node:e,className:t,children:n,...r}){let{csv:i,kinds:a,rowCount:o}=(0,b.useMemo)(()=>{let{header:t,body:n}=e?TJ(e):{header:[],body:[]};return{csv:kJ([...t,...n]),kinds:DJ(n),rowCount:n.length}},[e]);return(0,A.jsxs)(`div`,{className:`not-prose relative my-4 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[(0,A.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:o===1?`1 row`:`${o} rows`}),(0,A.jsx)(PJ,{csv:i})]}),(0,A.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":`Table`,className:_A(`overflow-x-auto`,AA),children:(0,A.jsx)(MJ.Provider,{value:a,children:(0,A.jsx)(`table`,{...r,"data-markdown-table":``,className:_A(`w-full border-collapse text-sm text-foreground`,AJ,t),children:n})})})]})}function IJ({node:e,className:t,...n}){return(0,A.jsx)(`thead`,{...n,className:_A(`bg-muted/50`,t)})}function LJ({node:e,className:t,...n}){return(0,A.jsx)(`tbody`,{...n,className:_A(`[&>tr:last-child>td]:border-b-0`,t)})}function RJ({node:e,children:t,...n}){let r=0;return(0,A.jsx)(`tr`,{...n,children:b.Children.map(t,e=>(0,b.isValidElement)(e)?(0,A.jsx)(NJ.Provider,{value:r++,children:e}):e)})}function zJ(){let e=(0,b.useContext)(MJ),t=(0,b.useContext)(NJ);return(t>=0?e[t]:void 0)??`short`}function BJ({node:e,className:t,...n}){let r=zJ()===`figure`;return(0,A.jsx)(`th`,{...n,className:_A(`whitespace-nowrap border-b border-border px-3 py-2 text-left font-semibold text-foreground`,jJ,r?`text-right [.tangle-prose_&]:text-right!`:`[.tangle-prose_&]:text-left!`,t)})}function VJ({node:e,className:t,...n}){let r=zJ();return(0,A.jsx)(`td`,{...n,className:_A(`border-b border-border/60 px-3 py-2 align-top`,jJ,r===`figure`?`whitespace-nowrap text-right tabular-nums`:r===`long`?`min-w-[14rem]`:`whitespace-nowrap`,t)})}var HJ=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],UJ={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...HJ,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...HJ],h2:[[`className`,`sr-only`]],img:[...HJ,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...HJ,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...HJ],table:[...HJ],ul:[...HJ,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},WJ={}.hasOwnProperty;function GJ(e,t){let n={type:`root`,children:[]},r=KJ({schema:t?{...UJ,...t}:UJ,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function KJ(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return qJ(e,n);case`doctype`:return JJ(e,n);case`element`:return YJ(e,n);case`root`:return XJ(e,n);case`text`:return ZJ(e,n)}}}function qJ(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return iY(r,t),r}}function JJ(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return iY(e,t),e}}function YJ(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=QJ(e,t.children),i=$J(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&WJ.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return iY(o,t),o}function XJ(e,t){let n={type:`root`,children:QJ(e,t.children)};return iY(n,t),n}function ZJ(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return iY(n,t),n}function QJ(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=KJ(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function $J(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&WJ.call(r,n)?r[n]:void 0,o=r&&WJ.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(WJ.call(s,l)){let t=s[l],n=eY(e,aY(a,l),l,t);n??=eY(e,aY(o,l),l,t),n!=null&&(c[l]=n)}if(i&&WJ.call(i,n)){let e=i[n];for(l in e)WJ.call(e,l)&&!WJ.call(c,l)&&(c[l]=e[l])}return c}function eY(e,t,n,r){return t?Array.isArray(r)?tY(e,t,n,r):nY(e,t,n,r):void 0}function tY(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=nY(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function nY(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&rY(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function rY(e,t,n){let r=e.schema.protocols&&WJ.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function iY(e,t){let n=dn(t);t.data&&(e.data=Wo(t.data)),n&&(e.position=n)}function aY(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function oY(e){return function(t){return GJ(t,e)}}var sY=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,cY=Object.hasOwnProperty,lY=class{constructor(){this.occurrences,this.reset()}slug(e,t){let n=this,r=uY(e,t===!0),i=r;for(;cY.call(n.occurrences,r);)n.occurrences[i]++,r=i+`-`+n.occurrences[i];return n.occurrences[r]=0,r}reset(){this.occurrences=Object.create(null)}};function uY(e,t){return typeof e==`string`?(t||(e=e.toLowerCase()),e.replace(sY,``).replace(/ /g,`-`)):``}function dY(e){let t=e.type===`element`?e.tagName.toLowerCase():``,n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}function fY(e){return`children`in e?mY(e):`value`in e?e.value:``}function pY(e){return e.type===`text`?e.value:`children`in e?mY(e):``}function mY(e){let t=-1,n=[];for(;++t<e.children.length;)n[t]=pY(e.children[t]);return n.join(``)}var hY={},gY=new lY;function _Y(e){let t=(e||hY).prefix||``;return function(e){gY.reset(),os(e,`element`,function(e){dY(e)&&!e.properties.id&&(e.properties.id=t+gY.slug(fY(e)))})}}var vY=`user-content-`;function yY(e){let t=e;try{t=decodeURIComponent(e)}catch{}return vY+new lY().slug(t)}function bY(e){return cc(e)??void 0}function xY(e,t,n,r){let i=r?r(e,t,n):e;if(i!=null)return t===`href`&&i===e&&e.startsWith(`#`)?bY(`#`+yY(e.slice(1))):bY(i)}var SY={file:wj,image:vj,asset:Hj,folder:Oj},CY=(0,b.createContext)(void 0),wY=(0,b.createContext)(!1);function TY({node:e,children:t,className:n,...r}){let i=(0,b.useContext)(CY),a=typeof r.href==`string`&&r.href?i?.(r.href):null;if(!a)return(0,A.jsx)(wY.Provider,{value:!0,children:(0,A.jsx)(`a`,{...r,className:n,children:t})});let o=SY[a.kind];return(0,A.jsx)(wY.Provider,{value:!0,children:(0,A.jsxs)(`a`,{...r,title:a.title??r.title,"data-link-chip":a.kind,className:_A(`not-prose inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/60 px-2 py-0.5 align-middle text-[0.9375em] font-medium leading-6 text-foreground no-underline transition-colors hover:border-[var(--border-strong)] hover:bg-muted`,`[.tangle-prose_&]:text-foreground! [.tangle-prose_&]:no-underline!`,kA,n),children:[(0,A.jsx)(o,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:a.label??t})]})})}var EY=(0,b.createContext)(!1);function DY({children:e}){return(0,A.jsx)(EY.Provider,{value:!0,children:e})}function OY({node:e,className:t,children:n,...r}){let i=(0,b.useContext)(EY),a=String(n).replace(/\n$/,``);if(!i){let{"data-meta":e,...i}=r;return(0,A.jsx)(`code`,{className:_A(`px-1.5 py-0.5 rounded border border-border bg-muted text-foreground text-[0.85em] font-mono`,t),...i,children:n})}let{language:o,filename:s}=SJ(t,e?.properties?.dataMeta);return(0,A.jsx)(BG,{code:a,language:o,filename:s,className:`my-4`,children:(0,A.jsx)(VG,{text:a})})}var kY={...UJ,attributes:{...UJ.attributes,code:[...UJ.attributes?.code??[],`dataMeta`]}};function AY({node:e,src:t,alt:n,className:r,...i}){let a=(0,b.useContext)(wY),o=(0,b.useRef)(null),s=typeof t==`string`&&t?t:void 0,[c,l]=(0,b.useState)();if((0,b.useEffect)(()=>{let e=o.current;if(!s||!e?.complete||typeof e.decode!=`function`)return;let t=!0;return e.decode().catch(()=>{t&&l(s)}),()=>{t=!1}},[s]),!s||c===s){let e=n?`Image unavailable: ${n}`:`Image unavailable`;return(0,A.jsxs)(`span`,{role:`img`,"aria-label":e,className:`inline-flex max-w-full items-center gap-2 rounded-md border border-dashed border-border bg-muted px-3 py-2 text-sm text-muted-foreground`,children:[(0,A.jsx)(Pj,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:e})]})}let u=(0,A.jsx)(`img`,{...i,ref:o,src:s,alt:n??``,loading:`lazy`,decoding:`async`,onError:()=>l(s),className:_A(`h-auto max-w-full rounded-md`,r)});return a?u:(0,A.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,"aria-label":n?void 0:`Open image full size`,className:`inline-block max-w-full`,children:u})}var jY=(0,b.memo)(({children:e,className:t,urlTransform:n,linkChip:r})=>(0,A.jsx)(`div`,{className:_A(`tangle-prose max-w-none text-sm`,t),children:(0,A.jsx)(CY.Provider,{value:r,children:(0,A.jsx)(ic,{remarkPlugins:[md,vJ],rehypePlugins:[_Y,[oY,kY]],urlTransform:(e,t,r)=>xY(e,t,r,n),components:{a:TY,img:AY,pre:DY,code:OY,table:FJ,thead:IJ,tbody:LJ,tr:RJ,th:BJ,td:VJ},children:e})})}));jY.displayName=`Markdown`;var MY=(0,b.memo)(({part:e,defaultOpen:t=!1,autoCollapse:n=!0,openWhileActive:r=!0,className:i,contentClassName:a})=>{let[o,s]=(0,b.useState)(t),c=(0,b.useRef)(!1),l=e.time?.start,u=e.time?.end,d=l!=null&&u!=null?u-l:void 0,f=l!=null&&u==null,p=e.text?vM(_M(e.text),120):void 0;return(0,b.useEffect)(()=>{if(f){c.current=!1,r&&s(!0);return}if(n&&!c.current&&d!=null){let e=window.setTimeout(()=>{s(!1),c.current=!0},900);return()=>window.clearTimeout(e)}},[n,d,f,r]),(0,A.jsx)(mJ,{icon:(0,A.jsx)(QA,{className:`h-3.5 w-3.5`}),title:f?(0,A.jsx)(wM,{children:`Thinking…`}):`Reasoning`,description:p,status:f?`running`:`idle`,durationMs:d,open:o,onOpenChange:s,className:i,children:e.text?(0,A.jsx)(AK,{fadeClassName:`from-[var(--md3-surface-container)]`,className:a?`px-3 py-3 ${a}`:`px-3 py-3`,children:(0,A.jsx)(`div`,{className:`text-sm leading-relaxed text-foreground`,children:(0,A.jsx)(jY,{children:e.text})})}):(0,A.jsx)(`div`,{className:`px-3 py-2.5 text-xs text-muted-foreground`,children:`No reasoning text provided.`})})});MY.displayName=`InlineThinkingItem`;function NY({className:e}){let[t,n]=(0,b.useState)(0);return(0,b.useEffect)(()=>{let e=window.setInterval(()=>n(e=>e+1),1e3);return()=>window.clearInterval(e)},[]),(0,A.jsxs)(`div`,{role:`status`,"aria-label":`Agent is thinking`,className:_A(`flex items-center gap-2 px-3 py-1.5`,e),children:[(0,A.jsxs)(`div`,{className:`flex gap-[3px]`,children:[(0,A.jsx)(`span`,{className:`h-[var(--indicator-dot-size)] w-[var(--indicator-dot-size)] animate-bounce rounded-full bg-[var(--brand-glow)]`,style:{animationDelay:`0ms`}}),(0,A.jsx)(`span`,{className:`h-[var(--indicator-dot-size)] w-[var(--indicator-dot-size)] animate-bounce rounded-full bg-[var(--brand-glow)]`,style:{animationDelay:`150ms`}}),(0,A.jsx)(`span`,{className:`h-[var(--indicator-dot-size)] w-[var(--indicator-dot-size)] animate-bounce rounded-full bg-[var(--brand-glow)]`,style:{animationDelay:`300ms`}})]}),t>3&&(0,A.jsxs)(`span`,{className:`text-[length:var(--font-size-xs)] tabular-nums text-muted-foreground`,children:[t,`s`]})]})}var PY={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,css:`css`,scss:`scss`,json:`json`,jsonc:`json`,md:`markdown`,mdx:`markdown`,py:`python`,sh:`bash`,bash:`bash`,zsh:`bash`,html:`html`,htm:`html`,yaml:`yaml`,yml:`yaml`,toml:`toml`,rs:`rust`,go:`go`,sql:`sql`,xml:`xml`};function FY(e,t){if(t)return t;if(!e)return;let n=e.split(`.`).pop()?.toLowerCase();return n?PY[n]:void 0}var IY={running:`running`,success:`completed`,error:`error`};function LY({type:e,label:t,status:n,detail:r,output:i,language:a,duration:o,className:s,actions:c,part:l}){let u=l??{type:`tool`,id:`${e}:${t}`,tool:e,state:{status:IY[n],input:r?{detail:r}:void 0,output:i,time:o==null?void 0:{start:0,end:o}}},d=FY(r,a);return(0,A.jsx)(_J,{part:u,title:t,description:r,className:s,actions:c,renderToolDetail:l?void 0:i?()=>(0,A.jsx)(BG,{code:i,language:d,className:`max-h-72 overflow-auto text-xs`}):()=>null})}function RY({title:e,children:t,className:n}){return(0,A.jsx)(`div`,{role:`group`,"aria-label":e,className:_A(`flex flex-col gap-1`,n),children:t})}var zY={default:{card:`border-border bg-card`,text:`text-foreground`,supportingText:`text-muted-foreground`,icon:uj},info:{card:`border-[var(--surface-info-border)] bg-[var(--surface-info-bg)]`,text:`text-[var(--surface-info-text)]`,supportingText:`text-[var(--surface-info-text)]`,icon:Ij},success:{card:`border-[var(--surface-success-border)] bg-[var(--surface-success-bg)]`,text:`text-[var(--surface-success-text)]`,supportingText:`text-[var(--surface-success-text)]`,icon:cj},warning:{card:`border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)]`,text:`text-[var(--surface-warning-text)]`,supportingText:`text-[var(--surface-warning-text)]`,icon:Qj},error:{card:`border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)]`,text:`text-[var(--surface-danger-text)]`,supportingText:`text-[var(--surface-danger-text)]`,icon:Qj}};function BY(e){return e.kind===`message`?e.role===`user`?`user`:`prose`:e.kind===`status`||e.kind===`artifact`?`card`:`tool`}function VY(e,t){return e===void 0?``:e===`user`||t===`user`?`mt-4`:e===`card`||t===`card`?`mt-2`:e===`tool`||t===`tool`?`mt-1`:`mt-3`}var HY=`-mx-3`,UY=`[&>:last-child:not(ul,ol)]:after:ml-0.5 [&>:last-child:not(ul,ol)]:after:inline-block [&>:last-child:not(ul,ol)]:after:h-[1em] [&>:last-child:not(ul,ol)]:after:w-0.5 [&>:last-child:not(ul,ol)]:after:animate-pulse [&>:last-child:not(ul,ol)]:after:rounded-full [&>:last-child:not(ul,ol)]:after:bg-muted-foreground [&>:last-child:not(ul,ol)]:after:align-text-bottom [&>:last-child:not(ul,ol)]:after:content-[''] [&>:is(ul,ol):last-child>li:last-child]:after:ml-0.5 [&>:is(ul,ol):last-child>li:last-child]:after:inline-block [&>:is(ul,ol):last-child>li:last-child]:after:h-[1em] [&>:is(ul,ol):last-child>li:last-child]:after:w-0.5 [&>:is(ul,ol):last-child>li:last-child]:after:animate-pulse [&>:is(ul,ol):last-child>li:last-child]:after:rounded-full [&>:is(ul,ol):last-child>li:last-child]:after:bg-muted-foreground [&>:is(ul,ol):last-child>li:last-child]:after:align-text-bottom [&>:is(ul,ol):last-child>li:last-child]:after:content-['']`;function WY({item:e,author:t}){return(0,A.jsxs)(`div`,{children:[t&&(0,A.jsx)(cM,{author:t,className:`mb-1.5`}),e.content&&(0,A.jsx)(jY,{className:_A(`tangle-prose`,`tangle-transcript-text text-[length:var(--transcript-font-size)] leading-[var(--transcript-line-height)]`,e.isStreaming&&UY),children:e.content}),e.isStreaming&&!e.content&&(0,A.jsx)(`span`,{"aria-hidden":!0,"data-streaming-caret":``,className:`ml-0.5 inline-block h-[1em] w-0.5 animate-pulse rounded-full bg-muted-foreground align-text-bottom`}),e.toolCalls&&(0,A.jsx)(`div`,{className:`mt-1`,children:e.toolCalls}),e.after&&(0,A.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:e.after})]})}function GY({item:e}){let t=zY[e.tone??`default`],n=t.icon;return(0,A.jsx)(`div`,{className:_A(`rounded-[var(--radius-lg)] border px-4 py-3`,t.card),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(n,{className:_A(`mt-0.5 h-4 w-4 shrink-0`,t.text)}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`div`,{className:_A(`text-sm font-medium`,t.text),children:e.label}),e.detail&&(0,A.jsx)(`div`,{className:_A(`mt-0.5 text-sm`,t.supportingText),children:e.detail})]})]})})}function KY({item:e}){let t=zY[e.tone??`default`],n=(0,A.jsx)(`div`,{className:_A(`rounded-[var(--radius-lg)] border px-4 py-3`,t.card),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(`div`,{className:`mt-0.5 flex h-[var(--avatar-size)] w-[var(--avatar-size)] shrink-0 items-center justify-center rounded-[var(--radius-md)] bg-muted/50 text-foreground`,children:e.icon??(0,A.jsx)(wj,{className:`h-4 w-4`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:_A(`text-sm font-medium`,t.text),children:e.title}),e.description&&(0,A.jsx)(`div`,{className:_A(`mt-1 text-sm`,t.supportingText),children:e.description}),e.meta&&(0,A.jsx)(`div`,{className:_A(`mt-2 flex flex-wrap items-center gap-2 text-xs`,t.supportingText),children:e.meta})]}),e.action&&(0,A.jsx)(`div`,{className:`shrink-0`,children:e.action})]})});return e.onClick?(0,A.jsx)(`div`,{role:`button`,tabIndex:0,onClick:e.onClick,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.onClick?.())},className:_A(`block w-full rounded-[var(--radius-lg)] text-left transition-transform hover:-translate-y-0.5`,kA),children:n}):n}function qY({items:e,isThinking:t,emptyState:n,className:r,renderToolActions:i,collapseAfter:a,viewerId:o}){let[s,c]=(0,b.useState)(!1);if(e.length===0&&!t)return n?(0,A.jsx)(`div`,{className:_A(`flex h-full items-center justify-center p-4`,r),children:n}):null;let l=t?[...e,{id:`__thinking__`,kind:`custom`,content:(0,A.jsx)(NY,{})}]:e,u=e=>e.kind===`message`&&e.role===`user`,d=l.filter(e=>!u(e)),f=a??1/0,p=d.length>f,m=p&&!s,h=l,g=0;if(m){let e=[],t=0;for(let n of l){if(t>=f)break;e.push(n),u(n)||(t+=1)}h=e,g=d.length-f}let _=new Set,v;for(let e of h)if(e.kind===`message`){if(e.role===`user`){v=void 0;continue}e.author&&e.author.id!==v&&_.add(e.id),v=e.author?.id}let y=e=>e.kind===`message`?e.role===`user`?(0,A.jsx)(hM,{content:e.content,timestamp:e.timestamp,author:e.author,viewerId:o}):(0,A.jsx)(WY,{item:e,author:_.has(e.id)?e.author:void 0}):e.kind===`tool`?(0,A.jsx)(LY,{type:e.call.type,label:e.call.label,status:e.call.status,detail:e.call.detail,output:e.call.output,duration:e.call.duration,part:e.part,actions:e.part?i?.(e.part):void 0}):e.kind===`tool_group`?(0,A.jsx)(RY,{title:e.title,children:e.calls.map((t,n)=>{let r=e.parts?.[n];return(0,A.jsx)(LY,{type:t.type,label:t.label,status:t.status,detail:t.detail,output:t.output,duration:t.duration,part:r,actions:r?i?.(r):void 0},t.id)})}):e.kind===`status`?(0,A.jsx)(GY,{item:e}):e.kind===`artifact`?(0,A.jsx)(KY,{item:e}):e.content;return(0,A.jsxs)(`div`,{className:_A(`mx-auto flex w-full max-w-5xl flex-col px-4 py-4`,r),children:[h.map((e,t)=>{let n=BY(e),r=t>0?BY(h[t-1]):void 0;return(0,A.jsx)(`div`,{"data-timeline-step":n,className:_A(VY(r,n),n===`tool`&&HY),children:y(e)},e.id)}),p?(0,A.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`mt-2 self-start text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:m?`Show ${g} more step${g===1?``:`s`}`:`Show less`}):null]})}function JY(e){let t=e.source,n=e.detail.nativeRecordId;return typeof n==`string`&&n?JSON.stringify([e.node,`native`,n,e.kind,t?.item??null]):t?.path?JSON.stringify([e.node,t.path,t.line??null,t.pointer??null,t.item??null]):e.id}function YY(e){let t=new Map,n=new Map;for(let r of e){let e=JY(r),i=t.get(e)??0;t.set(e,i+1),n.set(r.id,i?`${e}#${i}`:e)}return n}var XY=e=>e===void 0||/^\s*(\{\s*\}|null)?\s*$/.test(e);function ZY(e){return e===void 0?`args not captured`:XY(e)?`empty args`:null}function QY(e,t){switch(e){case`error`:return`Error`;case`returned`:return`Returned`;case`pending`:return`Not returned`;case`ambiguous`:return`Ambiguous`;default:return t?`Pending`:`Result not captured`}}function $Y(e){let t=e.usage;return typeof t?.output==`number`&&Number.isFinite(t.output)?t.output:null}function eX(e){let t=$Y(e);return t!==null&&t<2e3}function tX(e){let t=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):0,n=t(e.reasoningOmitted),r=t(e.reasoningRedacted),i=[];return n&&i.push(n===1?`thinking not returned by provider`:`${n} thinking blocks not returned by provider`),r&&i.push(r===1?`thinking redacted (encrypted)`:`${r} thinking blocks redacted (encrypted)`),i}var nX=/await|wait|poll|sleep|observe|status/i;function rX(e){if(typeof e!=`string`||!e.trimStart().startsWith(`{`))return!1;try{let t=JSON.parse(e);return!!t&&typeof t==`object`&&!Array.isArray(t)&&t.pending===!0}catch{return!1}}var iX=e=>(e??[]).some(e=>!rX(e.detail.publicText));function aX(e,t,n){let r=e.detail;if(r.role!==`assistant`||e.category===`lifecycle`||r.lifecycle!==void 0||r.publicText||r.recordedClaim||r.reasoning||r.responseStatus===`error`||r.contentOmitted||r.publicationNote||r.clip||tX(r).length||t.length!==1)return null;let i=t[0];return i.clip||i.publicationNote||n(i.id)||!XY(i.input)&&!nX.test(i.name)?null:i}function oX(e,t,n){let r=e.detail;return r.role!==`assistant`||e.category===`lifecycle`||r.lifecycle!==void 0||r.publicText||r.recordedClaim||r.reasoning||r.responseStatus===`error`||r.contentOmitted||r.publicationNote||r.clip||tX(r).length||!t.length||t.some(t=>t.input!==void 0||t.clip||t.publicationNote||n(e,t.id))?null:t}function sX(e,{callsOf:t,captured:n,keyOf:r,min:i=2}){let a=[],o=null,s=()=>{if(o){if(o.events.length>=i)a.push({kind:`hollow`,key:`hollow:${r(o.events[0])}`,events:o.events,calls:[...o.calls.entries()].map(([e,t])=>({name:e,count:t})),spanMs:o.spanMs});else for(let e of o.events)a.push({kind:`event`,key:r(e),event:e});o=null}};for(let r of e){if(r.kind!==`event`){s(),a.push(r);continue}let e=oX(r.event,t(r.event),n);if(!e){s(),a.push(r);continue}o??={events:[],calls:new Map,spanMs:0},o.events.push(r.event);for(let t of e)o.calls.set(t.name,(o.calls.get(t.name)??0)+1)}s();for(let e of a){if(e.kind!==`hollow`)continue;let t=e.events.map(e=>Date.parse(e.at)).filter(Number.isFinite);e.spanMs=t.length>1?Math.max(...t)-Math.min(...t):0}return a}function cX(e){let t=e.reduce((e,t)=>e+t.count,0),n=e.map(e=>e.count>1?`${e.name} ×${e.count}`:e.name);return`${t} tool call${t===1?``:`s`} · ${n.join(` · `)}`}function lX(e,{callsOf:t,answered:n,keyOf:r,min:i=2}){let a=[],o=null,s=()=>{if(o){if(o.events.length>=i)a.push({kind:`polls`,key:`polls:${r(o.events[0])}`,name:o.name,input:o.input,events:o.events});else for(let e of o.events)a.push({kind:`event`,key:r(e),event:e});o=null}};for(let i of e){let e=aX(i,t(i),e=>n(i,e));if(!e){s(),a.push({kind:`event`,key:r(i),event:i});continue}let c=XY(e.input)?``:e.input.trim();o&&(o.name!==e.name||o.args!==c)&&s(),o??={name:e.name,args:c,input:e.input,events:[]},o.events.push(i)}return s(),a}function uX(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function dX(e){let t=e.map(e=>Date.parse(e.at)).filter(Number.isFinite),n=t.length?Math.max(...t)-Math.min(...t):0,r=0,i=0;for(let t of e){let e=t.detail.usage;if(!e||t.detail.usageScope!==void 0)continue;let n=[e.input,e.output,e.cacheRead,e.cacheWrite].filter(e=>typeof e==`number`);n.length&&(i++,r+=n.reduce((e,t)=>e+t,0))}let a=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),o=i?i<e.length?`~${a.format(r)} tokens (${i} of ${e.length} measured)`:`~${a.format(r)} tokens`:`tokens unknown`;return{polls:e.length,spanMs:n,tokens:i?r:null,measured:i,label:`waited ${uX(n)} · ${e.length} polls · ${o}`}}function fX(e){let t=e.indexOf(`[user] `),n=e.startsWith(`[system] `)&&t>=0?e.slice(t+7).trim():e.trim();if(!n.startsWith(`{`))return n;try{let e=JSON.parse(n),t=[`objective`,`instruction`].map(t=>e[t]).filter(e=>typeof e==`string`&&e.trim().length>0);return t.length?t.join(`
542
+ ...(truncated)`:s,language:`json`,className:`rounded-none border-0`})})]}),a&&(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--radius-lg)] border border-[var(--surface-danger-border)]`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-2`,children:[(0,A.jsx)(oj,{className:`h-3 w-3 text-[var(--surface-danger-text)]`}),(0,A.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-[var(--surface-danger-text)]`,children:`Error`})]}),(0,A.jsx)(AK,{fadeClassName:`from-[var(--surface-danger-bg)]`,toggleClassName:jK,children:(0,A.jsx)(`pre`,{className:`bg-[var(--surface-danger-bg)] p-3 text-xs font-mono whitespace-pre-wrap break-all text-[var(--surface-danger-text)]`,children:a})})]}),(n===`pending`||n===`running`)&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(Rj,{className:_A(`h-3 w-3 animate-spin text-primary`)}),`Running…`]})]})});FK.displayName=`ExpandedToolDetail`;var IK=Object.defineProperty,LK=(e,t)=>IK(e,`name`,{value:t,configurable:!0}),RK=!!(typeof window<`u`&&window.document&&window.document.createElement);function zK(e,t,{checkForDefaultPrevented:n=!0}={}){return LK(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}LK(zK,`composeEventHandlers`);function BK(e){if(!RK)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}LK(BK,`getOwnerWindow`);function VK(e){if(!RK)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}LK(VK,`getOwnerDocument`);function HK(e,t=!1){let{activeElement:n}=VK(e);if(!n?.nodeName)return null;if(UK(n)&&n.contentDocument)return HK(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=VK(n).getElementById(e);if(t)return t}}return n}LK(HK,`getActiveElement`);function UK(e){return e.tagName===`IFRAME`}LK(UK,`isFrame`);var WK=Object.defineProperty,GK=(e,t)=>WK(e,`name`,{value:t,configurable:!0});function KK(e,t){let n=b.createContext(t);n.displayName=e+`Context`;let r=GK(e=>{let{children:t,...r}=e,i=b.useMemo(()=>r,Object.values(r));return(0,A.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=b.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return GK(i,`useContext`),[r,i]}GK(KK,`createContext`);function qK(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=GK(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=b.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return GK(s,`useContext`),[o,s]}GK(r,`createContext`);let i=GK(()=>{let t=n.map(e=>b.createContext(e));return GK(function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,JK(i,...t)]}GK(qK,`createContextScope`);function JK(...e){let t=e[0];if(e.length===1)return t;let n=GK(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return GK(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}GK(JK,`composeContextScopes`);var YK=globalThis?.document?b.useLayoutEffect:()=>{},XK=Object.defineProperty,ZK=(e,t)=>XK(e,`name`,{value:t,configurable:!0}),QK=b.useEffectEvent,$K=b.useInsertionEffect;function eq(e){if(typeof QK==`function`)return QK(e);let t=b.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $K==`function`?$K(()=>{t.current=e}):YK(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}ZK(eq,`useEffectEvent`);var tq=Object.defineProperty,nq=(e,t)=>tq(e,`name`,{value:t,configurable:!0}),rq=b.useInsertionEffect||YK;function iq({prop:e,defaultProp:t,onChange:n=nq(()=>{},`onChange`),caller:r}){let[i,a,o]=aq({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,b.useCallback(t=>{if(s){let n=oq(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}nq(iq,`useControllableState`);function aq({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return rq(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nq(aq,`useUncontrolledState`);function oq(e){return typeof e==`function`}nq(oq,`isFunction`);var sq=Symbol(`RADIX:SYNC_STATE`);function cq(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=eq(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=b.useReducer((t,n)=>{if(n.type===sq)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=b.useRef(p);b.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=b.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return b.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:sq,state:i})},[i,d.state,c]),[h,f]}nq(cq,`useControllableStateReducer`);var lq=Object.defineProperty,uq=(e,t)=>lq(e,`name`,{value:t,configurable:!0});function dq(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}uq(dq,`setRef`);function fq(...e){return t=>{let n=!1,r=e.map(e=>{let r=dq(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dq(e[t],null)}}}}uq(fq,`composeRefs`);function pq(...e){return b.useCallback(fq(...e),e)}uq(pq,`useComposedRefs`);var mq=Object.defineProperty,hq=(e,t)=>mq(e,`name`,{value:t,configurable:!0});function gq(e){let t=b.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Eq(r),b.Children.forEach(r,e=>{if(Sq(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;wq(n)&&typeof Aq==`function`;)n=Aq(n._payload);a=yq(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=b.cloneElement(a,void 0,s):!o&&b.Children.count(r)===1&&b.isValidElement(r)&&(a=r);let c=a?xq(a):void 0,l=pq(n,c);if(!a){if(r||r===0)throw Error(o?kq(e):Oq(e));return r}let u=bq(i,a.props??{});return a.type!==b.Fragment&&(u.ref=n?l:c),b.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}hq(gq,`createSlot`);var _q=Symbol.for(`radix.slottable`);function vq(e){let t=hq(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_q,t}hq(vq,`createSlottable`);var yq=hq((e,t)=>`child`in e.props?b.isValidElement(t)?b.cloneElement(t,void 0,e.props.children(t.props.children)):null:b.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function bq(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Dq(a,i))}return{...e,...n}}hq(bq,`mergeProps`);function xq(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)}hq(xq,`getElementRef`);function Sq(e){return b.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_q}hq(Sq,`isSlottable`);var Cq=Symbol.for(`react.lazy`);function wq(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Cq&&`_payload`in e&&Tq(e._payload)}hq(wq,`isLazyComponent`);function Tq(e){return typeof e==`object`&&!!e&&`then`in e}hq(Tq,`isPromiseLike`);function Eq(e){let t=e;for(;wq(t)&&typeof Aq==`function`;)t=Aq(t._payload);return t}hq(Eq,`useUnwrappedLazy`);function Dq(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}hq(Dq,`concatAriaDescribedby`);var Oq=hq(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),kq=hq(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Aq=b.use,jq=u(_(),1),Mq=Object.defineProperty,Nq=(e,t)=>Mq(e,`name`,{value:t,configurable:!0}),Pq=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=gq(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fq(e,t){e&&jq.flushSync(()=>e.dispatchEvent(t))}Nq(Fq,`dispatchDiscreteCustomEvent`);var Iq=Object.defineProperty,Lq=(e,t)=>Iq(e,`name`,{value:t,configurable:!0});function Rq(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}Lq(Rq,`useStateMachine`);var zq=Lq(e=>{let{present:t,children:n}=e,r=Bq(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=Hq(r.ref,Wq(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null},`Presence`);function Bq(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),o=b.useRef(void 0),[s,c]=Rq(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{s===`mounted`?(a.current=o.current??Uq(r.current),o.current=void 0):a.current=`none`},[s]),YK(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Uq(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),YK(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Lq(a=>{let o=Uq(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Lq(e=>{e.target===t&&(a.current=Uq(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:b.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Uq(t)}else r.current=null;n(e)},[])}}Lq(Bq,`usePresence`);function Vq(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Lq(Vq,`setRef`);function Hq(...e){let t=b.useRef(e);return t.current=e,b.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vq(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vq(n[e],null)}}},[])}Lq(Hq,`useStableComposedRefs`);function Uq(e){return e?.animationName||`none`}Lq(Uq,`getAnimationName`);function Wq(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)}Lq(Wq,`getElementRef`);var Gq=Object.defineProperty,Kq=(e,t)=>Gq(e,`name`,{value:t,configurable:!0}),qq=b.useId||(()=>void 0),Jq=0;function Yq(e){let[t,n]=b.useState(qq());return YK(()=>{e||n(e=>e??String(Jq++))},[e]),e||(t?`radix-${t}`:``)}Kq(Yq,`useId`);var Xq=Object.defineProperty,Zq=(e,t)=>Xq(e,`name`,{value:t,configurable:!0}),Qq=`Collapsible`,[$q,eJ]=qK(Qq),[tJ,nJ]=$q(Qq),rJ=b.forwardRef(Zq(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=iq({prop:r,defaultProp:i??!1,onChange:o,caller:Qq});return(0,A.jsx)(tJ,{scope:n,disabled:a,contentId:Yq(),open:c,onOpenToggle:b.useCallback(()=>l(e=>!e),[l]),children:(0,A.jsx)(Pq.div,{"data-state":lJ(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),iJ=`CollapsibleTrigger`,aJ=b.forwardRef(Zq(function(e,t){let{__scopeCollapsible:n,...r}=e,i=nJ(iJ,n);return(0,A.jsx)(Pq.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":lJ(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:zK(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),oJ=`CollapsibleContent`,sJ=b.forwardRef(Zq(function(e,t){let{forceMount:n,...r}=e,i=nJ(oJ,e.__scopeCollapsible);return(0,A.jsx)(zq,{present:n||i.open,children:({present:e})=>(0,A.jsx)(cJ,{...r,ref:t,present:e})})},`CollapsibleContent`)),cJ=b.forwardRef(Zq(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=nJ(oJ,n),[s,c]=b.useState(r),l=b.useRef(null),u=pq(t,l),d=b.useRef(0),f=d.current,p=b.useRef(0),m=p.current,h=o.open||s,g=b.useRef(h),_=b.useRef(void 0);return b.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),YK(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,A.jsx)(Pq.div,{"data-state":lJ(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function lJ(e){return e?`open`:`closed`}Zq(lJ,`getState`);var uJ={single:`rounded-[var(--radius-lg)]`,first:`rounded-t-[var(--radius-lg)] rounded-b-[var(--radius-sm)]`,middle:`rounded-[var(--radius-sm)]`,last:`rounded-t-[var(--radius-sm)] rounded-b-[var(--radius-lg)]`},dJ=`px-2 py-1`,fJ=`pl-[2.375rem]`;function pJ({icon:e,title:t,description:n,descriptionMono:r=!1,status:i=`idle`,durationMs:a,groupPosition:o=`single`,collapsedError:s,actions:c,open:l,onOpenChange:u,defaultOpen:d=!1,className:f,contentClassName:p,children:m}){let[h,g]=(0,b.useState)(d),_=l!==void 0,v=_?l:h,y=e=>{_||g(e),u?.(e)},x=i===`running`,S=m!=null;return(0,A.jsx)(rJ,{open:v,onOpenChange:y,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsxs)(`div`,{"data-run-row":``,"data-state":v?`open`:`closed`,className:_A(`group min-w-0 flex-1 overflow-hidden border transition-colors`,v?`border-border bg-[var(--md3-surface-container)]`:`border-transparent bg-transparent`,S&&!v&&`hover:bg-[var(--md3-surface-container)]`,uJ[o],f),children:[(0,A.jsx)(aJ,{asChild:!0,disabled:!S,children:(0,A.jsxs)(`button`,{type:`button`,className:_A(`flex w-full items-center gap-2 text-left`,dJ,S?`cursor-pointer`:`cursor-default`),children:[(0,A.jsxs)(`span`,{"aria-hidden":!0,"data-run-row-status":i===`error`?`error`:void 0,className:_A(`flex h-[1.375rem] w-[1.375rem] shrink-0 items-center justify-center`,i===`error`?`text-[var(--surface-danger-text)]`:`text-muted-foreground`),children:[(0,A.jsx)(`span`,{"data-run-row-glyph":``,className:_A(`flex items-center justify-center`,S&&`group-hover:hidden`,v&&`hidden`),children:e}),S?(0,A.jsx)(ij,{"data-run-row-chevron":``,className:_A(`hidden h-3.5 w-3.5 transition-transform group-hover:block`,v&&`block rotate-90`)}):null]}),(0,A.jsx)(`span`,{className:_A(`shrink-0 whitespace-nowrap text-sm font-normal text-muted-foreground transition-colors group-hover:text-foreground`,v&&`text-foreground`),children:t}),n?(0,A.jsx)(`span`,{className:_A(`min-w-0 flex-1 truncate text-sm text-muted-foreground transition-colors group-hover:text-foreground`,r&&`font-mono`),children:n}):null,!x&&a!=null?(0,A.jsx)(`span`,{"data-run-row-duration":``,className:`ml-auto shrink-0 font-mono text-sm tabular-nums text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:gM(a)}):null]})}),s&&!v?(0,A.jsx)(`div`,{className:_A(`pb-1.5 pr-2 text-sm leading-snug text-[var(--surface-danger-text)]`,fJ),children:s}):null,S?(0,A.jsx)(sJ,{className:`overflow-hidden data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp`,children:(0,A.jsx)(`div`,{className:_A(`border-t border-border`,p),children:m})}):null]}),c?(0,A.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1.5 pt-1`,onClick:e=>e.stopPropagation(),children:c}):null]})})}var mJ={command:Xj,write:bj,read:Sj,search:Kj,edit:Wj,task:XA,web:Mj,todo:fj,other:Jj};function hJ(e){return e===`pending`||e===`running`?`running`:e===`error`?`error`:`success`}var gJ=(0,b.memo)(({part:e,renderToolDetail:t,groupPosition:n=`single`,className:r,contentClassName:i,actions:a,title:o,description:s})=>{let c=jM(e),l=o??c.title,u=s??c.description,d=NM(e),f=e.state.time?.start,p=e.state.time?.end,m=f!=null&&p!=null?p-f:void 0,h=mJ[AM(e.tool)]??Jj,g=hJ(e.state.status);return(0,A.jsx)(pJ,{icon:(0,A.jsx)(h,{className:`h-3.5 w-3.5`}),title:g===`running`?(0,A.jsx)(wM,{children:l}):l,description:u,descriptionMono:!0,status:g,durationMs:m,groupPosition:n,collapsedError:d??void 0,actions:a,className:r,contentClassName:_A(`p-2`,i),children:t?.(e)??(0,A.jsx)(FK,{part:e})})});gJ.displayName=`InlineToolItem`;function _J(){return e=>{let t=e=>{e.type===`code`&&e.meta&&(e.data={...e.data,hProperties:{...e.data?.hProperties,dataMeta:e.meta}}),e.children?.forEach(t)};t(e)}}var vJ={ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,json:`json`,jsonc:`jsonc`,md:`markdown`,mdx:`mdx`,py:`python`,sh:`bash`,bash:`bash`,zsh:`bash`,yml:`yaml`,yaml:`yaml`,toml:`toml`,css:`css`,scss:`scss`,html:`html`,sql:`sql`,go:`go`,rs:`rust`,sol:`solidity`,rb:`ruby`,java:`java`,kt:`kotlin`,swift:`swift`,php:`php`,c:`c`,h:`c`,cpp:`cpp`,cs:`csharp`,graphql:`graphql`,gql:`graphql`,xml:`xml`,svg:`xml`,diff:`diff`,patch:`diff`},yJ=/^(?:\.{0,2}\/)?(?:[\w@.-]+\/)*[\w@.-]*\.[A-Za-z0-9]+$|^(?:[\w@.-]+\/)+[\w@.-]+$/;function bJ(e){let t=e.split(`/`).pop()??e;if(/^dockerfile$/i.test(t))return`dockerfile`;let n=t.includes(`.`)?t.split(`.`).pop()?.toLowerCase():void 0;return n?vJ[n]:void 0}function xJ(e,t){let n=/(?:^|\s)language-(\S+)/.exec(e??``)?.[1],r=n,i;if(n?.includes(`:`)?[r,i]=[n.slice(0,n.indexOf(`:`)),n.slice(n.indexOf(`:`)+1)]:n&&yJ.test(n)&&(n.includes(`/`)||bJ(n))&&(i=n,r=void 0),!i&&typeof t==`string`){let e=/(?:^|\s)(?:title|filename|file|name)=(?:"([^"]+)"|'([^']+)'|(\S+))/.exec(t),n=t.trim().split(/\s+/).find(e=>yJ.test(e));i=e?.[1]??e?.[2]??e?.[3]??n}return!r&&i&&(r=bJ(i)),{...r?{language:r}:{},...i?{filename:i}:{}}}var SJ=/^[(]?[-+−]?\s?[$€£¥₹]?\s?\d[\d,_ ]*(?:\.\d+)?\s?(?:%|[kKmMbB]|x|ms|s|h|pp)?[)]?$/;function CJ(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(CJ).join(``):``}function wJ(e){let t=[],n=[],r=(e,i)=>{for(let a of e.children)if(a.type===`element`){if(a.tagName===`tr`){let e=a.children.filter(e=>e.type===`element`&&(e.tagName===`th`||e.tagName===`td`)).map(e=>CJ(e).replace(/\s+/g,` `).trim());(i?t:n).push(e)}else r(a,i||a.tagName===`thead`)}};return r(e,!1),{header:t,body:n}}var TJ=32;function EJ(e){let t=Math.max(0,...e.map(e=>e.length));return Array.from({length:t},(t,n)=>{let r=e.map(e=>e[n]??``).filter(Boolean);return r.length>0&&r.every(e=>SJ.test(e))?`figure`:r.some(e=>e.length>TJ)?`long`:`short`})}function DJ(e){let t=/^[=+\-@\t\r]/.test(e)&&!SJ.test(e)?`'${e}`:e;return/[",\n\r]/.test(t)||t!==t.trim()?`"${t.replace(/"/g,`""`)}"`:t}function OJ(e){return e.map(e=>e.map(DJ).join(`,`)).join(`
543
+ `)}var kJ=`[.tangle-prose_&]:table! [.tangle-prose_&]:m-0! [.tangle-prose_&]:overflow-visible! [.tangle-prose_&]:text-sm!`,AJ=`[.tangle-prose_&]:px-3! [.tangle-prose_&]:py-2! [.tangle-prose_&]:border-t-0! [.tangle-prose_&]:border-l-0!`,jJ=(0,b.createContext)([]),MJ=(0,b.createContext)(-1);function NJ({csv:e}){let[t,n]=(0,b.useState)(`idle`),r=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let i=(0,b.useCallback)(async()=>{r.current&&clearTimeout(r.current);try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}r.current=setTimeout(()=>n(`idle`),2e3)},[e]);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,onClick:i,className:_A(`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,kA),children:[t===`copied`?(0,A.jsx)(ej,{"aria-hidden":!0,className:`size-4 text-[var(--surface-success-text)]`}):(0,A.jsx)(mj,{"aria-hidden":!0,className:`size-4`}),t===`copied`?`Copied`:`Copy CSV`]}),(0,A.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:t===`copied`?`Table copied as CSV`:t===`failed`?`Copy failed`:``})]})}function PJ({node:e,className:t,children:n,...r}){let{csv:i,kinds:a,rowCount:o}=(0,b.useMemo)(()=>{let{header:t,body:n}=e?wJ(e):{header:[],body:[]};return{csv:OJ([...t,...n]),kinds:EJ(n),rowCount:n.length}},[e]);return(0,A.jsxs)(`div`,{className:`not-prose relative my-4 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[(0,A.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:o===1?`1 row`:`${o} rows`}),(0,A.jsx)(NJ,{csv:i})]}),(0,A.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":`Table`,className:_A(`overflow-x-auto`,AA),children:(0,A.jsx)(jJ.Provider,{value:a,children:(0,A.jsx)(`table`,{...r,"data-markdown-table":``,className:_A(`w-full border-collapse text-sm text-foreground`,kJ,t),children:n})})})]})}function FJ({node:e,className:t,...n}){return(0,A.jsx)(`thead`,{...n,className:_A(`bg-muted/50`,t)})}function IJ({node:e,className:t,...n}){return(0,A.jsx)(`tbody`,{...n,className:_A(`[&>tr:last-child>td]:border-b-0`,t)})}function LJ({node:e,children:t,...n}){let r=0;return(0,A.jsx)(`tr`,{...n,children:b.Children.map(t,e=>(0,b.isValidElement)(e)?(0,A.jsx)(MJ.Provider,{value:r++,children:e}):e)})}function RJ(){let e=(0,b.useContext)(jJ),t=(0,b.useContext)(MJ);return(t>=0?e[t]:void 0)??`short`}function zJ({node:e,className:t,...n}){let r=RJ()===`figure`;return(0,A.jsx)(`th`,{...n,className:_A(`whitespace-nowrap border-b border-border px-3 py-2 text-left font-semibold text-foreground`,AJ,r?`text-right [.tangle-prose_&]:text-right!`:`[.tangle-prose_&]:text-left!`,t)})}function BJ({node:e,className:t,...n}){let r=RJ();return(0,A.jsx)(`td`,{...n,className:_A(`border-b border-border/60 px-3 py-2 align-top`,AJ,r===`figure`?`whitespace-nowrap text-right tabular-nums`:r===`long`?`min-w-[14rem]`:`whitespace-nowrap`,t)})}var VJ=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],HJ={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...VJ,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...VJ],h2:[[`className`,`sr-only`]],img:[...VJ,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...VJ,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...VJ],table:[...VJ],ul:[...VJ,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},UJ={}.hasOwnProperty;function WJ(e,t){let n={type:`root`,children:[]},r=GJ({schema:t?{...HJ,...t}:HJ,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function GJ(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return KJ(e,n);case`doctype`:return qJ(e,n);case`element`:return JJ(e,n);case`root`:return YJ(e,n);case`text`:return XJ(e,n)}}}function KJ(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return rY(r,t),r}}function qJ(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return rY(e,t),e}}function JJ(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=ZJ(e,t.children),i=QJ(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&UJ.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return rY(o,t),o}function YJ(e,t){let n={type:`root`,children:ZJ(e,t.children)};return rY(n,t),n}function XJ(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return rY(n,t),n}function ZJ(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=GJ(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function QJ(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&UJ.call(r,n)?r[n]:void 0,o=r&&UJ.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(UJ.call(s,l)){let t=s[l],n=$J(e,iY(a,l),l,t);n??=$J(e,iY(o,l),l,t),n!=null&&(c[l]=n)}if(i&&UJ.call(i,n)){let e=i[n];for(l in e)UJ.call(e,l)&&!UJ.call(c,l)&&(c[l]=e[l])}return c}function $J(e,t,n,r){return t?Array.isArray(r)?eY(e,t,n,r):tY(e,t,n,r):void 0}function eY(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=tY(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function tY(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&nY(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function nY(e,t,n){let r=e.schema.protocols&&UJ.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function rY(e,t){let n=dn(t);t.data&&(e.data=Wo(t.data)),n&&(e.position=n)}function iY(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function aY(e){return function(t){return WJ(t,e)}}var oY=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,sY=Object.hasOwnProperty,cY=class{constructor(){this.occurrences,this.reset()}slug(e,t){let n=this,r=lY(e,t===!0),i=r;for(;sY.call(n.occurrences,r);)n.occurrences[i]++,r=i+`-`+n.occurrences[i];return n.occurrences[r]=0,r}reset(){this.occurrences=Object.create(null)}};function lY(e,t){return typeof e==`string`?(t||(e=e.toLowerCase()),e.replace(oY,``).replace(/ /g,`-`)):``}function uY(e){let t=e.type===`element`?e.tagName.toLowerCase():``,n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}function dY(e){return`children`in e?pY(e):`value`in e?e.value:``}function fY(e){return e.type===`text`?e.value:`children`in e?pY(e):``}function pY(e){let t=-1,n=[];for(;++t<e.children.length;)n[t]=fY(e.children[t]);return n.join(``)}var mY={},hY=new cY;function gY(e){let t=(e||mY).prefix||``;return function(e){hY.reset(),os(e,`element`,function(e){uY(e)&&!e.properties.id&&(e.properties.id=t+hY.slug(dY(e)))})}}var _Y=`user-content-`;function vY(e){let t=e;try{t=decodeURIComponent(e)}catch{}return _Y+new cY().slug(t)}function yY(e){return cc(e)??void 0}function bY(e,t,n,r){let i=r?r(e,t,n):e;if(i!=null)return t===`href`&&i===e&&e.startsWith(`#`)?yY(`#`+vY(e.slice(1))):yY(i)}var xY={file:wj,image:vj,asset:Hj,folder:Oj},SY=(0,b.createContext)(void 0),CY=(0,b.createContext)(!1);function wY({node:e,children:t,className:n,...r}){let i=(0,b.useContext)(SY),a=typeof r.href==`string`&&r.href?i?.(r.href):null;if(!a)return(0,A.jsx)(CY.Provider,{value:!0,children:(0,A.jsx)(`a`,{...r,className:n,children:t})});let o=xY[a.kind];return(0,A.jsx)(CY.Provider,{value:!0,children:(0,A.jsxs)(`a`,{...r,title:a.title??r.title,"data-link-chip":a.kind,className:_A(`not-prose inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/60 px-2 py-0.5 align-middle text-[0.9375em] font-medium leading-6 text-foreground no-underline transition-colors hover:border-[var(--border-strong)] hover:bg-muted`,`[.tangle-prose_&]:text-foreground! [.tangle-prose_&]:no-underline!`,kA,n),children:[(0,A.jsx)(o,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:a.label??t})]})})}var TY=(0,b.createContext)(!1);function EY({children:e}){return(0,A.jsx)(TY.Provider,{value:!0,children:e})}function DY({node:e,className:t,children:n,...r}){let i=(0,b.useContext)(TY),a=String(n).replace(/\n$/,``);if(!i){let{"data-meta":e,...i}=r;return(0,A.jsx)(`code`,{className:_A(`px-1.5 py-0.5 rounded border border-border bg-muted text-foreground text-[0.85em] font-mono`,t),...i,children:n})}let{language:o,filename:s}=xJ(t,e?.properties?.dataMeta);return(0,A.jsx)(BG,{code:a,language:o,filename:s,className:`my-4`,children:(0,A.jsx)(VG,{text:a})})}var OY={...HJ,attributes:{...HJ.attributes,code:[...HJ.attributes?.code??[],`dataMeta`]}};function kY({node:e,src:t,alt:n,className:r,...i}){let a=(0,b.useContext)(CY),o=(0,b.useRef)(null),s=typeof t==`string`&&t?t:void 0,[c,l]=(0,b.useState)();if((0,b.useEffect)(()=>{let e=o.current;if(!s||!e?.complete||typeof e.decode!=`function`)return;let t=!0;return e.decode().catch(()=>{t&&l(s)}),()=>{t=!1}},[s]),!s||c===s){let e=n?`Image unavailable: ${n}`:`Image unavailable`;return(0,A.jsxs)(`span`,{role:`img`,"aria-label":e,className:`inline-flex max-w-full items-center gap-2 rounded-md border border-dashed border-border bg-muted px-3 py-2 text-sm text-muted-foreground`,children:[(0,A.jsx)(Pj,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:e})]})}let u=(0,A.jsx)(`img`,{...i,ref:o,src:s,alt:n??``,loading:`lazy`,decoding:`async`,onError:()=>l(s),className:_A(`h-auto max-w-full rounded-md`,r)});return a?u:(0,A.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,"aria-label":n?void 0:`Open image full size`,className:`inline-block max-w-full`,children:u})}var AY=(0,b.memo)(({children:e,className:t,urlTransform:n,linkChip:r})=>(0,A.jsx)(`div`,{className:_A(`tangle-prose max-w-none text-sm`,t),children:(0,A.jsx)(SY.Provider,{value:r,children:(0,A.jsx)(ic,{remarkPlugins:[md,_J],rehypePlugins:[gY,[aY,OY]],urlTransform:(e,t,r)=>bY(e,t,r,n),components:{a:wY,img:kY,pre:EY,code:DY,table:PJ,thead:FJ,tbody:IJ,tr:LJ,th:zJ,td:BJ},children:e})})}));AY.displayName=`Markdown`;var jY=(0,b.memo)(({part:e,defaultOpen:t=!1,autoCollapse:n=!0,openWhileActive:r=!0,className:i,contentClassName:a})=>{let[o,s]=(0,b.useState)(t),c=(0,b.useRef)(!1),l=e.time?.start,u=e.time?.end,d=l!=null&&u!=null?u-l:void 0,f=l!=null&&u==null,p=e.text?vM(_M(e.text),120):void 0;return(0,b.useEffect)(()=>{if(f){c.current=!1,r&&s(!0);return}if(n&&!c.current&&d!=null){let e=window.setTimeout(()=>{s(!1),c.current=!0},900);return()=>window.clearTimeout(e)}},[n,d,f,r]),(0,A.jsx)(pJ,{icon:(0,A.jsx)(QA,{className:`h-3.5 w-3.5`}),title:f?(0,A.jsx)(wM,{children:`Thinking…`}):`Reasoning`,description:p,status:f?`running`:`idle`,durationMs:d,open:o,onOpenChange:s,className:i,children:e.text?(0,A.jsx)(AK,{fadeClassName:`from-[var(--md3-surface-container)]`,className:a?`px-3 py-3 ${a}`:`px-3 py-3`,children:(0,A.jsx)(`div`,{className:`text-sm leading-relaxed text-foreground`,children:(0,A.jsx)(AY,{children:e.text})})}):(0,A.jsx)(`div`,{className:`px-3 py-2.5 text-sm text-muted-foreground`,children:`No reasoning text provided.`})})});jY.displayName=`InlineThinkingItem`;var MY={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,css:`css`,scss:`scss`,json:`json`,jsonc:`json`,md:`markdown`,mdx:`markdown`,py:`python`,sh:`bash`,bash:`bash`,zsh:`bash`,html:`html`,htm:`html`,yaml:`yaml`,yml:`yaml`,toml:`toml`,rs:`rust`,go:`go`,sql:`sql`,xml:`xml`};function NY(e,t){if(t)return t;if(!e)return;let n=e.split(`.`).pop()?.toLowerCase();return n?MY[n]:void 0}var PY={running:`running`,success:`completed`,error:`error`};function FY({type:e,label:t,status:n,detail:r,output:i,language:a,duration:o,className:s,actions:c,part:l}){let u=l??{type:`tool`,id:`${e}:${t}`,tool:e,state:{status:PY[n],input:r?{detail:r}:void 0,output:i,time:o==null?void 0:{start:0,end:o}}},d=NY(r,a);return(0,A.jsx)(gJ,{part:u,title:t,description:r,className:s,actions:c,renderToolDetail:l?void 0:i?()=>(0,A.jsx)(BG,{code:i,language:d,className:`max-h-72 overflow-auto text-xs`}):()=>null})}function IY({title:e,children:t,className:n}){return(0,A.jsx)(`div`,{role:`group`,"aria-label":e,className:_A(`flex flex-col gap-1`,n),children:t})}var LY={default:{card:`border-border bg-card`,text:`text-foreground`,supportingText:`text-muted-foreground`,icon:uj},info:{card:`border-[var(--surface-info-border)] bg-[var(--surface-info-bg)]`,text:`text-[var(--surface-info-text)]`,supportingText:`text-[var(--surface-info-text)]`,icon:Ij},success:{card:`border-[var(--surface-success-border)] bg-[var(--surface-success-bg)]`,text:`text-[var(--surface-success-text)]`,supportingText:`text-[var(--surface-success-text)]`,icon:cj},warning:{card:`border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)]`,text:`text-[var(--surface-warning-text)]`,supportingText:`text-[var(--surface-warning-text)]`,icon:Qj},error:{card:`border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)]`,text:`text-[var(--surface-danger-text)]`,supportingText:`text-[var(--surface-danger-text)]`,icon:Qj}};function RY(e){return e.kind===`message`?e.role===`user`?`user`:`prose`:e.kind===`status`||e.kind===`artifact`?`card`:`tool`}function zY(e,t){return e===void 0?``:e===`user`||t===`user`?`mt-4`:e===`card`||t===`card`?`mt-2`:e===`tool`||t===`tool`?`mt-1`:`mt-3`}var BY=`-mx-3`,VY=`[&>:last-child:not(ul,ol)]:after:ml-0.5 [&>:last-child:not(ul,ol)]:after:inline-block [&>:last-child:not(ul,ol)]:after:h-[1em] [&>:last-child:not(ul,ol)]:after:w-0.5 [&>:last-child:not(ul,ol)]:after:animate-pulse [&>:last-child:not(ul,ol)]:after:rounded-full [&>:last-child:not(ul,ol)]:after:bg-muted-foreground [&>:last-child:not(ul,ol)]:after:align-text-bottom [&>:last-child:not(ul,ol)]:after:content-[''] [&>:is(ul,ol):last-child>li:last-child]:after:ml-0.5 [&>:is(ul,ol):last-child>li:last-child]:after:inline-block [&>:is(ul,ol):last-child>li:last-child]:after:h-[1em] [&>:is(ul,ol):last-child>li:last-child]:after:w-0.5 [&>:is(ul,ol):last-child>li:last-child]:after:animate-pulse [&>:is(ul,ol):last-child>li:last-child]:after:rounded-full [&>:is(ul,ol):last-child>li:last-child]:after:bg-muted-foreground [&>:is(ul,ol):last-child>li:last-child]:after:align-text-bottom [&>:is(ul,ol):last-child>li:last-child]:after:content-['']`;function HY({item:e,author:t}){return(0,A.jsxs)(`div`,{children:[t&&(0,A.jsx)(cM,{author:t,className:`mb-1.5`}),e.content&&(0,A.jsx)(AY,{className:_A(`tangle-prose`,`tangle-transcript-text text-[length:var(--transcript-font-size)] leading-[var(--transcript-line-height)]`,e.isStreaming&&VY),children:e.content}),e.isStreaming&&!e.content&&(0,A.jsx)(`span`,{"aria-hidden":!0,"data-streaming-caret":``,className:`ml-0.5 inline-block h-[1em] w-0.5 animate-pulse rounded-full bg-muted-foreground align-text-bottom`}),e.toolCalls&&(0,A.jsx)(`div`,{className:`mt-1`,children:e.toolCalls}),e.after&&(0,A.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:e.after})]})}function UY({item:e}){let t=LY[e.tone??`default`],n=t.icon;return(0,A.jsx)(`div`,{className:_A(`rounded-[var(--radius-lg)] border px-4 py-3`,t.card),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(n,{className:_A(`mt-0.5 h-4 w-4 shrink-0`,t.text)}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`div`,{className:_A(`text-sm font-medium`,t.text),children:e.label}),e.detail&&(0,A.jsx)(`div`,{className:_A(`mt-0.5 text-sm`,t.supportingText),children:e.detail})]})]})})}function WY({item:e}){let t=LY[e.tone??`default`],n=(0,A.jsx)(`div`,{className:_A(`rounded-[var(--radius-lg)] border px-4 py-3`,t.card),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(`div`,{className:`mt-0.5 flex h-[var(--avatar-size)] w-[var(--avatar-size)] shrink-0 items-center justify-center rounded-[var(--radius-md)] bg-muted/50 text-foreground`,children:e.icon??(0,A.jsx)(wj,{className:`h-4 w-4`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:_A(`text-sm font-medium`,t.text),children:e.title}),e.description&&(0,A.jsx)(`div`,{className:_A(`mt-1 text-sm`,t.supportingText),children:e.description}),e.meta&&(0,A.jsx)(`div`,{className:_A(`mt-2 flex flex-wrap items-center gap-2 text-xs`,t.supportingText),children:e.meta})]}),e.action&&(0,A.jsx)(`div`,{className:`shrink-0`,children:e.action})]})});return e.onClick?(0,A.jsx)(`div`,{role:`button`,tabIndex:0,onClick:e.onClick,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.onClick?.())},className:_A(`block w-full rounded-[var(--radius-lg)] text-left transition-transform hover:-translate-y-0.5`,kA),children:n}):n}function GY({className:e,children:t}){return(0,A.jsx)(`div`,{className:_A(`mx-auto flex w-full max-w-5xl flex-col px-4 py-4`,e),children:t})}function KY({item:e,previous:t,headed:n,renderToolActions:r,viewerId:i}){let a=RY(e);return(0,A.jsx)(`div`,{"data-timeline-step":a,className:_A(zY(t,a),a===`tool`&&BY),children:(0,A.jsx)(qY,{item:e,headed:n,renderToolActions:r,viewerId:i})})}function qY({item:e,headed:t,renderToolActions:n,viewerId:r}){return e.kind===`message`?e.role===`user`?(0,A.jsx)(hM,{content:e.content,timestamp:e.timestamp,author:e.author,viewerId:r}):(0,A.jsx)(HY,{item:e,author:t?e.author:void 0}):e.kind===`tool`?(0,A.jsx)(FY,{type:e.call.type,label:e.call.label,status:e.call.status,detail:e.call.detail,output:e.call.output,duration:e.call.duration,part:e.part,actions:e.part?n?.(e.part):void 0}):e.kind===`tool_group`?(0,A.jsx)(IY,{title:e.title,children:e.calls.map((t,r)=>{let i=e.parts?.[r];return(0,A.jsx)(FY,{type:t.type,label:t.label,status:t.status,detail:t.detail,output:t.output,duration:t.duration,part:i,actions:i?n?.(i):void 0},t.id)})}):e.kind===`status`?(0,A.jsx)(UY,{item:e}):e.kind===`artifact`?(0,A.jsx)(WY,{item:e}):e.content}function JY(e){let t=e.source,n=e.detail.nativeRecordId;return typeof n==`string`&&n?JSON.stringify([e.node,`native`,n,e.kind,t?.item??null]):t?.path?JSON.stringify([e.node,t.path,t.line??null,t.pointer??null,t.item??null]):e.id}function YY(e){let t=new Map,n=new Map;for(let r of e){let e=JY(r),i=t.get(e)??0;t.set(e,i+1),n.set(r.id,i?`${e}#${i}`:e)}return n}var XY=e=>e===void 0||/^\s*(\{\s*\}|null)?\s*$/.test(e);function ZY(e){return e===void 0?`args not captured`:XY(e)?`empty args`:null}function QY(e,t){switch(e){case`error`:return`Error`;case`returned`:return`Returned`;case`pending`:return`Not returned`;case`ambiguous`:return`Ambiguous`;default:return t?`Pending`:`Result not captured`}}function $Y(e){let t=e.usage;return typeof t?.output==`number`&&Number.isFinite(t.output)?t.output:null}function eX(e){let t=$Y(e);return t!==null&&t<2e3}function tX(e){let t=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):0,n=t(e.reasoningOmitted),r=t(e.reasoningRedacted),i=[];return n&&i.push(n===1?`thinking not returned by provider`:`${n} thinking blocks not returned by provider`),r&&i.push(r===1?`thinking redacted (encrypted)`:`${r} thinking blocks redacted (encrypted)`),i}var nX=/await|wait|poll|sleep|observe|status/i;function rX(e){if(typeof e!=`string`||!e.trimStart().startsWith(`{`))return!1;try{let t=JSON.parse(e);return!!t&&typeof t==`object`&&!Array.isArray(t)&&t.pending===!0}catch{return!1}}var iX=e=>(e??[]).some(e=>!rX(e.detail.publicText));function aX(e,t,n){let r=e.detail;if(r.role!==`assistant`||e.category===`lifecycle`||r.lifecycle!==void 0||r.publicText||r.recordedClaim||r.reasoning||r.responseStatus===`error`||r.contentOmitted||r.publicationNote||r.clip||tX(r).length||t.length!==1)return null;let i=t[0];return i.clip||i.publicationNote||n(i.id)||!XY(i.input)&&!nX.test(i.name)?null:i}function oX(e,t,n){let r=e.detail;return r.role!==`assistant`||e.category===`lifecycle`||r.lifecycle!==void 0||r.publicText||r.recordedClaim||r.reasoning||r.responseStatus===`error`||r.contentOmitted||r.publicationNote||r.clip||tX(r).length||!t.length||t.some(t=>t.input!==void 0||t.clip||t.publicationNote||n(e,t.id))?null:t}function sX(e,{callsOf:t,captured:n,keyOf:r,min:i=2}){let a=[],o=null,s=()=>{if(o){if(o.events.length>=i)a.push({kind:`hollow`,key:`hollow:${r(o.events[0])}`,events:o.events,calls:[...o.calls.entries()].map(([e,t])=>({name:e,count:t})),spanMs:o.spanMs});else for(let e of o.events)a.push({kind:`event`,key:r(e),event:e});o=null}};for(let r of e){if(r.kind!==`event`){s(),a.push(r);continue}let e=oX(r.event,t(r.event),n);if(!e){s(),a.push(r);continue}o??={events:[],calls:new Map,spanMs:0},o.events.push(r.event);for(let t of e)o.calls.set(t.name,(o.calls.get(t.name)??0)+1)}s();for(let e of a){if(e.kind!==`hollow`)continue;let t=e.events.map(e=>Date.parse(e.at)).filter(Number.isFinite);e.spanMs=t.length>1?Math.max(...t)-Math.min(...t):0}return a}function cX(e){let t=e.reduce((e,t)=>e+t.count,0),n=e.map(e=>e.count>1?`${e.name} ×${e.count}`:e.name);return`${t} tool call${t===1?``:`s`} · ${n.join(` · `)}`}function lX(e,{callsOf:t,answered:n,keyOf:r,min:i=2}){let a=[],o=null,s=()=>{if(o){if(o.events.length>=i)a.push({kind:`polls`,key:`polls:${r(o.events[0])}`,name:o.name,input:o.input,events:o.events});else for(let e of o.events)a.push({kind:`event`,key:r(e),event:e});o=null}};for(let i of e){let e=aX(i,t(i),e=>n(i,e));if(!e){s(),a.push({kind:`event`,key:r(i),event:i});continue}let c=XY(e.input)?``:e.input.trim();o&&(o.name!==e.name||o.args!==c)&&s(),o??={name:e.name,args:c,input:e.input,events:[]},o.events.push(i)}return s(),a}function uX(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function dX(e){let t=e.map(e=>Date.parse(e.at)).filter(Number.isFinite),n=t.length?Math.max(...t)-Math.min(...t):0,r=0,i=0;for(let t of e){let e=t.detail.usage;if(!e||t.detail.usageScope!==void 0)continue;let n=[e.input,e.output,e.cacheRead,e.cacheWrite].filter(e=>typeof e==`number`);n.length&&(i++,r+=n.reduce((e,t)=>e+t,0))}let a=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),o=i?i<e.length?`~${a.format(r)} tokens (${i} of ${e.length} measured)`:`~${a.format(r)} tokens`:`tokens unknown`;return{polls:e.length,spanMs:n,tokens:i?r:null,measured:i,label:`waited ${uX(n)} · ${e.length} polls · ${o}`}}function fX(e){let t=e.indexOf(`[user] `),n=e.startsWith(`[system] `)&&t>=0?e.slice(t+7).trim():e.trim();if(!n.startsWith(`{`))return n;try{let e=JSON.parse(n),t=[`objective`,`instruction`].map(t=>e[t]).filter(e=>typeof e==`string`&&e.trim().length>0);return t.length?t.join(`
544
544
 
545
545
  `):n}catch{return n}}var pX=e=>e.category===`lifecycle`||e.detail.lifecycle!==void 0,mX=e=>new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}).format(e),hX=e=>{let t=Math.round(e/1e3);if(t<60)return`${t} s`;let n=Math.floor(t/60);return n<60?`${n} m ${t%60} s`:`${Math.floor(n/60)} h ${n%60} m`};function gX({name:e}){let t=e.toLowerCase(),n=/think|reason/.test(t)?`M8 2.5a4 4 0 0 0-2.5 7.1V11h5V9.6A4 4 0 0 0 8 2.5M6 13.5h4`:/search|grep|find/.test(t)?`M10 10l3.5 3.5M11 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0`:/bash|shell|exec|run|command/.test(t)?`M2 3h12v10H2zM4 6l2 2-2 2M8 10h4`:/await|wait|sleep|poll/.test(t)?`M8 2.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11M8 5v3l2 1.5`:`M10 8a2 2 0 1 0-4 0 2 2 0 0 0 4 0`;return(0,A.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,A.jsx)(`path`,{d:n,stroke:`currentColor`,strokeWidth:`1.4`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var _X=new Set([`bash`,`shell`,`command`,`execute`,`write`,`write_file`,`create_file`,`edit`,`patch`,`read`,`read_file`,`cat`,`grep`,`search`,`rg`,`glob`,`find`,`ls`,`web_search`,`web_fetch`,`fetch`,`task`,`agent`,`spawn`]),vX={bash:`bash`,shell:`bash`,command:`bash`,execute:`bash`,read:`read`,read_file:`read`,cat:`read`,write:`write`,write_file:`write`,create_file:`write`,edit:`edit`,patch:`edit`,grep:`grep`,search:`grep`,rg:`grep`,glob:`glob`,find:`glob`,ls:`list`},yX=e=>(e.startsWith(`mcp__`)&&e.slice(e.lastIndexOf(`__`)+2)||e).replace(/^agent-runtime-/,``),bX=e=>{if(e!==void 0)try{let t=JSON.parse(e);return t&&typeof t==`object`?t:e}catch{return e}},xX=e=>{let t=e;try{let n=JSON.parse(e),r=typeof n?.error==`string`?n.error:typeof n?.message==`string`?n.message:void 0;r&&(t=r)}catch{}return yO(t.split(`
546
- `).find(e=>e.trim())??``).slice(0,200)};function SX(e,t,n,r,i,a){let o=yX(t.name),s=n?EO(n)||n.detail.contentOmitted||``:void 0,c=r===`error`?`error`:r===`pending`||r===`missing`&&a?`running`:`completed`,l=r===`ambiguous`||r===`missing`&&!a?QY(r,a):void 0,u={type:`tool`,id:e,tool:o,state:{status:c,input:bX(t.input),...s===void 0?{}:{output:s},...c===`error`?{error:xX(s??``)||`The call failed.`}:{},...i!==null&&i>=0?{time:{start:0,end:i}}:{},...l?{metadata:{note:l}}:{}}},d=_X.has(o.toLowerCase()),f=jM(u),p=ZY(t.input)??(f.description||(d?void 0:AO(t)));return{id:e,kind:`tool`,part:u,call:{id:e,type:vX[o.toLowerCase()]??`unknown`,label:d?f.title:o.replaceAll(`_`,` `),status:c===`error`?`error`:c===`running`?`running`:`success`,...p?{detail:p}:{},...i!==null&&i>=0?{duration:i}:{}}}}var CX=e=>{let t=e.state.metadata?.note;return t?(0,A.jsx)(`span`,{className:`tool-note`,children:t}):null},wX=({id:e,children:t})=>(0,A.jsx)(qY,{className:`ar-tl`,items:[{id:e,kind:`custom`,content:t}]}),TX=e=>e&&typeof e==`object`&&`bytes`in e?e:void 0;function EX({clip:e,open:t}){return e?(0,A.jsxs)(`p`,{className:`clip-note`,children:[(0,A.jsxs)(`span`,{children:[new Intl.NumberFormat(`en-US`).format(e.bytes),` bytes, middle omitted.`]}),e.sha256&&t?(0,A.jsx)(`button`,{type:`button`,className:`link-button`,"data-load-full":e.sha256,onClick:()=>t(e.sha256),children:`Full output`}):null]}):null}function DX({row:e,context:t}){let n=dX(e.events),r=ZY(e.input)??yO(e.input??``);return(0,A.jsx)(`div`,{className:`chat-row poll-group${e.events.some(e=>e.id===t.selected)?` selected`:``}`,"data-poll-group":e.events.length,"data-entry":e.events[0].id,title:vO(e.events[0].at),children:(0,A.jsx)(wX,{id:e.key,children:(0,A.jsx)(mJ,{icon:(0,A.jsx)(gX,{name:e.name}),title:yX(e.name),description:[n.label,r].filter(Boolean).join(` · `),descriptionMono:!0,children:(0,A.jsx)(`ol`,{className:`poll-calls`,children:e.events.map(e=>(0,A.jsxs)(`li`,{"data-message":e.id,children:[(0,A.jsx)(`time`,{dateTime:e.at,children:vO(e.at)}),(0,A.jsx)(`span`,{className:`mono`,children:ZY(OO(e)[0]?.input)??yO(OO(e)[0]?.input??``)})]},e.id))})})})})}function OX({row:e,context:t}){return(0,A.jsx)(`div`,{className:`chat-row hollow-group${e.events.some(e=>e.id===t.selected)?` selected`:``}`,"data-hollow-group":e.events.length,"data-entry":e.events[0].id,title:vO(e.events[0].at),children:(0,A.jsx)(wX,{id:e.key,children:(0,A.jsx)(mJ,{icon:(0,A.jsx)(gX,{name:e.calls[0]?.name??`tool`}),title:cX(e.calls),description:`args not captured`,durationMs:e.spanMs||void 0})})})}function kX({row:e,context:t}){if(e.kind===`polls`)return(0,A.jsx)(DX,{row:e,context:t});if(e.kind===`hollow`)return(0,A.jsx)(OX,{row:e,context:t});let{index:n,cutoff:r,selected:i,anchor:a,thinkingSpan:o,opened:s,setOpen:c,flagMarks:l,opener:u,flags:d,paired:f,live:p}=t,m=e.event,h={className:[`chat-row`,i===m.id&&`selected`,d?.has(m.id)&&`flagged`].filter(Boolean).join(` `),"data-entry":m.id,"data-message":m.id,"data-message-node":m.node,title:vO(m.at)};if(pX(m)){let e=EO(m);return(0,A.jsxs)(`p`,{...h,className:`${h.className} lifecycle-note${m.detail.isError?` lifecycle-error`:``}`,children:[(0,A.jsx)(`b`,{children:m.label}),e&&(0,A.jsx)(`span`,{children:yO(e).slice(0,280)}),l(m)]})}let g=EO(m),_=OO(m),v=typeof m.detail.reasoning==`string`?m.detail.reasoning:``,y=tX(m.detail),b=m.detail.role===`user`,x=m.detail.responseStatus===`error`,S=m.detail.recordedClaim!==void 0,C=m.detail.toolCallId!==void 0||m.detail.role===`toolResult`,w=TX(m.detail.clip);if(b&&g&&!C){let e=fX(g),t=`prompt:${a(m)}`,n=e.length>280,r=n&&!s.has(t);return(0,A.jsxs)(`article`,{...h,children:[(0,A.jsx)(`div`,{className:`ar-user`,children:(0,A.jsx)(hM,{content:r?`${e.slice(0,280).trimEnd()}…`:e,timestamp:new Date(m.at),actions:n?(0,A.jsx)(`button`,{type:`button`,className:`link-button`,"data-open-key":t,"aria-expanded":!r,onClick:()=>c(t,r),children:r?`Full prompt`:`Shorter`}):void 0})}),!r&&(0,A.jsx)(EX,{clip:w,open:u(m)}),l(m)]})}let T=[];if(v&&T.push({id:`${m.id}:reasoning`,kind:`custom`,content:(0,A.jsx)(MY,{part:{type:`reasoning`,text:v},autoCollapse:!1})}),y.length){let e=$Y(m.detail),t=o.get(m.id),n=e===null?y.join(` · `):`${t!==void 0&&t>=1e3?`for ${hX(t)} · `:``}${mX(e)} output tokens · ${y.join(` · `)}`;T.push({id:`${m.id}:thinking`,kind:`custom`,content:(0,A.jsx)(`span`,{"data-thinking-withheld":!0,children:(0,A.jsx)(mJ,{icon:(0,A.jsx)(gX,{name:`think`}),title:`Thought`,description:n})})})}if(x)T.push({id:m.id,kind:`status`,tone:`error`,label:`The request failed`,detail:g?yO(g).slice(0,400):`No assistant response is present in this record.`});else if(S)T.push({id:m.id,kind:`status`,tone:`info`,label:`Recorded finding`,detail:yO(g).slice(0,600)});else if(C){let e=m.detail.toolCallId!==void 0&&(n.calls.get(DO(m.node,m.detail.toolCallId))?.length??0)>1;T.push(SX(m.id,{id:m.id,name:m.label||`Tool result`},m,e?`ambiguous`:m.detail.isError?`error`:`returned`,null,p))}else g?T.push({id:m.id,kind:`message`,role:`assistant`,content:g}):!_.length&&!v&&!y.length&&T.push({id:m.id,kind:`status`,label:m.detail.contentOmitted??`No text body is present in this record.`});let ee=a(m);for(let e of _){let t=f(m,e),i=t.filter(e=>_O(e.at)<=r).at(-1),a=(n.calls.get(DO(m.node,e.id))?.length??0)>1?`ambiguous`:i?i.detail.isError?`error`:`returned`:t.some(e=>_O(e.at)>r)?`pending`:`missing`,o=(typeof i?.detail.durationMs==`number`?i.detail.durationMs:null)??(i&&i.detail.atBasis!==`carried`?_O(i.at)-_O(m.at):null);T.push(SX(`tool:${ee}:${e.id}`,e,i,a,o,p))}let E=[m.detail.publicationNote,S?m.detail.assessment:void 0].filter(e=>!!e);return(0,A.jsxs)(`article`,{...h,children:[(0,A.jsx)(qY,{className:`ar-tl`,items:T,renderToolActions:CX}),g&&!C&&(0,A.jsx)(EX,{clip:_.length?void 0:w,open:u(m)}),E.map(e=>(0,A.jsx)(`p`,{className:`publication-note`,children:e},e)),l(m)]})}function AX({index:e,actor:t,cutoff:n,query:r,category:i,selected:a,openSource:o,flags:s,onFlag:c,lifecycle:l=!1,live:u=!1}){let[d,f]=(0,b.useState)(()=>{let t=YY(e.events);return new Set(e.events.filter(e=>e.detail.promptKind===`initial`).map(e=>`prompt:${t.get(e.id)??e.id}`))}),p=(0,b.useRef)(null),m=(0,b.useMemo)(()=>YY(e.events),[e]),h=(0,b.useCallback)(e=>m.get(e.id)??e.id,[m]),g=e=>o?t=>o(t,e):void 0,_=(e,t)=>f(n=>{if(n.has(e)===t)return n;let r=new Set(n);return t?r.add(e):r.delete(e),r}),v=(t,n)=>{let r=DO(t.node,n.id);return e.calls.get(r)?.length===1?e.results.get(r)??[]:[]},y=(0,b.useMemo)(()=>{if(!a)return;let t=e.byEvent.get(a);if(t?.detail.toolCallId!==void 0){let n=e.calls.get(DO(t.node,t.detail.toolCallId));if(n?.length===1)return n[0].event.id}return a},[a,e]),x=(0,b.useMemo)(()=>(e.byActor.get(t)??[]).filter(t=>{if(_O(t.at)>n)return!1;if(t.id===y)return!0;if(pX(t))return l&&MO(t,e,r,i);if(t.detail.toolCallId!==void 0){let r=e.calls.get(DO(t.node,t.detail.toolCallId));if(r?.length===1&&_O(r[0].event.at)<=n)return!1}let a=OO(t);return!(t.detail.role||EO(t)||t.detail.reasoning||t.detail.responseStatus===`error`||a.length)||t.detail.role===`assistant`&&!EO(t)&&!t.detail.reasoning&&!a.length&&t.detail.responseStatus!==`error`&&!t.detail.contentOmitted&&(!tX(t.detail).length||eX(t.detail))?!1:MO(t,e,r,i)?!0:a.some(a=>{let o=DO(t.node,a.id);return e.calls.get(o)?.length===1&&(e.results.get(o)??[]).some(t=>_O(t.at)<=n&&MO(t,e,r,i))})}),[e,t,n,r,i,l,y]),S=(0,b.useMemo)(()=>sX(lX(x,{callsOf:OO,answered:(t,n)=>iX(e.results.get(DO(t.node,n))),keyOf:h}),{callsOf:OO,captured:(t,n)=>(e.results.get(DO(t.node,n))??[]).some(e=>EO(e)),keyOf:h}),[x,e,h]),C=(0,b.useMemo)(()=>{let n=new Map,r=null;for(let i of e.byActor.get(t)??[]){let e=_O(i.at);r!==null&&Number.isFinite(e)&&tX(i.detail).length&&n.set(i.id,Math.max(0,e-r)),Number.isFinite(e)&&(r=e)}return n},[e,t]),w=(0,b.useMemo)(()=>{let e=new Map;for(let t of S)if(t.kind===`polls`)for(let n of t.events)e.set(n.id,t.key);else if(t.kind===`hollow`)for(let n of t.events)e.set(n.id,t.key);else e.set(t.event.id,t.key);return e},[S]),T=(e.byActor.get(t)??[]).some(e=>!pX(e)&&(e.detail.role||EO(e)||OO(e).length)),ee=(0,b.useRef)(y);ee.current=y;let E=(0,b.useRef)(!1);(0,b.useLayoutEffect)(()=>{E.current=u&&!ee.current,p.current&&!ee.current&&(p.current.scrollTop=u?p.current.scrollHeight:0)},[t]),(0,b.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{E.current=e.scrollHeight-e.scrollTop-e.clientHeight<24};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]),(0,b.useLayoutEffect)(()=>{let e=p.current;if(!e||!E.current)return;e.scrollTop=e.scrollHeight;let t=0,n=requestAnimationFrame(function r(){E.current&&(e.scrollTop=e.scrollHeight,++t<20&&(n=requestAnimationFrame(r)))});return()=>cancelAnimationFrame(n)},[S]),(0,b.useEffect)(()=>{if(!a)return;let t=e.byEvent.get(a);if(!t)return;let n=[`prompt:${h(t)}`,`reasoning:${h(t)}`];if(t.detail.toolCallId!==void 0)for(let r of e.calls.get(DO(t.node,t.detail.toolCallId))??[])n.push(`tool:${h(r.event)}:${r.call.id}`,w.get(r.event.id)??``);for(let e of OO(t))n.push(`tool:${h(t)}:${e.id}`);let r=w.get(a);r?.startsWith(`polls:`)&&n.push(r),f(e=>new Set([...e,...n.filter(Boolean)]))},[a,e]);let te=e=>{let t=s?.get(e.id);return t?.length?(0,A.jsx)(`span`,{className:`event-flags`,children:t.map(t=>(0,A.jsx)(`button`,{type:`button`,className:`event-flag polarity-${t.polarity}`,title:t.title,"data-flag":t.dimension,onClick:()=>c?.(t,e),children:t.dimension},`${t.dimension}:${t.label}`))}):null},ne=(0,b.useCallback)(e=>e.key,[]),re=(0,b.useCallback)(e=>e.kind===`polls`?36:e.kind===`hollow`||pX(e.event)?26:!EO(e.event)&&OO(e.event).length?16+36*OO(e.event).length:96,[]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(`div`,{className:`conversation-scroll`,"data-chat":!0,ref:p,tabIndex:0,"aria-label":`Scrollable retained conversation`,children:[!S.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:r||i!==`all`?`No messages match this filter.`:T?`No messages at the selected time.`:`Conversation not retained. Its absence does not mean the agent did no work.`}),(0,A.jsx)(VO,{items:S,keyOf:ne,render:t=>(0,A.jsx)(kX,{row:t,context:{index:e,cutoff:n,selected:a,opened:d,anchor:h,opener:g,setOpen:_,flagMarks:te,paired:v,thinkingSpan:C,flags:s,live:u}}),scroller:p,target:y?w.get(y):void 0,estimate:re})]})})}var jX=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),t())};function MX({index:e,cutoff:t,selected:n,inspect:r,showTooltip:i,hideTooltip:a,navigate:o,events:s,zoom:c,marks:l,behaviors:u,baseWidth:d=940}){let f=d*c,p=u?.length?26:0,m=Math.max(85,48+e.actors.length*30)+p,h=Math.max(e.end-e.start,1),g=e.events.some(e=>e.end!==void 0),_=Math.max(1,Math.log10(h)+1),v=t=>{let n=Math.max(0,t-e.start);return n<=0?200:g?200+n/h*(f-200-20):200+Math.log10(n+1)/_*(f-200-20)},y=(0,b.useMemo)(()=>new Map(e.actors.map((e,t)=>[e.id,t])),[e]),x=(0,b.useMemo)(()=>{let t=new Map;for(let n of s){let r=y.get(e.canonical(n.node));if(r===void 0)continue;if(n.end){t.set(n.id,{lane:r,bin:0,events:[n]});continue}let i=Math.floor((v(_O(n.at))-200)/6),a=`${r}:${i}`,o=t.get(a)??{lane:r,bin:i,events:[]};o.events.push(n),t.set(a,o)}return[...t.values()]},[s,y,e,h,f]),S=Math.ceil(f/160);return(0,A.jsx)(`div`,{className:`timeline-scroll`,tabIndex:0,"aria-label":`Scrollable agent activity timeline`,children:(0,A.jsxs)(`svg`,{"data-timeline":!0,viewBox:`0 0 ${f} ${m}`,style:{width:f,height:m},role:`group`,tabIndex:0,"aria-label":`Activity timeline. Left and right arrows select events.`,onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),o(e.key===`ArrowLeft`?-1:1))},children:[Array.from({length:S+1},(e,t)=>{let n=t/S,r=g?n*h:Math.max(0,10**(n*_)-1),i=200+n*(f-200-20);return(0,A.jsxs)(`g`,{children:[(0,A.jsx)(`line`,{x1:i,x2:i,y1:30,y2:m-12,className:`grid-line`}),(0,A.jsx)(`text`,{x:i,y:18,textAnchor:`middle`,className:`axis-label`,children:wO(Math.min(r,h))})]},t)}),e.actors.map((e,t)=>(0,A.jsxs)(`g`,{children:[(0,A.jsxs)(`text`,{x:4,y:44+t*30,className:`lane-label`,children:[(0,A.jsx)(`title`,{children:e.label}),e.label.length>20?`${e.label.slice(0,19)}…`:e.label]}),(0,A.jsx)(`line`,{x1:200,x2:f-20,y1:40+t*30,y2:40+t*30,className:`grid-line`})]},e.id)),x.map(({lane:o,bin:s,events:c})=>{let l=c.findIndex(e=>e.id===n),u=c[l<0?0:l],d=[...FO(u,e,t).sections];u.activity&&d.unshift({kind:`note`,value:`${u.activity} · ${u.phase??`activity`}${u.end?` · ${wO(_O(u.end)-_O(u.at))}`:``}`}),u.detail.modelSplitEstimated&&d.push({kind:`note`,value:`Model split is estimated from step tokens, normalized to observed elapsed time.`}),typeof u.detail.editMethod==`string`&&d.push({kind:`note`,value:`Edit: ${u.detail.editMethod} · ${String(u.detail.editTarget??`unknown`)}`}),c.length>1&&d.unshift({kind:`note`,value:`${c.length} events in this interval. Select again to cycle; zoom separates nearby times.`});let f=()=>{a(),r(c[l<0?0:(l+1)%c.length])};return(0,A.jsx)(`rect`,{x:u.end?v(_O(u.at)):200+s*6,y:34+o*30,width:u.end?Math.max(1,v(_O(u.end))-v(_O(u.at))):4,height:12,rx:1,className:`event category-${FX(u.category)} ${l>=0?`selected`:``}`,opacity:c.every(e=>_O(e.at)>t)?.25:1,"data-id":u.id,"data-cluster-count":c.length,role:`button`,tabIndex:l>=0?0:-1,"aria-label":`${u.label}, ${e.actors[o]?.label}, ${vO(u.at,!0)}${c.length>1?`, ${c.length} events, activate to cycle`:``}`,onMouseEnter:e=>i(e,u.label,d),onMouseLeave:a,onFocus:e=>i(e,u.label,d),onBlur:a,onClick:f,onKeyDown:e=>jX(e,f),children:(0,A.jsx)(`title`,{children:`${u.label} · ${vO(u.at,!0)}`})},u.end?u.id:`${o}:${s}`)}),l&&e.events.map(n=>{let i=l.get(n.id),a=y.get(e.canonical(n.node));if(!i?.length||a===void 0||_O(n.at)>t)return null;let o=v(_O(n.at)),s=31+a*30;return(0,A.jsx)(`path`,{d:`M${o-3},${s-4} L${o+3},${s-4} L${o},${s}z`,className:`timeline-flag polarity-${i[0].polarity}`,onClick:()=>r(n),children:(0,A.jsx)(`title`,{children:i.map(e=>e.title).join(`
547
- `)})},`mark:${n.id}`)}),(0,A.jsx)(`line`,{x1:v(t),x2:v(t),y1:26,y2:m-8,className:`cursor-line`,pointerEvents:`none`}),!s.length&&(0,A.jsx)(`text`,{x:210,y:m-8,className:`axis-label`,children:`No events match this filter.`}),u&&u.length>0&&(0,A.jsxs)(`g`,{"data-behavior-lane":!0,children:[(0,A.jsx)(`text`,{x:193,y:m-9,textAnchor:`end`,className:`axis-label`,children:`behaviors`}),u.map((t,n)=>(0,A.jsx)(`rect`,{x:v(t.at)-3,y:m-20,width:6,height:14,rx:2,className:`behavior-tick axis-${t.axis}`,opacity:.35+.65*t.confidence,role:`button`,tabIndex:0,"aria-label":`${t.behavior} (${Math.round(t.confidence*100)}%)${t.quote?`: ${t.quote.slice(0,60)}`:``}`,onMouseEnter:e=>i(e,t.behavior,[{kind:`status`,value:`${Math.round(t.confidence*100)}% confidence · ${t.axis}`,tone:t.axis===`alignment`?`error`:t.axis===`affect`?`warn`:`ok`},...t.quote?[{kind:`body`,value:t.quote.slice(0,90)}]:[]]),onMouseLeave:a,onFocus:e=>i(e,t.behavior,[{kind:`status`,value:`${Math.round(t.confidence*100)}% confidence · ${t.axis}`}]),onBlur:a,onClick:()=>t.eventId&&r(e.byEvent.get(t.eventId),!0),onKeyDown:n=>jX(n,()=>t.eventId&&r(e.byEvent.get(t.eventId),!0))},`${t.behavior}:${n}`))]})]})})}var NX=[`coordination`,`compute`,`computation`,`verification`,`literature`,`writing`,`setup`,`infrastructure`,`waiting`,`reasoning`,`lifecycle`,`other`],PX={"edit files":`writing`,build:`compute`,"gate/test":`verification`,"git/PR write":`coordination`,"prod/remote ops":`infrastructure`,"workspace setup":`setup`,messaging:`coordination`,"read messages":`coordination`,"query status":`lifecycle`,"analysis script":`reasoning`,"read code/files":`literature`,"memory search":`literature`,subagents:`coordination`},FX=e=>PX[e]??(NX.includes(e)?e:`other`),IX=[`input`,`output`,`cacheRead`,`cacheWrite`],LX={input:`Input`,output:`Output`,cacheRead:`Cache read`,cacheWrite:`Cache write`};function RX({index:e,cutoff:t,inspect:n,showTooltip:r,hideTooltip:i,navigate:a,actor:o,metric:s,axis:c}){let[l,u]=(0,b.useState)(()=>new Set),d=IX.filter(e=>!l.has(e)),f=(0,b.useMemo)(()=>{let n=[],r={input:0,output:0,cacheRead:0,cacheWrite:0},i={input:0,output:0,cacheRead:0,cacheWrite:0},a=0,l=0,u=0,d=e.byActor.get(o)??[],f=e.recordedOrder,p=c===`order`?[...d].sort((e,t)=>(f.get(e.id)??0)-(f.get(t.id)??0)):d;for(let o of p){if(_O(o.at)>t)continue;if(s===`tool-time`){if(o.detail.toolCallId===void 0)continue;let r=e.calls.get(DO(o.node,o.detail.toolCallId))??[];if(r.length!==1){l++;continue}let i=r[0].event;if(_O(i.at)>t||_O(o.at)<_O(i.at)){u++;continue}n.push({event:o,at:_O(o.at),values:{},elapsed:(_O(o.at)-_O(i.at))/1e3});continue}let c=o.detail.usage;if(!c)continue;let d=o.detail.usageScope!==void 0;if(s!==`cumulative`&&d)continue;IX.some(e=>c[e]===void 0)&&a++;let f={};for(let e of IX){let t=c[e];t!==void 0&&(d||(r[e]+=t,i[e]++),f[e]=s===`cumulative`?d?t:r[e]:t)}Object.keys(f).length&&n.push({event:o,at:_O(o.at),values:f,scoped:d})}return{points:n,totals:r,counts:i,incomplete:a,ambiguous:l,invalidTiming:u}},[e,t,o,s,c]),{points:p,totals:m,counts:h}=f,g=Math.max(1,...p.flatMap(e=>s===`tool-time`?[e.elapsed??0]:d.map(t=>e.values[t]??0))),_=(n,r)=>62+(c===`time`?(n.at-e.start)/Math.max(1,t-e.start):r/Math.max(1,p.length-1))*496,v=e=>218-e/g*190,y=(e,t)=>{let n=!1;return p.filter(e=>!!e.scoped===t).map(t=>{let r=t.values[e];if(r===void 0)return n=!1,``;let i=`${n?`L`:`M`}${_(t,p.indexOf(t))},${v(r)}`;return n=!0,i}).join(` `)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`svg`,{"data-tokens":!0,viewBox:`0 0 580 265`,role:`group`,tabIndex:0,"aria-label":`Recorded usage or tool return time. Points open source events.`,onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),a(e.key===`ArrowLeft`?-1:1))},children:[Array.from({length:5},(n,r)=>{let i=r*g/4,a=v(i),o=62+r/4*496;return(0,A.jsxs)(`g`,{children:[(0,A.jsx)(`line`,{x1:62,x2:558,y1:a,y2:a,className:`grid-line`}),(0,A.jsx)(`text`,{x:55,y:a+4,textAnchor:`end`,className:`axis-label`,children:s===`tool-time`?`${i.toFixed(g>10?0:1)}s`:CO(i)}),(0,A.jsx)(`text`,{x:o,y:240,textAnchor:`middle`,className:`axis-label`,children:c===`time`?wO((t-e.start)*r/4):p.length?String(Math.round((p.length-1)*r/4)+1):`—`})]},r)}),(0,A.jsx)(`text`,{x:62,y:14,className:`axis-label`,children:s===`tool-time`?`Observed call → result interval (seconds)`:s===`cumulative`?`Cumulative measured tokens`:`Measured tokens per response`}),s!==`tool-time`&&d.map(e=>(0,A.jsx)(`path`,{d:y(e,!1),className:`usage-line ${e}-line`},e)),s===`cumulative`&&p.some(e=>e.scoped)&&d.map(e=>(0,A.jsx)(`path`,{d:y(e,!0),className:`usage-line ${e}-line scoped-line`},`scoped-${e}`)),p.map((a,o)=>{let c=s===`tool-time`?a.elapsed:Math.max(0,...d.map(e=>a.values[e]??0));if(s!==`tool-time`&&c===0&&!d.some(e=>a.values[e]!==void 0))return null;let l=FO(a.event,e,t).sections;s===`tool-time`?l.push({kind:`status`,value:`${a.elapsed.toFixed(3)} seconds between the recorded call and this result. Includes queue and tool time.`,tone:`muted`}):s===`cumulative`&&l.push({kind:`usage`,value:IX.map(e=>`${LX[e]} ${a.values[e]===void 0?`unmeasured`:CO(a.values[e])}`).join(` `)});let u=()=>{i(),n(a.event,!0)};return(0,A.jsx)(`circle`,{cx:_(a,o),cy:v(c),r:4,className:s===`tool-time`?a.event.detail.isError?`time-error`:`time-point`:a.scoped?`usage-point scoped-point`:`usage-point`,"data-id":a.event.id,tabIndex:0,role:`button`,"aria-label":`${a.event.label}, ${s===`tool-time`?`${a.elapsed?.toFixed(3)} seconds`:`measured token usage`}`,onMouseEnter:e=>r(e,a.event.label,l),onMouseLeave:i,onFocus:e=>r(e,a.event.label,l),onBlur:i,onClick:u,onKeyDown:e=>jX(e,u)},a.event.id)}),!p.length&&(0,A.jsx)(`text`,{x:290,y:120,textAnchor:`middle`,className:`axis-label`,children:s===`tool-time`?`No matched tool timing at this time`:`No measured usage at this time`})]}),s!==`tool-time`&&(0,A.jsxs)(`div`,{className:`usage-legend`,children:[IX.map(e=>(0,A.jsx)(`button`,{type:`button`,className:`${e}-key legend-toggle`,"aria-pressed":!l.has(e),title:l.has(e)?`Show ${LX[e]}`:`Hide ${LX[e]}`,onClick:()=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:LX[e]},e)),p.some(e=>e.scoped)&&(0,A.jsx)(`span`,{className:`scoped-key`,children:`metered windows · execution-to-date`})]}),(0,A.jsx)(`p`,{className:`small`,"data-token-caption":!0,children:s===`tool-time`?`Observed tool return time, not model latency.${f.ambiguous||f.invalidTiming?` Unmatched, ambiguous and out-of-order results are omitted.`:``}`:`${IX.map(e=>`${LX[e]} ${h[e]?CO(m[e]):`unknown`}`).join(` · `)}.${f.incomplete?` Some responses lack counters, so these totals are lower bounds.`:``} Context repeated across responses is counted each time; tokens are not billed cost.`})]})}new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2});function zX(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)({width:0,em:16});return(0,b.useEffect)(()=>{if(!e)return;let t=new ResizeObserver(([t])=>r({width:Math.floor(t.contentRect.width),em:parseFloat(getComputedStyle(e).fontSize)||16}));return t.observe(e),()=>t.disconnect()},[e]),[t,n.width,n.em]}function BX({figure:e,presentation:t=`chart`}){let[n,r]=zX(),i=r>=720?Math.floor(r/32)*32:720,a=(0,b.useMemo)(()=>typeof e==`function`?e(i):e,[e,i]);if(me(a))return(0,A.jsx)(`p`,{className:`ov-refusal`,role:`note`,"data-refused":a.id,children:a.refused});let o=r>0&&r<720?a.svg.narrow?`narrow`:`table`:`wide`,s=o===`wide`?a.svg.wide:o===`narrow`?a.svg.narrow:a.table,c=[a.note.method,a.note.n,...a.note.exclusions].join(` `);return(0,A.jsxs)(`figure`,{ref:n,className:`tgc-figure tgc-figure-chart tgc-figure-view`,"data-figure":a.id,"data-layout":o,"aria-label":a.finding,children:[t===`report`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h3`,{className:`tgc-finding`,children:a.finding}),(0,A.jsx)(`p`,{className:`tgc-lede`,children:a.lede})]}),(0,A.jsx)(`div`,{className:`tgc-view-plot tgc-view-${o}`,role:a.svg.interactive?`group`:`img`,"aria-label":`${a.finding} ${a.lede}`,style:o===`narrow`?{maxWidth:358}:void 0,dangerouslySetInnerHTML:{__html:s}}),(0,A.jsxs)(`details`,{className:`tgc-data`,children:[(0,A.jsx)(`summary`,{children:`Data and method`}),(0,A.jsx)(`p`,{className:`tgc-lede`,children:a.lede}),(0,A.jsx)(`p`,{className:`tgc-read`,children:a.read}),(0,A.jsx)(`p`,{className:`tgc-read`,children:c}),(0,A.jsx)(`div`,{className:`tgc-scroll`,role:`region`,"aria-label":`${a.finding} data`,tabIndex:0,dangerouslySetInnerHTML:{__html:a.table}})]})]})}function VX({lanes:e,options:t,defaultCollapsed:n=[],presentation:r}){let[i,a]=(0,b.useState)(n),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useMemo)(()=>n=>Be(e,{...t,collapsed:i,width:n}),[e,t,i]);(0,b.useEffect)(()=>{let e=s.current;s.current=null,e!==null&&o.current&&Array.from(o.current.querySelectorAll(`[data-toggle]`)).find(t=>t.getAttribute(`data-toggle`)===e)?.focus()},[c]);let l=(e,t)=>{let n=e instanceof Element?e.closest(`[data-toggle]`)?.getAttribute(`data-toggle`):null;return n?(t&&(s.current=n),a(e=>e.includes(n)?e.filter(e=>e!==n):[...e,n]),!0):!1};return(0,A.jsx)(`div`,{ref:o,className:`tgc-timeline-view`,onClick:e=>l(e.target,!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&l(e.target,!0)&&e.preventDefault()},children:(0,A.jsx)(BX,{figure:c,presentation:r})})}Object.freeze([`var(--chart-category-1)`,`var(--chart-category-2)`,`var(--chart-category-3)`,`var(--chart-category-other)`]);var HX=e=>e<=0?0:(e-1)%5+1,UX=e=>e.status===`running`;function WX(e){if(!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;if(e<1e4)return`${(e/1e3).toFixed(1)}s`;if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n===60?`${t+1}m`:n?`${t}m ${n}s`:`${t}m`}let t=Math.floor(e/36e5),n=Math.round(e%36e5/6e4);return n===60?`${t+1}h`:`${t}h ${String(n).padStart(2,`0`)}m`}function GX(e){return e===0?`$0.00`:e<.01?`$${e.toPrecision(1).replace(/0+$/,``)}`:`$${e.toFixed(2)}`}function KX(e){if(e.id.startsWith(`family:`)){let t=Number(e.span.meta?.failedAgents??0);return[`${e.descendants} agents`,...t?[`${t} failed`]:[]]}if(e.id.startsWith(`run:`)){let t=e.own.filter(e=>e.kind===`failed`).length;return[t?`${t} failed`:`all done`]}let t=e.counts?.model??0,n=e.counts?.tool??0;return[e.span.outcome?.label??(UX(e.span)?`running`:e.ok?e.kind===`pipeline`?``:`done`:`failed`),t?`${t} LLM ${t===1?`call`:`calls`}`:``,n?`${n} tool ${n===1?`call`:`calls`}`:``].filter(Boolean)}var qX=(e,t)=>`${e.costFloor?`≥`:``}${GX(t)}`,JX=(e,t)=>(0,A.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!t||void 0,role:t?`img`:void 0,"aria-label":t,children:e});function YX(e){let t=(e??``).toLowerCase();if(/bash|shell|exec|terminal|command|run/.test(t))return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`2`}),(0,A.jsx)(`path`,{d:`m5 7 2 1.5L5 10M8.5 10.5h2.5`})]}));if(/edit|write|patch|apply/.test(t))return JX((0,A.jsx)(`path`,{d:`M3 13l1-3.5L10.5 3a1.4 1.4 0 0 1 2 2L6 11.5 3 13ZM9.5 4l2 2`}));if(/grep|search|find|query/.test(t))return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.25`}),(0,A.jsx)(`path`,{d:`m10.25 10.25 3.25 3.25`})]}));if(/read|glob|list|ls|cat|file|view/.test(t))return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M4 2.5h5l3 3v8H4z`}),(0,A.jsx)(`path`,{d:`M9 2.5v3h3M6 9h4M6 11h3`})]}));if(/web|fetch|http|browser|url/.test(t))return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,A.jsx)(`path`,{d:`M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11`})]}));if(/git|commit|branch|merge/.test(t))return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`5`,cy:`4`,r:`1.5`}),(0,A.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.5`}),(0,A.jsx)(`circle`,{cx:`11`,cy:`6`,r:`1.5`}),(0,A.jsx)(`path`,{d:`M5 5.5v5M11 7.5c0 2-3 2-6 3`})]}))}function XX({kind:e,name:t}){if(e===`tool`){let e=YX(t);if(e)return e}switch(e){case`pipeline`:return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`8`,cy:`4`,r:`1.75`}),(0,A.jsx)(`circle`,{cx:`4`,cy:`12`,r:`1.75`}),(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.75`}),(0,A.jsx)(`path`,{d:`M8 5.75v2.5M8 8.25 4.8 10.6M8 8.25l3.2 2.35`})]}));case`model`:return JX((0,A.jsx)(`path`,{d:`M8 2.5c.5 2.8 2.2 4.6 5 5.5-2.8.9-4.5 2.7-5 5.5-.5-2.8-2.2-4.6-5-5.5 2.8-.9 4.5-2.7 5-5.5Z`}));case`waiting`:return JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M4.5 2.5h7M4.5 13.5h7`}),(0,A.jsx)(`path`,{d:`M5.5 2.5c0 3 5 3 5 5.5s-5 2.5-5 5.5M10.5 2.5c0 3-5 3-5 5.5`})]}));case`handoff`:return JX((0,A.jsx)(`path`,{d:`M3 3v5.5a2 2 0 0 0 2 2h8M10.5 8l2.5 2.5-2.5 2.5`}));default:return JX((0,A.jsx)(`path`,{d:`M10.2 2.8a3.2 3.2 0 0 0-4 4L2.8 10.2a1.4 1.4 0 0 0 2 2l3.4-3.4a3.2 3.2 0 0 0 4-4l-1.9 1.9-1.6-.4-.4-1.6 1.9-1.9Z`}))}}var ZX=()=>JX((0,A.jsx)(`path`,{d:`m6 4 4 4-4 4`})),QX=({label:e})=>JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M12.5 8A4.5 4.5 0 1 1 11 4.6`}),(0,A.jsx)(`path`,{d:`M11.5 2v3h-3`})]}),e),$X=({label:e})=>JX((0,A.jsx)(`path`,{d:`m4.5 4.5 7 7m0-7-7 7`}),e),eZ=({label:e})=>JX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M8 2.5 14 13H2L8 2.5Z`}),(0,A.jsx)(`path`,{d:`M8 6.5v3M8 11.25v.01`})]}),e),tZ={pipeline:`Agent`,model:`LLM call`,tool:`Tool call`,waiting:`Waiting`,handoff:`Handoff`},nZ=0x9184e72a000,rZ=(e,t)=>({"--s":e,"--e":Number.isFinite(t)?t:nZ}),iZ=(e,t,n)=>e.length*7+8+(t?80:0)+(n?90:0);function aZ({mark:e,events:t,agentView:n,ending:r}){let i=e.kind===`failed`?n&&!r?null:`fail`:e.retry?`retry`:null,a=e.kind===`model`||e.modelCall,o=a?void 0:e.count===1?e.name:e.tool,s=Number.isFinite(e.endMs)?WX(e.endMs-e.startMs):``,c=[s,e.costUsd?GX(e.costUsd):``].filter(Boolean).join(` · `);return(0,A.jsxs)(`span`,{className:`fw-seg fw-seg-${e.kind}${e.alt?` fw-seg-alt`:``}`,"data-tone":HX(e.tone),style:rZ(e.startMs,e.endMs),title:e.name?`${e.name}${e.count>1?` +${e.count-1} more`:``}${c?` · ${c}`:``}`:void 0,onPointerEnter:n?n=>t.onInspect(e.id,n.currentTarget,n.clientX):void 0,onClick:n?n=>{n.stopPropagation(),t.onPin(e.id,n.currentTarget,n.clientX)}:void 0,children:[i&&(0,A.jsx)(`span`,{className:`fw-glyph`,"data-glyph":i,children:i===`fail`?(0,A.jsx)($X,{}):(0,A.jsx)(QX,{})}),n&&(0,A.jsxs)(`span`,{className:`fw-seg-label`,children:[(0,A.jsx)(`span`,{className:`fw-seg-icon`,"aria-hidden":!0,children:(0,A.jsx)(XX,{kind:a?`model`:`tool`,name:e.tool??e.name})}),o&&(0,A.jsx)(`span`,{className:`fw-seg-name`,children:o}),e.count>1&&(0,A.jsxs)(`span`,{className:`fw-seg-chip`,children:[`×`,e.count]}),s&&(0,A.jsx)(`span`,{className:`fw-seg-meta`,children:s}),e.costUsd?(0,A.jsx)(`span`,{className:`fw-seg-meta`,children:GX(e.costUsd)}):null]})]})}var oZ=(e,t)=>UX(e.span)||e.span.startMs<=t&&t<e.span.endMs;function sZ(e,t){let n=e.span;if(e.durationLabel===`—`)return`—`;if(e.approx&&n.endMs===n.startMs&&!UX(n))return n.costUsd===void 0?``:qX(e,n.costUsd);if(!UX(n)&&t<n.endMs)return`${WX(Math.max(0,t-n.startMs))}${e.approx?`~`:``}`;let r=UX(n)?`${WX(Math.max(n.endMs,t)-n.startMs)}${e.approx?`~`:``}`:e.durationLabel,i=n.costUsd??(e.rollupCostUsd?e.rollupCostUsd:void 0);return i===void 0?r:`${r} · ${qX(e,i)}`}(0,b.memo)(function(e){let{row:t,view:n,top:r,collapsed:i,searching:a,slowest:o,costliest:s,critical:c,matched:l,active:u,focusable:d,selected:f,sticky:p,clockMs:m,renderIcon:h,fillByAgent:g,motion:_}=e,v=t.span,y=UX(v),b=n===`agents`,x=t.hasChildren&&i&&!a,S=t.durationLabel===`—`,C=t.kind===`pipeline`,w=t.ok?t.kind:`failed`,T=C||t.hasChildren||t.id.startsWith(`run:`)?x&&!b?t.segments:t.own:[],ee=sZ(t,m),E=[...v.detail&&v.detail!==e.sharedDetail?[v.detail]:[],...KX(t).filter(t=>t!==e.sharedOutcome)],te=n=>e.onInspect(t.id,n.currentTarget,n.clientX),ne=b&&t.id.startsWith(`family:`),re=b&&t.stepOf!==void 0,ie=ne||b&&C&&t.own.length>0,D=b&&!t.ok?T.map(e=>e.kind).lastIndexOf(`failed`):-1;return(0,A.jsxs)(`div`,{role:`row`,"data-span-id":t.id,"data-span-kind":w,"data-slowest":o||void 0,"data-critical":c||void 0,"data-search":a?l?`match`:`context`:void 0,"data-running":y||void 0,"aria-level":b?void 0:t.depth+1,"aria-expanded":t.hasChildren&&!b?!x:void 0,"aria-selected":f,tabIndex:d?0:-1,"data-tone":HX(t.tone),"data-outcome":g?void 0:v.outcome?.tone,className:`fw-row${u?` fw-active`:``}${p?` fw-sticky-row`:``}${C?` fw-agent-row`:``}${re?` fw-step`:``}${_?.enter===void 0?``:` fw-enter`}${_?.settle?` fw-settle`:``}`,style:{"--row-y":`${r}px`,"--fw-enter-delay":`${_?.enter??0}ms`,"--fw-end-w":`${iZ(ee,o,s)}px`},onFocus:n=>{n.target===n.currentTarget&&e.onActivate(t)},onClick:n=>{if(e.onActivate(t),ne){e.onToggle(t);return}let r=b?n.currentTarget.querySelector(`.fw-bar`):null;r&&e.onPin(t.id,r,n.target instanceof Element&&n.target.closest(`.fw-lane`)?n.clientX:void 0)},children:[(0,A.jsxs)(`div`,{role:`gridcell`,className:`fw-label`,style:{"--depth":b?t.inset??0:t.depth},children:[ie&&(0,A.jsx)(`button`,{type:`button`,tabIndex:-1,className:`fw-toggle${e.expanded?` fw-open`:``}`,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${t.name}`,"aria-expanded":!!e.expanded,onClick:n=>{n.stopPropagation(),e.onToggle(t)},children:(0,A.jsx)(ZX,{})}),!b&&(0,A.jsx)(`span`,{className:`fw-guides`,"aria-hidden":!0}),!b&&(t.hasChildren?(0,A.jsx)(`button`,{type:`button`,tabIndex:-1,className:`fw-toggle${x?``:` fw-open`}`,disabled:a,"aria-label":`${x?`Expand`:`Collapse`} ${t.name}`,"aria-expanded":!x,onClick:n=>{n.stopPropagation(),e.onToggle(t)},children:(0,A.jsx)(ZX,{})}):(0,A.jsx)(`span`,{className:`fw-toggle-space`,"aria-hidden":!0})),b&&!ie&&(0,A.jsx)(`span`,{className:`fw-toggle-space`,"aria-hidden":!0}),(!b||re)&&(0,A.jsx)(`span`,{className:`fw-icon-tile`,"aria-hidden":!0,children:h?.(v)??(0,A.jsx)(XX,{kind:v.kind,name:v.name})}),(0,A.jsxs)(`span`,{className:`fw-names`,title:`${t.name}${v.detail?` · ${v.detail}`:``} · ${tZ[v.kind]}${y?` · running`:``}${t.ok?``:` · failed`}`,children:[(0,A.jsxs)(`span`,{className:`fw-span-name${C||t.hasChildren?` fw-strong`:``}`,children:[g&&C&&v.outcome?(0,A.jsx)(`span`,{className:`fw-agent-dot`,"data-tone":`0`,"data-outcome":v.outcome.tone,title:v.outcome.label,"aria-hidden":!0}):b&&!re&&(0,A.jsx)(`span`,{className:`fw-agent-dot`,"aria-hidden":!0}),y&&(0,A.jsx)(`span`,{className:`fw-spinner`,role:`status`,"aria-label":`running`}),(0,A.jsx)(`span`,{className:`fw-name-text`,children:t.name})]}),b&&(0,A.jsxs)(`span`,{className:`fw-subtitle`,children:[h&&(0,A.jsx)(`span`,{className:`fw-detail-icon`,"aria-hidden":!0,children:h(v)}),(0,A.jsxs)(`span`,{className:`fw-subtitle-tail`,children:[(0,A.jsx)(`span`,{className:`fw-subtitle-text`,children:E[0]}),E.slice(1).map(e=>(0,A.jsxs)(`span`,{className:`fw-subtitle-extra`,children:[`· `,e]},e))]})]})]}),x&&(0,A.jsxs)(`span`,{className:`fw-count`,"aria-label":`${t.descendants} hidden steps`,children:[`+`,t.descendants]}),ne&&!e.expanded&&(0,A.jsxs)(`span`,{className:`fw-count`,"aria-label":`${t.descendants} agents folded`,children:[`+`,t.descendants]}),!t.ok&&!b&&(0,A.jsx)(`span`,{className:`fw-alert`,children:(0,A.jsx)(eZ,{label:`failed`})})]}),(0,A.jsx)(`div`,{role:`gridcell`,className:`fw-lane`,"data-waterfall-track":!0,"aria-label":`${tZ[v.kind]}, ${ee}${o?`, slowest ${b?`agent`:`step`}`:``}${s?`, costliest agent`:``}${c?`, critical path`:``}`,children:S?(0,A.jsx)(`span`,{className:`fw-invalid`,children:`—`}):(0,A.jsxs)(A.Fragment,{children:[v.marks?.map(e=>(0,A.jsx)(`span`,{className:`fw-mark`,"data-mark":e.kind,style:rZ(e.at,e.at),title:e.label,"aria-label":e.label,role:`img`},`m-${e.at}-${e.label}`)),(0,A.jsxs)(`span`,{className:`fw-bar fw-k-${C?`pipeline`:w}${t.approx?` fw-approx`:``}${T.length?` fw-has-marks`:``}${t.hasAgents?` fw-has-agents`:``}`,"data-tone":HX(t.tone),style:rZ(v.startMs,y?nZ:v.endMs),onPointerEnter:te,onPointerLeave:e.onLeave,onClick:n=>{n.stopPropagation(),ne?e.onToggle(t):e.onPin(t.id,n.currentTarget,n.clientX)},children:[!C&&!t.ok&&(0,A.jsx)(`span`,{className:`fw-glyph`,children:(0,A.jsx)($X,{})}),!C&&t.ok&&t.retry&&(0,A.jsx)(`span`,{className:`fw-glyph`,children:(0,A.jsx)(QX,{})})]}),T.map((t,n)=>(0,A.jsx)(aZ,{mark:t,events:e,agentView:b,ending:n===D},`${t.id}-${n}`)),(0,A.jsxs)(`span`,{className:`fw-end`,style:rZ(v.startMs,y?nZ:v.endMs),children:[(0,A.jsx)(`span`,{className:`fw-duration`,children:ee}),o&&(0,A.jsx)(`span`,{className:`fw-badge`,children:`Slowest`}),s&&(0,A.jsx)(`span`,{className:`fw-badge`,children:`Costliest`})]})]})})]})},(e,t)=>e.row===t.row&&e.view===t.view&&e.top===t.top&&e.collapsed===t.collapsed&&e.searching===t.searching&&e.slowest===t.slowest&&e.costliest===t.costliest&&e.critical===t.critical&&e.matched===t.matched&&e.active===t.active&&e.focusable===t.focusable&&e.selected===t.selected&&e.sticky===t.sticky&&e.motion===t.motion&&e.renderIcon===t.renderIcon&&e.fillByAgent===t.fillByAgent&&e.sharedDetail===t.sharedDetail&&e.sharedOutcome===t.sharedOutcome&&e.expanded===t.expanded&&(e.clockMs===t.clockMs||!oZ(e.row,e.clockMs)&&!oZ(t.row,t.clockMs)));function cZ({record:e}){let t=(0,b.useMemo)(()=>lZ(e),[e]);return t.length?(0,A.jsx)(VX,{lanes:t,options:{measure:`elapsed time`,formatTime:e=>{let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}},defaultCollapsed:t.filter(e=>e.parent&&t.some(t=>t.parent===e.id)).map(e=>e.id)}):null}function lZ(e){let t=new Map;for(let n of e.events){let e=t.get(n.node)??[];e.push(n),t.set(n.node,e)}let n=new Map(e.nodes.map(e=>[e.id,e])),r=[];for(let i of e.nodes){if(i.kind===`session`)continue;let a=t.get(i.id)??[],o=a.map(e=>_O(e.at)).filter(Number.isFinite);if(!o.length){let n=e.nodes.filter(e=>e.parent===i.id);if(!n.length)continue;let r=n.flatMap(e=>(t.get(e.id)??[]).map(e=>_O(e.at)).filter(Number.isFinite)),a=i.start?_O(i.start):void 0,s=a!==void 0&&Number.isFinite(a)?a:r.length?Math.min(...r):void 0;if(s===void 0)continue;o.push(s)}let s=Math.min(...o),c=Math.max(...o),l=n.get(i.parent??``),u=c>s?[{start:s,end:c,state:`running`}]:[{start:s,end:s,state:`running`}],d=typeof i.model==`string`?i.model.split(`/`).pop():void 0,f=typeof i.role==`string`?i.role:void 0,p=[i.label,f?`Role: ${f}`:null,d?`Model: ${d}`:null,`${a.length} events`].filter(e=>e!==null);r.push({id:i.id,label:i.label.length>28?`${i.label.slice(0,27)}…`:i.label,parent:l&&l.kind!==`session`?l.id:void 0,spans:u,detail:p})}return r}function uZ({label:e,value:t,onChange:n,children:r,field:i}){return(0,A.jsxs)(`label`,{className:`ui-field ar-select`,children:[(0,A.jsx)(`span`,{className:`ui-label`,children:e}),(0,A.jsxs)(`span`,{className:`select-shell`,children:[(0,A.jsx)(`select`,{value:t,onChange:e=>n(e.target.value),[`data-${i}`]:``,children:r}),(0,A.jsx)(`span`,{className:`ui-chevron`,"aria-hidden":`true`})]})]})}function dZ({records:e,selection:t,defaultSelection:n,onSelectionChange:r,theme:i=`auto`,className:a=``,behaviors:o}){let[s,c]=(0,b.useState)(n),l=t??s,u=e.find(e=>e.runId===l?.runId)??e[0],d=(0,b.useCallback)(e=>{t===void 0&&c(e),r?.(e)},[t,r]);return(0,A.jsx)(`div`,{className:`agent-record ${a}`,"data-theme":i===`auto`?void 0:i,children:u?(0,A.jsx)(fZ,{records:e,record:u,selection:l?.runId===u.runId?l:{runId:u.runId},onChange:d,behaviors:o},u.runId):(0,A.jsx)(`p`,{className:`chat-empty`,role:`status`,children:`No records supplied.`})})}function fZ({records:e,record:t,selection:n,onChange:r,behaviors:i}){let a=(0,b.useId)(),o=(0,b.useMemo)(()=>jO(t),[t]),s=(0,b.useMemo)(()=>{let e=i?.find(e=>e.runId===t?.runId);if(!e)return;let n={alignment:`alignment`,efficiency:`efficiency`,affect:`affect`};return e.verdicts.filter(e=>e.verdict===`yes`&&e.evidence?.length).flatMap(e=>(e.evidence??[]).filter(e=>o.byEvent.has(e.eventId)).map(t=>({behavior:e.behavior,axis:n[e.behavior]??(e.behavior.includes(`hack`)||e.behavior.includes(`unsafe`)||e.behavior.includes(`decept`)||e.behavior.includes(`escape`)||e.behavior.includes(`intent`)||e.behavior.includes(`scope`)?`alignment`:e.behavior.includes(`frustrat`)||e.behavior.includes(`confidence`)||e.behavior.includes(`breakthrough`)||e.behavior.includes(`giving`)?`affect`:`efficiency`),confidence:e.confidence,at:_O(o.byEvent.get(t.eventId).at),eventId:t.eventId,quote:t.quote})))},[i,t,o]),c=n.eventId?o.byEvent.get(n.eventId):void 0,l=n.nodeId?o.canonical(n.nodeId):void 0,u=c?o.canonical(c.node):l&&o.nodes.has(l)?l:o.actors[0]?.id??``,d=c??o.byActor.get(u)?.[0],f=o.nodes.get(u),p=f&&typeof f.metadata==`object`&&f.metadata!==null?f.metadata:void 0,m=o.byActor.get(u)?.length??0,h=f?.capture,g=(t.coverage?.gaps??[]).filter(e=>e.nodeId===u).map(e=>e.detail).join(` `),_=typeof f?.captureNote==`string`?f.captureNote:typeof p?.captureReason==`string`?p.captureReason:h&&h.status!==`complete`&&g?g:null,v=p?.captureStatus===`retained-partial`||h?.status===`lossy`?`Partial capture`:p?.captureStatus===`missing-source`||h?.status===`absent`||m===0?`Conversation unavailable`:p?.captureStatus===`retained`?`Retained capture`:null,y=n.view??`chat`,x=n.at?_O(n.at):o.end,S=Number.isFinite(x)?Math.max(o.start,Math.min(o.end,x)):o.end,C=o.end>o.start?(S-o.start)/(o.end-o.start)*1e3:1e3,[w,T]=(0,b.useState)(`all`),[ee,E]=(0,b.useState)(``),[te,ne]=(0,b.useState)(1),[re,ie]=(0,b.useState)(`cumulative`),[D,ae]=(0,b.useState)(`time`),[oe,se]=(0,b.useState)(!1),[O,ce]=(0,b.useState)(`1`),[le,ue]=(0,b.useState)(`time`),[de,fe]=(0,b.useState)(!1),[pe,me]=(0,b.useState)(`system`),he=de||pe===`reduced`,[ge,_e]=(0,b.useState)(!1),[ve,ye]=(0,b.useState)(null),be=(0,b.useRef)(null),xe=Rv(),Se=(0,b.useRef)(new Map),Ce=(0,b.useRef)({selection:n,cutoff:S,index:o,onChange:r});Ce.current={selection:n,cutoff:S,index:o,onChange:r};let we=ee.trim().toLowerCase(),Te=(0,b.useMemo)(()=>o.events.filter(e=>MO(e,o,we,w)),[o,we,w]),Ee=[...new Set([...NX,...t.events.map(e=>e.category)])].filter(e=>e!==`all`&&e!==`findings`),De=e=>r({...n,runId:t.runId,nodeId:u,eventId:d?.id,...e}),Oe=(e,n=!1)=>{ye(null),se(!1),r({runId:t.runId,nodeId:o.canonical(e.node),eventId:e.id,at:e.at,view:n?`source`:`chat`})},ke=e=>{ye(null);let i=o.byActor.get(e)?.find(e=>e.detail.role||e.detail.publicText||e.detail.publicToolCalls?.length)??o.byActor.get(e)?.[0];r({runId:t.runId,nodeId:e,eventId:i?.id,view:`chat`,at:i&&_O(i.at)>S?i.at:n.at})},Ae=e=>{if(!Te.length)return;let t=Te.findIndex(e=>e.id===d?.id);Oe(Te[t<0?e>0?0:Te.length-1:(t+e+Te.length)%Te.length])},je=(e,t,n)=>{let r=e.currentTarget.getBoundingClientRect(),i=Math.max(8,Math.min(r.left+r.width/2,window.innerWidth-361)),a=r.top>window.innerHeight/2?Math.max(8,r.top-12):r.bottom+10;ye({title:t,lines:n,x:i,y:a})},Me=()=>ye(null);(0,b.useEffect)(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{fe(e.matches),se(!1)};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let Ne=he?`events`:le;(0,b.useEffect)(()=>{if(!oe)return;let e=performance.now(),n=window.setInterval(()=>{let n=Ce.current,r=performance.now(),i=Wv({cutoff:n.cutoff,start:n.index.start,end:n.index.end,elapsedMs:r-e,speed:Number(O),mode:Ne,eventTimes:n.index.events.map(e=>_O(e.at))});e=r,n.onChange({...n.selection,runId:t.runId,at:i>=n.index.end?void 0:new Date(i).toISOString()}),i>=n.index.end&&se(!1)},Ne===`events`?1e3/Number(O):120),r=()=>{document.hidden&&se(!1)};return document.addEventListener(`visibilitychange`,r),()=>{window.clearInterval(n),document.removeEventListener(`visibilitychange`,r)}},[oe,t.runId,O,Ne]),(0,b.useEffect)(()=>{ye(null)},[S,w,we,u,y,re,D,t]);let Pe=t.nodes.filter(e=>e.kind===`session`&&!e.agentId),Fe=Te.findIndex(e=>e.id===d?.id);return(0,A.jsxs)(`div`,{ref:be,className:`ar-view`,"data-reduced-motion":he||void 0,onKeyDown:e=>{e.key===`Escape`&&Me()},onScrollCapture:Me,children:[(0,A.jsxs)(`div`,{className:`controls`,children:[e.length>1&&(0,A.jsx)(uZ,{label:`Run`,field:`run`,value:t.runId,onChange:e=>{se(!1),r({runId:e})},children:e.map(e=>(0,A.jsx)(`option`,{value:e.runId,children:e.title},e.runId))}),(0,A.jsxs)(uZ,{label:`Activity type`,field:`category`,value:w,onChange:T,children:[(0,A.jsx)(`option`,{value:`all`,children:`All activity`}),(0,A.jsx)(`option`,{value:`findings`,children:`Recorded findings`}),Ee.map(e=>(0,A.jsxs)(`option`,{value:e,children:[e[0]?.toUpperCase(),e.slice(1)]},e))]}),(0,A.jsxs)(`label`,{className:`ui-field`,children:[(0,A.jsx)(`span`,{className:`ui-label`,children:`Search all agents`}),(0,A.jsx)(`input`,{"data-search":!0,type:`search`,placeholder:`Message, tool, agent…`,value:ee,onChange:e=>E(e.target.value)})]})]}),(0,A.jsxs)(`details`,{className:`topology-tree`,children:[(0,A.jsx)(`summary`,{children:`Agent topology`}),(0,A.jsx)(cZ,{record:t})]}),(0,A.jsxs)(`details`,{className:`activity-replay`,open:!0,children:[(0,A.jsx)(`summary`,{children:`Timeline and replay`}),(0,A.jsxs)(`div`,{className:`playback`,children:[(0,A.jsx)(`button`,{className:`ui-button`,"data-play":!0,type:`button`,"aria-label":oe?`Pause recorded progression`:`Play recorded progression`,disabled:o.end<=o.start,onClick:()=>{!oe&&S>=o.end&&De({at:new Date(o.start).toISOString()}),se(e=>!e)},children:oe?`Pause`:`Play`}),(0,A.jsxs)(`label`,{children:[`Recorded time`,` `,(0,A.jsx)(`input`,{"data-cursor":!0,type:`range`,min:0,max:1e3,value:C,"aria-valuetext":vO(new Date(S).toISOString(),!0),disabled:!t.events.length,onChange:e=>{se(!1),De({at:new Date(o.start+(o.end-o.start)*Number(e.target.value)/1e3).toISOString()})}}),(0,A.jsx)(`output`,{"data-clock":!0,children:wO(S-o.start)})]}),(0,A.jsx)(`button`,{className:`ui-button`,"data-full":!0,type:`button`,onClick:()=>{se(!1),De({at:void 0})},children:`Full run`})]}),(0,A.jsxs)(`div`,{className:`replay-settings`,children:[(0,A.jsxs)(uZ,{label:`Replay speed`,field:`speed`,value:O,onChange:ce,children:[(0,A.jsx)(`option`,{value:`0.5`,children:`0.5×`}),(0,A.jsx)(`option`,{value:`1`,children:`1×`}),(0,A.jsx)(`option`,{value:`2`,children:`2×`}),(0,A.jsx)(`option`,{value:`4`,children:`4×`})]}),(0,A.jsxs)(uZ,{label:`Replay progression`,field:`progression`,value:Ne,onChange:e=>{se(!1),ue(e)},children:[!he&&(0,A.jsx)(`option`,{value:`time`,children:`Recorded time`}),(0,A.jsx)(`option`,{value:`events`,children:`Event steps`})]}),(0,A.jsxs)(uZ,{label:`Motion`,field:`motion`,value:pe,onChange:e=>{se(!1),me(e)},children:[(0,A.jsx)(`option`,{value:`system`,children:`System`}),(0,A.jsx)(`option`,{value:`reduced`,children:`Reduced`})]}),(0,A.jsxs)(`p`,{className:`small`,children:[he?`Reduced motion: timestamp steps. `:``,Ne===`time`?`1× compresses the full recorded span into 30 seconds.`:`1× advances to the next recorded timestamp each second; gaps are skipped.`]})]}),(0,A.jsx)(`div`,{className:`timeline-heading`,children:(0,A.jsxs)(`label`,{children:[`Zoom`,` `,(0,A.jsx)(`input`,{"data-zoom":!0,type:`range`,min:1,max:8,step:1,value:te,onChange:e=>ne(Number(e.target.value))})]})}),(0,A.jsx)(MX,{index:o,events:Te,cutoff:S,selected:d?.id,zoom:te,inspect:Oe,navigate:Ae,showTooltip:je,hideTooltip:Me,behaviors:s}),(0,A.jsx)(`div`,{className:`legend`,children:Ee.map(e=>(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`category-${FX(e)}`}),e]},e))})]}),we&&(0,A.jsxs)(`section`,{className:`activity-search-results`,"aria-label":`Matching activity`,children:[(0,A.jsxs)(`p`,{role:`status`,children:[Te.length,` matching events`]}),Te.slice(0,100).map(e=>(0,A.jsxs)(`button`,{onClick:()=>{E(``),se(!1),r({runId:t.runId,nodeId:o.canonical(e.node),eventId:e.id,view:`chat`})},children:[(0,A.jsx)(`span`,{children:o.nodes.get(o.canonical(e.node))?.label??e.node}),(0,A.jsx)(`time`,{children:vO(e.at)}),(0,A.jsx)(`strong`,{children:e.label}),(0,A.jsx)(`small`,{children:(EO(e)||e.detail.publicToolCalls?.map(e=>`${e.name} ${e.input}`).join(` `)||`Recorded event`).replace(/\s+/g,` `).slice(0,240)})]},e.id)),Te.length>100&&(0,A.jsx)(`p`,{className:`small`,children:`Showing the first 100 matches. Narrow the search to find a particular event.`}),!Te.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:`No retained activity matches. Missing captures are not searched.`})]}),(0,A.jsxs)(`div`,{className:`workspace flat-activity`,hidden:!!we,children:[(0,A.jsxs)(`details`,{className:`topology`,open:ge,onToggle:e=>_e(e.currentTarget.open),children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)(`span`,{children:`Agents`}),(0,A.jsx)(`span`,{"data-agent-count":!0,children:o.actors.filter(e=>e.kind!==`finding`).length})]}),Pe.length>0&&(0,A.jsxs)(`p`,{className:`small`,"data-graph-caption":!0,children:[`Not linked to an agent:`,` `,Pe.map(e=>e.label).join(`, `)]}),(0,A.jsx)(IO,{index:o,actor:u,cutoff:S,select:ke})]}),(0,A.jsxs)(`section`,{className:`conversation-panel`,"aria-label":`Agent record details`,children:[(0,A.jsxs)(`div`,{className:`conversation-head`,children:[(0,A.jsxs)(`div`,{className:`agent-identity`,children:[(0,A.jsx)(`span`,{className:`agent-avatar`,"data-agent-avatar":!0,"aria-hidden":`true`,children:TO(f).slice(0,1).toUpperCase()}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{"data-agent-title":!0,children:f?.label??`Messages`}),(0,A.jsx)(`p`,{"data-agent-role":!0,children:[TO(f),PO(f,t),f?.status??`State unknown`].filter(Boolean).join(` · `)})]})]}),(0,A.jsx)(uZ,{label:`Agent`,field:`agent`,value:u,onChange:ke,children:o.actors.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label===e.id||e.label.startsWith(`wf_`)||e.label.length<8?`${TO(e)} (${e.label.slice(0,12)})`:e.label===TO(e)?e.label:`${e.label} · ${TO(e)}`},e.id))})]}),(v||_||f?.assignment)&&(0,A.jsxs)(`div`,{className:`agent-capture-summary`,role:`status`,children:[v,_?(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{children:`Capture details`}),(0,A.jsx)(`p`,{children:_})]}):null,f?.assignment&&(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{children:`What this agent did`}),(0,A.jsx)(`p`,{children:f.assignment})]})]}),(0,A.jsx)(`div`,{className:`ui-tabs`,role:`tablist`,"aria-label":`Agent evidence`,children:[`chat`,`source`,`usage`].map((e,t,n)=>(0,A.jsx)(`button`,{ref:t=>{t?Se.current.set(e,t):Se.current.delete(e)},type:`button`,"data-view":e,role:`tab`,"aria-selected":y===e,tabIndex:y===e?0:-1,id:`${a}-${e}-tab`,"aria-controls":`${a}-${e}`,onClick:()=>De({view:e}),onKeyDown:e=>{let r=e.key===`ArrowRight`?n[(t+1)%n.length]:e.key===`ArrowLeft`?n[(t-1+n.length)%n.length]:e.key===`Home`?n[0]:e.key===`End`?n.at(-1):void 0;r&&(e.preventDefault(),De({view:r}),Se.current.get(r)?.focus())},children:e===`chat`?`Messages`:e===`source`?`Event details`:`Usage`},e))}),(0,A.jsx)(`div`,{id:`${a}-chat`,role:`tabpanel`,"aria-labelledby":`${a}-chat-tab`,"data-panel":`chat`,hidden:y!==`chat`,children:(0,A.jsx)(AX,{index:o,actor:u,cutoff:S,query:we,category:w,selected:c?.id})}),(0,A.jsx)(`div`,{id:`${a}-source`,role:`tabpanel`,"aria-labelledby":`${a}-source-tab`,"data-panel":`source`,hidden:y!==`source`,children:d?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h4`,{"data-event-title":!0,children:d.label}),(0,A.jsxs)(`p`,{className:`small`,"data-event-meta":!0,children:[vO(d.at,!0),` ·`,` `,o.nodes.get(o.canonical(d.node))?.label??d.node]}),_O(d.at)>S?(0,A.jsx)(`p`,{children:`This event occurs after the selected time. Advance the timeline to read it.`}):(0,A.jsxs)(A.Fragment,{children:[EO(d)&&(0,A.jsx)(BO,{text:EO(d)}),d.detail.publicToolCalls?.map(e=>(0,A.jsxs)(`section`,{className:`event-tool`,children:[(0,A.jsx)(`h4`,{children:e.name}),e.input===void 0?(0,A.jsx)(`p`,{className:`publication-note`,children:`Args not captured.`}):(0,A.jsx)(BO,{text:e.input,rawLabel:`Raw input`})]},e.id)),!EO(d)&&!d.detail.publicToolCalls?.length&&(0,A.jsx)(`p`,{children:d.detail.contentOmitted??d.detail.publicationNote??`No visible message or tool payload was retained for this event.`}),(0,A.jsxs)(`details`,{className:`raw-data`,children:[(0,A.jsx)(`summary`,{children:`Raw event and source`}),(0,A.jsx)(`pre`,{"data-event-detail":!0,children:JSON.stringify(d.detail,null,2)}),(0,A.jsx)(`pre`,{"data-event-source":!0,children:JSON.stringify(NO(d,t,o),null,2)})]})]})]}):(0,A.jsx)(`p`,{className:`chat-empty`,children:`No source event selected.`})}),(0,A.jsxs)(`div`,{id:`${a}-usage`,role:`tabpanel`,"aria-labelledby":`${a}-usage-tab`,"data-panel":`usage`,hidden:y!==`usage`,children:[(0,A.jsxs)(`div`,{className:`metric-controls`,children:[(0,A.jsxs)(uZ,{label:`Measure`,field:`metric`,value:re,onChange:e=>ie(e),children:[(0,A.jsx)(`option`,{value:`cumulative`,children:`Cumulative tokens`}),(0,A.jsx)(`option`,{value:`response`,children:`Tokens per response`}),(0,A.jsx)(`option`,{value:`tool-time`,children:`Tool return time`})]}),(0,A.jsxs)(uZ,{label:`Horizontal axis`,field:`axis`,value:D,onChange:e=>ae(e),children:[(0,A.jsx)(`option`,{value:`time`,children:`Elapsed time`}),(0,A.jsx)(`option`,{value:`order`,children:`Recorded order`})]})]}),(0,A.jsx)(RX,{index:o,cutoff:S,selected:d?.id,actor:u,metric:re,axis:D,inspect:Oe,navigate:Ae,showTooltip:je,hideTooltip:Me})]})]})]}),(0,A.jsxs)(`div`,{className:`navigation`,children:[(0,A.jsxs)(uZ,{label:`Jump to a moment`,field:`moment`,value:d?.id??``,onChange:e=>{let t=o.byEvent.get(e);t&&Oe(t)},children:[!Te.some(e=>e.id===d?.id)&&(0,A.jsx)(`option`,{value:d?.id??``,children:d?`Selected event is outside this filter`:`Select an event`}),Te.map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[vO(e.at),` · `,e.label]},e.id))]}),(0,A.jsx)(`button`,{className:`ui-button`,"data-prev":!0,type:`button`,disabled:!Te.length,onClick:()=>Ae(-1),children:`Previous`}),(0,A.jsx)(`button`,{className:`ui-button`,"data-next":!0,type:`button`,disabled:!Te.length,onClick:()=>Ae(1),children:`Next`}),(0,A.jsxs)(`span`,{"data-position":!0,children:[Fe>=0?Fe+1:`—`,` / `,Te.length]}),(0,A.jsx)(`button`,{type:`button`,className:`download-record`,"data-download":!0,onClick:()=>xe(JSON.stringify(t,null,2),t.runId+`.json`,`application/json`),children:`Download record`})]}),(0,A.jsxs)(`details`,{className:`assignment`,children:[(0,A.jsx)(`summary`,{children:`Original assignment`}),(0,A.jsx)(`dl`,{"data-assignment":!0,children:Object.entries(t.assignment).filter(([e])=>e!==`source`).map(([e,t])=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:e.replace(/([a-z])([A-Z])/g,`$1 $2`)}),(0,A.jsx)(`dd`,{children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))}),t.assignment.source&&(0,A.jsxs)(`details`,{className:`assignment-source`,children:[(0,A.jsx)(`summary`,{children:`Provenance`}),(0,A.jsx)(`pre`,{children:JSON.stringify(t.assignment.source,null,2)})]})]}),(0,A.jsxs)(`details`,{className:`coverage`,children:[(0,A.jsx)(`summary`,{children:`Sources, redactions & capture gaps`}),(0,A.jsxs)(`div`,{"data-coverage":!0,children:[t.coverage.publicContent&&(0,A.jsx)(`p`,{children:t.coverage.publicContent}),t.coverage.categoryMethod&&(0,A.jsx)(`p`,{children:t.coverage.categoryMethod}),t.coverage.cost&&t.coverage.cost!==`Not recorded`&&(0,A.jsxs)(`p`,{children:[`Cost: `,t.coverage.cost]}),t.terminal&&(0,A.jsxs)(`p`,{children:[`Recorded terminal: `,t.terminal.kind??`unknown`,t.terminal.reason?` · ${t.terminal.reason}`:``]}),(0,A.jsx)(`pre`,{children:JSON.stringify({coverage:t.coverage,sources:t.sources},null,2)})]})]}),ve&&(0,A.jsxs)(`div`,{className:`ui-plot-tooltip`,role:`tooltip`,style:{left:ve.x,top:ve.y,transform:ve.y>window.innerHeight/2?`translateY(-100%)`:void 0},children:[(0,A.jsx)(`strong`,{className:`tooltip-title`,children:ve.title}),ve.lines.map((e,t)=>e.kind===`header`?(0,A.jsx)(`p`,{className:`tooltip-header`,children:e.value},t):e.kind===`status`?(0,A.jsx)(`p`,{className:`tooltip-status tooltip-${e.tone??`default`}`,children:e.value},t):e.kind===`usage`?(0,A.jsx)(`p`,{className:`tooltip-usage`,children:e.value},t):e.kind===`note`?(0,A.jsx)(`p`,{className:`tooltip-note`,children:e.value},t):(0,A.jsxs)(`p`,{className:`tooltip-body`,children:[e.label&&(0,A.jsx)(`span`,{className:`tooltip-label`,children:e.label}),e.value]},t))]})]})}var pZ=CD({offset:!0}),mZ=YE(K(),q()),hZ=Y({path:K(),sha256:K().regex(/^[0-9a-f]{64}$/).optional(),line:PE().int().positive().optional(),pointer:K().startsWith(`/`).optional()}).catchall(q()),gZ=Y({channel:K(),status:ZE([`complete`,`lossy`,`absent`]),reason:K().nullable()}).catchall(q()),_Z=Y({runId:K().optional(),nodeId:K().nullable().optional(),code:K(),detail:K()}).catchall(q()),vZ=K().regex(/^[0-9a-f]{64}$/),yZ=K().regex(/^sha256:[0-9a-f]{64}$/),bZ=Y({pageSha256:vZ,claimId:K().min(1)}).catchall(q()),xZ=Y({id:K().min(1),kind:K().min(1),title:K(),digest:vZ.optional(),sessionNodeId:K().optional(),eventId:K().optional(),source:hZ.nullish()}).catchall(q()),SZ=bZ.extend({statement:K(),agentNodeId:K().optional(),eventId:K().optional(),runId:K().optional()}).catchall(q()),CZ=Y({id:K().min(1),subject:bZ,reviewerSessionNodeId:K().min(1),judgment:K().min(1),at:pZ.nullish(),eventId:K().optional()}).catchall(q()),wZ=Y({id:K().min(1),kind:K().min(1),title:K(),url:_E().nullish(),sessionNodeId:K().optional(),cites:J(bZ.extend({verdictId:K().optional()}))}).catchall(q()),TZ=Y({digest:yZ,parents:J(yZ),runId:K().optional(),authorNodeId:K().optional(),title:K().optional()}).catchall(q()),EZ=Y({from:K().min(1),to:K().min(1),basis:K().min(1),at:pZ.nullish(),reason:K().nullish(),source:hZ.nullish()}).catchall(q()),DZ=Y({nodeId:K().min(1),runId:K().min(1),recordDigest:K().nullish(),href:K().nullish()}).catchall(q()),OZ=Y({schema:$E(`agent-record.v1`),runId:K().min(1),title:K(),nodes:J(Y({id:K().min(1),label:K(),parent:K().nullable().default(null),kind:ZE([`agent`,`session`,`finding`]),role:K().optional(),assignment:K().optional(),model:K().nullable().optional(),start:pZ.optional(),end:pZ.optional(),status:K().optional(),nativeSessionId:K().optional(),agentId:K().optional(),joinBasis:K().optional(),joinProof:mZ.optional(),modelSource:K().optional(),servedModel:K().nullable().optional(),harness:K().nullable().optional(),sandboxes:J(K()).optional(),capture:gZ.optional(),captureNote:K().optional()}).catchall(q())),events:J(Y({id:K().min(1),node:K().min(1),at:pZ,kind:K(),category:K().default(`other`),activity:K().optional(),end:pZ.optional(),phase:ZE([`tool`,`model`,`idle`]).optional(),label:K(),source:hZ.nullable().optional(),detail:Y({role:K().optional(),publicText:K().optional(),publicationNote:K().nullish(),contentOmitted:K().optional(),publicToolCalls:J(Y({id:K(),name:K(),input:K().optional(),publicationNote:K().nullish()}).catchall(q())).optional(),toolCallIds:J(K()).optional(),toolNames:J(K()).optional(),toolCallId:K().optional(),isError:RE().optional(),responseStatus:K().optional(),recordedClaim:K().optional(),assessment:K().optional(),usage:Y({input:PE().nonnegative().optional(),output:PE().nonnegative().optional(),cacheRead:PE().nonnegative().optional(),cacheWrite:PE().nonnegative().optional()}).catchall(q()).nullish(),reasoning:K().optional(),reasoningOmitted:PE().int().nonnegative().optional(),reasoningRedacted:PE().int().nonnegative().optional(),durationMs:PE().nonnegative().optional(),costListUsd:PE().nonnegative().optional(),usdKnown:RE().optional(),rateLimit:Y({window:K().nullable(),utilization:PE().nullable(),status:K().nullable()}).catchall(q()).optional(),clip:Y({bytes:PE().int().nonnegative(),sha256:K().regex(/^[0-9a-f]{64}$/).nullable()}).catchall(q()).optional()}).catchall(q())}).catchall(q())),artifacts:J(xZ).optional(),claims:J(SZ).optional(),verdicts:J(CZ).optional(),publications:J(wZ).optional(),profileVersions:J(TZ).optional(),runs:J(DZ).optional(),forks:J(EZ).optional(),sources:J(hZ.extend({bytes:PE().nonnegative().optional()})).default([]),assignment:Y({objective:K(),suppliedKnowledge:K(),deliverables:K(),constraints:K(),source:hZ.nullable()}).catchall(q()).default({objective:``,suppliedKnowledge:``,deliverables:``,constraints:``,source:null}),terminal:Y({kind:K().nullable(),reason:K().nullable()}).catchall(q()).nullable().default(null),coverage:Y({completeOriginalCapture:RE(),publicContent:K(),categoryMethod:K(),cost:K(),nodes:J(gZ.extend({nodeId:K()})).optional(),gaps:J(_Z).optional()}).catchall(q()).default({completeOriginalCapture:!1,publicContent:``,categoryMethod:``,cost:`Unknown`})}).catchall(q()).superRefine((e,t)=>{let n=new Map(e.nodes.map(e=>[e.id,e]));n.size!==e.nodes.length&&t.addIssue({code:`custom`,path:[`nodes`],message:`Node IDs must be unique within a run`}),new Set(e.events.map(e=>e.id)).size!==e.events.length&&t.addIssue({code:`custom`,path:[`events`],message:`Event IDs must be unique within a run`});for(let[r,i]of e.nodes.entries()){i.agentId&&(i.kind!==`session`||n.get(i.agentId)?.kind!==`agent`)&&t.addIssue({code:`custom`,path:[`nodes`,r,`agentId`],message:`A proven session join must reference an existing agent`});let e=new Set([i.id]),a=i.parent;for(;a&&n.has(a);){if(e.has(a)){t.addIssue({code:`custom`,path:[`nodes`,r,`parent`],message:`Parent relationships must not contain a cycle`});break}e.add(a),a=n.get(a).parent}}for(let[r,i]of e.events.entries()){n.has(i.node)||t.addIssue({code:`custom`,path:[`events`,r,`node`],message:`An event must reference an existing node, even when that node has unresolved identity`});let e=i.detail.publicToolCalls??[];new Set(e.map(e=>e.id)).size!==e.length&&t.addIssue({code:`custom`,path:[`events`,r,`detail`,`publicToolCalls`],message:`Published tool call IDs must be unique within an event`})}let r=(e,n)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,path:[n],message:`${n} identifiers must be unique`})};r((e.artifacts??[]).map(e=>e.id),`artifacts`),r((e.claims??[]).map(e=>`${e.pageSha256}:${e.claimId}`),`claims`),r((e.verdicts??[]).map(e=>e.id),`verdicts`),r((e.publications??[]).map(e=>e.id),`publications`),r((e.profileVersions??[]).map(e=>e.digest),`profileVersions`);let i=new Set(e.events.map(e=>e.id));for(let[r,a]of(e.artifacts??[]).entries())a.sessionNodeId&&!n.has(a.sessionNodeId)&&t.addIssue({code:`custom`,path:[`artifacts`,r,`sessionNodeId`],message:`Artifact session must exist in this record`}),a.eventId&&!i.has(a.eventId)&&t.addIssue({code:`custom`,path:[`artifacts`,r,`eventId`],message:`Artifact event must exist in this record`});for(let[r,a]of(e.claims??[]).entries())a.agentNodeId&&!n.has(a.agentNodeId)&&t.addIssue({code:`custom`,path:[`claims`,r,`agentNodeId`],message:`Claim agent must exist in this record`}),a.eventId&&!i.has(a.eventId)&&t.addIssue({code:`custom`,path:[`claims`,r,`eventId`],message:`Claim event must exist in this record`});for(let[r,a]of(e.verdicts??[]).entries())n.get(a.reviewerSessionNodeId)?.kind!==`session`&&t.addIssue({code:`custom`,path:[`verdicts`,r,`reviewerSessionNodeId`],message:`Verdict reviewer must be a session in this record`}),a.eventId&&!i.has(a.eventId)&&t.addIssue({code:`custom`,path:[`verdicts`,r,`eventId`],message:`Verdict event must exist in this record`});for(let[r,i]of(e.publications??[]).entries())i.sessionNodeId&&n.get(i.sessionNodeId)?.kind!==`session`&&t.addIssue({code:`custom`,path:[`publications`,r,`sessionNodeId`],message:`Publication session must exist in this record`});for(let[r,i]of(e.profileVersions??[]).entries())i.authorNodeId&&!n.has(i.authorNodeId)&&t.addIssue({code:`custom`,path:[`profileVersions`,r,`authorNodeId`],message:`Profile author must exist in this record`})}),kZ=CD({offset:!0}),AZ=_E().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS source URL`),jZ=[`supported`,`hypothesis`,`unresolved`,`refuted`],MZ=Y({label:K().optional(),path:K().min(1).optional(),url:AZ.optional(),sha256:K().regex(/^[0-9a-f]{64}$/).optional(),line:PE().int().positive().optional(),eventId:K().min(1).optional(),excerpt:K().optional(),asOf:kZ.optional()}).catchall(q()).refine(e=>e.path||e.url||e.eventId,`Evidence needs a source path, URL, or recorded event`),NZ=Y({id:K().min(1),statement:K().min(1),title:K().min(1).optional(),status:ZE(jZ),method:K().optional(),evidence:J(MZ),limitations:J(K()).default([])}).catchall(q()).superRefine((e,t)=>{(e.status===`supported`||e.status===`refuted`)&&!e.evidence.length&&t.addIssue({code:`custom`,path:[`evidence`],message:`A supported or refuted assessment needs evidence`})}),PZ=Y({id:K().min(1),question:K(),status:ZE([`observed`,`unavailable`,`not_applicable`]),answer:K().optional(),evidence:J(MZ),asOf:kZ.optional(),why:K().optional(),record:K().optional()}).superRefine((e,t)=>{e.status===`observed`&&!e.evidence.length&&t.addIssue({code:`custom`,path:[`evidence`],message:`An observed answer needs evidence`})}),FZ=Y({id:K().min(1),kind:ZE([`check`,`negative-finding`,`wait`,`resources`,`next-step`,`context`]),title:K(),body:K(),evidence:J(MZ)}),IZ=Y({id:K().min(1),path:K().min(1),title:K().min(1),content:K(),sha256:K().regex(/^[0-9a-f]{64}$/).optional(),kind:ZE([`knowledge`,`report`,`code`,`data`]).default(`knowledge`)}).catchall(q()),LZ=Y({id:K().min(1),label:K().min(1),value:K().nullable(),unit:K().optional(),coverage:K().optional(),source:MZ.optional(),section:K().optional(),comparable:RE().nullable().optional(),note:K().optional(),why:K().optional(),record:K().optional()}).catchall(q()),RZ=Y({id:K().min(1),title:K().min(1),summary:K().optional()}),zZ=Y({text:K().nullable(),comparable:RE().nullable().optional(),note:K().optional(),href:K().optional()}),BZ=Y({id:K().min(1),section:K().min(1),title:K().min(1),columns:J(K()),rows:J(J(zZ)),source:MZ.optional()}),VZ=Y({id:K().min(1),question:K(),state:K(),threshold:K().optional(),instances:J(Y({sentence:K(),value:K().nullable().optional(),evidence:J(MZ)}))}),HZ=Y({field:K().min(1),why:K(),record:K()}),UZ=Y({id:K().min(1),label:K().min(1),href:K().optional(),ending:K().nullable(),reason:K().nullable().optional(),wallHours:PE().nullable(),agentHours:LZ,hoursByOutcome:YE(K(),PE()).nullable(),triesByOutcome:YE(K(),PE()).nullable().optional(),best:K().nullable().optional(),cost:K().nullable().optional()}),WZ=Y({schema:$E(`agent-research-report.v1`),id:K().min(1),title:K().min(1),generatedAt:kZ,summary:K(),assessmentBy:K().optional(),window:Y({from:kZ,to:kZ,label:K().optional()}).optional(),limitations:J(K()).default([]),freshness:Y({state:ZE([`current`,`stale`,`error`]),checkedAt:kZ,message:K(),lastSuccessfulAt:kZ.optional()}).optional(),questionCoverage:J(PZ).default([]),plays:J(Y({id:K().min(1),title:K().min(1),summary:K(),updatedAt:kZ.nullable(),status:K().nullable(),claims:J(NZ),limitations:J(K()).default([]),sources:J(MZ).default([]),observations:J(FZ).default([]),questionCoverage:J(PZ).default([]),record:OZ.optional(),documents:J(IZ).default([]),metrics:J(LZ).default([]),href:K().optional(),verdict:Y({sentence:K(),status:K().nullable(),evidence:J(MZ)}).optional(),sections:J(RZ).optional(),tables:J(BZ).optional(),runs:J(UZ).optional(),rules:J(VZ).optional(),unknowns:J(HZ).optional()}).catchall(q()))}).catchall(q()).superRefine((e,t)=>{e.window&&Date.parse(e.window.from)>=Date.parse(e.window.to)&&t.addIssue({code:`custom`,path:[`window`],message:`The report window must end after it starts`}),new Set(e.plays.map(e=>e.id)).size!==e.plays.length&&t.addIssue({code:`custom`,path:[`plays`],message:`Play IDs must be unique`});for(let[n,r]of e.questionCoverage.entries())r.evidence.some(e=>e.eventId)&&t.addIssue({code:`custom`,path:[`questionCoverage`,n],message:`Report-wide evidence needs a path or URL; event references belong to one play`});for(let[n,r]of e.plays.entries()){new Set(r.claims.map(e=>e.id)).size!==r.claims.length&&t.addIssue({code:`custom`,path:[`plays`,n,`claims`],message:`Claim IDs must be unique within a play`});for(let e of[`documents`,`metrics`])new Set(r[e].map(e=>e.id)).size!==r[e].length&&t.addIssue({code:`custom`,path:[`plays`,n,e],message:`IDs must be unique within a section`});new Set(r.documents.map(e=>e.path)).size!==r.documents.length&&t.addIssue({code:`custom`,path:[`plays`,n,`documents`],message:`Document paths must be unique within a play`});let e=new Set(r.record?.events.map(e=>e.id));for(let[i,a]of r.metrics.entries())a.source?.eventId&&!e.has(a.source.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,`metrics`,i,`source`,`eventId`],message:`Evidence event must exist in this play record`});for(let i of[`observations`,`questionCoverage`]){new Set(r[i].map(e=>e.id)).size!==r[i].length&&t.addIssue({code:`custom`,path:[`plays`,n,i],message:`IDs must be unique within a section`});for(let[a,o]of r[i].entries())for(let[r,s]of o.evidence.entries())s.eventId&&!e.has(s.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,i,a,`evidence`,r,`eventId`],message:`Evidence event must exist in this play record`})}for(let[i,a]of r.sources.entries())a.eventId&&!e.has(a.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,`sources`,i,`eventId`],message:`Evidence event must exist in this play record`});for(let[i,a]of r.claims.entries())for(let[r,o]of a.evidence.entries())o.eventId&&!e.has(o.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,`claims`,i,`evidence`,r,`eventId`],message:`Evidence event must exist in this play record`})}});function GZ(e){return WZ.parse(e)}function KZ(e){let t={"\\":`\\textbackslash{}`,"{":`\\{`,"}":`\\}`,$:`\\$`,"&":`\\&`,"#":`\\#`,"%":`\\%`,_:`\\_`,"~":`\\textasciitilde{}`,"^":`\\textasciicircum{}`};return e.replace(/[\\{}$&#%_~^]/g,e=>t[e])}function qZ(e,t){let n=t===void 0?e.plays:e.plays.filter(e=>e.id===t);if(t!==void 0&&!n.length)throw Error(`Unknown play: `+t);let r=e=>e.split(/(\S{32,})/u).map(e=>/^\S{32,}$/u.test(e)?Array.from(e).map(KZ).join(`\\allowbreak{}`):KZ(e)).join(``),i=e=>r(e)+`
546
+ `).find(e=>e.trim())??``).slice(0,200)};function SX(e,t,n,r,i,a){let o=yX(t.name),s=n?EO(n)||n.detail.contentOmitted||``:void 0,c=r===`error`?`error`:r===`pending`||r===`missing`&&a?`running`:`completed`,l=r===`ambiguous`||r===`missing`&&!a?QY(r,a):void 0,u={type:`tool`,id:e,tool:o,state:{status:c,input:bX(t.input),...s===void 0?{}:{output:s},...c===`error`?{error:xX(s??``)||`The call failed.`}:{},...i!==null&&i>=0?{time:{start:0,end:i}}:{},...l?{metadata:{note:l}}:{}}},d=_X.has(o.toLowerCase()),f=jM(u),p=ZY(t.input)??(f.description||(d?void 0:AO(t)));return{id:e,kind:`tool`,part:u,call:{id:e,type:vX[o.toLowerCase()]??`unknown`,label:d?f.title:o.replaceAll(`_`,` `),status:c===`error`?`error`:c===`running`?`running`:`success`,...p?{detail:p}:{},...i!==null&&i>=0?{duration:i}:{}}}}var CX=e=>{let t=e.state.metadata?.note;return t?(0,A.jsx)(`span`,{className:`tool-note`,children:t}):null},wX=e=>e&&typeof e==`object`&&`bytes`in e?e:void 0;function TX({clip:e,open:t}){return e?(0,A.jsxs)(`p`,{className:`clip-note`,children:[(0,A.jsxs)(`span`,{children:[new Intl.NumberFormat(`en-US`).format(e.bytes),` bytes, middle omitted.`]}),e.sha256&&t?(0,A.jsx)(`button`,{type:`button`,className:`link-button`,"data-load-full":e.sha256,onClick:()=>t(e.sha256),children:`Full output`}):null]}):null}function EX(e){let t=dX(e.events),n=ZY(e.input)??yO(e.input??``);return{id:e.key,kind:`custom`,content:(0,A.jsx)(pJ,{icon:(0,A.jsx)(gX,{name:e.name}),title:yX(e.name),description:[t.label,n].filter(Boolean).join(` · `),descriptionMono:!0,children:(0,A.jsx)(`ol`,{className:`poll-calls`,children:e.events.map(e=>(0,A.jsxs)(`li`,{"data-message":e.id,children:[(0,A.jsx)(`time`,{dateTime:e.at,children:vO(e.at)}),(0,A.jsx)(`span`,{className:`mono`,children:ZY(OO(e)[0]?.input)??yO(OO(e)[0]?.input??``)})]},e.id))})})}}var DX=e=>({id:e.key,kind:`custom`,content:(0,A.jsx)(pJ,{icon:(0,A.jsx)(gX,{name:e.calls[0]?.name??`tool`}),title:cX(e.calls),description:`args not captured`,durationMs:e.spanMs||void 0})});function OX(e,t){if(e.kind===`polls`)return[EX(e)];if(e.kind===`hollow`)return[DX(e)];let{index:n,cutoff:r,anchor:i,thinkingSpan:a,opened:o,paired:s,live:c}=t,l=e.event;if(pX(l)){let e=EO(l);return[{id:l.id,kind:`custom`,content:(0,A.jsxs)(`p`,{className:`lifecycle-note${l.detail.isError?` lifecycle-error`:``}`,children:[(0,A.jsx)(`b`,{children:l.label}),e&&(0,A.jsx)(`span`,{children:yO(e).slice(0,280)})]})}]}let u=EO(l),d=OO(l),f=typeof l.detail.reasoning==`string`?l.detail.reasoning:``,p=tX(l.detail),m=l.detail.responseStatus===`error`,h=l.detail.recordedClaim!==void 0,g=l.detail.toolCallId!==void 0||l.detail.role===`toolResult`;if(l.detail.role===`user`&&u&&!g){let e=fX(u),t=e.length>280&&!o.has(`prompt:${i(l)}`);return[{id:l.id,kind:`message`,role:`user`,content:t?`${e.slice(0,280).trimEnd()}…`:e,timestamp:new Date(l.at)}]}let _=[];if(f&&_.push({id:`${l.id}:reasoning`,kind:`custom`,content:(0,A.jsx)(jY,{part:{type:`reasoning`,text:f},autoCollapse:!1})}),p.length){let e=$Y(l.detail),t=a.get(l.id),n=e===null?p.join(` · `):`${t!==void 0&&t>=1e3?`for ${hX(t)} · `:``}${mX(e)} output tokens · ${p.join(` · `)}`;_.push({id:`${l.id}:thinking`,kind:`custom`,content:(0,A.jsx)(`span`,{"data-thinking-withheld":!0,children:(0,A.jsx)(pJ,{icon:(0,A.jsx)(gX,{name:`think`}),title:`Thought`,description:n})})})}if(m)_.push({id:l.id,kind:`status`,tone:`error`,label:`The request failed`,detail:u?yO(u).slice(0,400):`No assistant response is present in this record.`});else if(h)_.push({id:l.id,kind:`status`,tone:`info`,label:`Recorded finding`,detail:yO(u).slice(0,600)});else if(g){let e=l.detail.toolCallId!==void 0&&(n.calls.get(DO(l.node,l.detail.toolCallId))?.length??0)>1;_.push(SX(l.id,{id:l.id,name:l.label||`Tool result`},l,e?`ambiguous`:l.detail.isError?`error`:`returned`,null,c))}else u?_.push({id:l.id,kind:`message`,role:`assistant`,content:u}):!d.length&&!f&&!p.length&&_.push({id:l.id,kind:`status`,label:l.detail.contentOmitted??`No text body is present in this record.`});let v=i(l);for(let e of d){let t=s(l,e),i=t.filter(e=>_O(e.at)<=r).at(-1),a=(n.calls.get(DO(l.node,e.id))?.length??0)>1?`ambiguous`:i?i.detail.isError?`error`:`returned`:t.some(e=>_O(e.at)>r)?`pending`:`missing`,o=(typeof i?.detail.durationMs==`number`?i.detail.durationMs:null)??(i&&i.detail.atBasis!==`carried`?_O(i.at)-_O(l.at):null);_.push(SX(`tool:${v}:${e.id}`,e,i,a,o,c))}return _}var kX=e=>e.length?RY(e[e.length-1]):void 0;function AX({row:e,items:t,previous:n,context:r}){let{selected:i,opened:a,anchor:o,setOpen:s,flagMarks:c,opener:l,flags:u}=r,d=e.kind===`event`?[e.event]:e.events,f=d[0],p=t.map((e,r)=>(0,A.jsx)(KY,{item:e,previous:r?RY(t[r-1]):n,renderToolActions:CX},e.id)),m={className:[`chat-row`,d.some(e=>e.id===i)&&`selected`,e.kind===`event`&&u?.has(f.id)&&`flagged`].filter(Boolean).join(` `),"data-entry":f.id,title:vO(f.at),...e.kind===`polls`?{"data-poll-group":e.events.length}:e.kind===`hollow`?{"data-hollow-group":e.events.length}:{"data-message":f.id,"data-message-node":f.node}};if(e.kind!==`event`||pX(f))return(0,A.jsxs)(`div`,{...m,children:[p,e.kind===`event`&&c(f)]});let h=EO(f),g=f.detail.toolCallId!==void 0||f.detail.role===`toolResult`,_=wX(f.detail.clip);if(f.detail.role===`user`&&h&&!g){let e=`prompt:${o(f)}`,t=fX(h).length>280,n=t&&!a.has(e);return(0,A.jsxs)(`article`,{...m,children:[p,t&&(0,A.jsx)(`p`,{className:`ar-prompt-more`,children:(0,A.jsx)(`button`,{type:`button`,className:`link-button`,"data-open-key":e,"aria-expanded":!n,onClick:()=>s(e,n),children:n?`Full prompt`:`Shorter`})}),!n&&(0,A.jsx)(TX,{clip:_,open:l(f)}),c(f)]})}let v=f.detail.recordedClaim!==void 0,y=[f.detail.publicationNote,v?f.detail.assessment:void 0].filter(e=>!!e);return(0,A.jsxs)(`article`,{...m,children:[p,h&&!g&&(0,A.jsx)(TX,{clip:OO(f).length?void 0:_,open:l(f)}),y.map(e=>(0,A.jsx)(`p`,{className:`publication-note`,children:e},e)),c(f)]})}function jX({index:e,actor:t,cutoff:n,query:r,category:i,selected:a,openSource:o,flags:s,onFlag:c,lifecycle:l=!1,live:u=!1,opening:d}){let[f,p]=(0,b.useState)(()=>{let t=YY(e.events);return new Set(e.events.filter(e=>e.detail.promptKind===`initial`).map(e=>`prompt:${t.get(e.id)??e.id}`))}),m=(0,b.useRef)(null),h=(0,b.useMemo)(()=>YY(e.events),[e]),g=(0,b.useCallback)(e=>h.get(e.id)??e.id,[h]),_=e=>o?t=>o(t,e):void 0,v=(e,t)=>p(n=>{if(n.has(e)===t)return n;let r=new Set(n);return t?r.add(e):r.delete(e),r}),y=(t,n)=>{let r=DO(t.node,n.id);return e.calls.get(r)?.length===1?e.results.get(r)??[]:[]},x=(0,b.useMemo)(()=>{if(!a)return;let t=e.byEvent.get(a);if(t?.detail.toolCallId!==void 0){let n=e.calls.get(DO(t.node,t.detail.toolCallId));if(n?.length===1)return n[0].event.id}return a},[a,e]),S=(0,b.useMemo)(()=>(e.byActor.get(t)??[]).filter(t=>{if(_O(t.at)>n)return!1;if(t.id===x)return!0;if(pX(t))return l&&MO(t,e,r,i);if(t.detail.toolCallId!==void 0){let r=e.calls.get(DO(t.node,t.detail.toolCallId));if(r?.length===1&&_O(r[0].event.at)<=n)return!1}let a=OO(t);return!(t.detail.role||EO(t)||t.detail.reasoning||t.detail.responseStatus===`error`||a.length)||t.detail.role===`assistant`&&!EO(t)&&!t.detail.reasoning&&!a.length&&t.detail.responseStatus!==`error`&&!t.detail.contentOmitted&&(!tX(t.detail).length||eX(t.detail))?!1:MO(t,e,r,i)?!0:a.some(a=>{let o=DO(t.node,a.id);return e.calls.get(o)?.length===1&&(e.results.get(o)??[]).some(t=>_O(t.at)<=n&&MO(t,e,r,i))})}),[e,t,n,r,i,l,x]),C=(0,b.useMemo)(()=>{if(!d?.text||r||i!==`all`||S.some(e=>e.detail.role===`user`))return S;let e=S[0]?.at??d.at;return[{id:`${t}:opening`,node:t,at:e<d.at?e:d.at,kind:`message`,category:`other`,label:`prompt`,detail:{role:`user`,publicText:d.text,promptKind:`initial`}},...S]},[S,d,t,r,i]),w=(0,b.useMemo)(()=>sX(lX(C,{callsOf:OO,answered:(t,n)=>iX(e.results.get(DO(t.node,n))),keyOf:g}),{callsOf:OO,captured:(t,n)=>(e.results.get(DO(t.node,n))??[]).some(e=>EO(e)),keyOf:g}),[C,e,g]),T=(0,b.useMemo)(()=>{let n=new Map,r=null;for(let i of e.byActor.get(t)??[]){let e=_O(i.at);r!==null&&Number.isFinite(e)&&tX(i.detail).length&&n.set(i.id,Math.max(0,e-r)),Number.isFinite(e)&&(r=e)}return n},[e,t]),ee=(0,b.useMemo)(()=>{let e=new Map;for(let t of w)if(t.kind===`polls`)for(let n of t.events)e.set(n.id,t.key);else if(t.kind===`hollow`)for(let n of t.events)e.set(n.id,t.key);else e.set(t.event.id,t.key);return e},[w]),E=(e.byActor.get(t)??[]).some(e=>!pX(e)&&(e.detail.role||EO(e)||OO(e).length)),te=(0,b.useRef)(x);te.current=x;let ne=(0,b.useRef)(!1);(0,b.useLayoutEffect)(()=>{ne.current=u&&!te.current,m.current&&!te.current&&(m.current.scrollTop=u?m.current.scrollHeight:0)},[t]),(0,b.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{ne.current=e.scrollHeight-e.scrollTop-e.clientHeight<24};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]),(0,b.useLayoutEffect)(()=>{let e=m.current;if(!e||!ne.current)return;e.scrollTop=e.scrollHeight;let t=0,n=requestAnimationFrame(function r(){ne.current&&(e.scrollTop=e.scrollHeight,++t<20&&(n=requestAnimationFrame(r)))});return()=>cancelAnimationFrame(n)},[w]),(0,b.useEffect)(()=>{if(!a)return;let t=e.byEvent.get(a);if(!t)return;let n=[`prompt:${g(t)}`,`reasoning:${g(t)}`];if(t.detail.toolCallId!==void 0)for(let r of e.calls.get(DO(t.node,t.detail.toolCallId))??[])n.push(`tool:${g(r.event)}:${r.call.id}`,ee.get(r.event.id)??``);for(let e of OO(t))n.push(`tool:${g(t)}:${e.id}`);let r=ee.get(a);r?.startsWith(`polls:`)&&n.push(r),p(e=>new Set([...e,...n.filter(Boolean)]))},[a,e]);let re=e=>{let t=s?.get(e.id);return t?.length?(0,A.jsx)(`span`,{className:`event-flags`,children:t.map(t=>(0,A.jsx)(`button`,{type:`button`,className:`event-flag polarity-${t.polarity}`,title:t.title,"data-flag":t.dimension,onClick:()=>c?.(t,e),children:t.dimension},`${t.dimension}:${t.label}`))}):null},ie=(0,b.useCallback)(e=>e.key,[]),D=(0,b.useCallback)(e=>e.kind===`polls`?36:e.kind===`hollow`||pX(e.event)?26:!EO(e.event)&&OO(e.event).length?16+36*OO(e.event).length:96,[]),ae={index:e,cutoff:n,selected:a,opened:f,anchor:g,opener:_,setOpen:v,flagMarks:re,paired:y,thinkingSpan:T,flags:s,live:u},oe=(0,b.useMemo)(()=>w.map(e=>OX(e,ae)),[w,f,n,a,u,e,T]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(`div`,{className:`conversation-scroll`,"data-chat":!0,ref:m,tabIndex:0,"aria-label":`Scrollable retained conversation`,children:[!w.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:r||i!==`all`?`No messages match this filter.`:E?`No messages at the selected time.`:`Conversation not retained. Its absence does not mean the agent did no work.`}),(0,A.jsx)(GY,{className:`ar-chat`,children:(0,A.jsx)(VO,{items:w,keyOf:ie,render:(e,t)=>(0,A.jsx)(AX,{row:e,items:oe[t]??[],previous:t?kX(oe[t-1]??[]):void 0,context:ae}),scroller:m,target:x?ee.get(x):void 0,estimate:D})})]})})}var MX=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),t())};function NX({index:e,cutoff:t,selected:n,inspect:r,showTooltip:i,hideTooltip:a,navigate:o,events:s,zoom:c,marks:l,behaviors:u,baseWidth:d=940}){let f=d*c,p=u?.length?26:0,m=Math.max(85,48+e.actors.length*30)+p,h=Math.max(e.end-e.start,1),g=e.events.some(e=>e.end!==void 0),_=Math.max(1,Math.log10(h)+1),v=t=>{let n=Math.max(0,t-e.start);return n<=0?200:g?200+n/h*(f-200-20):200+Math.log10(n+1)/_*(f-200-20)},y=(0,b.useMemo)(()=>new Map(e.actors.map((e,t)=>[e.id,t])),[e]),x=(0,b.useMemo)(()=>{let t=new Map;for(let n of s){let r=y.get(e.canonical(n.node));if(r===void 0)continue;if(n.end){t.set(n.id,{lane:r,bin:0,events:[n]});continue}let i=Math.floor((v(_O(n.at))-200)/6),a=`${r}:${i}`,o=t.get(a)??{lane:r,bin:i,events:[]};o.events.push(n),t.set(a,o)}return[...t.values()]},[s,y,e,h,f]),S=Math.ceil(f/160);return(0,A.jsx)(`div`,{className:`timeline-scroll`,tabIndex:0,"aria-label":`Scrollable agent activity timeline`,children:(0,A.jsxs)(`svg`,{"data-timeline":!0,viewBox:`0 0 ${f} ${m}`,style:{width:f,height:m},role:`group`,tabIndex:0,"aria-label":`Activity timeline. Left and right arrows select events.`,onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),o(e.key===`ArrowLeft`?-1:1))},children:[Array.from({length:S+1},(e,t)=>{let n=t/S,r=g?n*h:Math.max(0,10**(n*_)-1),i=200+n*(f-200-20);return(0,A.jsxs)(`g`,{children:[(0,A.jsx)(`line`,{x1:i,x2:i,y1:30,y2:m-12,className:`grid-line`}),(0,A.jsx)(`text`,{x:i,y:18,textAnchor:`middle`,className:`axis-label`,children:wO(Math.min(r,h))})]},t)}),e.actors.map((e,t)=>(0,A.jsxs)(`g`,{children:[(0,A.jsxs)(`text`,{x:4,y:44+t*30,className:`lane-label`,children:[(0,A.jsx)(`title`,{children:e.label}),e.label.length>20?`${e.label.slice(0,19)}…`:e.label]}),(0,A.jsx)(`line`,{x1:200,x2:f-20,y1:40+t*30,y2:40+t*30,className:`grid-line`})]},e.id)),x.map(({lane:o,bin:s,events:c})=>{let l=c.findIndex(e=>e.id===n),u=c[l<0?0:l],d=[...FO(u,e,t).sections];u.activity&&d.unshift({kind:`note`,value:`${u.activity} · ${u.phase??`activity`}${u.end?` · ${wO(_O(u.end)-_O(u.at))}`:``}`}),u.detail.modelSplitEstimated&&d.push({kind:`note`,value:`Model split is estimated from step tokens, normalized to observed elapsed time.`}),typeof u.detail.editMethod==`string`&&d.push({kind:`note`,value:`Edit: ${u.detail.editMethod} · ${String(u.detail.editTarget??`unknown`)}`}),c.length>1&&d.unshift({kind:`note`,value:`${c.length} events in this interval. Select again to cycle; zoom separates nearby times.`});let f=()=>{a(),r(c[l<0?0:(l+1)%c.length])};return(0,A.jsx)(`rect`,{x:u.end?v(_O(u.at)):200+s*6,y:34+o*30,width:u.end?Math.max(1,v(_O(u.end))-v(_O(u.at))):4,height:12,rx:1,className:`event category-${IX(u.category)} ${l>=0?`selected`:``}`,opacity:c.every(e=>_O(e.at)>t)?.25:1,"data-id":u.id,"data-cluster-count":c.length,role:`button`,tabIndex:l>=0?0:-1,"aria-label":`${u.label}, ${e.actors[o]?.label}, ${vO(u.at,!0)}${c.length>1?`, ${c.length} events, activate to cycle`:``}`,onMouseEnter:e=>i(e,u.label,d),onMouseLeave:a,onFocus:e=>i(e,u.label,d),onBlur:a,onClick:f,onKeyDown:e=>MX(e,f),children:(0,A.jsx)(`title`,{children:`${u.label} · ${vO(u.at,!0)}`})},u.end?u.id:`${o}:${s}`)}),l&&e.events.map(n=>{let i=l.get(n.id),a=y.get(e.canonical(n.node));if(!i?.length||a===void 0||_O(n.at)>t)return null;let o=v(_O(n.at)),s=31+a*30;return(0,A.jsx)(`path`,{d:`M${o-3},${s-4} L${o+3},${s-4} L${o},${s}z`,className:`timeline-flag polarity-${i[0].polarity}`,onClick:()=>r(n),children:(0,A.jsx)(`title`,{children:i.map(e=>e.title).join(`
547
+ `)})},`mark:${n.id}`)}),(0,A.jsx)(`line`,{x1:v(t),x2:v(t),y1:26,y2:m-8,className:`cursor-line`,pointerEvents:`none`}),!s.length&&(0,A.jsx)(`text`,{x:210,y:m-8,className:`axis-label`,children:`No events match this filter.`}),u&&u.length>0&&(0,A.jsxs)(`g`,{"data-behavior-lane":!0,children:[(0,A.jsx)(`text`,{x:193,y:m-9,textAnchor:`end`,className:`axis-label`,children:`behaviors`}),u.map((t,n)=>(0,A.jsx)(`rect`,{x:v(t.at)-3,y:m-20,width:6,height:14,rx:2,className:`behavior-tick axis-${t.axis}`,opacity:.35+.65*t.confidence,role:`button`,tabIndex:0,"aria-label":`${t.behavior} (${Math.round(t.confidence*100)}%)${t.quote?`: ${t.quote.slice(0,60)}`:``}`,onMouseEnter:e=>i(e,t.behavior,[{kind:`status`,value:`${Math.round(t.confidence*100)}% confidence · ${t.axis}`,tone:t.axis===`alignment`?`error`:t.axis===`affect`?`warn`:`ok`},...t.quote?[{kind:`body`,value:t.quote.slice(0,90)}]:[]]),onMouseLeave:a,onFocus:e=>i(e,t.behavior,[{kind:`status`,value:`${Math.round(t.confidence*100)}% confidence · ${t.axis}`}]),onBlur:a,onClick:()=>t.eventId&&r(e.byEvent.get(t.eventId),!0),onKeyDown:n=>MX(n,()=>t.eventId&&r(e.byEvent.get(t.eventId),!0))},`${t.behavior}:${n}`))]})]})})}var PX=[`coordination`,`compute`,`computation`,`verification`,`literature`,`writing`,`setup`,`infrastructure`,`waiting`,`reasoning`,`lifecycle`,`other`],FX={"edit files":`writing`,build:`compute`,"gate/test":`verification`,"git/PR write":`coordination`,"prod/remote ops":`infrastructure`,"workspace setup":`setup`,messaging:`coordination`,"read messages":`coordination`,"query status":`lifecycle`,"analysis script":`reasoning`,"read code/files":`literature`,"memory search":`literature`,subagents:`coordination`},IX=e=>FX[e]??(PX.includes(e)?e:`other`),LX=[`input`,`output`,`cacheRead`,`cacheWrite`],RX={input:`Input`,output:`Output`,cacheRead:`Cache read`,cacheWrite:`Cache write`};function zX({index:e,cutoff:t,inspect:n,showTooltip:r,hideTooltip:i,navigate:a,actor:o,metric:s,axis:c}){let[l,u]=(0,b.useState)(()=>new Set),d=LX.filter(e=>!l.has(e)),f=(0,b.useMemo)(()=>{let n=[],r={input:0,output:0,cacheRead:0,cacheWrite:0},i={input:0,output:0,cacheRead:0,cacheWrite:0},a=0,l=0,u=0,d=e.byActor.get(o)??[],f=e.recordedOrder,p=c===`order`?[...d].sort((e,t)=>(f.get(e.id)??0)-(f.get(t.id)??0)):d;for(let o of p){if(_O(o.at)>t)continue;if(s===`tool-time`){if(o.detail.toolCallId===void 0)continue;let r=e.calls.get(DO(o.node,o.detail.toolCallId))??[];if(r.length!==1){l++;continue}let i=r[0].event;if(_O(i.at)>t||_O(o.at)<_O(i.at)){u++;continue}n.push({event:o,at:_O(o.at),values:{},elapsed:(_O(o.at)-_O(i.at))/1e3});continue}let c=o.detail.usage;if(!c)continue;let d=o.detail.usageScope!==void 0;if(s!==`cumulative`&&d)continue;LX.some(e=>c[e]===void 0)&&a++;let f={};for(let e of LX){let t=c[e];t!==void 0&&(d||(r[e]+=t,i[e]++),f[e]=s===`cumulative`?d?t:r[e]:t)}Object.keys(f).length&&n.push({event:o,at:_O(o.at),values:f,scoped:d})}return{points:n,totals:r,counts:i,incomplete:a,ambiguous:l,invalidTiming:u}},[e,t,o,s,c]),{points:p,totals:m,counts:h}=f,g=Math.max(1,...p.flatMap(e=>s===`tool-time`?[e.elapsed??0]:d.map(t=>e.values[t]??0))),_=(n,r)=>62+(c===`time`?(n.at-e.start)/Math.max(1,t-e.start):r/Math.max(1,p.length-1))*496,v=e=>218-e/g*190,y=(e,t)=>{let n=!1;return p.filter(e=>!!e.scoped===t).map(t=>{let r=t.values[e];if(r===void 0)return n=!1,``;let i=`${n?`L`:`M`}${_(t,p.indexOf(t))},${v(r)}`;return n=!0,i}).join(` `)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`svg`,{"data-tokens":!0,viewBox:`0 0 580 265`,role:`group`,tabIndex:0,"aria-label":`Recorded usage or tool return time. Points open source events.`,onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),a(e.key===`ArrowLeft`?-1:1))},children:[Array.from({length:5},(n,r)=>{let i=r*g/4,a=v(i),o=62+r/4*496;return(0,A.jsxs)(`g`,{children:[(0,A.jsx)(`line`,{x1:62,x2:558,y1:a,y2:a,className:`grid-line`}),(0,A.jsx)(`text`,{x:55,y:a+4,textAnchor:`end`,className:`axis-label`,children:s===`tool-time`?`${i.toFixed(g>10?0:1)}s`:CO(i)}),(0,A.jsx)(`text`,{x:o,y:240,textAnchor:`middle`,className:`axis-label`,children:c===`time`?wO((t-e.start)*r/4):p.length?String(Math.round((p.length-1)*r/4)+1):`—`})]},r)}),(0,A.jsx)(`text`,{x:62,y:14,className:`axis-label`,children:s===`tool-time`?`Observed call → result interval (seconds)`:s===`cumulative`?`Cumulative measured tokens`:`Measured tokens per response`}),s!==`tool-time`&&d.map(e=>(0,A.jsx)(`path`,{d:y(e,!1),className:`usage-line ${e}-line`},e)),s===`cumulative`&&p.some(e=>e.scoped)&&d.map(e=>(0,A.jsx)(`path`,{d:y(e,!0),className:`usage-line ${e}-line scoped-line`},`scoped-${e}`)),p.map((a,o)=>{let c=s===`tool-time`?a.elapsed:Math.max(0,...d.map(e=>a.values[e]??0));if(s!==`tool-time`&&c===0&&!d.some(e=>a.values[e]!==void 0))return null;let l=FO(a.event,e,t).sections;s===`tool-time`?l.push({kind:`status`,value:`${a.elapsed.toFixed(3)} seconds between the recorded call and this result. Includes queue and tool time.`,tone:`muted`}):s===`cumulative`&&l.push({kind:`usage`,value:LX.map(e=>`${RX[e]} ${a.values[e]===void 0?`unmeasured`:CO(a.values[e])}`).join(` `)});let u=()=>{i(),n(a.event,!0)};return(0,A.jsx)(`circle`,{cx:_(a,o),cy:v(c),r:4,className:s===`tool-time`?a.event.detail.isError?`time-error`:`time-point`:a.scoped?`usage-point scoped-point`:`usage-point`,"data-id":a.event.id,tabIndex:0,role:`button`,"aria-label":`${a.event.label}, ${s===`tool-time`?`${a.elapsed?.toFixed(3)} seconds`:`measured token usage`}`,onMouseEnter:e=>r(e,a.event.label,l),onMouseLeave:i,onFocus:e=>r(e,a.event.label,l),onBlur:i,onClick:u,onKeyDown:e=>MX(e,u)},a.event.id)}),!p.length&&(0,A.jsx)(`text`,{x:290,y:120,textAnchor:`middle`,className:`axis-label`,children:s===`tool-time`?`No matched tool timing at this time`:`No measured usage at this time`})]}),s!==`tool-time`&&(0,A.jsxs)(`div`,{className:`usage-legend`,children:[LX.map(e=>(0,A.jsx)(`button`,{type:`button`,className:`${e}-key legend-toggle`,"aria-pressed":!l.has(e),title:l.has(e)?`Show ${RX[e]}`:`Hide ${RX[e]}`,onClick:()=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:RX[e]},e)),p.some(e=>e.scoped)&&(0,A.jsx)(`span`,{className:`scoped-key`,children:`metered windows · execution-to-date`})]}),(0,A.jsx)(`p`,{className:`small`,"data-token-caption":!0,children:s===`tool-time`?`Observed tool return time, not model latency.${f.ambiguous||f.invalidTiming?` Unmatched, ambiguous and out-of-order results are omitted.`:``}`:`${LX.map(e=>`${RX[e]} ${h[e]?CO(m[e]):`unknown`}`).join(` · `)}.${f.incomplete?` Some responses lack counters, so these totals are lower bounds.`:``} Context repeated across responses is counted each time; tokens are not billed cost.`})]})}new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2});function BX(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)({width:0,em:16});return(0,b.useEffect)(()=>{if(!e)return;let t=new ResizeObserver(([t])=>r({width:Math.floor(t.contentRect.width),em:parseFloat(getComputedStyle(e).fontSize)||16}));return t.observe(e),()=>t.disconnect()},[e]),[t,n.width,n.em]}function VX({figure:e,presentation:t=`chart`}){let[n,r]=BX(),i=r>=720?Math.floor(r/32)*32:720,a=(0,b.useMemo)(()=>typeof e==`function`?e(i):e,[e,i]);if(me(a))return(0,A.jsx)(`p`,{className:`ov-refusal`,role:`note`,"data-refused":a.id,children:a.refused});let o=r>0&&r<720?a.svg.narrow?`narrow`:`table`:`wide`,s=o===`wide`?a.svg.wide:o===`narrow`?a.svg.narrow:a.table,c=[a.note.method,a.note.n,...a.note.exclusions].join(` `);return(0,A.jsxs)(`figure`,{ref:n,className:`tgc-figure tgc-figure-chart tgc-figure-view`,"data-figure":a.id,"data-layout":o,"aria-label":a.finding,children:[t===`report`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h3`,{className:`tgc-finding`,children:a.finding}),(0,A.jsx)(`p`,{className:`tgc-lede`,children:a.lede})]}),(0,A.jsx)(`div`,{className:`tgc-view-plot tgc-view-${o}`,role:a.svg.interactive?`group`:`img`,"aria-label":`${a.finding} ${a.lede}`,style:o===`narrow`?{maxWidth:358}:void 0,dangerouslySetInnerHTML:{__html:s}}),(0,A.jsxs)(`details`,{className:`tgc-data`,children:[(0,A.jsx)(`summary`,{children:`Data and method`}),(0,A.jsx)(`p`,{className:`tgc-lede`,children:a.lede}),(0,A.jsx)(`p`,{className:`tgc-read`,children:a.read}),(0,A.jsx)(`p`,{className:`tgc-read`,children:c}),(0,A.jsx)(`div`,{className:`tgc-scroll`,role:`region`,"aria-label":`${a.finding} data`,tabIndex:0,dangerouslySetInnerHTML:{__html:a.table}})]})]})}function HX({lanes:e,options:t,defaultCollapsed:n=[],presentation:r}){let[i,a]=(0,b.useState)(n),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useMemo)(()=>n=>Be(e,{...t,collapsed:i,width:n}),[e,t,i]);(0,b.useEffect)(()=>{let e=s.current;s.current=null,e!==null&&o.current&&Array.from(o.current.querySelectorAll(`[data-toggle]`)).find(t=>t.getAttribute(`data-toggle`)===e)?.focus()},[c]);let l=(e,t)=>{let n=e instanceof Element?e.closest(`[data-toggle]`)?.getAttribute(`data-toggle`):null;return n?(t&&(s.current=n),a(e=>e.includes(n)?e.filter(e=>e!==n):[...e,n]),!0):!1};return(0,A.jsx)(`div`,{ref:o,className:`tgc-timeline-view`,onClick:e=>l(e.target,!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&l(e.target,!0)&&e.preventDefault()},children:(0,A.jsx)(VX,{figure:c,presentation:r})})}Object.freeze([`var(--chart-category-1)`,`var(--chart-category-2)`,`var(--chart-category-3)`,`var(--chart-category-other)`]);var UX=e=>e<=0?0:(e-1)%5+1,WX=e=>e.status===`running`;function GX(e){if(!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;if(e<1e4)return`${(e/1e3).toFixed(1)}s`;if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n===60?`${t+1}m`:n?`${t}m ${n}s`:`${t}m`}let t=Math.floor(e/36e5),n=Math.round(e%36e5/6e4);return n===60?`${t+1}h`:`${t}h ${String(n).padStart(2,`0`)}m`}function KX(e){return e===0?`$0.00`:e<.01?`$${e.toPrecision(1).replace(/0+$/,``)}`:`$${e.toFixed(2)}`}function qX(e){if(e.id.startsWith(`family:`)){let t=Number(e.span.meta?.failedAgents??0);return[`${e.descendants} agents`,...t?[`${t} failed`]:[]]}if(e.id.startsWith(`run:`)){let t=e.own.filter(e=>e.kind===`failed`).length;return[t?`${t} failed`:`all done`]}let t=e.counts?.model??0,n=e.counts?.tool??0;return[e.span.outcome?.label??(WX(e.span)?`running`:e.ok?e.kind===`pipeline`?``:`done`:`failed`),t?`${t} LLM ${t===1?`call`:`calls`}`:``,n?`${n} tool ${n===1?`call`:`calls`}`:``].filter(Boolean)}var JX=(e,t)=>`${e.costFloor?`≥`:``}${KX(t)}`,YX=(e,t)=>(0,A.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!t||void 0,role:t?`img`:void 0,"aria-label":t,children:e});function XX(e){let t=(e??``).toLowerCase();if(/bash|shell|exec|terminal|command|run/.test(t))return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`2`}),(0,A.jsx)(`path`,{d:`m5 7 2 1.5L5 10M8.5 10.5h2.5`})]}));if(/edit|write|patch|apply/.test(t))return YX((0,A.jsx)(`path`,{d:`M3 13l1-3.5L10.5 3a1.4 1.4 0 0 1 2 2L6 11.5 3 13ZM9.5 4l2 2`}));if(/grep|search|find|query/.test(t))return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.25`}),(0,A.jsx)(`path`,{d:`m10.25 10.25 3.25 3.25`})]}));if(/read|glob|list|ls|cat|file|view/.test(t))return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M4 2.5h5l3 3v8H4z`}),(0,A.jsx)(`path`,{d:`M9 2.5v3h3M6 9h4M6 11h3`})]}));if(/web|fetch|http|browser|url/.test(t))return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,A.jsx)(`path`,{d:`M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11`})]}));if(/git|commit|branch|merge/.test(t))return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`5`,cy:`4`,r:`1.5`}),(0,A.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.5`}),(0,A.jsx)(`circle`,{cx:`11`,cy:`6`,r:`1.5`}),(0,A.jsx)(`path`,{d:`M5 5.5v5M11 7.5c0 2-3 2-6 3`})]}))}function ZX({kind:e,name:t}){if(e===`tool`){let e=XX(t);if(e)return e}switch(e){case`pipeline`:return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:`8`,cy:`4`,r:`1.75`}),(0,A.jsx)(`circle`,{cx:`4`,cy:`12`,r:`1.75`}),(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.75`}),(0,A.jsx)(`path`,{d:`M8 5.75v2.5M8 8.25 4.8 10.6M8 8.25l3.2 2.35`})]}));case`model`:return YX((0,A.jsx)(`path`,{d:`M8 2.5c.5 2.8 2.2 4.6 5 5.5-2.8.9-4.5 2.7-5 5.5-.5-2.8-2.2-4.6-5-5.5 2.8-.9 4.5-2.7 5-5.5Z`}));case`waiting`:return YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M4.5 2.5h7M4.5 13.5h7`}),(0,A.jsx)(`path`,{d:`M5.5 2.5c0 3 5 3 5 5.5s-5 2.5-5 5.5M10.5 2.5c0 3-5 3-5 5.5`})]}));case`handoff`:return YX((0,A.jsx)(`path`,{d:`M3 3v5.5a2 2 0 0 0 2 2h8M10.5 8l2.5 2.5-2.5 2.5`}));default:return YX((0,A.jsx)(`path`,{d:`M10.2 2.8a3.2 3.2 0 0 0-4 4L2.8 10.2a1.4 1.4 0 0 0 2 2l3.4-3.4a3.2 3.2 0 0 0 4-4l-1.9 1.9-1.6-.4-.4-1.6 1.9-1.9Z`}))}}var QX=()=>YX((0,A.jsx)(`path`,{d:`m6 4 4 4-4 4`})),$X=({label:e})=>YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M12.5 8A4.5 4.5 0 1 1 11 4.6`}),(0,A.jsx)(`path`,{d:`M11.5 2v3h-3`})]}),e),eZ=({label:e})=>YX((0,A.jsx)(`path`,{d:`m4.5 4.5 7 7m0-7-7 7`}),e),tZ=({label:e})=>YX((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`path`,{d:`M8 2.5 14 13H2L8 2.5Z`}),(0,A.jsx)(`path`,{d:`M8 6.5v3M8 11.25v.01`})]}),e),nZ={pipeline:`Agent`,model:`LLM call`,tool:`Tool call`,waiting:`Waiting`,handoff:`Handoff`},rZ=0x9184e72a000,iZ=(e,t)=>({"--s":e,"--e":Number.isFinite(t)?t:rZ}),aZ=(e,t,n)=>e.length*7+8+(t?80:0)+(n?90:0);function oZ({mark:e,events:t,agentView:n,ending:r}){let i=e.kind===`failed`?n&&!r?null:`fail`:e.retry?`retry`:null,a=e.kind===`model`||e.modelCall,o=a?void 0:e.count===1?e.name:e.tool,s=Number.isFinite(e.endMs)?GX(e.endMs-e.startMs):``,c=[s,e.costUsd?KX(e.costUsd):``].filter(Boolean).join(` · `);return(0,A.jsxs)(`span`,{className:`fw-seg fw-seg-${e.kind}${e.alt?` fw-seg-alt`:``}`,"data-tone":UX(e.tone),style:iZ(e.startMs,e.endMs),title:e.name?`${e.name}${e.count>1?` +${e.count-1} more`:``}${c?` · ${c}`:``}`:void 0,onPointerEnter:n?n=>t.onInspect(e.id,n.currentTarget,n.clientX):void 0,onClick:n?n=>{n.stopPropagation(),t.onPin(e.id,n.currentTarget,n.clientX)}:void 0,children:[i&&(0,A.jsx)(`span`,{className:`fw-glyph`,"data-glyph":i,children:i===`fail`?(0,A.jsx)(eZ,{}):(0,A.jsx)($X,{})}),n&&(0,A.jsxs)(`span`,{className:`fw-seg-label`,children:[(0,A.jsx)(`span`,{className:`fw-seg-icon`,"aria-hidden":!0,children:(0,A.jsx)(ZX,{kind:a?`model`:`tool`,name:e.tool??e.name})}),o&&(0,A.jsx)(`span`,{className:`fw-seg-name`,children:o}),e.count>1&&o&&(0,A.jsxs)(`span`,{className:`fw-seg-chip`,children:[`×`,e.count]}),s&&(0,A.jsx)(`span`,{className:`fw-seg-meta`,children:s}),e.costUsd?(0,A.jsx)(`span`,{className:`fw-seg-meta`,children:KX(e.costUsd)}):null]})]})}var sZ=(e,t)=>WX(e.span)||e.span.startMs<=t&&t<e.span.endMs;function cZ(e,t){let n=e.span;if(e.durationLabel===`—`)return`—`;if(e.approx&&n.endMs===n.startMs&&!WX(n))return n.costUsd===void 0?``:JX(e,n.costUsd);if(!WX(n)&&t<n.endMs)return`${GX(Math.max(0,t-n.startMs))}${e.approx?`~`:``}`;let r=WX(n)?`${GX(Math.max(n.endMs,t)-n.startMs)}${e.approx?`~`:``}`:e.durationLabel,i=n.costUsd??(e.rollupCostUsd?e.rollupCostUsd:void 0);return i===void 0?r:`${r} · ${JX(e,i)}`}(0,b.memo)(function(e){let{row:t,view:n,top:r,collapsed:i,searching:a,slowest:o,costliest:s,critical:c,matched:l,active:u,focusable:d,selected:f,sticky:p,clockMs:m,renderIcon:h,fillByAgent:g,motion:_}=e,v=t.span,y=WX(v),b=n===`agents`,x=t.hasChildren&&i&&!a,S=t.durationLabel===`—`,C=t.kind===`pipeline`,w=t.ok?t.kind:`failed`,T=C||t.hasChildren||t.id.startsWith(`run:`)?x&&!b?t.segments:t.own:[],ee=cZ(t,m),E=[...v.detail&&v.detail!==e.sharedDetail?[v.detail]:[],...qX(t).filter(t=>t!==e.sharedOutcome)],te=n=>e.onInspect(t.id,n.currentTarget,n.clientX),ne=b&&t.id.startsWith(`family:`),re=b&&t.stepOf!==void 0,ie=ne||b&&C&&t.own.length>0,D=b&&!t.ok?T.map(e=>e.kind).lastIndexOf(`failed`):-1;return(0,A.jsxs)(`div`,{role:`row`,"data-span-id":t.id,"data-span-kind":w,"data-slowest":o||void 0,"data-critical":c||void 0,"data-search":a?l?`match`:`context`:void 0,"data-running":y||void 0,"aria-level":b?void 0:t.depth+1,"aria-expanded":t.hasChildren&&!b?!x:void 0,"aria-selected":f,tabIndex:d?0:-1,"data-tone":UX(t.tone),"data-outcome":g?void 0:v.outcome?.tone,className:`fw-row${u?` fw-active`:``}${p?` fw-sticky-row`:``}${C?` fw-agent-row`:``}${re?` fw-step`:``}${_?.enter===void 0?``:` fw-enter`}${_?.settle?` fw-settle`:``}`,style:{"--row-y":`${r}px`,"--fw-enter-delay":`${_?.enter??0}ms`,"--fw-end-w":`${aZ(ee,o,s)}px`},onFocus:n=>{n.target===n.currentTarget&&e.onActivate(t)},onClick:n=>{if(e.onActivate(t),ne){e.onToggle(t);return}let r=b?n.currentTarget.querySelector(`.fw-bar`):null;r&&e.onPin(t.id,r,n.target instanceof Element&&n.target.closest(`.fw-lane`)?n.clientX:void 0)},children:[(0,A.jsxs)(`div`,{role:`gridcell`,className:`fw-label`,style:{"--depth":b?t.inset??0:t.depth},children:[ie&&(0,A.jsx)(`button`,{type:`button`,tabIndex:-1,className:`fw-toggle${e.expanded?` fw-open`:``}`,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${t.name}`,"aria-expanded":!!e.expanded,onClick:n=>{n.stopPropagation(),e.onToggle(t)},children:(0,A.jsx)(QX,{})}),!b&&(0,A.jsx)(`span`,{className:`fw-guides`,"aria-hidden":!0}),!b&&(t.hasChildren?(0,A.jsx)(`button`,{type:`button`,tabIndex:-1,className:`fw-toggle${x?``:` fw-open`}`,disabled:a,"aria-label":`${x?`Expand`:`Collapse`} ${t.name}`,"aria-expanded":!x,onClick:n=>{n.stopPropagation(),e.onToggle(t)},children:(0,A.jsx)(QX,{})}):(0,A.jsx)(`span`,{className:`fw-toggle-space`,"aria-hidden":!0})),b&&!ie&&(0,A.jsx)(`span`,{className:`fw-toggle-space`,"aria-hidden":!0}),(!b||re)&&(0,A.jsx)(`span`,{className:`fw-icon-tile`,"aria-hidden":!0,children:h?.(v)??(0,A.jsx)(ZX,{kind:v.kind,name:v.name})}),(0,A.jsxs)(`span`,{className:`fw-names`,title:`${t.name}${v.detail?` · ${v.detail}`:``} · ${nZ[v.kind]}${y?` · running`:``}${t.ok?``:` · failed`}`,children:[(0,A.jsxs)(`span`,{className:`fw-span-name${C||t.hasChildren?` fw-strong`:``}`,children:[g&&C&&v.outcome?(0,A.jsx)(`span`,{className:`fw-agent-dot`,"data-tone":`0`,"data-outcome":v.outcome.tone,title:v.outcome.label,"aria-hidden":!0}):b&&!re&&(0,A.jsx)(`span`,{className:`fw-agent-dot`,"aria-hidden":!0}),y&&(0,A.jsx)(`span`,{className:`fw-spinner`,role:`status`,"aria-label":`running`}),(0,A.jsx)(`span`,{className:`fw-name-text`,children:t.name})]}),b&&(0,A.jsxs)(`span`,{className:`fw-subtitle`,children:[h&&(0,A.jsx)(`span`,{className:`fw-detail-icon`,"aria-hidden":!0,children:h(v)}),(0,A.jsxs)(`span`,{className:`fw-subtitle-tail`,children:[(0,A.jsx)(`span`,{className:`fw-subtitle-text`,children:E[0]}),E.slice(1).map(e=>(0,A.jsxs)(`span`,{className:`fw-subtitle-extra`,children:[`· `,e]},e))]})]})]}),x&&(0,A.jsxs)(`span`,{className:`fw-count`,"aria-label":`${t.descendants} hidden steps`,children:[`+`,t.descendants]}),!t.ok&&!b&&(0,A.jsx)(`span`,{className:`fw-alert`,children:(0,A.jsx)(tZ,{label:`failed`})})]}),(0,A.jsx)(`div`,{role:`gridcell`,className:`fw-lane`,"data-waterfall-track":!0,"aria-label":`${nZ[v.kind]}, ${ee}${o?`, slowest ${b?`agent`:`step`}`:``}${s?`, costliest agent`:``}${c?`, critical path`:``}`,children:S?(0,A.jsx)(`span`,{className:`fw-invalid`,children:`—`}):(0,A.jsxs)(A.Fragment,{children:[v.marks?.map(e=>(0,A.jsx)(`span`,{className:`fw-mark`,"data-mark":e.kind,style:iZ(e.at,e.at),title:e.label,"aria-label":e.label,role:`img`},`m-${e.at}-${e.label}`)),(0,A.jsxs)(`span`,{className:`fw-bar fw-k-${C?`pipeline`:w}${t.approx?` fw-approx`:``}${T.length?` fw-has-marks`:``}${t.hasAgents?` fw-has-agents`:``}`,"data-tone":UX(t.tone),style:iZ(v.startMs,y?rZ:v.endMs),onPointerEnter:te,onPointerLeave:e.onLeave,onClick:n=>{n.stopPropagation(),ne?e.onToggle(t):e.onPin(t.id,n.currentTarget,n.clientX)},children:[!C&&!t.ok&&(0,A.jsx)(`span`,{className:`fw-glyph`,children:(0,A.jsx)(eZ,{})}),!C&&t.ok&&t.retry&&(0,A.jsx)(`span`,{className:`fw-glyph`,children:(0,A.jsx)($X,{})})]}),T.map((t,n)=>(0,A.jsx)(oZ,{mark:t,events:e,agentView:b,ending:n===D},`${t.id}-${n}`)),(0,A.jsxs)(`span`,{className:`fw-end`,style:iZ(v.startMs,y?rZ:v.endMs),children:[(0,A.jsx)(`span`,{className:`fw-duration`,children:ee}),o&&(0,A.jsx)(`span`,{className:`fw-badge`,children:`Slowest`}),s&&(0,A.jsx)(`span`,{className:`fw-badge`,children:`Costliest`})]})]})})]})},(e,t)=>e.row===t.row&&e.view===t.view&&e.top===t.top&&e.collapsed===t.collapsed&&e.searching===t.searching&&e.slowest===t.slowest&&e.costliest===t.costliest&&e.critical===t.critical&&e.matched===t.matched&&e.active===t.active&&e.focusable===t.focusable&&e.selected===t.selected&&e.sticky===t.sticky&&e.motion===t.motion&&e.renderIcon===t.renderIcon&&e.fillByAgent===t.fillByAgent&&e.sharedDetail===t.sharedDetail&&e.sharedOutcome===t.sharedOutcome&&e.expanded===t.expanded&&(e.clockMs===t.clockMs||!sZ(e.row,e.clockMs)&&!sZ(t.row,t.clockMs)));function lZ({record:e}){let t=(0,b.useMemo)(()=>uZ(e),[e]);return t.length?(0,A.jsx)(HX,{lanes:t,options:{measure:`elapsed time`,formatTime:e=>{let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}},defaultCollapsed:t.filter(e=>e.parent&&t.some(t=>t.parent===e.id)).map(e=>e.id)}):null}function uZ(e){let t=new Map;for(let n of e.events){let e=t.get(n.node)??[];e.push(n),t.set(n.node,e)}let n=new Map(e.nodes.map(e=>[e.id,e])),r=[];for(let i of e.nodes){if(i.kind===`session`)continue;let a=t.get(i.id)??[],o=a.map(e=>_O(e.at)).filter(Number.isFinite);if(!o.length){let n=e.nodes.filter(e=>e.parent===i.id);if(!n.length)continue;let r=n.flatMap(e=>(t.get(e.id)??[]).map(e=>_O(e.at)).filter(Number.isFinite)),a=i.start?_O(i.start):void 0,s=a!==void 0&&Number.isFinite(a)?a:r.length?Math.min(...r):void 0;if(s===void 0)continue;o.push(s)}let s=Math.min(...o),c=Math.max(...o),l=n.get(i.parent??``),u=c>s?[{start:s,end:c,state:`running`}]:[{start:s,end:s,state:`running`}],d=typeof i.model==`string`?i.model.split(`/`).pop():void 0,f=typeof i.role==`string`?i.role:void 0,p=[i.label,f?`Role: ${f}`:null,d?`Model: ${d}`:null,`${a.length} events`].filter(e=>e!==null);r.push({id:i.id,label:i.label.length>28?`${i.label.slice(0,27)}…`:i.label,parent:l&&l.kind!==`session`?l.id:void 0,spans:u,detail:p})}return r}function dZ({label:e,value:t,onChange:n,children:r,field:i}){return(0,A.jsxs)(`label`,{className:`ui-field ar-select`,children:[(0,A.jsx)(`span`,{className:`ui-label`,children:e}),(0,A.jsxs)(`span`,{className:`select-shell`,children:[(0,A.jsx)(`select`,{value:t,onChange:e=>n(e.target.value),[`data-${i}`]:``,children:r}),(0,A.jsx)(`span`,{className:`ui-chevron`,"aria-hidden":`true`})]})]})}function fZ({records:e,selection:t,defaultSelection:n,onSelectionChange:r,theme:i=`auto`,className:a=``,behaviors:o}){let[s,c]=(0,b.useState)(n),l=t??s,u=e.find(e=>e.runId===l?.runId)??e[0],d=(0,b.useCallback)(e=>{t===void 0&&c(e),r?.(e)},[t,r]);return(0,A.jsx)(`div`,{className:`agent-record ${a}`,"data-theme":i===`auto`?void 0:i,children:u?(0,A.jsx)(pZ,{records:e,record:u,selection:l?.runId===u.runId?l:{runId:u.runId},onChange:d,behaviors:o},u.runId):(0,A.jsx)(`p`,{className:`chat-empty`,role:`status`,children:`No records supplied.`})})}function pZ({records:e,record:t,selection:n,onChange:r,behaviors:i}){let a=(0,b.useId)(),o=(0,b.useMemo)(()=>jO(t),[t]),s=(0,b.useMemo)(()=>{let e=i?.find(e=>e.runId===t?.runId);if(!e)return;let n={alignment:`alignment`,efficiency:`efficiency`,affect:`affect`};return e.verdicts.filter(e=>e.verdict===`yes`&&e.evidence?.length).flatMap(e=>(e.evidence??[]).filter(e=>o.byEvent.has(e.eventId)).map(t=>({behavior:e.behavior,axis:n[e.behavior]??(e.behavior.includes(`hack`)||e.behavior.includes(`unsafe`)||e.behavior.includes(`decept`)||e.behavior.includes(`escape`)||e.behavior.includes(`intent`)||e.behavior.includes(`scope`)?`alignment`:e.behavior.includes(`frustrat`)||e.behavior.includes(`confidence`)||e.behavior.includes(`breakthrough`)||e.behavior.includes(`giving`)?`affect`:`efficiency`),confidence:e.confidence,at:_O(o.byEvent.get(t.eventId).at),eventId:t.eventId,quote:t.quote})))},[i,t,o]),c=n.eventId?o.byEvent.get(n.eventId):void 0,l=n.nodeId?o.canonical(n.nodeId):void 0,u=c?o.canonical(c.node):l&&o.nodes.has(l)?l:o.actors[0]?.id??``,d=c??o.byActor.get(u)?.[0],f=o.nodes.get(u),p=f&&typeof f.metadata==`object`&&f.metadata!==null?f.metadata:void 0,m=o.byActor.get(u)?.length??0,h=f?.capture,g=(t.coverage?.gaps??[]).filter(e=>e.nodeId===u).map(e=>e.detail).join(` `),_=typeof f?.captureNote==`string`?f.captureNote:typeof p?.captureReason==`string`?p.captureReason:h&&h.status!==`complete`&&g?g:null,v=p?.captureStatus===`retained-partial`||h?.status===`lossy`?`Partial capture`:p?.captureStatus===`missing-source`||h?.status===`absent`||m===0?`Conversation unavailable`:p?.captureStatus===`retained`?`Retained capture`:null,y=n.view??`chat`,x=n.at?_O(n.at):o.end,S=Number.isFinite(x)?Math.max(o.start,Math.min(o.end,x)):o.end,C=o.end>o.start?(S-o.start)/(o.end-o.start)*1e3:1e3,[w,T]=(0,b.useState)(`all`),[ee,E]=(0,b.useState)(``),[te,ne]=(0,b.useState)(1),[re,ie]=(0,b.useState)(`cumulative`),[D,ae]=(0,b.useState)(`time`),[oe,se]=(0,b.useState)(!1),[O,ce]=(0,b.useState)(`1`),[le,ue]=(0,b.useState)(`time`),[de,fe]=(0,b.useState)(!1),[pe,me]=(0,b.useState)(`system`),he=de||pe===`reduced`,[ge,_e]=(0,b.useState)(!1),[ve,ye]=(0,b.useState)(null),be=(0,b.useRef)(null),xe=Rv(),Se=(0,b.useRef)(new Map),Ce=(0,b.useRef)({selection:n,cutoff:S,index:o,onChange:r});Ce.current={selection:n,cutoff:S,index:o,onChange:r};let we=ee.trim().toLowerCase(),Te=(0,b.useMemo)(()=>o.events.filter(e=>MO(e,o,we,w)),[o,we,w]),Ee=[...new Set([...PX,...t.events.map(e=>e.category)])].filter(e=>e!==`all`&&e!==`findings`),De=e=>r({...n,runId:t.runId,nodeId:u,eventId:d?.id,...e}),Oe=(e,n=!1)=>{ye(null),se(!1),r({runId:t.runId,nodeId:o.canonical(e.node),eventId:e.id,at:e.at,view:n?`source`:`chat`})},ke=e=>{ye(null);let i=o.byActor.get(e)?.find(e=>e.detail.role||e.detail.publicText||e.detail.publicToolCalls?.length)??o.byActor.get(e)?.[0];r({runId:t.runId,nodeId:e,eventId:i?.id,view:`chat`,at:i&&_O(i.at)>S?i.at:n.at})},Ae=e=>{if(!Te.length)return;let t=Te.findIndex(e=>e.id===d?.id);Oe(Te[t<0?e>0?0:Te.length-1:(t+e+Te.length)%Te.length])},je=(e,t,n)=>{let r=e.currentTarget.getBoundingClientRect(),i=Math.max(8,Math.min(r.left+r.width/2,window.innerWidth-361)),a=r.top>window.innerHeight/2?Math.max(8,r.top-12):r.bottom+10;ye({title:t,lines:n,x:i,y:a})},Me=()=>ye(null);(0,b.useEffect)(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{fe(e.matches),se(!1)};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let Ne=he?`events`:le;(0,b.useEffect)(()=>{if(!oe)return;let e=performance.now(),n=window.setInterval(()=>{let n=Ce.current,r=performance.now(),i=Wv({cutoff:n.cutoff,start:n.index.start,end:n.index.end,elapsedMs:r-e,speed:Number(O),mode:Ne,eventTimes:n.index.events.map(e=>_O(e.at))});e=r,n.onChange({...n.selection,runId:t.runId,at:i>=n.index.end?void 0:new Date(i).toISOString()}),i>=n.index.end&&se(!1)},Ne===`events`?1e3/Number(O):120),r=()=>{document.hidden&&se(!1)};return document.addEventListener(`visibilitychange`,r),()=>{window.clearInterval(n),document.removeEventListener(`visibilitychange`,r)}},[oe,t.runId,O,Ne]),(0,b.useEffect)(()=>{ye(null)},[S,w,we,u,y,re,D,t]);let Pe=t.nodes.filter(e=>e.kind===`session`&&!e.agentId),Fe=Te.findIndex(e=>e.id===d?.id);return(0,A.jsxs)(`div`,{ref:be,className:`ar-view`,"data-reduced-motion":he||void 0,onKeyDown:e=>{e.key===`Escape`&&Me()},onScrollCapture:Me,children:[(0,A.jsxs)(`div`,{className:`controls`,children:[e.length>1&&(0,A.jsx)(dZ,{label:`Run`,field:`run`,value:t.runId,onChange:e=>{se(!1),r({runId:e})},children:e.map(e=>(0,A.jsx)(`option`,{value:e.runId,children:e.title},e.runId))}),(0,A.jsxs)(dZ,{label:`Activity type`,field:`category`,value:w,onChange:T,children:[(0,A.jsx)(`option`,{value:`all`,children:`All activity`}),(0,A.jsx)(`option`,{value:`findings`,children:`Recorded findings`}),Ee.map(e=>(0,A.jsxs)(`option`,{value:e,children:[e[0]?.toUpperCase(),e.slice(1)]},e))]}),(0,A.jsxs)(`label`,{className:`ui-field`,children:[(0,A.jsx)(`span`,{className:`ui-label`,children:`Search all agents`}),(0,A.jsx)(`input`,{"data-search":!0,type:`search`,placeholder:`Message, tool, agent…`,value:ee,onChange:e=>E(e.target.value)})]})]}),(0,A.jsxs)(`details`,{className:`topology-tree`,children:[(0,A.jsx)(`summary`,{children:`Agent topology`}),(0,A.jsx)(lZ,{record:t})]}),(0,A.jsxs)(`details`,{className:`activity-replay`,open:!0,children:[(0,A.jsx)(`summary`,{children:`Timeline and replay`}),(0,A.jsxs)(`div`,{className:`playback`,children:[(0,A.jsx)(`button`,{className:`ui-button`,"data-play":!0,type:`button`,"aria-label":oe?`Pause recorded progression`:`Play recorded progression`,disabled:o.end<=o.start,onClick:()=>{!oe&&S>=o.end&&De({at:new Date(o.start).toISOString()}),se(e=>!e)},children:oe?`Pause`:`Play`}),(0,A.jsxs)(`label`,{children:[`Recorded time`,` `,(0,A.jsx)(`input`,{"data-cursor":!0,type:`range`,min:0,max:1e3,value:C,"aria-valuetext":vO(new Date(S).toISOString(),!0),disabled:!t.events.length,onChange:e=>{se(!1),De({at:new Date(o.start+(o.end-o.start)*Number(e.target.value)/1e3).toISOString()})}}),(0,A.jsx)(`output`,{"data-clock":!0,children:wO(S-o.start)})]}),(0,A.jsx)(`button`,{className:`ui-button`,"data-full":!0,type:`button`,onClick:()=>{se(!1),De({at:void 0})},children:`Full run`})]}),(0,A.jsxs)(`div`,{className:`replay-settings`,children:[(0,A.jsxs)(dZ,{label:`Replay speed`,field:`speed`,value:O,onChange:ce,children:[(0,A.jsx)(`option`,{value:`0.5`,children:`0.5×`}),(0,A.jsx)(`option`,{value:`1`,children:`1×`}),(0,A.jsx)(`option`,{value:`2`,children:`2×`}),(0,A.jsx)(`option`,{value:`4`,children:`4×`})]}),(0,A.jsxs)(dZ,{label:`Replay progression`,field:`progression`,value:Ne,onChange:e=>{se(!1),ue(e)},children:[!he&&(0,A.jsx)(`option`,{value:`time`,children:`Recorded time`}),(0,A.jsx)(`option`,{value:`events`,children:`Event steps`})]}),(0,A.jsxs)(dZ,{label:`Motion`,field:`motion`,value:pe,onChange:e=>{se(!1),me(e)},children:[(0,A.jsx)(`option`,{value:`system`,children:`System`}),(0,A.jsx)(`option`,{value:`reduced`,children:`Reduced`})]}),(0,A.jsxs)(`p`,{className:`small`,children:[he?`Reduced motion: timestamp steps. `:``,Ne===`time`?`1× compresses the full recorded span into 30 seconds.`:`1× advances to the next recorded timestamp each second; gaps are skipped.`]})]}),(0,A.jsx)(`div`,{className:`timeline-heading`,children:(0,A.jsxs)(`label`,{children:[`Zoom`,` `,(0,A.jsx)(`input`,{"data-zoom":!0,type:`range`,min:1,max:8,step:1,value:te,onChange:e=>ne(Number(e.target.value))})]})}),(0,A.jsx)(NX,{index:o,events:Te,cutoff:S,selected:d?.id,zoom:te,inspect:Oe,navigate:Ae,showTooltip:je,hideTooltip:Me,behaviors:s}),(0,A.jsx)(`div`,{className:`legend`,children:Ee.map(e=>(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{className:`category-${IX(e)}`}),e]},e))})]}),we&&(0,A.jsxs)(`section`,{className:`activity-search-results`,"aria-label":`Matching activity`,children:[(0,A.jsxs)(`p`,{role:`status`,children:[Te.length,` matching events`]}),Te.slice(0,100).map(e=>(0,A.jsxs)(`button`,{onClick:()=>{E(``),se(!1),r({runId:t.runId,nodeId:o.canonical(e.node),eventId:e.id,view:`chat`})},children:[(0,A.jsx)(`span`,{children:o.nodes.get(o.canonical(e.node))?.label??e.node}),(0,A.jsx)(`time`,{children:vO(e.at)}),(0,A.jsx)(`strong`,{children:e.label}),(0,A.jsx)(`small`,{children:(EO(e)||e.detail.publicToolCalls?.map(e=>`${e.name} ${e.input}`).join(` `)||`Recorded event`).replace(/\s+/g,` `).slice(0,240)})]},e.id)),Te.length>100&&(0,A.jsx)(`p`,{className:`small`,children:`Showing the first 100 matches. Narrow the search to find a particular event.`}),!Te.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:`No retained activity matches. Missing captures are not searched.`})]}),(0,A.jsxs)(`div`,{className:`workspace flat-activity`,hidden:!!we,children:[(0,A.jsxs)(`details`,{className:`topology`,open:ge,onToggle:e=>_e(e.currentTarget.open),children:[(0,A.jsxs)(`summary`,{children:[(0,A.jsx)(`span`,{children:`Agents`}),(0,A.jsx)(`span`,{"data-agent-count":!0,children:o.actors.filter(e=>e.kind!==`finding`).length})]}),Pe.length>0&&(0,A.jsxs)(`p`,{className:`small`,"data-graph-caption":!0,children:[`Not linked to an agent:`,` `,Pe.map(e=>e.label).join(`, `)]}),(0,A.jsx)(IO,{index:o,actor:u,cutoff:S,select:ke})]}),(0,A.jsxs)(`section`,{className:`conversation-panel`,"aria-label":`Agent record details`,children:[(0,A.jsxs)(`div`,{className:`conversation-head`,children:[(0,A.jsxs)(`div`,{className:`agent-identity`,children:[(0,A.jsx)(`span`,{className:`agent-avatar`,"data-agent-avatar":!0,"aria-hidden":`true`,children:TO(f).slice(0,1).toUpperCase()}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{"data-agent-title":!0,children:f?.label??`Messages`}),(0,A.jsx)(`p`,{"data-agent-role":!0,children:[TO(f),PO(f,t),f?.status??`State unknown`].filter(Boolean).join(` · `)})]})]}),(0,A.jsx)(dZ,{label:`Agent`,field:`agent`,value:u,onChange:ke,children:o.actors.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label===e.id||e.label.startsWith(`wf_`)||e.label.length<8?`${TO(e)} (${e.label.slice(0,12)})`:e.label===TO(e)?e.label:`${e.label} · ${TO(e)}`},e.id))})]}),(v||_||f?.assignment)&&(0,A.jsxs)(`div`,{className:`agent-capture-summary`,role:`status`,children:[v,_?(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{children:`Capture details`}),(0,A.jsx)(`p`,{children:_})]}):null,f?.assignment&&(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{children:`What this agent did`}),(0,A.jsx)(`p`,{children:f.assignment})]})]}),(0,A.jsx)(`div`,{className:`ui-tabs`,role:`tablist`,"aria-label":`Agent evidence`,children:[`chat`,`source`,`usage`].map((e,t,n)=>(0,A.jsx)(`button`,{ref:t=>{t?Se.current.set(e,t):Se.current.delete(e)},type:`button`,"data-view":e,role:`tab`,"aria-selected":y===e,tabIndex:y===e?0:-1,id:`${a}-${e}-tab`,"aria-controls":`${a}-${e}`,onClick:()=>De({view:e}),onKeyDown:e=>{let r=e.key===`ArrowRight`?n[(t+1)%n.length]:e.key===`ArrowLeft`?n[(t-1+n.length)%n.length]:e.key===`Home`?n[0]:e.key===`End`?n.at(-1):void 0;r&&(e.preventDefault(),De({view:r}),Se.current.get(r)?.focus())},children:e===`chat`?`Messages`:e===`source`?`Event details`:`Usage`},e))}),(0,A.jsx)(`div`,{id:`${a}-chat`,role:`tabpanel`,"aria-labelledby":`${a}-chat-tab`,"data-panel":`chat`,hidden:y!==`chat`,children:(0,A.jsx)(jX,{index:o,actor:u,cutoff:S,query:we,category:w,selected:c?.id})}),(0,A.jsx)(`div`,{id:`${a}-source`,role:`tabpanel`,"aria-labelledby":`${a}-source-tab`,"data-panel":`source`,hidden:y!==`source`,children:d?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h4`,{"data-event-title":!0,children:d.label}),(0,A.jsxs)(`p`,{className:`small`,"data-event-meta":!0,children:[vO(d.at,!0),` ·`,` `,o.nodes.get(o.canonical(d.node))?.label??d.node]}),_O(d.at)>S?(0,A.jsx)(`p`,{children:`This event occurs after the selected time. Advance the timeline to read it.`}):(0,A.jsxs)(A.Fragment,{children:[EO(d)&&(0,A.jsx)(BO,{text:EO(d)}),d.detail.publicToolCalls?.map(e=>(0,A.jsxs)(`section`,{className:`event-tool`,children:[(0,A.jsx)(`h4`,{children:e.name}),e.input===void 0?(0,A.jsx)(`p`,{className:`publication-note`,children:`Args not captured.`}):(0,A.jsx)(BO,{text:e.input,rawLabel:`Raw input`})]},e.id)),!EO(d)&&!d.detail.publicToolCalls?.length&&(0,A.jsx)(`p`,{children:d.detail.contentOmitted??d.detail.publicationNote??`No visible message or tool payload was retained for this event.`}),(0,A.jsxs)(`details`,{className:`raw-data`,children:[(0,A.jsx)(`summary`,{children:`Raw event and source`}),(0,A.jsx)(`pre`,{"data-event-detail":!0,children:JSON.stringify(d.detail,null,2)}),(0,A.jsx)(`pre`,{"data-event-source":!0,children:JSON.stringify(NO(d,t,o),null,2)})]})]})]}):(0,A.jsx)(`p`,{className:`chat-empty`,children:`No source event selected.`})}),(0,A.jsxs)(`div`,{id:`${a}-usage`,role:`tabpanel`,"aria-labelledby":`${a}-usage-tab`,"data-panel":`usage`,hidden:y!==`usage`,children:[(0,A.jsxs)(`div`,{className:`metric-controls`,children:[(0,A.jsxs)(dZ,{label:`Measure`,field:`metric`,value:re,onChange:e=>ie(e),children:[(0,A.jsx)(`option`,{value:`cumulative`,children:`Cumulative tokens`}),(0,A.jsx)(`option`,{value:`response`,children:`Tokens per response`}),(0,A.jsx)(`option`,{value:`tool-time`,children:`Tool return time`})]}),(0,A.jsxs)(dZ,{label:`Horizontal axis`,field:`axis`,value:D,onChange:e=>ae(e),children:[(0,A.jsx)(`option`,{value:`time`,children:`Elapsed time`}),(0,A.jsx)(`option`,{value:`order`,children:`Recorded order`})]})]}),(0,A.jsx)(zX,{index:o,cutoff:S,selected:d?.id,actor:u,metric:re,axis:D,inspect:Oe,navigate:Ae,showTooltip:je,hideTooltip:Me})]})]})]}),(0,A.jsxs)(`div`,{className:`navigation`,children:[(0,A.jsxs)(dZ,{label:`Jump to a moment`,field:`moment`,value:d?.id??``,onChange:e=>{let t=o.byEvent.get(e);t&&Oe(t)},children:[!Te.some(e=>e.id===d?.id)&&(0,A.jsx)(`option`,{value:d?.id??``,children:d?`Selected event is outside this filter`:`Select an event`}),Te.map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[vO(e.at),` · `,e.label]},e.id))]}),(0,A.jsx)(`button`,{className:`ui-button`,"data-prev":!0,type:`button`,disabled:!Te.length,onClick:()=>Ae(-1),children:`Previous`}),(0,A.jsx)(`button`,{className:`ui-button`,"data-next":!0,type:`button`,disabled:!Te.length,onClick:()=>Ae(1),children:`Next`}),(0,A.jsxs)(`span`,{"data-position":!0,children:[Fe>=0?Fe+1:`—`,` / `,Te.length]}),(0,A.jsx)(`button`,{type:`button`,className:`download-record`,"data-download":!0,onClick:()=>xe(JSON.stringify(t,null,2),t.runId+`.json`,`application/json`),children:`Download record`})]}),(0,A.jsxs)(`details`,{className:`assignment`,children:[(0,A.jsx)(`summary`,{children:`Original assignment`}),(0,A.jsx)(`dl`,{"data-assignment":!0,children:Object.entries(t.assignment).filter(([e])=>e!==`source`).map(([e,t])=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:e.replace(/([a-z])([A-Z])/g,`$1 $2`)}),(0,A.jsx)(`dd`,{children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))}),t.assignment.source&&(0,A.jsxs)(`details`,{className:`assignment-source`,children:[(0,A.jsx)(`summary`,{children:`Provenance`}),(0,A.jsx)(`pre`,{children:JSON.stringify(t.assignment.source,null,2)})]})]}),(0,A.jsxs)(`details`,{className:`coverage`,children:[(0,A.jsx)(`summary`,{children:`Sources, redactions & capture gaps`}),(0,A.jsxs)(`div`,{"data-coverage":!0,children:[t.coverage.publicContent&&(0,A.jsx)(`p`,{children:t.coverage.publicContent}),t.coverage.categoryMethod&&(0,A.jsx)(`p`,{children:t.coverage.categoryMethod}),t.coverage.cost&&t.coverage.cost!==`Not recorded`&&(0,A.jsxs)(`p`,{children:[`Cost: `,t.coverage.cost]}),t.terminal&&(0,A.jsxs)(`p`,{children:[`Recorded terminal: `,t.terminal.kind??`unknown`,t.terminal.reason?` · ${t.terminal.reason}`:``]}),(0,A.jsx)(`pre`,{children:JSON.stringify({coverage:t.coverage,sources:t.sources},null,2)})]})]}),ve&&(0,A.jsxs)(`div`,{className:`ui-plot-tooltip`,role:`tooltip`,style:{left:ve.x,top:ve.y,transform:ve.y>window.innerHeight/2?`translateY(-100%)`:void 0},children:[(0,A.jsx)(`strong`,{className:`tooltip-title`,children:ve.title}),ve.lines.map((e,t)=>e.kind===`header`?(0,A.jsx)(`p`,{className:`tooltip-header`,children:e.value},t):e.kind===`status`?(0,A.jsx)(`p`,{className:`tooltip-status tooltip-${e.tone??`default`}`,children:e.value},t):e.kind===`usage`?(0,A.jsx)(`p`,{className:`tooltip-usage`,children:e.value},t):e.kind===`note`?(0,A.jsx)(`p`,{className:`tooltip-note`,children:e.value},t):(0,A.jsxs)(`p`,{className:`tooltip-body`,children:[e.label&&(0,A.jsx)(`span`,{className:`tooltip-label`,children:e.label}),e.value]},t))]})]})}var mZ=CD({offset:!0}),hZ=YE(K(),q()),gZ=Y({path:K(),sha256:K().regex(/^[0-9a-f]{64}$/).optional(),line:PE().int().positive().optional(),pointer:K().startsWith(`/`).optional()}).catchall(q()),_Z=Y({channel:K(),status:ZE([`complete`,`lossy`,`absent`]),reason:K().nullable()}).catchall(q()),vZ=Y({runId:K().optional(),nodeId:K().nullable().optional(),code:K(),detail:K()}).catchall(q()),yZ=K().regex(/^[0-9a-f]{64}$/),bZ=K().regex(/^sha256:[0-9a-f]{64}$/),xZ=Y({pageSha256:yZ,claimId:K().min(1)}).catchall(q()),SZ=Y({id:K().min(1),kind:K().min(1),title:K(),digest:yZ.optional(),sessionNodeId:K().optional(),eventId:K().optional(),source:gZ.nullish()}).catchall(q()),CZ=xZ.extend({statement:K(),agentNodeId:K().optional(),eventId:K().optional(),runId:K().optional()}).catchall(q()),wZ=Y({id:K().min(1),subject:xZ,reviewerSessionNodeId:K().min(1),judgment:K().min(1),at:mZ.nullish(),eventId:K().optional()}).catchall(q()),TZ=Y({id:K().min(1),kind:K().min(1),title:K(),url:_E().nullish(),sessionNodeId:K().optional(),cites:J(xZ.extend({verdictId:K().optional()}))}).catchall(q()),EZ=Y({digest:bZ,parents:J(bZ),runId:K().optional(),authorNodeId:K().optional(),title:K().optional()}).catchall(q()),DZ=Y({from:K().min(1),to:K().min(1),basis:K().min(1),at:mZ.nullish(),reason:K().nullish(),source:gZ.nullish()}).catchall(q()),OZ=Y({nodeId:K().min(1),runId:K().min(1),recordDigest:K().nullish(),href:K().nullish()}).catchall(q()),kZ=Y({schema:$E(`agent-record.v1`),runId:K().min(1),title:K(),nodes:J(Y({id:K().min(1),label:K(),parent:K().nullable().default(null),kind:ZE([`agent`,`session`,`finding`]),role:K().optional(),assignment:K().optional(),model:K().nullable().optional(),start:mZ.optional(),end:mZ.optional(),status:K().optional(),nativeSessionId:K().optional(),agentId:K().optional(),joinBasis:K().optional(),joinProof:hZ.optional(),modelSource:K().optional(),servedModel:K().nullable().optional(),harness:K().nullable().optional(),sandboxes:J(K()).optional(),capture:_Z.optional(),captureNote:K().optional()}).catchall(q())),events:J(Y({id:K().min(1),node:K().min(1),at:mZ,kind:K(),category:K().default(`other`),activity:K().optional(),end:mZ.optional(),phase:ZE([`tool`,`model`,`idle`]).optional(),label:K(),source:gZ.nullable().optional(),detail:Y({role:K().optional(),publicText:K().optional(),publicationNote:K().nullish(),contentOmitted:K().optional(),publicToolCalls:J(Y({id:K(),name:K(),input:K().optional(),publicationNote:K().nullish()}).catchall(q())).optional(),toolCallIds:J(K()).optional(),toolNames:J(K()).optional(),toolCallId:K().optional(),isError:RE().optional(),responseStatus:K().optional(),recordedClaim:K().optional(),assessment:K().optional(),usage:Y({input:PE().nonnegative().optional(),output:PE().nonnegative().optional(),cacheRead:PE().nonnegative().optional(),cacheWrite:PE().nonnegative().optional()}).catchall(q()).nullish(),reasoning:K().optional(),reasoningOmitted:PE().int().nonnegative().optional(),reasoningRedacted:PE().int().nonnegative().optional(),durationMs:PE().nonnegative().optional(),costListUsd:PE().nonnegative().optional(),usdKnown:RE().optional(),rateLimit:Y({window:K().nullable(),utilization:PE().nullable(),status:K().nullable()}).catchall(q()).optional(),clip:Y({bytes:PE().int().nonnegative(),sha256:K().regex(/^[0-9a-f]{64}$/).nullable()}).catchall(q()).optional()}).catchall(q())}).catchall(q())),artifacts:J(SZ).optional(),claims:J(CZ).optional(),verdicts:J(wZ).optional(),publications:J(TZ).optional(),profileVersions:J(EZ).optional(),runs:J(OZ).optional(),forks:J(DZ).optional(),sources:J(gZ.extend({bytes:PE().nonnegative().optional()})).default([]),assignment:Y({objective:K(),suppliedKnowledge:K(),deliverables:K(),constraints:K(),source:gZ.nullable()}).catchall(q()).default({objective:``,suppliedKnowledge:``,deliverables:``,constraints:``,source:null}),terminal:Y({kind:K().nullable(),reason:K().nullable()}).catchall(q()).nullable().default(null),coverage:Y({completeOriginalCapture:RE(),publicContent:K(),categoryMethod:K(),cost:K(),nodes:J(_Z.extend({nodeId:K()})).optional(),gaps:J(vZ).optional()}).catchall(q()).default({completeOriginalCapture:!1,publicContent:``,categoryMethod:``,cost:`Unknown`})}).catchall(q()).superRefine((e,t)=>{let n=new Map(e.nodes.map(e=>[e.id,e]));n.size!==e.nodes.length&&t.addIssue({code:`custom`,path:[`nodes`],message:`Node IDs must be unique within a run`}),new Set(e.events.map(e=>e.id)).size!==e.events.length&&t.addIssue({code:`custom`,path:[`events`],message:`Event IDs must be unique within a run`});for(let[r,i]of e.nodes.entries()){i.agentId&&(i.kind!==`session`||n.get(i.agentId)?.kind!==`agent`)&&t.addIssue({code:`custom`,path:[`nodes`,r,`agentId`],message:`A proven session join must reference an existing agent`});let e=new Set([i.id]),a=i.parent;for(;a&&n.has(a);){if(e.has(a)){t.addIssue({code:`custom`,path:[`nodes`,r,`parent`],message:`Parent relationships must not contain a cycle`});break}e.add(a),a=n.get(a).parent}}for(let[r,i]of e.events.entries()){n.has(i.node)||t.addIssue({code:`custom`,path:[`events`,r,`node`],message:`An event must reference an existing node, even when that node has unresolved identity`});let e=i.detail.publicToolCalls??[];new Set(e.map(e=>e.id)).size!==e.length&&t.addIssue({code:`custom`,path:[`events`,r,`detail`,`publicToolCalls`],message:`Published tool call IDs must be unique within an event`})}let r=(e,n)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,path:[n],message:`${n} identifiers must be unique`})};r((e.artifacts??[]).map(e=>e.id),`artifacts`),r((e.claims??[]).map(e=>`${e.pageSha256}:${e.claimId}`),`claims`),r((e.verdicts??[]).map(e=>e.id),`verdicts`),r((e.publications??[]).map(e=>e.id),`publications`),r((e.profileVersions??[]).map(e=>e.digest),`profileVersions`);let i=new Set(e.events.map(e=>e.id));for(let[r,a]of(e.artifacts??[]).entries())a.sessionNodeId&&!n.has(a.sessionNodeId)&&t.addIssue({code:`custom`,path:[`artifacts`,r,`sessionNodeId`],message:`Artifact session must exist in this record`}),a.eventId&&!i.has(a.eventId)&&t.addIssue({code:`custom`,path:[`artifacts`,r,`eventId`],message:`Artifact event must exist in this record`});for(let[r,a]of(e.claims??[]).entries())a.agentNodeId&&!n.has(a.agentNodeId)&&t.addIssue({code:`custom`,path:[`claims`,r,`agentNodeId`],message:`Claim agent must exist in this record`}),a.eventId&&!i.has(a.eventId)&&t.addIssue({code:`custom`,path:[`claims`,r,`eventId`],message:`Claim event must exist in this record`});for(let[r,a]of(e.verdicts??[]).entries())n.get(a.reviewerSessionNodeId)?.kind!==`session`&&t.addIssue({code:`custom`,path:[`verdicts`,r,`reviewerSessionNodeId`],message:`Verdict reviewer must be a session in this record`}),a.eventId&&!i.has(a.eventId)&&t.addIssue({code:`custom`,path:[`verdicts`,r,`eventId`],message:`Verdict event must exist in this record`});for(let[r,i]of(e.publications??[]).entries())i.sessionNodeId&&n.get(i.sessionNodeId)?.kind!==`session`&&t.addIssue({code:`custom`,path:[`publications`,r,`sessionNodeId`],message:`Publication session must exist in this record`});for(let[r,i]of(e.profileVersions??[]).entries())i.authorNodeId&&!n.has(i.authorNodeId)&&t.addIssue({code:`custom`,path:[`profileVersions`,r,`authorNodeId`],message:`Profile author must exist in this record`})}),AZ=CD({offset:!0}),jZ=_E().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS source URL`),MZ=[`supported`,`hypothesis`,`unresolved`,`refuted`],NZ=Y({label:K().optional(),path:K().min(1).optional(),url:jZ.optional(),sha256:K().regex(/^[0-9a-f]{64}$/).optional(),line:PE().int().positive().optional(),eventId:K().min(1).optional(),excerpt:K().optional(),asOf:AZ.optional()}).catchall(q()).refine(e=>e.path||e.url||e.eventId,`Evidence needs a source path, URL, or recorded event`),PZ=Y({id:K().min(1),statement:K().min(1),title:K().min(1).optional(),status:ZE(MZ),method:K().optional(),evidence:J(NZ),limitations:J(K()).default([])}).catchall(q()).superRefine((e,t)=>{(e.status===`supported`||e.status===`refuted`)&&!e.evidence.length&&t.addIssue({code:`custom`,path:[`evidence`],message:`A supported or refuted assessment needs evidence`})}),FZ=Y({id:K().min(1),question:K(),status:ZE([`observed`,`unavailable`,`not_applicable`]),answer:K().optional(),evidence:J(NZ),asOf:AZ.optional(),why:K().optional(),record:K().optional()}).superRefine((e,t)=>{e.status===`observed`&&!e.evidence.length&&t.addIssue({code:`custom`,path:[`evidence`],message:`An observed answer needs evidence`})}),IZ=Y({id:K().min(1),kind:ZE([`check`,`negative-finding`,`wait`,`resources`,`next-step`,`context`]),title:K(),body:K(),evidence:J(NZ)}),LZ=Y({id:K().min(1),path:K().min(1),title:K().min(1),content:K(),sha256:K().regex(/^[0-9a-f]{64}$/).optional(),kind:ZE([`knowledge`,`report`,`code`,`data`]).default(`knowledge`)}).catchall(q()),RZ=Y({id:K().min(1),label:K().min(1),value:K().nullable(),unit:K().optional(),coverage:K().optional(),source:NZ.optional(),section:K().optional(),comparable:RE().nullable().optional(),note:K().optional(),why:K().optional(),record:K().optional()}).catchall(q()),zZ=Y({id:K().min(1),title:K().min(1),summary:K().optional()}),BZ=Y({text:K().nullable(),comparable:RE().nullable().optional(),note:K().optional(),href:K().optional()}),VZ=Y({id:K().min(1),section:K().min(1),title:K().min(1),columns:J(K()),rows:J(J(BZ)),source:NZ.optional()}),HZ=Y({id:K().min(1),question:K(),state:K(),threshold:K().optional(),instances:J(Y({sentence:K(),value:K().nullable().optional(),evidence:J(NZ)}))}),UZ=Y({field:K().min(1),why:K(),record:K()}),WZ=Y({id:K().min(1),label:K().min(1),href:K().optional(),ending:K().nullable(),reason:K().nullable().optional(),wallHours:PE().nullable(),agentHours:RZ,hoursByOutcome:YE(K(),PE()).nullable(),triesByOutcome:YE(K(),PE()).nullable().optional(),best:K().nullable().optional(),cost:K().nullable().optional()}),GZ=Y({schema:$E(`agent-research-report.v1`),id:K().min(1),title:K().min(1),generatedAt:AZ,summary:K(),assessmentBy:K().optional(),window:Y({from:AZ,to:AZ,label:K().optional()}).optional(),limitations:J(K()).default([]),freshness:Y({state:ZE([`current`,`stale`,`error`]),checkedAt:AZ,message:K(),lastSuccessfulAt:AZ.optional()}).optional(),questionCoverage:J(FZ).default([]),plays:J(Y({id:K().min(1),title:K().min(1),summary:K(),updatedAt:AZ.nullable(),status:K().nullable(),claims:J(PZ),limitations:J(K()).default([]),sources:J(NZ).default([]),observations:J(IZ).default([]),questionCoverage:J(FZ).default([]),record:kZ.optional(),documents:J(LZ).default([]),metrics:J(RZ).default([]),href:K().optional(),verdict:Y({sentence:K(),status:K().nullable(),evidence:J(NZ)}).optional(),sections:J(zZ).optional(),tables:J(VZ).optional(),runs:J(WZ).optional(),rules:J(HZ).optional(),unknowns:J(UZ).optional()}).catchall(q()))}).catchall(q()).superRefine((e,t)=>{e.window&&Date.parse(e.window.from)>=Date.parse(e.window.to)&&t.addIssue({code:`custom`,path:[`window`],message:`The report window must end after it starts`}),new Set(e.plays.map(e=>e.id)).size!==e.plays.length&&t.addIssue({code:`custom`,path:[`plays`],message:`Play IDs must be unique`});for(let[n,r]of e.questionCoverage.entries())r.evidence.some(e=>e.eventId)&&t.addIssue({code:`custom`,path:[`questionCoverage`,n],message:`Report-wide evidence needs a path or URL; event references belong to one play`});for(let[n,r]of e.plays.entries()){new Set(r.claims.map(e=>e.id)).size!==r.claims.length&&t.addIssue({code:`custom`,path:[`plays`,n,`claims`],message:`Claim IDs must be unique within a play`});for(let e of[`documents`,`metrics`])new Set(r[e].map(e=>e.id)).size!==r[e].length&&t.addIssue({code:`custom`,path:[`plays`,n,e],message:`IDs must be unique within a section`});new Set(r.documents.map(e=>e.path)).size!==r.documents.length&&t.addIssue({code:`custom`,path:[`plays`,n,`documents`],message:`Document paths must be unique within a play`});let e=new Set(r.record?.events.map(e=>e.id));for(let[i,a]of r.metrics.entries())a.source?.eventId&&!e.has(a.source.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,`metrics`,i,`source`,`eventId`],message:`Evidence event must exist in this play record`});for(let i of[`observations`,`questionCoverage`]){new Set(r[i].map(e=>e.id)).size!==r[i].length&&t.addIssue({code:`custom`,path:[`plays`,n,i],message:`IDs must be unique within a section`});for(let[a,o]of r[i].entries())for(let[r,s]of o.evidence.entries())s.eventId&&!e.has(s.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,i,a,`evidence`,r,`eventId`],message:`Evidence event must exist in this play record`})}for(let[i,a]of r.sources.entries())a.eventId&&!e.has(a.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,`sources`,i,`eventId`],message:`Evidence event must exist in this play record`});for(let[i,a]of r.claims.entries())for(let[r,o]of a.evidence.entries())o.eventId&&!e.has(o.eventId)&&t.addIssue({code:`custom`,path:[`plays`,n,`claims`,i,`evidence`,r,`eventId`],message:`Evidence event must exist in this play record`})}});function KZ(e){return GZ.parse(e)}function qZ(e){let t={"\\":`\\textbackslash{}`,"{":`\\{`,"}":`\\}`,$:`\\$`,"&":`\\&`,"#":`\\#`,"%":`\\%`,_:`\\_`,"~":`\\textasciitilde{}`,"^":`\\textasciicircum{}`};return e.replace(/[\\{}$&#%_~^]/g,e=>t[e])}function JZ(e,t){let n=t===void 0?e.plays:e.plays.filter(e=>e.id===t);if(t!==void 0&&!n.length)throw Error(`Unknown play: `+t);let r=e=>e.split(/(\S{32,})/u).map(e=>/^\S{32,}$/u.test(e)?Array.from(e).map(qZ).join(`\\allowbreak{}`):qZ(e)).join(``),i=e=>r(e)+`
548
548
 
549
549
  `,a=e=>e.length?`\\begin{itemize}
550
550
  `+e.map(e=>`\\item `+r(e)).join(`
@@ -553,5 +553,5 @@ XID_Start XIDS`.split(/\s/).map(e=>[sU(e),e])),qW=new Map([[`s`,LW(383)],[LW(383
553
553
  `:``,o=e=>[e.label,e.path,e.line===void 0?``:`line `+e.line,e.url,e.eventId?`event `+e.eventId:``,e.sha256?`SHA-256 `+e.sha256:``,e.excerpt?`Excerpt: `+e.excerpt:``].filter(Boolean).join(` · `),s=e=>e.length?[`\\subsection*{Question coverage}`,...e.flatMap(e=>[i(e.id+` · `+e.status+` · `+e.question),e.answer?i(e.answer):``,a(e.evidence.map(o))])].join(`
554
554
  `):``;return[`\\documentclass[11pt]{article}`,`% Compile with LuaLaTeX and the DejaVu fonts (TeX Live dejavu package).`,`\\usepackage{fontspec}`,`\\setmainfont{DejaVuSans.ttf}[BoldFont=DejaVuSans-Bold.ttf,ItalicFont=DejaVuSans-Oblique.ttf,BoldItalicFont=DejaVuSans-BoldOblique.ttf]`,`\\tracinglostchars=3`,`\\usepackage[margin=25mm]{geometry}`,`\\usepackage{enumitem}`,`\\setlist{nosep}`,`\\setlength{\\emergencystretch}{3em}`,`\\setlength{\\parindent}{0pt}`,`\\setlength{\\parskip}{0.4em}`,`\\raggedright`,`\\title{`+r(t===void 0?e.title:n[0].title)+`}`,`\\author{\\parbox{0.9\\textwidth}{\\centering `+r(e.assessmentBy??`Research report`)+`}}`,`\\date{`+r(e.generatedAt)+`}`,`\\begin{document}`,`\\maketitle`,i(e.summary),e.window?i(`Observation window: `+(e.window.label??``)+` · `+e.window.from+` to `+e.window.to):``,i(`Assessment labels are the report author's judgments, not independent verification.`),a(e.limitations),e.freshness?i(`Report freshness: `+e.freshness.state+` · checked `+e.freshness.checkedAt+` · `+e.freshness.message):``,s(e.questionCoverage),...n.flatMap(e=>[`\\section{`+r(e.title)+`}`,i(`Play: `+e.id+` · State: `+(e.status??`Unknown`)+` · Updated: `+(e.updatedAt??`Unknown`)),i(e.summary),a(e.limitations),...e.metrics.length?[`\\subsection*{Recorded measurements}`,...e.metrics.flatMap(e=>[i(e.label+`: `+(e.value??`Unknown`)+(e.value!==null&&e.unit?` `+e.unit:``)),e.coverage?i(e.coverage):``,e.source?a([o(e.source)]):``])]:[],...e.documents.length?[`\\subsection*{Retained documents}`,i(`Full document contents are retained in the HTML reader and JSON download.`),a(e.documents.map(e=>e.title+` · `+e.path+(e.sha256?` · SHA-256 `+e.sha256:` · hash unknown`)))]:[],...e.claims.flatMap(e=>[`\\subsection{`+r(e.status+`: `+e.statement)+`}`,e.method?i(`Method: `+e.method):``,a(e.limitations),e.evidence.length?a(e.evidence.map(o)):i(`No supporting evidence supplied.`)]),e.sources.length?`\\subsection*{Play sources}
555
555
  `+a(e.sources.map(o)):``,...e.observations.flatMap(e=>[`\\subsection*{`+r(e.kind+`: `+e.title)+`}`,i(e.body),a(e.evidence.map(o))]),s(e.questionCoverage),i(e.record?`Trace: `+e.record.runId+`. Capture `+(e.record.coverage.completeOriginalCapture?`marked complete by producer.`:`incomplete or unknown.`)+` Cost: `+e.record.coverage.cost:`No event record was supplied. Topology, activity, and cost are unknown.`)]),`\\end{document}`,``].join(`
556
- `)}var JZ={ok:`ok`,quota:`quota`,lost:`lost`,"rate-limit":`rate limit`,oom:`OOM`,refused:`refused`,aborted:`aborted`,other:`other`},YZ={ok:`ok`,quota:`failed`,lost:`failed`,"rate-limit":`failed`,oom:`failed`,refused:`failed`,aborted:`other`,other:`other`},XZ={ok:`var(--ar-c-ok)`,failed:`var(--ar-c-fail)`,other:`var(--ar-c-neutral)`};function ZZ({outcomes:e,open:t}){let n=[`ok`,`failed`,`other`].filter(t=>e.some(e=>YZ[e]===t));return(0,A.jsxs)(`ul`,{className:`outcome-legend`,"aria-label":`Attempt outcomes`,children:[n.map(e=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`i`,{style:{background:XZ[e]}}),e]},e)),t&&(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`i`,{className:`outcome-open`}),`open turn`]})]})}var QZ=e=>typeof e.outcomeNotes==`string`?[e.outcomeNotes]:Array.isArray(e.outcomeNotes)?e.outcomeNotes:e.outcomeNotes?Object.entries(e.outcomeNotes).map(([e,t])=>`${e}: ${t}`):[];function $Z({row:e,max:t}){let n=e.hoursByOutcome??null,r=e.open?.hours??0,i=Object.values(n??{}).reduce((e,t)=>e+t,0);if(!i&&!r)return(0,A.jsx)(`span`,{className:`faint`,title:`attempts not recorded`,children:`—`});let a=Ne.filter(e=>(n?.[e]??0)>0),o=[...a.map(t=>`${JZ[t]} ${n[t].toFixed(2)} h${e.triesByOutcome?.[t]===void 0?``:` · ${e.triesByOutcome[t]} tries`}`),r?`open turn ${r.toFixed(1)} h${e.open?.since?` since ${tO(e.open.since)}`:``}`:null,e.outcomeBasis===`mapped-causes`?`mapped from the older cause keys`:null,...QZ(e)].filter(Boolean).join(`
557
- `);return(0,A.jsxs)(`span`,{className:`outcome-bar`,title:o,"data-outcome-basis":e.outcomeBasis??`none`,children:[(0,A.jsxs)(`span`,{className:`outcome-track`,style:{width:`${Math.max(2,(i+r)/t*100)}%`},children:[a.map(t=>(0,A.jsx)(`i`,{"data-outcome":t,title:`${JZ[t]}: ${n[t].toFixed(1)} h${e.triesByOutcome?.[t]===void 0?``:`, ${e.triesByOutcome[t]} tries`}`,style:{flexGrow:n[t],background:XZ[YZ[t]??`other`]}},t)),r>0&&(0,A.jsx)(`i`,{className:`outcome-open`,title:`open turn: ${r.toFixed(1)} h${e.open?.since?` since ${tO(e.open.since)}`:``}`,style:{flexGrow:r}})]}),(0,A.jsxs)(`span`,{className:`outcome-total num`,children:[(i+r).toFixed(1),` h`]})]})}var eQ=(0,b.createContext)({documents:[],open:()=>{}});function tQ({report:e,theme:t=`auto`,defaultPlayId:n,onPlayChange:r,defaultView:i,onViewChange:a,defaultActivitySelection:o,onActivityChange:s,defaultDocumentSelection:c,onDocumentChange:l,sourceSearchEndpoint:u,figures:f,className:p=``}){u=d({sourceSearchEndpoint:u}).sourceSearchEndpoint;let[m,h]=(0,b.useState)(c?.playId??n??e.plays[0]?.id),[g,_]=(0,b.useState)(``),v=Rv(),y=e.plays.filter(e=>[e.title,e.id].join(` `).toLowerCase().includes(g.trim().toLowerCase())),x=e.plays.find(e=>e.id===m)??e.plays[0];function S(e){h(e),r?.(e)}return(0,A.jsxs)(`article`,{className:`agent-record research-report research-workspace `+p,"data-theme":t,children:[(0,A.jsxs)(`aside`,{className:`research-rail`,children:[(0,A.jsx)(`h1`,{children:e.title}),(0,A.jsxs)(`label`,{className:`ui-field`,children:[(0,A.jsx)(`span`,{className:`ui-label`,children:`Find a play`}),(0,A.jsx)(`input`,{type:`search`,value:g,onChange:e=>_(e.target.value),placeholder:`Name…`})]}),(0,A.jsxs)(`nav`,{className:`research-play-list`,"aria-label":`Research plays`,children:[y.map(e=>(0,A.jsxs)(`button`,{"aria-current":e.id===x?.id?`page`:void 0,onClick:()=>S(e.id),children:[(0,A.jsx)(`span`,{children:e.title}),(0,A.jsxs)(`small`,{children:[e.claims.length,` results · `,e.documents.length,` sources`]})]},e.id)),!y.length&&(0,A.jsx)(`p`,{className:`small`,children:`No matching play.`})]}),(0,A.jsxs)(`details`,{className:`research-info`,children:[(0,A.jsx)(`summary`,{children:`Report summary and exports`}),(0,A.jsx)(`p`,{className:`small`,children:e.summary}),(0,A.jsxs)(`p`,{className:`small`,children:[`Authored `,vO(e.generatedAt,!0)]}),e.freshness&&(0,A.jsx)(`p`,{className:`small`,children:e.freshness.message}),(0,A.jsxs)(`p`,{className:`small`,children:[`Assessed by `,e.assessmentBy??`the report author`,`; assessment labels are judgments, not independent verification.`]}),e.limitations.length>0&&(0,A.jsx)(`ul`,{children:e.limitations.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),e.questionCoverage.length>0&&(0,A.jsx)(rQ,{questions:e.questionCoverage,inspect:()=>{},printOnly:!1}),(0,A.jsxs)(`div`,{className:`research-exports`,children:[(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>v(qZ(e),e.id+`.tex`,`application/x-tex`),children:`Export LaTeX`}),(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>v(JSON.stringify(e,null,2),e.id+`.json`,`application/json`),children:`Download data`}),(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>window.print(),children:`Print results`})]})]})]}),x?(0,A.jsx)(nQ,{play:x,report:e,theme:t,initialView:i,initialActivity:o,onActivityChange:s,initialDocument:c?.playId===x.id?c:void 0,onDocumentChange:l,onViewChange:a,sourceSearchEndpoint:u,figures:f},x.id):(0,A.jsx)(`p`,{className:`chat-empty`,children:`No plays were included.`}),(0,A.jsx)(`div`,{className:`rr-print`,children:e.plays.map(n=>(0,A.jsx)(nQ,{play:n,report:e,theme:t,printOnly:!0},n.id))})]})}function nQ({play:e,report:t,theme:n,printOnly:r=!1,initialDocument:i,initialView:a,initialActivity:o,onActivityChange:s,onDocumentChange:c,onViewChange:l,sourceSearchEndpoint:u,figures:d}){let[f,p]=(0,b.useState)(i?`sources`:a??`results`),[m,h]=(0,b.useState)(o),[g,_]=(0,b.useState)(i),v=(0,b.useId)(),y=Rv(),x=e=>r?void 0:e;function S(e){e===`sources`&&_(void 0),p(e),l?.(e)}function C(t){e.record?.events.find(e=>e.id===t)&&e.record&&(h({runId:e.record.runId,eventId:t,view:`source`}),S(`activity`),s?.(e.id,{runId:e.record.runId,eventId:t,view:`source`}))}function w(t){_(t),p(`sources`),c?.({playId:e.id,...t})}return(0,A.jsx)(eQ.Provider,{value:{documents:e.documents,open:w},children:(0,A.jsxs)(`section`,{className:`research-main`,"aria-labelledby":v,children:[(0,A.jsxs)(`header`,{className:`research-heading`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{id:v,children:e.title}),(0,A.jsxs)(`p`,{className:`small`,children:[e.updatedAt?`Updated ${vO(e.updatedAt,!0)}`:`Update time unknown`,` · `,e.status??`State unknown`,e.href&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`a`,{href:e.href,children:`Play page`})]})]})]}),!r&&(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>y(qZ(t,e.id),e.id+`.tex`,`application/x-tex`),children:`Export`})]}),!r&&(0,A.jsx)(`nav`,{className:`research-sections`,"aria-label":`Play sections`,children:[`results`,`activity`,`sources`].map(t=>(0,A.jsxs)(`button`,{"aria-current":f===t?`page`:void 0,onClick:()=>S(t),children:[t[0].toUpperCase()+t.slice(1),t===`sources`?` · ${e.documents.length}`:``]},t))}),(r||f===`results`)&&(0,A.jsxs)(`div`,{className:`research-results`,children:[e.verdict?(0,A.jsxs)(`section`,{className:`rr-section rr-lead-verdict`,id:x(`verdict`),"data-section":`verdict`,"aria-label":`Verdict`,children:[(0,A.jsx)(`h3`,{children:`Verdict`}),e.verdict.status&&(0,A.jsx)(`p`,{className:`rr-assessment`,"data-assessment":e.verdict.status,children:e.verdict.status.replace(/-/g,` `)}),(0,A.jsx)(`p`,{className:`research-summary`,children:e.verdict.sentence}),(0,A.jsx)(iQ,{sources:e.verdict.evidence,inspect:C,printOnly:r,inline:!0})]}):(0,A.jsx)(`p`,{className:`research-summary`,children:e.summary}),(0,A.jsx)(`div`,{className:`research-result-list`,children:e.claims.map(e=>(0,A.jsxs)(`article`,{className:`research-result`,children:[(0,A.jsx)(`p`,{className:`rr-assessment`,"data-assessment":e.status,children:e.status[0].toUpperCase()+e.status.slice(1)}),(0,A.jsx)(`h3`,{children:typeof e.title==`string`?e.title:e.statement}),typeof e.title==`string`&&(0,A.jsx)(`p`,{children:e.statement}),e.method&&(0,A.jsx)(`p`,{className:`small`,children:e.method}),e.limitations.length>0&&(0,A.jsx)(`ul`,{className:`rr-limitations`,children:e.limitations.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),e.evidence.length>0?(0,A.jsx)(iQ,{sources:e.evidence,inspect:C,printOnly:r}):(0,A.jsx)(`p`,{className:`small`,children:`Supporting sources not supplied.`})]},e.id))}),!e.claims.length&&!e.questionCoverage.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:`No assessed results supplied.`}),e.questionCoverage.length>0&&(0,A.jsx)(rQ,{questions:e.questionCoverage,inspect:C,printOnly:r,open:!e.claims.length,id:x(`questions`)}),e.sections?.map(t=>(0,A.jsxs)(`section`,{className:`rr-section`,id:x(t.id),"data-section":t.id,"aria-label":t.title,children:[(0,A.jsx)(`h3`,{children:t.title}),t.summary&&(0,A.jsx)(`p`,{children:t.summary}),!r&&d?.[t.id],e.metrics.some(e=>e.section===t.id)&&(0,A.jsx)(`dl`,{className:`rr-metrics rr-fact-grid`,children:e.metrics.filter(e=>e.section===t.id).map(e=>(0,A.jsx)(aQ,{metric:e,inspect:C,printOnly:r},e.id))}),e.tables?.filter(e=>e.section===t.id).map(e=>(0,A.jsx)(oQ,{table:e,inspect:C,printOnly:r},e.id))]},t.id)),e.runs&&e.runs.length>0&&(0,A.jsx)(sQ,{runs:e.runs,inspect:C,printOnly:r,id:x(`runs`)}),e.rules&&(0,A.jsx)(lQ,{rules:e.rules,inspect:C,printOnly:r,id:x(`anomalies`)}),e.unknowns&&(0,A.jsx)(uQ,{unknowns:e.unknowns,id:x(`unknowns`)}),e.observations.length>0&&(0,A.jsxs)(`details`,{className:`research-observations`,open:r||void 0,children:[(0,A.jsx)(`summary`,{children:`Checks and next steps`}),e.observations.map(e=>(0,A.jsxs)(`article`,{children:[(0,A.jsx)(`h3`,{children:e.title}),(0,A.jsx)(`p`,{children:e.body}),e.evidence.length>0&&(0,A.jsx)(iQ,{sources:e.evidence,inspect:C,printOnly:r})]},e.id))]}),(0,A.jsxs)(`details`,{className:`research-measurements`,open:r||void 0,children:[(0,A.jsx)(`summary`,{children:`Measurements and coverage`}),e.metrics.some(e=>!e.section)&&(0,A.jsx)(`dl`,{className:`rr-metrics`,"aria-label":`Recorded measurements`,children:e.metrics.filter(e=>!e.section).map(e=>(0,A.jsx)(aQ,{metric:e,inspect:C,printOnly:r},e.id))}),e.limitations.length>0&&(0,A.jsx)(`ul`,{children:e.limitations.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),!e.record&&(0,A.jsx)(`p`,{children:`No event record was supplied for this play. Activity and topology are unavailable.`}),e.sources.length>0&&(0,A.jsx)(iQ,{sources:e.sources,inspect:C,printOnly:r})]})]}),!r&&f===`sources`&&(0,A.jsx)(Vv,{documents:e.documents,selection:g,onSelect:w,onClear:()=>{_(void 0),S(`sources`)},playId:e.id,sourceSearchEndpoint:u}),!r&&f===`activity`&&(e.record?(0,A.jsx)(dZ,{records:[e.record],theme:n,selection:m,onSelectionChange:t=>{h(t),s?.(e.id,t)}}):(0,A.jsx)(`p`,{className:`chat-empty`,children:`No event record was supplied for this play. Its activity and topology are unavailable.`}))]})})}function rQ({questions:e,inspect:t,printOnly:n,open:r=!1,id:i}){return(0,A.jsxs)(`details`,{className:`rr-questions`,id:i,open:n||r||void 0,children:[(0,A.jsx)(`summary`,{children:`Questions and answers`}),(0,A.jsx)(`dl`,{children:e.map(e=>(0,A.jsxs)(`div`,{className:`rr-question`,children:[(0,A.jsx)(`dt`,{children:e.question}),(0,A.jsx)(`dd`,{className:`rr-meta`,children:e.status.replace(/_/g,` `)}),e.answer?(0,A.jsx)(`dd`,{children:e.answer}):e.status!==`observed`&&(0,A.jsx)(`dd`,{className:`rr-unknown`,children:`Unknown`}),e.why&&(0,A.jsxs)(`dd`,{className:`rr-meta`,children:[e.status===`observed`?`Not known: `:`Why: `,e.why]}),e.record&&(0,A.jsxs)(`dd`,{className:`rr-meta`,children:[`Would be answered by: `,e.record]}),e.evidence.length>0&&(0,A.jsx)(`dd`,{children:(0,A.jsx)(iQ,{sources:e.evidence,inspect:t,printOnly:n,inline:!0})})]},e.id))})]})}function iQ({sources:e,inspect:t,printOnly:n,inline:r=!1}){let i=(0,b.useContext)(eQ);return r&&e.every(e=>!e.excerpt&&!e.eventId)?(0,A.jsx)(`ul`,{className:`rr-source-line`,children:e.map((e,t)=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{children:`Source `}),e.label&&(0,A.jsxs)(`strong`,{children:[e.label,` `]}),e.url&&(0,A.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),e.path&&(0,A.jsxs)(`code`,{children:[e.path,e.line?`:`+e.line:``]}),e.asOf?(0,A.jsxs)(`span`,{children:[` · as of `,vO(e.asOf,!0)]}):(0,A.jsx)(`span`,{children:` · as-of time not recorded`})]},t))}):(0,A.jsxs)(`details`,{className:`rr-sources`,open:n||void 0,children:[(0,A.jsxs)(`summary`,{children:[e.length,` `,e.length===1?`source`:`sources`]}),(0,A.jsx)(`ol`,{children:e.map((e,r)=>(0,A.jsxs)(`li`,{children:[e.label&&(0,A.jsx)(`strong`,{children:e.label}),e.url&&(0,A.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),e.path&&(0,A.jsxs)(`code`,{children:[e.path,e.line?`:`+e.line:``]}),!n&&e.path&&zv(i.documents,e.path)&&(0,A.jsx)(`button`,{className:`ui-button`,type:`button`,onClick:()=>i.open({path:zv(i.documents,e.path).path,line:e.line}),children:`Read retained document`}),e.sha256&&(0,A.jsxs)(`small`,{children:[`SHA-256 `,(0,A.jsx)(`code`,{children:e.sha256})]}),e.asOf&&(0,A.jsxs)(`small`,{children:[`As of `,vO(e.asOf,!0)]}),e.excerpt&&(0,A.jsx)(`blockquote`,{children:e.excerpt}),e.eventId&&(n?(0,A.jsxs)(`code`,{children:[`Event: `,e.eventId]}):(0,A.jsx)(`button`,{className:`ui-button`,type:`button`,onClick:()=>t(e.eventId),children:`Open recorded event`}))]},r))})]})}function aQ({metric:e,inspect:t,printOnly:n}){let r=e.comparable===!1?`not comparable`:e.comparable===!0?`comparable`:null,i=r&&e.note?e.note.replace(/^not comparable:\s*/i,``):e.note;return(0,A.jsxs)(`div`,{"data-fact":e.id,"data-unknown":e.value===null||void 0,children:[(0,A.jsx)(`dt`,{children:e.label}),(0,A.jsxs)(`dd`,{className:e.value===null?`rr-unknown`:void 0,children:[e.value??`Unknown`,e.value!==null&&e.unit?` ${e.unit}`:``]}),r&&(0,A.jsx)(`small`,{className:`rr-comparable`,"data-comparable":String(e.comparable),children:r}),i&&(0,A.jsx)(`small`,{children:i}),e.coverage&&(0,A.jsx)(`small`,{children:e.coverage}),e.value===null&&e.why&&(0,A.jsxs)(`small`,{children:[`Why: `,e.why]}),e.value===null&&e.record&&(0,A.jsxs)(`small`,{children:[`Would be answered by: `,e.record]}),e.source&&(0,A.jsx)(iQ,{sources:[e.source],inspect:t,printOnly:n,inline:!0})]})}function oQ({table:e,inspect:t,printOnly:n}){let r=e.rows.some(e=>e.some(e=>e.comparable===!1));return(0,A.jsxs)(`figure`,{className:`rr-data-table`,"data-table":e.id,children:[(0,A.jsxs)(`figcaption`,{children:[e.title,r&&(0,A.jsx)(`span`,{className:`small`,children:` · * not comparable with the bar`})]}),(0,A.jsx)(`div`,{className:`rr-table-scroll`,children:(0,A.jsxs)(`table`,{children:[(0,A.jsx)(`thead`,{children:(0,A.jsx)(`tr`,{children:e.columns.map(e=>(0,A.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,A.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,A.jsx)(`tr`,{children:e.map((e,t)=>(0,A.jsxs)(`td`,{className:e.text===null?`rr-unknown`:void 0,title:e.note,children:[e.text===null?`unknown`:e.href?(0,A.jsx)(`a`,{href:e.href,children:e.text}):e.text,e.comparable===!1&&(0,A.jsx)(`span`,{className:`rr-comparable`,"data-comparable":`false`,children:`*`}),e.note&&(0,A.jsx)(`small`,{children:e.note})]},t))},t))})]})}),e.source&&(0,A.jsx)(iQ,{sources:[e.source],inspect:t,printOnly:n,inline:!0})]})}function sQ({runs:e,inspect:t,printOnly:n,id:r}){let i=e=>Object.values(e.hoursByOutcome??{}).reduce((e,t)=>e+t,0),a=Math.max(1,...e.map(i)),o=Ne.filter(t=>e.some(e=>(e.hoursByOutcome?.[t]??0)>0));return(0,A.jsxs)(`section`,{className:`rr-section`,id:r,"data-section":`runs`,"aria-label":`Runs`,children:[(0,A.jsx)(`h3`,{children:`Runs`}),o.length>0&&(0,A.jsx)(ZZ,{outcomes:o}),(0,A.jsx)(`ol`,{className:`rr-runs`,children:e.map(e=>(0,A.jsxs)(`li`,{className:`rr-run`,"data-run":e.id,children:[(0,A.jsxs)(`p`,{className:`rr-run-head`,children:[e.href?(0,A.jsx)(`a`,{href:e.href,children:e.label}):(0,A.jsx)(`strong`,{children:e.label}),(0,A.jsx)(`span`,{children:e.ending??`ending unknown`}),e.best&&(0,A.jsxs)(`span`,{children:[`best `,e.best]}),(0,A.jsx)(`span`,{children:e.cost??`cost unknown`}),(0,A.jsx)(`span`,{children:e.wallHours===null?`wall time unknown`:`${e.wallHours} h wall`})]}),e.hoursByOutcome&&i(e)>0?(0,A.jsx)($Z,{row:{hoursByOutcome:e.hoursByOutcome,triesByOutcome:e.triesByOutcome??null},max:a}):(0,A.jsx)(`dl`,{className:`rr-metrics rr-fact-grid`,children:(0,A.jsx)(aQ,{metric:e.agentHours,inspect:t,printOnly:n})}),e.hoursByOutcome&&i(e)>0&&e.agentHours.source&&(0,A.jsx)(iQ,{sources:[e.agentHours.source],inspect:t,printOnly:n,inline:!0}),e.reason&&(0,A.jsx)(`p`,{className:`small`,children:e.reason})]},e.id))})]})}var cQ={fired:`fired`,quiet:`quiet`,"could-not-evaluate":`could not evaluate`};function lQ({rules:e,inspect:t,printOnly:n,id:r}){let i=e.reduce((e,t)=>e+t.instances.length,0);return(0,A.jsxs)(`section`,{className:`rr-section`,id:r,"data-section":`anomalies`,"aria-label":`Anomalies`,children:[(0,A.jsx)(`h3`,{children:`Anomalies`}),(0,A.jsxs)(`p`,{children:[i,` `,i===1?`anomaly`:`anomalies`,` from `,e.filter(e=>e.instances.length).length,` of `,e.length,` rules.`]}),!e.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:`No rule was evaluated.`}),(0,A.jsx)(`ol`,{className:`rr-rules`,children:e.map(e=>(0,A.jsxs)(`li`,{className:`rr-rule`,"data-rule":e.id,"data-state":e.state,children:[(0,A.jsxs)(`p`,{className:`rr-rule-head`,children:[(0,A.jsx)(`span`,{className:`rr-assessment`,"data-rule-state":cQ[e.state]?e.state:`unrecognised`,children:cQ[e.state]??`unrecognised state: ${e.state}`}),` `,(0,A.jsx)(`strong`,{children:e.question})]}),(0,A.jsxs)(`p`,{className:`rr-meta`,children:[(0,A.jsx)(`code`,{children:e.id}),e.threshold&&(0,A.jsxs)(A.Fragment,{children:[` · threshold `,e.threshold]}),` · `,e.instances.length,` fired`]}),e.instances.length>0&&(0,A.jsx)(`ul`,{children:e.instances.map((e,r)=>(0,A.jsxs)(`li`,{children:[(0,A.jsxs)(`p`,{children:[e.sentence,e.value&&(0,A.jsxs)(`span`,{className:`rr-meta`,children:[` (`,e.value,`)`]})]}),e.evidence.length?(0,A.jsx)(iQ,{sources:e.evidence,inspect:t,printOnly:n,inline:!0}):(0,A.jsx)(`p`,{className:`rr-meta`,children:`Source not recorded.`})]},r))})]},e.id))})]})}function uQ({unknowns:e,id:t}){return(0,A.jsxs)(`section`,{className:`rr-section`,id:t,"data-section":`unknowns`,"aria-label":`Unknowns`,children:[(0,A.jsx)(`h3`,{children:`Unknowns`}),e.length?(0,A.jsx)(`ul`,{className:`rr-unknowns`,children:e.map((e,t)=>(0,A.jsxs)(`li`,{"data-unknown-field":e.field,children:[(0,A.jsx)(`code`,{children:e.field}),` `,(0,A.jsx)(`span`,{className:`rr-unknown`,children:`unknown`}),(0,A.jsxs)(`p`,{className:`rr-meta`,children:[`Why: `,e.why]}),(0,A.jsxs)(`p`,{className:`rr-meta`,children:[`Would be answered by: `,e.record]})]},t))}):(0,A.jsx)(`p`,{children:`The report lists no unknown field.`})]})}function dQ(e,t){let n=new URLSearchParams(t);if([`play`,`document`,`line`,`view`,`agent`,`event`].some(e=>n.getAll(e).length>1))return{error:`This citation contains an ambiguous selection.`};let r=n.get(`view`);if(r!==null&&![`results`,`activity`,`sources`].includes(r))return{error:`Unknown research view.`};let i=r,a=i?{view:i}:{},o=n.get(`play`)??void 0,s=n.get(`document`)??void 0,c=n.get(`line`)??void 0,l=n.get(`agent`)??void 0,u=n.get(`event`)??void 0;if(!o&&(s!==void 0||c!==void 0||l!==void 0||u!==void 0))return{error:`A document citation must name its play.`};if(!o)return a;let d=e.plays.find(e=>e.id===o);if(!d)return{error:`The cited play is not included in this report.`};if(l!==void 0||u!==void 0){if(s!==void 0||c!==void 0||!d.record)return{error:`Activity citation does not match this play.`};let e=l?d.record.nodes.find(e=>e.id===l):void 0,t=u?d.record.events.find(e=>e.id===u):void 0;if(l&&!e||u&&!t)return{error:`This activity is not retained in the selected play.`};if(t&&e){let n=d.record.nodes.find(e=>e.id===t.node);if(t.node!==e.id&&n?.agentId!==e.id)return{error:`The event belongs to a different agent.`}}return{playId:o,view:`activity`,activity:{runId:d.record.runId,...l?{nodeId:l}:{},...u?{eventId:u}:{}}}}if(s===void 0)return c===void 0?{playId:o,...a}:{error:`A line citation must name its document.`};if(!d.documents.some(e=>e.path===s))return{error:`The cited document is not retained in this play.`};let f=c===void 0?void 0:Number(c);return f!==void 0&&(!/^[1-9]\d*$/.test(c)||!Number.isSafeInteger(f))?{error:`The cited source line must be a positive whole number.`}:{playId:o,...a,document:{playId:o,path:s,...f===void 0?{}:{line:f}}}}function fQ(e,t,n,r,i){let a=new URLSearchParams(e);return a.set(`play`,t),a.delete(`document`),a.delete(`line`),a.delete(`view`),a.delete(`agent`),a.delete(`event`),i&&(i.nodeId&&a.set(`agent`,i.nodeId),i.eventId&&a.set(`event`,i.eventId)),r&&a.set(`view`,r),n&&n.playId===t&&(a.set(`document`,n.path),n.line!==void 0&&a.set(`line`,String(n.line))),`?`+a.toString()}function pQ({report:e,options:t}){let[n,r]=(0,b.useState)(``);(0,b.useEffect)(()=>{let e=()=>r(window.location.search);return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let i=dQ(e,n);function a(e,t,n,r){let i=fQ(window.location.search,e,t,n,r);i!==window.location.search&&window.history.pushState(null,``,window.location.pathname+i)}return i.error?(0,A.jsxs)(`main`,{children:[(0,A.jsx)(`h1`,{children:`Source citation unavailable`}),(0,A.jsx)(`p`,{role:`alert`,children:i.error}),(0,A.jsx)(`a`,{href:window.location.pathname,children:`Open the report`})]}):(0,A.jsx)(tQ,{report:e,defaultPlayId:i.playId,defaultView:i.view,defaultActivitySelection:i.activity,onActivityChange:(e,t)=>a(e,void 0,`activity`,t),sourceSearchEndpoint:t.sourceSearchEndpoint,defaultDocumentSelection:i.document,onPlayChange:e=>{a(e),r(window.location.search)},onViewChange:t=>a(new URLSearchParams(window.location.search).get(`play`)??e.plays[0].id,void 0,t),onDocumentChange:e=>a(e.playId,e)},n)}var mQ=document.getElementById(`research-report`),hQ=document.getElementById(`research-report-data`);if(mQ&&hQ){let e=GZ(JSON.parse(hQ.textContent??`null`));(0,x.hydrateRoot)(mQ,(0,A.jsx)(b.StrictMode,{children:(0,A.jsx)(pQ,{report:e,options:d(JSON.parse(document.getElementById(`research-report-options`)?.textContent??`{}`))})}))}})();
556
+ `)}var YZ={ok:`ok`,quota:`quota`,lost:`lost`,"rate-limit":`rate limit`,oom:`OOM`,refused:`refused`,aborted:`aborted`,other:`other`},XZ={ok:`ok`,quota:`failed`,lost:`failed`,"rate-limit":`failed`,oom:`failed`,refused:`failed`,aborted:`other`,other:`other`},ZZ={ok:`var(--ar-c-ok)`,failed:`var(--ar-c-fail)`,other:`var(--ar-c-neutral)`};function QZ({outcomes:e,open:t}){let n=[`ok`,`failed`,`other`].filter(t=>e.some(e=>XZ[e]===t));return(0,A.jsxs)(`ul`,{className:`outcome-legend`,"aria-label":`Attempt outcomes`,children:[n.map(e=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`i`,{style:{background:ZZ[e]}}),e]},e)),t&&(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`i`,{className:`outcome-open`}),`open turn`]})]})}var $Z=e=>typeof e.outcomeNotes==`string`?[e.outcomeNotes]:Array.isArray(e.outcomeNotes)?e.outcomeNotes:e.outcomeNotes?Object.entries(e.outcomeNotes).map(([e,t])=>`${e}: ${t}`):[];function eQ({row:e,max:t}){let n=e.hoursByOutcome??null,r=e.open?.hours??0,i=Object.values(n??{}).reduce((e,t)=>e+t,0);if(!i&&!r)return(0,A.jsx)(`span`,{className:`faint`,title:`attempts not recorded`,children:`—`});let a=Ne.filter(e=>(n?.[e]??0)>0),o=[...a.map(t=>`${YZ[t]} ${n[t].toFixed(2)} h${e.triesByOutcome?.[t]===void 0?``:` · ${e.triesByOutcome[t]} tries`}`),r?`open turn ${r.toFixed(1)} h${e.open?.since?` since ${tO(e.open.since)}`:``}`:null,e.outcomeBasis===`mapped-causes`?`mapped from the older cause keys`:null,...$Z(e)].filter(Boolean).join(`
557
+ `);return(0,A.jsxs)(`span`,{className:`outcome-bar`,title:o,"data-outcome-basis":e.outcomeBasis??`none`,children:[(0,A.jsxs)(`span`,{className:`outcome-track`,style:{width:`${Math.max(2,(i+r)/t*100)}%`},children:[a.map(t=>(0,A.jsx)(`i`,{"data-outcome":t,title:`${YZ[t]}: ${n[t].toFixed(1)} h${e.triesByOutcome?.[t]===void 0?``:`, ${e.triesByOutcome[t]} tries`}`,style:{flexGrow:n[t],background:ZZ[XZ[t]??`other`]}},t)),r>0&&(0,A.jsx)(`i`,{className:`outcome-open`,title:`open turn: ${r.toFixed(1)} h${e.open?.since?` since ${tO(e.open.since)}`:``}`,style:{flexGrow:r}})]}),(0,A.jsxs)(`span`,{className:`outcome-total num`,children:[(i+r).toFixed(1),` h`]})]})}var tQ=(0,b.createContext)({documents:[],open:()=>{}});function nQ({report:e,theme:t=`auto`,defaultPlayId:n,onPlayChange:r,defaultView:i,onViewChange:a,defaultActivitySelection:o,onActivityChange:s,defaultDocumentSelection:c,onDocumentChange:l,sourceSearchEndpoint:u,figures:f,className:p=``}){u=d({sourceSearchEndpoint:u}).sourceSearchEndpoint;let[m,h]=(0,b.useState)(c?.playId??n??e.plays[0]?.id),[g,_]=(0,b.useState)(``),v=Rv(),y=e.plays.filter(e=>[e.title,e.id].join(` `).toLowerCase().includes(g.trim().toLowerCase())),x=e.plays.find(e=>e.id===m)??e.plays[0];function S(e){h(e),r?.(e)}return(0,A.jsxs)(`article`,{className:`agent-record research-report research-workspace `+p,"data-theme":t,children:[(0,A.jsxs)(`aside`,{className:`research-rail`,children:[(0,A.jsx)(`h1`,{children:e.title}),(0,A.jsxs)(`label`,{className:`ui-field`,children:[(0,A.jsx)(`span`,{className:`ui-label`,children:`Find a play`}),(0,A.jsx)(`input`,{type:`search`,value:g,onChange:e=>_(e.target.value),placeholder:`Name…`})]}),(0,A.jsxs)(`nav`,{className:`research-play-list`,"aria-label":`Research plays`,children:[y.map(e=>(0,A.jsxs)(`button`,{"aria-current":e.id===x?.id?`page`:void 0,onClick:()=>S(e.id),children:[(0,A.jsx)(`span`,{children:e.title}),(0,A.jsxs)(`small`,{children:[e.claims.length,` results · `,e.documents.length,` sources`]})]},e.id)),!y.length&&(0,A.jsx)(`p`,{className:`small`,children:`No matching play.`})]}),(0,A.jsxs)(`details`,{className:`research-info`,children:[(0,A.jsx)(`summary`,{children:`Report summary and exports`}),(0,A.jsx)(`p`,{className:`small`,children:e.summary}),(0,A.jsxs)(`p`,{className:`small`,children:[`Authored `,vO(e.generatedAt,!0)]}),e.freshness&&(0,A.jsx)(`p`,{className:`small`,children:e.freshness.message}),(0,A.jsxs)(`p`,{className:`small`,children:[`Assessed by `,e.assessmentBy??`the report author`,`; assessment labels are judgments, not independent verification.`]}),e.limitations.length>0&&(0,A.jsx)(`ul`,{children:e.limitations.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),e.questionCoverage.length>0&&(0,A.jsx)(iQ,{questions:e.questionCoverage,inspect:()=>{},printOnly:!1}),(0,A.jsxs)(`div`,{className:`research-exports`,children:[(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>v(JZ(e),e.id+`.tex`,`application/x-tex`),children:`Export LaTeX`}),(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>v(JSON.stringify(e,null,2),e.id+`.json`,`application/json`),children:`Download data`}),(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>window.print(),children:`Print results`})]})]})]}),x?(0,A.jsx)(rQ,{play:x,report:e,theme:t,initialView:i,initialActivity:o,onActivityChange:s,initialDocument:c?.playId===x.id?c:void 0,onDocumentChange:l,onViewChange:a,sourceSearchEndpoint:u,figures:f},x.id):(0,A.jsx)(`p`,{className:`chat-empty`,children:`No plays were included.`}),(0,A.jsx)(`div`,{className:`rr-print`,children:e.plays.map(n=>(0,A.jsx)(rQ,{play:n,report:e,theme:t,printOnly:!0},n.id))})]})}function rQ({play:e,report:t,theme:n,printOnly:r=!1,initialDocument:i,initialView:a,initialActivity:o,onActivityChange:s,onDocumentChange:c,onViewChange:l,sourceSearchEndpoint:u,figures:d}){let[f,p]=(0,b.useState)(i?`sources`:a??`results`),[m,h]=(0,b.useState)(o),[g,_]=(0,b.useState)(i),v=(0,b.useId)(),y=Rv(),x=e=>r?void 0:e;function S(e){e===`sources`&&_(void 0),p(e),l?.(e)}function C(t){e.record?.events.find(e=>e.id===t)&&e.record&&(h({runId:e.record.runId,eventId:t,view:`source`}),S(`activity`),s?.(e.id,{runId:e.record.runId,eventId:t,view:`source`}))}function w(t){_(t),p(`sources`),c?.({playId:e.id,...t})}return(0,A.jsx)(tQ.Provider,{value:{documents:e.documents,open:w},children:(0,A.jsxs)(`section`,{className:`research-main`,"aria-labelledby":v,children:[(0,A.jsxs)(`header`,{className:`research-heading`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{id:v,children:e.title}),(0,A.jsxs)(`p`,{className:`small`,children:[e.updatedAt?`Updated ${vO(e.updatedAt,!0)}`:`Update time unknown`,` · `,e.status??`State unknown`,e.href&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`a`,{href:e.href,children:`Play page`})]})]})]}),!r&&(0,A.jsx)(`button`,{className:`ui-button`,onClick:()=>y(JZ(t,e.id),e.id+`.tex`,`application/x-tex`),children:`Export`})]}),!r&&(0,A.jsx)(`nav`,{className:`research-sections`,"aria-label":`Play sections`,children:[`results`,`activity`,`sources`].map(t=>(0,A.jsxs)(`button`,{"aria-current":f===t?`page`:void 0,onClick:()=>S(t),children:[t[0].toUpperCase()+t.slice(1),t===`sources`?` · ${e.documents.length}`:``]},t))}),(r||f===`results`)&&(0,A.jsxs)(`div`,{className:`research-results`,children:[e.verdict?(0,A.jsxs)(`section`,{className:`rr-section rr-lead-verdict`,id:x(`verdict`),"data-section":`verdict`,"aria-label":`Verdict`,children:[(0,A.jsx)(`h3`,{children:`Verdict`}),e.verdict.status&&(0,A.jsx)(`p`,{className:`rr-assessment`,"data-assessment":e.verdict.status,children:e.verdict.status.replace(/-/g,` `)}),(0,A.jsx)(`p`,{className:`research-summary`,children:e.verdict.sentence}),(0,A.jsx)(aQ,{sources:e.verdict.evidence,inspect:C,printOnly:r,inline:!0})]}):(0,A.jsx)(`p`,{className:`research-summary`,children:e.summary}),(0,A.jsx)(`div`,{className:`research-result-list`,children:e.claims.map(e=>(0,A.jsxs)(`article`,{className:`research-result`,children:[(0,A.jsx)(`p`,{className:`rr-assessment`,"data-assessment":e.status,children:e.status[0].toUpperCase()+e.status.slice(1)}),(0,A.jsx)(`h3`,{children:typeof e.title==`string`?e.title:e.statement}),typeof e.title==`string`&&(0,A.jsx)(`p`,{children:e.statement}),e.method&&(0,A.jsx)(`p`,{className:`small`,children:e.method}),e.limitations.length>0&&(0,A.jsx)(`ul`,{className:`rr-limitations`,children:e.limitations.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),e.evidence.length>0?(0,A.jsx)(aQ,{sources:e.evidence,inspect:C,printOnly:r}):(0,A.jsx)(`p`,{className:`small`,children:`Supporting sources not supplied.`})]},e.id))}),!e.claims.length&&!e.questionCoverage.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:`No assessed results supplied.`}),e.questionCoverage.length>0&&(0,A.jsx)(iQ,{questions:e.questionCoverage,inspect:C,printOnly:r,open:!e.claims.length,id:x(`questions`)}),e.sections?.map(t=>(0,A.jsxs)(`section`,{className:`rr-section`,id:x(t.id),"data-section":t.id,"aria-label":t.title,children:[(0,A.jsx)(`h3`,{children:t.title}),t.summary&&(0,A.jsx)(`p`,{children:t.summary}),!r&&d?.[t.id],e.metrics.some(e=>e.section===t.id)&&(0,A.jsx)(`dl`,{className:`rr-metrics rr-fact-grid`,children:e.metrics.filter(e=>e.section===t.id).map(e=>(0,A.jsx)(oQ,{metric:e,inspect:C,printOnly:r},e.id))}),e.tables?.filter(e=>e.section===t.id).map(e=>(0,A.jsx)(sQ,{table:e,inspect:C,printOnly:r},e.id))]},t.id)),e.runs&&e.runs.length>0&&(0,A.jsx)(cQ,{runs:e.runs,inspect:C,printOnly:r,id:x(`runs`)}),e.rules&&(0,A.jsx)(uQ,{rules:e.rules,inspect:C,printOnly:r,id:x(`anomalies`)}),e.unknowns&&(0,A.jsx)(dQ,{unknowns:e.unknowns,id:x(`unknowns`)}),e.observations.length>0&&(0,A.jsxs)(`details`,{className:`research-observations`,open:r||void 0,children:[(0,A.jsx)(`summary`,{children:`Checks and next steps`}),e.observations.map(e=>(0,A.jsxs)(`article`,{children:[(0,A.jsx)(`h3`,{children:e.title}),(0,A.jsx)(`p`,{children:e.body}),e.evidence.length>0&&(0,A.jsx)(aQ,{sources:e.evidence,inspect:C,printOnly:r})]},e.id))]}),(0,A.jsxs)(`details`,{className:`research-measurements`,open:r||void 0,children:[(0,A.jsx)(`summary`,{children:`Measurements and coverage`}),e.metrics.some(e=>!e.section)&&(0,A.jsx)(`dl`,{className:`rr-metrics`,"aria-label":`Recorded measurements`,children:e.metrics.filter(e=>!e.section).map(e=>(0,A.jsx)(oQ,{metric:e,inspect:C,printOnly:r},e.id))}),e.limitations.length>0&&(0,A.jsx)(`ul`,{children:e.limitations.map((e,t)=>(0,A.jsx)(`li`,{children:e},t))}),!e.record&&(0,A.jsx)(`p`,{children:`No event record was supplied for this play. Activity and topology are unavailable.`}),e.sources.length>0&&(0,A.jsx)(aQ,{sources:e.sources,inspect:C,printOnly:r})]})]}),!r&&f===`sources`&&(0,A.jsx)(Vv,{documents:e.documents,selection:g,onSelect:w,onClear:()=>{_(void 0),S(`sources`)},playId:e.id,sourceSearchEndpoint:u}),!r&&f===`activity`&&(e.record?(0,A.jsx)(fZ,{records:[e.record],theme:n,selection:m,onSelectionChange:t=>{h(t),s?.(e.id,t)}}):(0,A.jsx)(`p`,{className:`chat-empty`,children:`No event record was supplied for this play. Its activity and topology are unavailable.`}))]})})}function iQ({questions:e,inspect:t,printOnly:n,open:r=!1,id:i}){return(0,A.jsxs)(`details`,{className:`rr-questions`,id:i,open:n||r||void 0,children:[(0,A.jsx)(`summary`,{children:`Questions and answers`}),(0,A.jsx)(`dl`,{children:e.map(e=>(0,A.jsxs)(`div`,{className:`rr-question`,children:[(0,A.jsx)(`dt`,{children:e.question}),(0,A.jsx)(`dd`,{className:`rr-meta`,children:e.status.replace(/_/g,` `)}),e.answer?(0,A.jsx)(`dd`,{children:e.answer}):e.status!==`observed`&&(0,A.jsx)(`dd`,{className:`rr-unknown`,children:`Unknown`}),e.why&&(0,A.jsxs)(`dd`,{className:`rr-meta`,children:[e.status===`observed`?`Not known: `:`Why: `,e.why]}),e.record&&(0,A.jsxs)(`dd`,{className:`rr-meta`,children:[`Would be answered by: `,e.record]}),e.evidence.length>0&&(0,A.jsx)(`dd`,{children:(0,A.jsx)(aQ,{sources:e.evidence,inspect:t,printOnly:n,inline:!0})})]},e.id))})]})}function aQ({sources:e,inspect:t,printOnly:n,inline:r=!1}){let i=(0,b.useContext)(tQ);return r&&e.every(e=>!e.excerpt&&!e.eventId)?(0,A.jsx)(`ul`,{className:`rr-source-line`,children:e.map((e,t)=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{children:`Source `}),e.label&&(0,A.jsxs)(`strong`,{children:[e.label,` `]}),e.url&&(0,A.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),e.path&&(0,A.jsxs)(`code`,{children:[e.path,e.line?`:`+e.line:``]}),e.asOf?(0,A.jsxs)(`span`,{children:[` · as of `,vO(e.asOf,!0)]}):(0,A.jsx)(`span`,{children:` · as-of time not recorded`})]},t))}):(0,A.jsxs)(`details`,{className:`rr-sources`,open:n||void 0,children:[(0,A.jsxs)(`summary`,{children:[e.length,` `,e.length===1?`source`:`sources`]}),(0,A.jsx)(`ol`,{children:e.map((e,r)=>(0,A.jsxs)(`li`,{children:[e.label&&(0,A.jsx)(`strong`,{children:e.label}),e.url&&(0,A.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),e.path&&(0,A.jsxs)(`code`,{children:[e.path,e.line?`:`+e.line:``]}),!n&&e.path&&zv(i.documents,e.path)&&(0,A.jsx)(`button`,{className:`ui-button`,type:`button`,onClick:()=>i.open({path:zv(i.documents,e.path).path,line:e.line}),children:`Read retained document`}),e.sha256&&(0,A.jsxs)(`small`,{children:[`SHA-256 `,(0,A.jsx)(`code`,{children:e.sha256})]}),e.asOf&&(0,A.jsxs)(`small`,{children:[`As of `,vO(e.asOf,!0)]}),e.excerpt&&(0,A.jsx)(`blockquote`,{children:e.excerpt}),e.eventId&&(n?(0,A.jsxs)(`code`,{children:[`Event: `,e.eventId]}):(0,A.jsx)(`button`,{className:`ui-button`,type:`button`,onClick:()=>t(e.eventId),children:`Open recorded event`}))]},r))})]})}function oQ({metric:e,inspect:t,printOnly:n}){let r=e.comparable===!1?`not comparable`:e.comparable===!0?`comparable`:null,i=r&&e.note?e.note.replace(/^not comparable:\s*/i,``):e.note;return(0,A.jsxs)(`div`,{"data-fact":e.id,"data-unknown":e.value===null||void 0,children:[(0,A.jsx)(`dt`,{children:e.label}),(0,A.jsxs)(`dd`,{className:e.value===null?`rr-unknown`:void 0,children:[e.value??`Unknown`,e.value!==null&&e.unit?` ${e.unit}`:``]}),r&&(0,A.jsx)(`small`,{className:`rr-comparable`,"data-comparable":String(e.comparable),children:r}),i&&(0,A.jsx)(`small`,{children:i}),e.coverage&&(0,A.jsx)(`small`,{children:e.coverage}),e.value===null&&e.why&&(0,A.jsxs)(`small`,{children:[`Why: `,e.why]}),e.value===null&&e.record&&(0,A.jsxs)(`small`,{children:[`Would be answered by: `,e.record]}),e.source&&(0,A.jsx)(aQ,{sources:[e.source],inspect:t,printOnly:n,inline:!0})]})}function sQ({table:e,inspect:t,printOnly:n}){let r=e.rows.some(e=>e.some(e=>e.comparable===!1));return(0,A.jsxs)(`figure`,{className:`rr-data-table`,"data-table":e.id,children:[(0,A.jsxs)(`figcaption`,{children:[e.title,r&&(0,A.jsx)(`span`,{className:`small`,children:` · * not comparable with the bar`})]}),(0,A.jsx)(`div`,{className:`rr-table-scroll`,children:(0,A.jsxs)(`table`,{children:[(0,A.jsx)(`thead`,{children:(0,A.jsx)(`tr`,{children:e.columns.map(e=>(0,A.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,A.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,A.jsx)(`tr`,{children:e.map((e,t)=>(0,A.jsxs)(`td`,{className:e.text===null?`rr-unknown`:void 0,title:e.note,children:[e.text===null?`unknown`:e.href?(0,A.jsx)(`a`,{href:e.href,children:e.text}):e.text,e.comparable===!1&&(0,A.jsx)(`span`,{className:`rr-comparable`,"data-comparable":`false`,children:`*`}),e.note&&(0,A.jsx)(`small`,{children:e.note})]},t))},t))})]})}),e.source&&(0,A.jsx)(aQ,{sources:[e.source],inspect:t,printOnly:n,inline:!0})]})}function cQ({runs:e,inspect:t,printOnly:n,id:r}){let i=e=>Object.values(e.hoursByOutcome??{}).reduce((e,t)=>e+t,0),a=Math.max(1,...e.map(i)),o=Ne.filter(t=>e.some(e=>(e.hoursByOutcome?.[t]??0)>0));return(0,A.jsxs)(`section`,{className:`rr-section`,id:r,"data-section":`runs`,"aria-label":`Runs`,children:[(0,A.jsx)(`h3`,{children:`Runs`}),o.length>0&&(0,A.jsx)(QZ,{outcomes:o}),(0,A.jsx)(`ol`,{className:`rr-runs`,children:e.map(e=>(0,A.jsxs)(`li`,{className:`rr-run`,"data-run":e.id,children:[(0,A.jsxs)(`p`,{className:`rr-run-head`,children:[e.href?(0,A.jsx)(`a`,{href:e.href,children:e.label}):(0,A.jsx)(`strong`,{children:e.label}),(0,A.jsx)(`span`,{children:e.ending??`ending unknown`}),e.best&&(0,A.jsxs)(`span`,{children:[`best `,e.best]}),(0,A.jsx)(`span`,{children:e.cost??`cost unknown`}),(0,A.jsx)(`span`,{children:e.wallHours===null?`wall time unknown`:`${e.wallHours} h wall`})]}),e.hoursByOutcome&&i(e)>0?(0,A.jsx)(eQ,{row:{hoursByOutcome:e.hoursByOutcome,triesByOutcome:e.triesByOutcome??null},max:a}):(0,A.jsx)(`dl`,{className:`rr-metrics rr-fact-grid`,children:(0,A.jsx)(oQ,{metric:e.agentHours,inspect:t,printOnly:n})}),e.hoursByOutcome&&i(e)>0&&e.agentHours.source&&(0,A.jsx)(aQ,{sources:[e.agentHours.source],inspect:t,printOnly:n,inline:!0}),e.reason&&(0,A.jsx)(`p`,{className:`small`,children:e.reason})]},e.id))})]})}var lQ={fired:`fired`,quiet:`quiet`,"could-not-evaluate":`could not evaluate`};function uQ({rules:e,inspect:t,printOnly:n,id:r}){let i=e.reduce((e,t)=>e+t.instances.length,0);return(0,A.jsxs)(`section`,{className:`rr-section`,id:r,"data-section":`anomalies`,"aria-label":`Anomalies`,children:[(0,A.jsx)(`h3`,{children:`Anomalies`}),(0,A.jsxs)(`p`,{children:[i,` `,i===1?`anomaly`:`anomalies`,` from `,e.filter(e=>e.instances.length).length,` of `,e.length,` rules.`]}),!e.length&&(0,A.jsx)(`p`,{className:`chat-empty`,children:`No rule was evaluated.`}),(0,A.jsx)(`ol`,{className:`rr-rules`,children:e.map(e=>(0,A.jsxs)(`li`,{className:`rr-rule`,"data-rule":e.id,"data-state":e.state,children:[(0,A.jsxs)(`p`,{className:`rr-rule-head`,children:[(0,A.jsx)(`span`,{className:`rr-assessment`,"data-rule-state":lQ[e.state]?e.state:`unrecognised`,children:lQ[e.state]??`unrecognised state: ${e.state}`}),` `,(0,A.jsx)(`strong`,{children:e.question})]}),(0,A.jsxs)(`p`,{className:`rr-meta`,children:[(0,A.jsx)(`code`,{children:e.id}),e.threshold&&(0,A.jsxs)(A.Fragment,{children:[` · threshold `,e.threshold]}),` · `,e.instances.length,` fired`]}),e.instances.length>0&&(0,A.jsx)(`ul`,{children:e.instances.map((e,r)=>(0,A.jsxs)(`li`,{children:[(0,A.jsxs)(`p`,{children:[e.sentence,e.value&&(0,A.jsxs)(`span`,{className:`rr-meta`,children:[` (`,e.value,`)`]})]}),e.evidence.length?(0,A.jsx)(aQ,{sources:e.evidence,inspect:t,printOnly:n,inline:!0}):(0,A.jsx)(`p`,{className:`rr-meta`,children:`Source not recorded.`})]},r))})]},e.id))})]})}function dQ({unknowns:e,id:t}){return(0,A.jsxs)(`section`,{className:`rr-section`,id:t,"data-section":`unknowns`,"aria-label":`Unknowns`,children:[(0,A.jsx)(`h3`,{children:`Unknowns`}),e.length?(0,A.jsx)(`ul`,{className:`rr-unknowns`,children:e.map((e,t)=>(0,A.jsxs)(`li`,{"data-unknown-field":e.field,children:[(0,A.jsx)(`code`,{children:e.field}),` `,(0,A.jsx)(`span`,{className:`rr-unknown`,children:`unknown`}),(0,A.jsxs)(`p`,{className:`rr-meta`,children:[`Why: `,e.why]}),(0,A.jsxs)(`p`,{className:`rr-meta`,children:[`Would be answered by: `,e.record]})]},t))}):(0,A.jsx)(`p`,{children:`The report lists no unknown field.`})]})}function fQ(e,t){let n=new URLSearchParams(t);if([`play`,`document`,`line`,`view`,`agent`,`event`].some(e=>n.getAll(e).length>1))return{error:`This citation contains an ambiguous selection.`};let r=n.get(`view`);if(r!==null&&![`results`,`activity`,`sources`].includes(r))return{error:`Unknown research view.`};let i=r,a=i?{view:i}:{},o=n.get(`play`)??void 0,s=n.get(`document`)??void 0,c=n.get(`line`)??void 0,l=n.get(`agent`)??void 0,u=n.get(`event`)??void 0;if(!o&&(s!==void 0||c!==void 0||l!==void 0||u!==void 0))return{error:`A document citation must name its play.`};if(!o)return a;let d=e.plays.find(e=>e.id===o);if(!d)return{error:`The cited play is not included in this report.`};if(l!==void 0||u!==void 0){if(s!==void 0||c!==void 0||!d.record)return{error:`Activity citation does not match this play.`};let e=l?d.record.nodes.find(e=>e.id===l):void 0,t=u?d.record.events.find(e=>e.id===u):void 0;if(l&&!e||u&&!t)return{error:`This activity is not retained in the selected play.`};if(t&&e){let n=d.record.nodes.find(e=>e.id===t.node);if(t.node!==e.id&&n?.agentId!==e.id)return{error:`The event belongs to a different agent.`}}return{playId:o,view:`activity`,activity:{runId:d.record.runId,...l?{nodeId:l}:{},...u?{eventId:u}:{}}}}if(s===void 0)return c===void 0?{playId:o,...a}:{error:`A line citation must name its document.`};if(!d.documents.some(e=>e.path===s))return{error:`The cited document is not retained in this play.`};let f=c===void 0?void 0:Number(c);return f!==void 0&&(!/^[1-9]\d*$/.test(c)||!Number.isSafeInteger(f))?{error:`The cited source line must be a positive whole number.`}:{playId:o,...a,document:{playId:o,path:s,...f===void 0?{}:{line:f}}}}function pQ(e,t,n,r,i){let a=new URLSearchParams(e);return a.set(`play`,t),a.delete(`document`),a.delete(`line`),a.delete(`view`),a.delete(`agent`),a.delete(`event`),i&&(i.nodeId&&a.set(`agent`,i.nodeId),i.eventId&&a.set(`event`,i.eventId)),r&&a.set(`view`,r),n&&n.playId===t&&(a.set(`document`,n.path),n.line!==void 0&&a.set(`line`,String(n.line))),`?`+a.toString()}function mQ({report:e,options:t}){let[n,r]=(0,b.useState)(``);(0,b.useEffect)(()=>{let e=()=>r(window.location.search);return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let i=fQ(e,n);function a(e,t,n,r){let i=pQ(window.location.search,e,t,n,r);i!==window.location.search&&window.history.pushState(null,``,window.location.pathname+i)}return i.error?(0,A.jsxs)(`main`,{children:[(0,A.jsx)(`h1`,{children:`Source citation unavailable`}),(0,A.jsx)(`p`,{role:`alert`,children:i.error}),(0,A.jsx)(`a`,{href:window.location.pathname,children:`Open the report`})]}):(0,A.jsx)(nQ,{report:e,defaultPlayId:i.playId,defaultView:i.view,defaultActivitySelection:i.activity,onActivityChange:(e,t)=>a(e,void 0,`activity`,t),sourceSearchEndpoint:t.sourceSearchEndpoint,defaultDocumentSelection:i.document,onPlayChange:e=>{a(e),r(window.location.search)},onViewChange:t=>a(new URLSearchParams(window.location.search).get(`play`)??e.plays[0].id,void 0,t),onDocumentChange:e=>a(e.playId,e)},n)}var hQ=document.getElementById(`research-report`),gQ=document.getElementById(`research-report-data`);if(hQ&&gQ){let e=KZ(JSON.parse(gQ.textContent??`null`));(0,x.hydrateRoot)(hQ,(0,A.jsx)(b.StrictMode,{children:(0,A.jsx)(mQ,{report:e,options:d(JSON.parse(document.getElementById(`research-report-options`)?.textContent??`{}`))})}))}})();