@qredence/fleet 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/web/client/assets/action-swap-roll-COzQ86wm.js +1 -0
  3. package/dist/web/client/assets/agent-activity-svETLf_5.js +1 -0
  4. package/dist/web/client/assets/agent-disclosure-DAMuuGcM.js +1 -0
  5. package/dist/web/client/assets/analytics-stub-B6zGMuSV.js +1 -0
  6. package/dist/web/client/assets/{artifacts-panel-CJ75gQub.js → artifacts-panel-HVjqBMyx.js} +1 -1
  7. package/dist/web/client/assets/button-C5wFDY5_.js +1 -0
  8. package/dist/web/client/assets/card-DA3Vnqay.js +1 -0
  9. package/dist/web/client/assets/chat-BhYseKd6.js +52 -0
  10. package/dist/web/client/assets/{chat-command-palette-CkISHfKE.js → chat-command-palette-LILDO_vG.js} +1 -1
  11. package/dist/web/client/assets/{citations-C_tPOJE_.js → citations-BPv8HIpf.js} +2 -2
  12. package/dist/web/client/assets/command-PhicLCoO.js +1 -0
  13. package/dist/web/client/assets/dialog-pBGUjAQ7.js +1 -0
  14. package/dist/web/client/assets/{fleet-message-queue-BCno4XP-.js → fleet-message-queue-fbYYwMj0.js} +1 -1
  15. package/dist/web/client/assets/{fleet-pi-tool-renderer-BEDIO3al.js → fleet-pi-tool-renderer-BRgNnmaJ.js} +28 -28
  16. package/dist/web/client/assets/fleet-reasoning-panel-CjA2dwUJ.js +1 -0
  17. package/dist/web/client/assets/{fork-picker-dialog-ByBOGVsa.js → fork-picker-dialog-B7NNpVmW.js} +1 -1
  18. package/dist/web/client/assets/globals-CuIiqOTg.css +2 -0
  19. package/dist/web/client/assets/horizontal-resize-Cp3iHMH7.js +1 -0
  20. package/dist/web/client/assets/index-CSGplyr_.js +12 -0
  21. package/dist/web/client/assets/{input-0wwjWjKq.js → input-PcdubeKn.js} +1 -1
  22. package/dist/web/client/assets/input-group-C2HJEZvl.js +1 -0
  23. package/dist/web/client/assets/ipython-tool-CyuMOxz1.js +3 -0
  24. package/dist/web/client/assets/{markdown-code-CuQcR3UO.js → markdown-code-xNyjdZ4g.js} +1 -1
  25. package/dist/web/client/assets/{markdown-DInPmRUG.js → markdown-lvexwooo.js} +2 -2
  26. package/dist/web/client/assets/{model-selector-list-Ch05B2nZ.js → model-selector-list-CoXX358G.js} +1 -1
  27. package/dist/web/client/assets/{notify-DgMKgZZW.js → notify-DxL0VD7Z.js} +1 -1
  28. package/dist/web/client/assets/openui-renderer-TLNe5e_Q.js +378 -0
  29. package/dist/web/client/assets/prompt-input-fwP8TsgQ.js +1 -0
  30. package/dist/web/client/assets/{prompt-suggestions-Cc--lSNR.js → prompt-suggestions-BlGXmWS7.js} +1 -1
  31. package/dist/web/client/assets/provider-catalog-DYMFdbKc.js +1 -0
  32. package/dist/web/client/assets/provider-label-B4q5mI65.js +1 -0
  33. package/dist/web/client/assets/{repl-panel-DsPX04Xr.js → repl-panel-C5om8MGU.js} +1 -1
  34. package/dist/web/client/assets/{right-panel-registry-Dp8yX-oL.js → right-panel-registry-BBlxLxnx.js} +2 -2
  35. package/dist/web/client/assets/routes-XGsAIqBJ.js +16 -0
  36. package/dist/web/client/assets/settings-dialog-BSBasR3o.js +2 -0
  37. package/dist/web/client/assets/{subagent-chat-panel-Yujplxpb.js → subagent-chat-panel-oeLDPDAK.js} +1 -1
  38. package/dist/web/client/assets/{subagent-transcript-CnI-mqN0.js → subagent-transcript-DaVHjNUH.js} +1 -1
  39. package/dist/web/client/assets/{subagents-panel-CjXEdimj.js → subagents-panel-D_aVgSCi.js} +1 -1
  40. package/dist/web/client/assets/surfaces-BhAXz9So.js +1 -0
  41. package/dist/web/client/assets/{switch-9rTeg6J6.js → switch-WhXeJNNY.js} +1 -1
  42. package/dist/web/client/assets/{toast-Bt9p2OL4.js → toast-D3c9XeGe.js} +1 -1
  43. package/dist/web/client/assets/{tool-result-DfnPN0FQ.js → tool-result-Cki8WUNc.js} +3 -3
  44. package/dist/web/client/assets/virtualized-turn-list-CdMa-ydT.js +6 -0
  45. package/dist/web/client/assets/workspace-panel-77bDbprs.js +1 -0
  46. package/dist/web/client/bundle-budget.json +5 -5
  47. package/dist/web/launcher.mjs +10 -1
  48. package/dist/web/server/{_tanstack-start-manifest_v-DS_CSIFQ-WB3VTKF3.js → _tanstack-start-manifest_v-0L7fqnH4-KMVGUFE4.js} +24 -24
  49. package/dist/web/server/{agent-activity-CS2rbF_C-A3R26CYH.js → agent-activity-BuEE6iVw-CDZLK4D2.js} +4 -4
  50. package/dist/web/server/{artifacts-panel-CaKrX2XC-R37I4BHF.js → artifacts-panel-D3ySO--V-XSL53CXL.js} +18 -18
  51. package/dist/web/server/{chat-command-palette-7gbqEnm9-6XICQZN7.js → chat-command-palette-kAbXhWVg-TJWXH2WW.js} +9 -9
  52. package/dist/web/server/{chunk-CNXJN5HN.js → chunk-2DDWXTVG.js} +5 -5
  53. package/dist/web/server/{chunk-TWYHHG5N.js → chunk-2JHTYWD5.js} +15 -15
  54. package/dist/web/server/{chunk-EAE2QXRK.js → chunk-3TIMGWWI.js} +1 -2
  55. package/dist/web/server/{chunk-AGFRJQZ7.js → chunk-4WBFCB4O.js} +257 -257
  56. package/dist/web/server/{chunk-P6UMR32I.js → chunk-5UCAJBAH.js} +4 -4
  57. package/dist/web/server/{chunk-DZ2IC3FH.js → chunk-D27LRYVT.js} +42 -42
  58. package/dist/web/server/{chunk-YXXRP3NS.js → chunk-DLUZFOG3.js} +5 -5
  59. package/dist/web/server/{chunk-K3BXQG3N.js → chunk-EBG3XFGQ.js} +60 -60
  60. package/dist/web/server/{chunk-2ATMSG7U.js → chunk-EJEPDVK6.js} +3 -3
  61. package/dist/web/server/{chunk-IJPCV6DH.js → chunk-FYDQK6UX.js} +1 -1
  62. package/dist/web/server/{chunk-WHBVQJ4K.js → chunk-HF7DG7PC.js} +73 -73
  63. package/dist/web/server/{chunk-WYL2DW5R.js → chunk-JTCCQZLN.js} +2 -2
  64. package/dist/web/server/{chunk-UAPNEWCA.js → chunk-KP2PNDGL.js} +6 -6
  65. package/dist/web/server/{chunk-7SR6WDM2.js → chunk-MNBGB2SP.js} +2 -2
  66. package/dist/web/server/{chunk-HSJMLO36.js → chunk-MNPHMZU7.js} +3 -3
  67. package/dist/web/server/{chunk-JQDLJ7KI.js → chunk-NGCQJ33Y.js} +1134 -1134
  68. package/dist/web/server/{chunk-7SD2ZSEA.js → chunk-NIDBN7BQ.js} +1 -1
  69. package/dist/web/server/{chunk-ZJFA4F5X.js → chunk-NIZBFVJF.js} +2 -2
  70. package/dist/web/server/{chunk-PIOFZUOU.js → chunk-NJ4QEZHK.js} +3 -4
  71. package/dist/web/server/{chunk-WM4PUT6M.js → chunk-NNKJTKOQ.js} +234 -234
  72. package/dist/web/server/{chunk-N6NOTURM.js → chunk-NWDI3OWB.js} +4 -4
  73. package/dist/web/server/{chunk-KELEYPVK.js → chunk-O3HDELZ2.js} +74826 -74825
  74. package/dist/web/server/{chunk-YNUWKMNQ.js → chunk-PLYZ7P2Y.js} +1 -152
  75. package/dist/web/server/{chunk-LXJD6IGW.js → chunk-QFRCJWQQ.js} +7 -7
  76. package/dist/web/server/{chunk-NXJ32VFR.js → chunk-QIULBRTU.js} +13 -13
  77. package/dist/web/server/{chunk-DI7XRK2H.js → chunk-RIP3PBWT.js} +3 -3
  78. package/dist/web/server/{chunk-YKVGQBZA.js → chunk-S5LFXXDY.js} +625 -622
  79. package/dist/web/server/{chunk-XLNCWZMZ.js → chunk-UCUFC553.js} +3 -1
  80. package/dist/web/server/{chunk-KOUEJ3NU.js → chunk-UL2725KQ.js} +3 -3
  81. package/dist/web/server/{chunk-HFQTI7AX.js → chunk-VPKX7QRU.js} +3 -3
  82. package/dist/web/server/{chunk-LZ4Q5KUJ.js → chunk-WNCAL4HN.js} +133 -133
  83. package/dist/web/server/{chunk-C5X6G26O.js → chunk-XIB6XNUX.js} +436 -436
  84. package/dist/web/server/{chunk-EH4BZ6QM.js → chunk-YGYOBX7G.js} +2 -2
  85. package/dist/web/server/{chunk-BBBS5AS7.js → chunk-ZIFSJ3HQ.js} +626 -626
  86. package/dist/web/server/{fleet-message-queue-BS-cZ56r-GLZXUKDF.js → fleet-message-queue-D_w8lSeY-T3HB7HVQ.js} +5 -5
  87. package/dist/web/server/{fleet-pi-tool-renderer-umKunT3K-O4GBH35V.js → fleet-pi-tool-renderer-qwc-qZFq-4U556N5Q.js} +12 -12
  88. package/dist/web/server/{fleet-reasoning-panel-BxC2COxi-GPLMQSTT.js → fleet-reasoning-panel-DG_vuvv0-NCZWEEIT.js} +26 -26
  89. package/dist/web/server/{fleet-subagent-list-CpSYzCIq-JDH2LHSS.js → fleet-subagent-list-BGb0PjhF-2X67FMUV.js} +1 -1
  90. package/dist/web/server/{fleet-tool-timeline-IB36_PB2-XJENTO6I.js → fleet-tool-timeline-D6yM4ZMz-ZSFVRRRI.js} +1 -1
  91. package/dist/web/server/{fork-picker-dialog-DlINz9UQ-UWIXFDJX.js → fork-picker-dialog-Ds6Tgtu3-DIBWN7MV.js} +5 -5
  92. package/dist/web/server/{model-selector-list-jBTZc2Mu-OXJOS5NA.js → model-selector-list-DxeGZoD2-P6S6FSJH.js} +9 -9
  93. package/dist/web/server/{openui-renderer-Biyyjhjn-SJOEKPTJ.js → openui-renderer-MKFv6LlH-MDRSVFEY.js} +11 -11
  94. package/dist/web/server/{prompt-suggestions-D4AEEY7K-RZSP7PWV.js → prompt-suggestions-BOItmGnD-YQA7RHLG.js} +2 -2
  95. package/dist/web/server/{repl-panel-D5KsoJik-BQKO53JO.js → repl-panel-CuyF8wt5-CHDT2Q3N.js} +2 -2
  96. package/dist/web/server/{router-DWALoX_M-I5CBL7FQ.js → router-Dg72SESP-PCWKLFRG.js} +16 -16
  97. package/dist/web/server/{routes-BBVirYfL-5WXMOT7M.js → routes-BGrVtPYF-SURPAJN6.js} +6432 -6413
  98. package/dist/web/server/server.js +2 -2
  99. package/dist/web/server/{settings-dialog-DndPbM-v-RFNXXEAN.js → settings-dialog-CK0FJlTg-HZRBAXDZ.js} +1392 -1402
  100. package/dist/web/server/{subagent-chat-panel-C0RpnXav-J7VYO7QY.js → subagent-chat-panel-gzamnTgK-PQ2TLLJF.js} +21 -21
  101. package/dist/web/server/{subagents-panel-jDqIn9Nh-YEV6QLUY.js → subagents-panel-Berjd7HJ-EI5ZKC6V.js} +20 -20
  102. package/dist/web/server/{workspace-panel-CX_Vo6As-EWO6AMPI.js → workspace-panel-CBBa_3UO-B4PPFPMA.js} +45 -20
  103. package/package.json +1 -1
  104. package/dist/web/client/assets/action-swap-roll-BB8DFMuf.js +0 -1
  105. package/dist/web/client/assets/agent-activity-CwMDU7aP.js +0 -1
  106. package/dist/web/client/assets/agent-disclosure-B8SnhQXL.js +0 -1
  107. package/dist/web/client/assets/analytics-stub-Cas1He0w.js +0 -1
  108. package/dist/web/client/assets/button-BR2WWrFo.js +0 -1
  109. package/dist/web/client/assets/card-BKl76a3R.js +0 -1
  110. package/dist/web/client/assets/chat-Ci2cEQrR.js +0 -52
  111. package/dist/web/client/assets/command-_WjnervL.js +0 -1
  112. package/dist/web/client/assets/dialog-BEZuZhzk.js +0 -1
  113. package/dist/web/client/assets/fleet-reasoning-panel-CbkO7u-v.js +0 -1
  114. package/dist/web/client/assets/globals-B_I1Eq1u.css +0 -2
  115. package/dist/web/client/assets/horizontal-resize-CwoDojST.js +0 -1
  116. package/dist/web/client/assets/index-DJ1fFbQu.js +0 -12
  117. package/dist/web/client/assets/input-group-Tb5TYbzi.js +0 -1
  118. package/dist/web/client/assets/ipython-tool-ldJ9F1Cw.js +0 -3
  119. package/dist/web/client/assets/openui-renderer-Bf60nxNi.js +0 -378
  120. package/dist/web/client/assets/prompt-input-qPIXZ-Rb.js +0 -1
  121. package/dist/web/client/assets/provider-catalog-D8G66gwc.js +0 -1
  122. package/dist/web/client/assets/provider-label-DDLRnZyC.js +0 -1
  123. package/dist/web/client/assets/routes-DpgMJZ5n.js +0 -16
  124. package/dist/web/client/assets/settings-dialog-YJkvt5EB.js +0 -2
  125. package/dist/web/client/assets/surfaces-DI-U-_2a.js +0 -1
  126. package/dist/web/client/assets/virtualized-turn-list--Vynre4D.js +0 -6
  127. package/dist/web/client/assets/workspace-panel-CPPIznT9.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 32da53c: Fix clipped right-panel tabs, low-contrast chrome menus, header New chat, and hung workspace Markdown previews.
8
+ - ada7fde: Restore the source-checkout `fleet-prime.sh` launcher, replace an existing `fleet-agent` symlink instead of writing through it, and keep the web launcher running if an SSR stream times out.
9
+
3
10
  ## 0.6.0
4
11
 
5
12
  ### Minor Changes
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-Eg7xtNmV.js";import{d as i,i as a,r as o,u as s}from"./ease-u56MhKYS.js";import{n as c,t as l}from"./use-reduced-motion-eORd7fqW.js";import{t as u}from"./createLucideIcon-DwxZHm0M.js";var d=u(`copy`,[[`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`}]]),f=u(`file-code-corner`,[[`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`}]]),p=e(t(),1),m=n(),h={duration:.2,ease:`easeInOut`},g=s,_={duration:.14,ease:o},v=`blur(8px)`,y=`blur(3px)`,b=.025,x={initial:{opacity:0,y:`105%`,filter:y},animate:(e=0)=>({opacity:1,y:`0%`,filter:`blur(0px)`,transition:{...s,delay:e}}),exit:(e=0)=>({opacity:0,y:`-105%`,filter:y,transition:{duration:.16,ease:o,delay:e*.5}})},S={blur:{initial:{opacity:0,scale:.94,filter:v},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:h},exit:{opacity:0,scale:.94,filter:v,transition:h}},roll:{initial:{opacity:0,y:`90%`,filter:y},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:g},exit:{opacity:0,y:`-90%`,filter:y,transition:_}}};function C({value:e,children:t,animation:n=`blur`,className:o}){let s=l(),u=(0,p.useRef)(null),[d,f]=(0,p.useState)();(0,p.useLayoutEffect)(()=>{let e=u.current?.offsetWidth;e&&f(t=>t===e?t:e)});let h=typeof t==`string`?t:null,g=n===`cascade`&&h!==null&&!s,_=n===`cascade`?`roll`:n;return(0,m.jsxs)(`span`,{className:r(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,o),style:{width:d,transition:s?void 0:`width 220ms ${a}`},children:[(0,m.jsx)(`span`,{ref:u,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),g?(0,m.jsx)(`span`,{className:`sr-only`,children:h}):null,(0,m.jsx)(c,{initial:!1,children:g?(0,m.jsx)(i.span,{"aria-hidden":!0,initial:`initial`,animate:`animate`,exit:`exit`,className:`absolute left-0 top-0 inline-block whitespace-pre`,children:h.split(``).map((e,t)=>(0,m.jsx)(i.span,{custom:t*b,variants:x,className:`inline-block whitespace-pre`,children:e},t))},`cascade-${e}`):(0,m.jsx)(i.span,{variants:S[_],initial:!s&&`initial`,animate:s?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:s?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`${n}-${e}`)})]})}function w(e){return(0,m.jsx)(C,{...e,animation:`roll`})}export{f as n,d as r,w as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-Eg7xtNmV.js";import{d as i,o as a,r as o,u as s}from"./ease-u56MhKYS.js";import{n as c,t as l}from"./use-reduced-motion-eORd7fqW.js";import{t as u}from"./createLucideIcon-DwxZHm0M.js";import{t as d}from"./check-JjHKAZas.js";import{t as f}from"./chevron-down-BEVGmnSb.js";import{t as p}from"./earth-DGZXAN5r.js";import{t as m}from"./file-text-T-NcAlZs.js";import{t as h}from"./image-BbPmlw-n.js";import{t as g}from"./message-square-hbDao-A1.js";import{t as _}from"./search-eWVnAJsb.js";import{t as v}from"./sparkles-DuclzqlE.js";import{t as y}from"./square-terminal-BYTN_I86.js";import{t as b}from"./wrench-BJNNe07k.js";import{t as x}from"./agent-disclosure-DAMuuGcM.js";import{t as S}from"./safe-external-url-D3PJJIcM.js";var C=u(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),w=u(`pencil-line`,[[`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`}]]),T=`@keyframes beui-text-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.beui-text-shimmer{animation:none !important}}`,E=`beui-text-shimmer bg-[length:200%_100%] bg-clip-text text-transparent bg-[linear-gradient(110deg,var(--muted-foreground)_30%,var(--foreground)_50%,var(--muted-foreground)_70%)]`;function D(e){return{animation:`beui-text-shimmer ${e}s linear infinite`}}var O=n();function k({children:e,as:t=`span`,duration:n=2.5,className:i}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`style`,{children:T}),(0,O.jsx)(t,{style:D(n),className:r(`inline-block`,E,i),children:e})]})}function A({children:e=`Thinking…`,duration:t=1.8,className:n}){return(0,O.jsx)(k,{as:`span`,duration:t,className:r(`font-medium`,n),children:e})}var j=e(t(),1);function M({item:e}){let t=e.status??`complete`;return(0,O.jsxs)(`div`,{className:`flex min-h-7 items-start gap-2.5 rounded-md px-1.5 py-1`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 grid size-4 shrink-0 place-items-center text-muted-foreground/70`,children:t===`complete`?(0,O.jsx)(d,{className:`size-4`,strokeWidth:1.8}):t===`active`?(0,O.jsxs)(`span`,{className:`relative grid size-3 place-items-center`,children:[(0,O.jsx)(i.span,{className:`absolute inset-0 rounded-full bg-foreground/10`,animate:{opacity:[.35,.8,.35]},transition:{duration:1.5,repeat:1/0}}),(0,O.jsx)(`span`,{className:`size-1.5 rounded-full bg-foreground/60`})]}):(0,O.jsx)(C,{className:`size-3`,strokeWidth:1.5})}),(0,O.jsx)(`span`,{className:r(`min-w-0 flex-1 leading-5`,t===`pending`?`text-muted-foreground/55`:`text-foreground/90`),children:e.label}),e.meta?(0,O.jsx)(`span`,{className:`shrink-0 leading-5 text-muted-foreground/55`,children:e.meta}):null]})}function N({item:e}){return(0,O.jsx)(`div`,{className:`rounded-md px-1.5 py-1 leading-5 text-muted-foreground`,children:e.content})}function P({result:e}){let t=e.url&&S(e.url)?e.url:void 0,n=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-5 shrink-0 place-items-center text-muted-foreground`,children:e.icon??(0,O.jsx)(p,{className:`size-3`,strokeWidth:2})}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:e.title}),e.domain?(0,O.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground/55`,children:e.domain}):null]}),i=r(`flex min-h-7 items-center gap-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors`,t&&`focus-visible:ring-2 focus-visible:ring-ring`);return t?(0,O.jsx)(`a`,{href:t,className:i,children:n}):(0,O.jsx)(`div`,{className:i,children:n})}function F({item:e}){let t=l()??!1,n=t?{opacity:1}:{opacity:0,y:6},r={opacity:1,y:0},s=t?{opacity:0}:{opacity:0,y:-3},u=t?{duration:0}:{opacity:{duration:.18,ease:o},y:a,layout:a};return(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,O.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2.5 rounded-md px-1.5 py-1 text-muted-foreground`,children:[(0,O.jsx)(_,{"aria-hidden":`true`,className:`size-4 shrink-0`,strokeWidth:1.7}),(0,O.jsx)(`span`,{className:`min-w-0 truncate`,children:e.query})]}),e.results?.length?(0,O.jsx)(`div`,{className:`space-y-0.5 pl-4`,children:(0,O.jsx)(c,{initial:!0,mode:`popLayout`,children:e.results.map(e=>(0,O.jsx)(i.div,{layout:`position`,initial:n,animate:r,exit:s,transition:u,children:(0,O.jsx)(P,{result:e})},e.id))})}):null,(0,O.jsx)(c,{initial:!0,children:e.moreCount?(0,O.jsxs)(i.div,{initial:n,animate:r,exit:s,transition:u,className:`px-1.5 py-1 pl-8 text-muted-foreground/55`,children:[`+`,e.moreCount,` more`]},`more-results`):null})]})}function I({action:e}){return e===`read`?(0,O.jsx)(m,{className:`size-4`}):e===`edit`||e===`write`?(0,O.jsx)(w,{className:`size-4`}):e===`run`?(0,O.jsx)(y,{className:`size-4`}):(0,O.jsx)(b,{className:`size-4`})}function L({action:e}){return(0,O.jsx)(`button`,{type:`button`,"aria-label":e.ariaLabel??e.label,onClick:e.onClick,className:`shrink-0 rounded-md px-1.5 py-1 text-[0.625rem] font-medium text-primary outline-none hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring`,children:e.label})}function R({item:e}){let t=e.action.charAt(0).toUpperCase()+e.action.slice(1),n=typeof e.additions==`number`||typeof e.deletions==`number`;return(0,O.jsxs)(`div`,{className:`grid min-h-8 min-w-0 grid-cols-[1rem_auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-md px-1.5 py-0.5 leading-5`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground/70`,children:(0,O.jsx)(I,{action:e.action})}),(0,O.jsx)(`span`,{className:`shrink-0 font-medium text-foreground/90`,children:t}),(0,O.jsx)(`span`,{className:`min-w-0 flex-1 truncate rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-xs text-muted-foreground/70`,children:e.target}),n||e.openAction?(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n?(0,O.jsxs)(`span`,{className:`flex items-center gap-2 font-mono tabular-nums`,children:[typeof e.additions==`number`?(0,O.jsxs)(`span`,{className:`text-emerald-500`,children:[`+`,e.additions]}):null,typeof e.deletions==`number`?(0,O.jsxs)(`span`,{className:`text-rose-500`,children:[`−`,e.deletions]}):null]}):null,e.openAction?(0,O.jsx)(L,{action:e.openAction}):null]}):null]})}function z({kind:e}){return e===`thinking`?(0,O.jsx)(v,{className:`size-4`}):e===`message`?(0,O.jsx)(g,{className:`size-4`}):e===`write`?(0,O.jsx)(w,{className:`size-4`}):e===`run`?(0,O.jsx)(y,{className:`size-4`}):e===`read`?(0,O.jsx)(h,{className:`size-4`}):(0,O.jsx)(b,{className:`size-4`})}function B({item:e}){let t=e.kind===`thinking`;return(0,O.jsxs)(`div`,{className:r(`grid min-h-8 grid-cols-[1rem_auto_minmax(0,1fr)_auto] gap-2.5 rounded-md px-1.5 py-0.5`,t?`items-start`:`items-center`),children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 place-items-center text-muted-foreground/70`,children:e.icon??(0,O.jsx)(z,{kind:e.kind})}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:e.label}),e.detail?(0,O.jsx)(`span`,{className:r(`min-w-0 rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-xs text-muted-foreground/70`,t?`max-h-40 overflow-y-auto whitespace-pre-wrap break-words`:`truncate`),children:e.detail}):(0,O.jsx)(`span`,{}),e.action?(0,O.jsx)(L,{action:e.action}):null]})}function V({item:e}){return e.type===`text`?(0,O.jsx)(N,{item:e}):e.type===`search`?(0,O.jsx)(F,{item:e}):e.type===`tool`?(0,O.jsx)(R,{item:e}):e.type===`trace`?(0,O.jsx)(B,{item:e}):(0,O.jsx)(M,{item:e})}function H(e){let t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function U({open:e,defaultOpen:t,onOpenChange:n}){let[r,i]=(0,j.useState)(t),a=e!==void 0;return[e??r,(0,j.useCallback)(e=>{a||i(e),n?.(e)},[a,n])]}function W(e){let t=e[0]?.type;return t&&e.every(e=>e.type===t)?t:`mixed`}function G(e){return e===`search`?`Searching the web…`:e===`tool`?`Running tools…`:e===`trace`?`Working through the run…`:e===`mixed`?`Working through it…`:`Thinking…`}function K(e,t,n){if(e===`step`||e===`text`)return(0,O.jsxs)(O.Fragment,{children:[`Thought for `,(0,O.jsx)(`span`,{className:`tabular-nums`,children:H(n)})]});if(e===`search`)return`Searched the web`;if(e===`tool`)return`Ran ${t.length} ${t.length===1?`tool`:`tools`}`;if(e===`trace`){let e=t.filter(e=>e.type===`trace`&&(e.kind===`thinking`||e.kind===`message`)).length,n=t.length-e;return`${n} ${n===1?`tool call`:`tool calls`}, ${e} ${e===1?`message`:`messages`}`}return`Completed ${t.length} ${t.length===1?`step`:`steps`}`}function q({items:e,contentType:t,status:n=`working`,duration:u=0,open:d,defaultOpen:p=!1,onOpenChange:m,collapseOnComplete:h=!0,activeLabel:g,summary:_,renderWorkingStatus:v,renderCompletedStatus:y,maxHeight:b=208,className:S,contentClassName:C}){let w=l()??!1,T=(0,j.useId)(),E=`${T}-trigger`,D=`${T}-content`,k=(0,j.useRef)(null),M=(0,j.useRef)(null),N=(0,j.useRef)(n),[P,F]=(0,j.useState)(0),[I,L]=U({open:d,defaultOpen:p,onOpenChange:m}),R=n===`working`,z=R||I,B=e.length?W(e):t??`mixed`,H=R?Math.max(0,b):Math.min(P,Math.max(0,b)),q=P>b,J=R?Math.min(0,H-P):0;(0,j.useLayoutEffect)(()=>{let e=k.current;if(!e)return;let t=()=>F(e.offsetHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,j.useEffect)(()=>{N.current===`working`&&n===`complete`&&L(!h),N.current=n},[h,L,n]);let Y=()=>{let e=!I;L(e),e&&requestAnimationFrame(()=>M.current?.scrollTo({top:0}))},X=g??G(B),Z=_??K(B,e,u),Q=q?R?`linear-gradient(to bottom, transparent, black 12px)`:`linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)`:void 0;return(0,O.jsxs)(`div`,{"data-state":R?`working`:z?`open`:`closed`,"data-content":B,"aria-busy":R,className:r(`w-full text-sm`,S),children:[R?(0,O.jsx)(`div`,{id:E,role:`status`,className:`flex h-7 min-w-0 items-center text-muted-foreground`,children:v?v({label:X,duration:u}):(0,O.jsx)(A,{children:X})}):(0,O.jsxs)(`button`,{id:E,type:`button`,"aria-expanded":z,"aria-controls":D,onClick:Y,className:`group flex h-7 min-w-0 items-center gap-1.5 rounded-md text-left font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,O.jsx)(`span`,{className:`truncate`,children:y?y({summary:Z,duration:u}):Z}),(0,O.jsx)(i.span,{"aria-hidden":`true`,animate:{rotate:z?180:0},transition:w?{duration:0}:s,className:`inline-flex shrink-0 text-muted-foreground/70 group-hover:text-foreground`,children:(0,O.jsx)(f,{className:`size-3.5`})})]}),(0,O.jsx)(x,{id:D,role:`region`,"aria-labelledby":E,open:z,openHeight:H,children:(0,O.jsx)(`div`,{ref:M,className:r(`scrollbar-hide pr-1`,q&&z&&!R?`overflow-y-auto`:`overflow-y-hidden`),style:{height:H,maskImage:Q,WebkitMaskImage:Q},children:(0,O.jsx)(i.div,{ref:k,role:`list`,initial:!1,animate:{y:J},transition:w?{duration:0}:a,className:r(`space-y-0.5 py-2`,C),children:(0,O.jsx)(c,{mode:`popLayout`,children:e.map(e=>(0,O.jsx)(i.div,{layout:`position`,role:`listitem`,initial:w?{opacity:1}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:w?{opacity:0}:{opacity:0,y:-3},transition:w?{duration:0}:{opacity:{duration:.18,ease:o},y:a,layout:a},children:(0,O.jsx)(V,{item:e})},e.id))})})})})]})}export{q as AgentActivity};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-Eg7xtNmV.js";import{d as n,r}from"./ease-u56MhKYS.js";import{t as i}from"./use-reduced-motion-eORd7fqW.js";var a=e();function o({open:e,openHeight:o=`auto`,className:s,style:c,transition:l,...u}){let d=i()??!1;return(0,a.jsx)(n.div,{...u,"aria-hidden":!e,inert:!e,initial:!1,animate:d?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:l??{duration:d?0:e?.22:.14,ease:r},className:t(`overflow-hidden`,s),style:{...c,height:e?o:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}export{o as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,d as i,i as a,l as o,n as s}from"./layout-gyLzPvVv.js";var c=e(t(),1),l=c.createContext(null);function u(e){return c.useContext(l)}function d(e){let t=u();return c.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var f=n();function p({children:e,features:t,strict:n=!1}){let[,r]=(0,c.useState)(!m(t)),a=(0,c.useRef)(void 0);if(!m(t)){let{renderer:e,...n}=t;a.current=e,o(n)}return(0,c.useEffect)(()=>{m(t)&&t().then(({renderer:e,...t})=>{o(t),a.current=e,r(!0)})},[]),(0,f.jsx)(i.Provider,{value:{renderer:a.current,strict:n},children:e})}function m(e){return typeof e==`function`}var h={renderer:r,...a,...s},g=c.createContext(void 0),_=e=>{let t=c.useContext(g);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},v=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,f.jsx)(g.Provider,{value:e,children:t})),y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b=new class{#e=y;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function x(e){setTimeout(e,0)}var S=typeof window>`u`||`Deno`in globalThis;function C(){}function ee(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E(e,t){return typeof e==`function`?e(t):e}function te(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==D(o,t.options))return!1}else if(!k(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ne(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(O(t.options.mutationKey)!==O(a))return!1}else if(!k(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function D(e,t){return(t?.queryKeyHashFn||O)(e)}function O(e){return JSON.stringify(e,(e,t)=>M(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function k(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!k(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!k(e[r],t[r]))return!1;return!0}return!1}var re=Object.prototype.hasOwnProperty;function A(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=j(e)&&j(t);if(!r&&!(M(e)&&M(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:re.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=A(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ie(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function j(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function M(e){if(!N(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!N(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function N(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{b.setTimeout(t,e)})}function P(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:A(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function F(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var I=Symbol();function L(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===I?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function se(e,t){return typeof e==`function`?e(...t):!!e}function ce(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var le=()=>S,R=()=>le(),z=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},B=new class extends z{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ue=x;function de(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ue,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var V=de(),H=new class extends z{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function U(e){return Math.min(1e3*2**e,3e4)}function W(e){return(e??`online`)!==`online`||H.isOnline()}var G=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function K(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(C);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new G(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>B.isFocused()&&(e.networkMode===`always`||H.isOnline())&&e.canRun(),p=()=>W(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(R()?0:3),a=e.retryDelay??U,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ae(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var q=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&(this.#e=b.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(R()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(b.clearTimeout(this.#e),this.#e=void 0)}};function fe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ce(e,()=>t.signal,()=>n=!0)},u=L(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?F:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?pe:J,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:J(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function J(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var me=class extends q{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Z(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Z(this.options);e.data!==void 0&&(this.setState(X(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=P(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(C).catch(C):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===I||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>E(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!T(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=L(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?fe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=K({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof G&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof G){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Y(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...X(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),V.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Y(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:W(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function X(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Z(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var he=class extends q{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Q(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=K({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),V.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Q(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}function $(e){if(typeof window>`u`||typeof PerformanceObserver>`u`)return()=>{};let t=window.location.pathname,n=[],r,i=!1,a=!1;try{let o=new PerformanceObserver(e=>{if(i)return;let t=e.getEntries(),n=t[t.length-1];n&&(r=n.startTime)});o.observe({type:`largest-contentful-paint`,buffered:!0}),n.push(o);let s=0,c=0,l=0,u=0,d=!1,f=e=>{for(let t of e){let e=t;if(!e.hadRecentInput){let n=e.value??0;d&&t.startTime-u<1e3&&t.startTime-l<5e3?c+=n:(c=n,l=t.startTime),d=!0,u=t.startTime,s=Math.max(s,c)}}},p=new PerformanceObserver(e=>f(e.getEntries()));p.observe({type:`layout-shift`,buffered:!0}),n.push(p);let m=new Map,h=e=>{for(let t of e){let e=t;e.interactionId&&m.set(e.interactionId,Math.max(m.get(e.interactionId)??0,e.duration??0))}},g=()=>{if(m.size===0)return;let e=[...m.values()].sort((e,t)=>e-t),t=performance.interactionCount,n=typeof t==`number`&&Number.isFinite(t)?Math.max(t,e.length):e.length,r=Math.floor(n/50);return e[Math.max(0,e.length-r-1)]},_=new PerformanceObserver(e=>h(e.getEntries()));_.observe({type:`event`,buffered:!0,durationThreshold:40}),n.push(_);let v=()=>{if(i)return;let n=o.takeRecords(),a=n[n.length-1];a&&(r=a.startTime),i=!0,r!==void 0&&e({name:`LCP`,value:r,url:t})},y=()=>{if(a)return;v(),f(p.takeRecords()),h(_.takeRecords()),a=!0,d&&e({name:`CLS`,value:s,url:t});let n=g();n!==void 0&&e({name:`INP`,value:n,url:t})},b=()=>v(),x=()=>{document.visibilityState===`hidden`&&y()},S=[`pointerdown`,`keydown`,`touchstart`];for(let e of S)window.addEventListener(e,b,{capture:!0});return document.addEventListener(`visibilitychange`,x),window.addEventListener(`pagehide`,y),()=>{y();for(let e of S)window.removeEventListener(e,b,{capture:!0});document.removeEventListener(`visibilitychange`,x),window.removeEventListener(`pagehide`,y);for(let e of n)e.disconnect()}}catch{}return()=>{for(let e of n)e.disconnect()}}function ge(){if(typeof window>`u`||window.__fleetVitalsInit)return;window.__fleetVitalsInit=!0;let e=e=>{try{let t=JSON.stringify(e);navigator.sendBeacon&&navigator.sendBeacon(`/api/analytics/vitals`,t)}catch{}},t=$(e);window.addEventListener(`pageshow`,n=>{n.persisted&&(t(),t=$(e))})}function _e(e){}function ve(){}function ye(e){}function be(e){}export{b as A,k as C,se as D,ie as E,d as F,u as I,l as L,_ as M,h as N,I as O,p as P,C as S,E as T,D as _,ve as a,ne as b,me as c,V as d,B as f,O as g,ee as h,ge as i,v as j,T as k,Y as l,R as m,be as n,he as o,z as p,_e as r,Q as s,ye as t,H as u,S as v,P as w,te as x,w as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-BR2WWrFo.js";import{t as i}from"./createLucideIcon-DwxZHm0M.js";import{i as a,n as o,r as s,t as c}from"./tool-result-DfnPN0FQ.js";import{t as l}from"./chevron-right-DrJxToLs.js";import{t as u}from"./package-CdcJFPf2.js";import{r as d,t as f}from"./openui-renderer-Bf60nxNi.js";import{n as p,r as m,t as h}from"./collapsible-BoXtZZWN.js";import{n as g}from"./prime-agent-artifacts-C-g1VPiW.js";import{J as _}from"./chat-Ci2cEQrR.js";import{t as v}from"./artifacts-utils-N_kUFbz2.js";var y=i(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),b=e(t(),1),x=n(),S=[];function C(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function w(e){return e===`running`?`running`:e===`error`?`error`:e===`cancelled`?`cancelled`:`success`}function T(e){return e===`running`?`streaming`:e===`error`?`error`:e===`cancelled`?`cancelled`:`complete`}function E(e){let t=typeof e==`object`&&e?e:void 0;if(!t)return e===void 0?[]:[{label:`result`,text:C(e)}];let n=[];for(let e of[`stdout`,`stderr`,`result`,`error`])t[e]!==void 0&&t[e]!==``&&n.push({label:e,text:C(t[e])});let r=t.details??t.output??t.result;if(n.length===0&&r!==e&&n.push(...E(r)),n.length===0&&Array.isArray(t.content)){let e=t.content.flatMap(e=>typeof e==`string`?[e]:typeof e==`object`&&e&&`text`in e&&typeof e.text==`string`?[e.text]:[]).join(``);e&&n.push({label:t.isError===!0?`error`:`stdout`,text:e})}return n.length>0?n:[{label:`result`,text:C(e)}]}function D(e){let t=typeof e.input==`object`&&e.input!==null?e.input:void 0,n=t?.command??t?.code??t?.script;if(!(typeof n!=`string`||!n))return e.kind===`bash`?{code:n,language:`bash`,label:`Bash`}:e.kind===`ipython`?{code:n,language:/^\s*%%bash(?:\s|$)/im.test(n)?`bash`:`python`,label:`IPython`}:e.kind===`diff`?{code:n,language:`text`,label:`Text`}:{code:n,language:`json`,label:`JSON`}}function O(e){if(e.kind!==`openui-html`)return;let t=typeof e.output==`object`&&e.output!==null?e.output:void 0;if(typeof t?.title==`string`&&typeof t.document==`string`)return{title:t.title,document:t.document}}function k({artifact:e,selected:t}){let n=(0,b.useRef)(null);(0,b.useEffect)(()=>{t&&requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})})},[t]);let r=O(e);return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`min-w-0 rounded-md border border-border/60 bg-background p-2.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,title:e.title,children:e.title||`OpenUI artifact`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:e.status})]}),r?(0,x.jsx)(d,{artifact:r}):(0,x.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-xs text-destructive`,children:[(0,x.jsx)(`p`,{children:`OpenUI artifact data is unavailable.`}),(0,x.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-foreground/5 p-2 text-foreground/70`,children:C(e.output)})]})]})}function A({artifact:e,selected:t}){let n=(0,b.useRef)(null),r=t||e.status===`running`,[i,l]=(0,b.useState)(r);(0,b.useEffect)(()=>{t&&(l(!0),requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})}))},[t]);let u=D(e),d=E(e.output),f=e.kind===`diff`||e.kind===`refinement`?g(e):void 0;return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`rounded-md border border-border/60 bg-background px-2.5 py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[f?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{file:f.file,lines:f.lines,status:T(e.status),defaultOpen:r,copyText:f.copyText,maxHeight:240}),d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,f?null:(0,x.jsx)(c,{tool:e.kind,title:e.title,status:w(e.status),open:i,onOpenChange:l,defaultOpen:r,kind:e.kind===`bash`||e.kind===`ipython`?`terminal`:`custom`,children:(0,x.jsxs)(`div`,{className:`space-y-3`,children:[u?(0,x.jsx)(a,{code:u.code,language:u.language,languageLabel:u.label,showStatus:!1,showLineNumbers:!1,wrap:!0}):null,d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]})})]})}function j({block:e,expanded:t,isStreaming:n,onOpenUIAction:i,onToggle:a}){return(0,x.jsxs)(h,{open:t,onOpenChange:a,children:[(0,x.jsxs)(m,{render:(0,x.jsx)(r,{variant:`ghost`,size:`sm`,className:`group w-full justify-start gap-1.5 text-left text-label font-normal text-foreground/65 transition-none hover:bg-foreground/5 hover:text-foreground/80`}),children:[(0,x.jsx)(l,{className:`size-3 shrink-0 text-foreground/35 transition-transform group-data-panel-open:rotate-90`}),(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.component,children:e.component}),(0,x.jsxs)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:[`#`,e.ordinal]})]}),(0,x.jsx)(p,{children:(0,x.jsx)(`div`,{className:`mb-1 mt-0.5 flex min-w-0 flex-col overflow-hidden rounded-md border border-border/60 bg-background px-2.5 py-2`,children:(0,x.jsx)(_,{resetKeys:[e.content],children:(0,x.jsx)(f,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:i})})})})]})}function M({messages:e,onOpenUIAction:t,status:n,artifactRuns:r=S,selectedArtifactId:i}){let a=(0,b.useMemo)(()=>v(e),[e]),[o,s]=(0,b.useState)(null),c=n===`streaming`?a.at(-1)?.blockId:void 0,l=(0,b.useMemo)(()=>r.flatMap(e=>e.artifacts),[r]),d=(0,b.useMemo)(()=>l.filter(e=>e.kind===`openui-html`),[l]),f=(0,b.useMemo)(()=>l.filter(e=>e.kind!==`openui-html`&&e.kind!==`ipython`),[l]);return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2 overflow-hidden`,children:[d.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`OpenUI artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:d.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:d.map(e=>(0,x.jsx)(k,{artifact:e,selected:e.id===i},e.id))})]}):null,f.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(u,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Technical artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:f.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:f.map(e=>(0,x.jsx)(A,{artifact:e,selected:e.id===i},e.id))})]}):null,(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Generative UI`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:a.length>0?`${a.length}`:`none yet`})]}),a.length===0?(0,x.jsx)(`p`,{className:`px-2 pb-1 text-[0.6875rem] leading-4 text-foreground/40`,children:`OpenUI interfaces the agent generates in this session appear here, and can be re-opened without scrolling the conversation.`}):(0,x.jsx)(`div`,{className:`flex min-h-0 flex-col gap-0.5 overflow-y-auto`,children:a.map(e=>(0,x.jsx)(j,{block:e,expanded:e.blockId===o,isStreaming:e.blockId===c,onOpenUIAction:t,onToggle:()=>s(t=>t===e.blockId?null:e.blockId)},e.blockId))})]})]})}export{M as ArtifactsPanelContent};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-C5wFDY5_.js";import{t as i}from"./createLucideIcon-DwxZHm0M.js";import{i as a,n as o,r as s,t as c}from"./tool-result-Cki8WUNc.js";import{t as l}from"./chevron-right-DrJxToLs.js";import{t as u}from"./package-CdcJFPf2.js";import{r as d,t as f}from"./openui-renderer-TLNe5e_Q.js";import{n as p,r as m,t as h}from"./collapsible-BoXtZZWN.js";import{n as g}from"./prime-agent-artifacts-C-g1VPiW.js";import{v as _}from"./chat-BhYseKd6.js";import{t as v}from"./artifacts-utils-N_kUFbz2.js";var y=i(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),b=e(t(),1),x=n(),S=[];function C(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function w(e){return e===`running`?`running`:e===`error`?`error`:e===`cancelled`?`cancelled`:`success`}function T(e){return e===`running`?`streaming`:e===`error`?`error`:e===`cancelled`?`cancelled`:`complete`}function E(e){let t=typeof e==`object`&&e?e:void 0;if(!t)return e===void 0?[]:[{label:`result`,text:C(e)}];let n=[];for(let e of[`stdout`,`stderr`,`result`,`error`])t[e]!==void 0&&t[e]!==``&&n.push({label:e,text:C(t[e])});let r=t.details??t.output??t.result;if(n.length===0&&r!==e&&n.push(...E(r)),n.length===0&&Array.isArray(t.content)){let e=t.content.flatMap(e=>typeof e==`string`?[e]:typeof e==`object`&&e&&`text`in e&&typeof e.text==`string`?[e.text]:[]).join(``);e&&n.push({label:t.isError===!0?`error`:`stdout`,text:e})}return n.length>0?n:[{label:`result`,text:C(e)}]}function D(e){let t=typeof e.input==`object`&&e.input!==null?e.input:void 0,n=t?.command??t?.code??t?.script;if(!(typeof n!=`string`||!n))return e.kind===`bash`?{code:n,language:`bash`,label:`Bash`}:e.kind===`ipython`?{code:n,language:/^\s*%%bash(?:\s|$)/im.test(n)?`bash`:`python`,label:`IPython`}:e.kind===`diff`?{code:n,language:`text`,label:`Text`}:{code:n,language:`json`,label:`JSON`}}function O(e){if(e.kind!==`openui-html`)return;let t=typeof e.output==`object`&&e.output!==null?e.output:void 0;if(typeof t?.title==`string`&&typeof t.document==`string`)return{title:t.title,document:t.document}}function k({artifact:e,selected:t}){let n=(0,b.useRef)(null);(0,b.useEffect)(()=>{t&&requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})})},[t]);let r=O(e);return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`min-w-0 rounded-md border border-border/60 bg-background p-2.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,title:e.title,children:e.title||`OpenUI artifact`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:e.status})]}),r?(0,x.jsx)(d,{artifact:r}):(0,x.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-xs text-destructive`,children:[(0,x.jsx)(`p`,{children:`OpenUI artifact data is unavailable.`}),(0,x.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-foreground/5 p-2 text-foreground/70`,children:C(e.output)})]})]})}function A({artifact:e,selected:t}){let n=(0,b.useRef)(null),r=t||e.status===`running`,[i,l]=(0,b.useState)(r);(0,b.useEffect)(()=>{t&&(l(!0),requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})}))},[t]);let u=D(e),d=E(e.output),f=e.kind===`diff`||e.kind===`refinement`?g(e):void 0;return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`rounded-md border border-border/60 bg-background px-2.5 py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[f?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{file:f.file,lines:f.lines,status:T(e.status),defaultOpen:r,copyText:f.copyText,maxHeight:240}),d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,f?null:(0,x.jsx)(c,{tool:e.kind,title:e.title,status:w(e.status),open:i,onOpenChange:l,defaultOpen:r,kind:e.kind===`bash`||e.kind===`ipython`?`terminal`:`custom`,children:(0,x.jsxs)(`div`,{className:`space-y-3`,children:[u?(0,x.jsx)(a,{code:u.code,language:u.language,languageLabel:u.label,showStatus:!1,showLineNumbers:!1,wrap:!0}):null,d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]})})]})}function j({block:e,expanded:t,isStreaming:n,onOpenUIAction:i,onToggle:a}){return(0,x.jsxs)(h,{open:t,onOpenChange:a,children:[(0,x.jsxs)(m,{render:(0,x.jsx)(r,{variant:`ghost`,size:`sm`,className:`group w-full justify-start gap-1.5 text-left text-label font-normal text-foreground/65 transition-none hover:bg-foreground/5 hover:text-foreground/80`}),children:[(0,x.jsx)(l,{className:`size-3 shrink-0 text-foreground/35 transition-transform group-data-panel-open:rotate-90`}),(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.component,children:e.component}),(0,x.jsxs)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:[`#`,e.ordinal]})]}),(0,x.jsx)(p,{children:(0,x.jsx)(`div`,{className:`mb-1 mt-0.5 flex min-w-0 flex-col overflow-hidden rounded-md border border-border/60 bg-background px-2.5 py-2`,children:(0,x.jsx)(_,{resetKeys:[e.content],children:(0,x.jsx)(f,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:i})})})})]})}function M({messages:e,onOpenUIAction:t,status:n,artifactRuns:r=S,selectedArtifactId:i}){let a=(0,b.useMemo)(()=>v(e),[e]),[o,s]=(0,b.useState)(null),c=n===`streaming`?a.at(-1)?.blockId:void 0,l=(0,b.useMemo)(()=>r.flatMap(e=>e.artifacts),[r]),d=(0,b.useMemo)(()=>l.filter(e=>e.kind===`openui-html`),[l]),f=(0,b.useMemo)(()=>l.filter(e=>e.kind!==`openui-html`&&e.kind!==`ipython`),[l]);return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2 overflow-hidden`,children:[d.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`OpenUI artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:d.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:d.map(e=>(0,x.jsx)(k,{artifact:e,selected:e.id===i},e.id))})]}):null,f.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(u,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Technical artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:f.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:f.map(e=>(0,x.jsx)(A,{artifact:e,selected:e.id===i},e.id))})]}):null,(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Generative UI`}),(0,x.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:a.length>0?`${a.length}`:`none yet`})]}),a.length===0?(0,x.jsx)(`p`,{className:`px-2 pb-1 text-[0.6875rem] leading-4 text-foreground/40`,children:`OpenUI interfaces the agent generates in this session appear here, and can be re-opened without scrolling the conversation.`}):(0,x.jsx)(`div`,{className:`flex min-h-0 flex-col gap-0.5 overflow-y-auto`,children:a.map(e=>(0,x.jsx)(j,{block:e,expanded:e.blockId===o,isStreaming:e.blockId===c,onOpenUIAction:t,onToggle:()=>s(t=>t===e.blockId?null:e.blockId)},e.blockId))})]})]})}export{M as ArtifactsPanelContent};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{i as n,r}from"./bundle-mjs-DKHVkVWu.js";import{t as i}from"./react-dom-Bwxum3ti.js";import{t as a}from"./jsx-runtime-NZYk81nU.js";import{t as o}from"./utils-Eg7xtNmV.js";import{F as s,G as c,J as l,K as u,O as d,P as f,S as p,X as m,at as h,ct as g,et as _,it as v,rt as y,st as b,t as ee,tt as x,v as S,z as C}from"./createBaseUIEventDetails-DV0dQrBX.js";var te=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),w=t(((e,t)=>{t.exports=te()})),ne=t((e=>{var t=n(),r=w();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),re=t(((e,t)=>{t.exports=ne()})),T=w(),ie=e(re(),1),E=e(n(),1),D=[],O=void 0;function ae(){return O}function oe(e){D.push(e)}function se(e){let t=(t,n)=>{let r=v(le).current,i;try{O=r;for(let e of D)e.before(r);i=e(t,n);for(let e of D)e.after(r);r.didInitialize=!0}finally{O=void 0}return i};return t.displayName=e.displayName||e.name,t}function ce(e){return E.forwardRef(se(e))}function le(){return{didInitialize:!1}}var ue=x(19)?fe:pe;function k(e,t,n,r,i){return ue(e,t,n,r,i)}function de(e,t,n,r,i){let a=E.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,T.useSyncExternalStore)(e.subscribe,a,a)}oe({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,T.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function fe(e,t,n,r,i){let a=ae();if(!a)return de(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function pe(e,t,n,r,i){return(0,ie.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var me=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return k(this,e,t,n,r)}},he=class extends me{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){E.useDebugValue(e);let n=this;y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);y(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){E.useDebugValue(e);let n=this,r=t!==void 0;y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return E.useDebugValue(e),k(this,this.selectors[e],t,n,r)}useContextCallback(e,t){E.useDebugValue(e);let n=_(t??g);this.context[e]=n}useStateSetter(e){let t=E.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},A=e(i(),1);function j(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var M=a();function N(e){return e?.ownerDocument||document}var P=0,F=class e{static create(){return new e}currentId=P;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=P,t()},e)}isStarted(){return this.currentId!==P}clear=()=>{this.currentId!==P&&(clearTimeout(this.currentId),this.currentId=P)};disposeEffect=()=>this.clear};function ge(){let e=v(F.create).current;return h(e.disposeEffect),e}function _e(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ve,platform:ye,maxTouchPoints:be}=_e(),I=ve.toLowerCase(),L=ye.toLowerCase(),R=/^i(os$|p)/.test(L)||L===`macintel`&&be>1,xe=`android`,Se=L===xe||I.includes(xe),Ce=!R&&L.startsWith(`mac`);L.startsWith(`win`),!Se&&/^(linux|chrome os)/.test(L);var we=Ce||R,z=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!z&&I.includes(`firefox`),!z&&I.includes(`chrom`);var Te=we,Ee=/jsdom|happydom/.test(I),De=`data-base-ui-focusable`,Oe=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ke=`ArrowLeft`,Ae=`ArrowRight`,je=`ArrowUp`,Me=`ArrowDown`;function Ne(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function B(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Pe(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Fe(e,t){if(!c(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(B(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ie(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Le(e){return e.matches(`html,body`)}function V(e){return u(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Re(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Oe}`)!=null}function ze(e){return e?e.getAttribute(`role`)===`combobox`&&V(e):!1}function Be(e){if(!e||Ee)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ve(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function He(e,t){return t<0||t>=e.length}function Ue(e,t){return H(e.current,{disabledIndices:t})}function We(e,t){return H(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function H(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&U(e,a,r));return a}function U(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!W(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ge(e){return e.visibility===`hidden`||e.visibility===`collapse`}function W(e,t=e?s(e):null){return!e||!e.isConnected||!t||Ge(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ke=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function qe(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return m(n)?n.host:null}function G(e){for(let t of Array.from(e.children))if(C(t)===`summary`)return t;return null}function Je(e,t){let n=G(t);return!!n&&(e===n||B(n,e))}function K(e){let t=e?C(e):``;return e!=null&&e.matches(Ke)&&(t!==`summary`||e.parentElement!=null&&C(e.parentElement)===`details`&&G(e.parentElement)===e)&&(t!==`details`||G(e)==null)&&(t!==`input`||e.type!==`hidden`)}function q(e){if(!K(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=qe(t)){let n=t!==e,r=C(t)===`slot`;if(t.hasAttribute(`inert`)||n&&C(t)===`details`&&!t.open&&!Je(e,t)||t.hasAttribute(`hidden`)||!r&&!Ye(t,n))return!1}return!0}function Ye(e,t){let n=s(e);return t?n.display!==`none`:W(e,n)}function J(e){let t=e.tabIndex;if(t<0){let t=C(e);if(t===`details`||t===`audio`||t===`video`||u(e)&&e.isContentEditable)return 0}return t}function Y(e){if(C(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Xe(e,t){let n=Y(e);if(!n)return!0;let r=t.find(e=>{let t=Y(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Y(e);return t?.name===n.name&&t.form===n.form})===n}function Ze(e){if(u(e)&&C(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return u(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Qe(e,t){Ze(e).forEach(e=>{K(e)&&t.push(e),Qe(e,t)})}function $e(e,t,n){Ze(e).forEach(e=>{u(e)&&e.matches(t)&&n.push(e),$e(e,t,n)})}function et(e){return q(e)&&J(e)>=0}function tt(e){let t=[];return Qe(e,t),t.filter(q)}function X(e){let t=tt(e);return t.filter(e=>J(e)>=0&&Xe(e,t))}function nt(e,t){let n=X(e),r=n.length;if(r===0)return;let i=Ne(N(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function rt(e){return nt(N(e).body,1)||e}function it(e){return nt(N(e).body,-1)||e}function at(e,t){if(!e)return null;let n=X(N(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function ot(e){return at(e,1)}function st(e){return at(e,-1)}function Z(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!B(n,r)}function ct(e){X(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function lt(e){let t=[];$e(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Q={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ut={...Q,position:`fixed`,top:0,left:0},dt={...Q,position:`absolute`},$=E.forwardRef(function(e,t){let[n,r]=E.useState();y(()=>{Te&&z&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,M.jsx)(`span`,{...e,ref:t,style:ut,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function ft(e){return x(19)?e:e?`true`:void 0}var pt={style:{transition:`none`}},mt=`data-base-ui-click-trigger`,ht=`data-base-ui-swipe-ignore`,gt=`data-swipe-ignore`,_t=`[${ht}]`,vt=`[${gt}]`,yt={fallbackAxisSide:`none`},bt={fallbackAxisSide:`end`},xt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function St(e){return`data-base-ui-${e}`}var Ct=E.createContext(null),wt=()=>E.useContext(Ct),Tt=St(`portal`);function Et(e={}){let{ref:t,container:n,componentProps:r=b,elementProps:i}=e,a=p(),o=wt()?.portalNode,[s,c]=E.useState(null),[u,f]=E.useState(null),m=_(e=>{e!==null&&f(e)}),h=E.useRef(null);y(()=>{if(n===null){h.current&&(h.current=null,f(null),c(null));return}let e=(n&&(l(n)?n:n.current))??o??document.body;if(e==null){h.current&&(h.current=null,f(null),c(null));return}h.current!==e&&(h.current=e,f(null),c(e))},[n,o]);let g=d(`div`,r,{ref:[t,m],props:[{id:a,[Tt]:``},i]}),v=s&&g?A.createPortal(g,s):null;return{node:u,nodeId:E.isValidElement(g)?g.props.id:void 0,subtree:v}}var Dt=E.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=Et({container:o,ref:t,componentProps:e,elementProps:s}),d=E.useRef(null),p=E.useRef(null),m=E.useRef(null),h=E.useRef(null),[g,_]=E.useState(null),v=E.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!c;E.useEffect(()=>{if(!c||b)return;function e(e){c&&e.relatedTarget&&Z(e)&&(e.type===`focusin`?v.current&&=(lt(c),!1):(ct(c),v.current=!0))}return j(f(c,`focusin`,e,!0),f(c,`focusout`,e,!0))},[c,b]),y(()=>{!c||x!==!0||!v.current||(lt(c),v.current=!1)},[x,c]);let C=E.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:c,setFocusManagerState:_}),[c]);return(0,M.jsxs)(E.Fragment,{children:[u,(0,M.jsxs)(Ct.Provider,{value:C,children:[S&&c&&(0,M.jsx)($,{"data-type":`outside`,ref:d,onFocus:e=>{Z(e,c)?m.current?.focus():it(g?g.domReference:null)?.focus()}}),S&&c&&(0,M.jsx)(`span`,{"aria-owns":l,style:xt}),c&&A.createPortal(a,c),S&&c&&(0,M.jsx)($,{"data-type":`outside`,ref:p,onFocus:e=>{Z(e,c)?h.current?.focus():(rt(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,ee(`focus-out`,e.nativeEvent)))}})]})]})}),Ot=E.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=S({disabled:i,focusableWhenDisabled:a,native:o});return d(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),kt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,At=r,jt=(e,t)=>n=>{if(t?.variants==null)return At(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=kt(t)||kt(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return At(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Mt=jt(`group/button inline-flex shrink-0 items-center justify-center rounded-full border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 rounded-full px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 rounded-full px-2 text-xs in-data-[slot=button-group]:rounded-full has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-full px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-full has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 rounded-full px-3.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8 rounded-full`,"icon-xs":`size-6 rounded-full in-data-[slot=button-group]:rounded-full [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-full in-data-[slot=button-group]:rounded-full`,"icon-lg":`size-9 rounded-full`}},defaultVariants:{variant:`default`,size:`default`}});function Nt({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,M.jsx)(Ot,{"data-slot":`button`,className:o(Mt({variant:t,size:n,className:e})),...r})}export{ge as $,U as A,B,et as C,Ue as D,We as E,Fe as F,je as G,Me as H,ze as I,z as J,De as K,V as L,Ie as M,Re as N,W as O,Le as P,F as Q,Be as R,Z as S,H as T,ke as U,Pe as V,Ae as W,R as X,Se as Y,Ce as Z,tt as _,wt as a,ce as at,ot as b,mt as c,vt as d,N as et,bt as f,dt as g,ut as h,Et as i,se as it,Ve as j,He as k,pt as l,$ as m,jt as n,he as nt,St as o,re as ot,ft as p,Ee as q,Dt as r,k as rt,_t as s,w as st,Nt as t,j as tt,yt as u,rt as v,X as w,st as x,it as y,Ne as z};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-Eg7xtNmV.js";var n=e();function r({className:e,size:r=`default`,...i}){return(0,n.jsx)(`div`,{"data-slot":`card`,"data-size":r,className:t(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function i({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-header`,className:t(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...r})}function a({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-title`,className:t(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...r})}function o({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-description`,className:t(`text-sm text-muted-foreground`,e),...r})}function s({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-content`,className:t(`px-4 group-data-[size=sm]/card:px-3`,e),...r})}export{a,i,s as n,o as r,r as t};