@decocms/mesh 2.15.0 → 2.15.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 (159) hide show
  1. package/dist/client/assets/{AlertCircle-CIFhWg2i.js → AlertCircle-DlBo4Xw9.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-D0vIuW0V.js → ArrowLeft-CCqPW2JN.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-MjJJcV-O.js → ArrowUp-KvHCnFh3.js} +1 -1
  4. package/dist/client/assets/{Check-LvJ1lSFr.js → Check-D4dBNJmC.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-QF_Tgl2v.js → ChevronDown-CJaS1NVA.js} +1 -1
  6. package/dist/client/assets/{Clock-CiIkKpUg.js → Clock-ljBuaWDA.js} +1 -1
  7. package/dist/client/assets/{Code01-Du8Lx-Uw.js → Code01-CMazpegY.js} +1 -1
  8. package/dist/client/assets/{Copy01-CunLN8rc.js → Copy01-Rf_P7R5F.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-WE50knOB.js → DotsHorizontal-Nj82ZW12.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CuQjcY-h.js → DotsVertical-f9rnazjX.js} +1 -1
  11. package/dist/client/assets/{Download01-syi4c4iH.js → Download01-Cnas0PSW.js} +1 -1
  12. package/dist/client/assets/{Edit01-DVUwOcf8.js → Edit01-MWKLkbpZ.js} +1 -1
  13. package/dist/client/assets/{File06-BM3BX-NC.js → File06-Dir7h2_j.js} +1 -1
  14. package/dist/client/assets/{FilterLines-DS1pmySA.js → FilterLines-BgxUhbig.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-BKppcJN9.js → FlipBackward-B1KVh_65.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-C3ShOPmQ.js → GitBranch01-CA4KhZZx.js} +1 -1
  17. package/dist/client/assets/{Grid01-DwtrqYPx.js → Grid01-BgBQwtBY.js} +1 -1
  18. package/dist/client/assets/{Home02-DlsAgg82.js → Home02-CR-W2ctm.js} +1 -1
  19. package/dist/client/assets/{Image01-Bw2o5F05.js → Image01-B8cj-qoF.js} +1 -1
  20. package/dist/client/assets/{Inbox01-CSDhYGLL.js → Inbox01-Bh5pMKE1.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-xFKFZGrj.js → InfoCircle-CVdyaBb8.js} +1 -1
  22. package/dist/client/assets/{Key01-S9eZFu7R.js → Key01-BcxLAym0.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-Dbxh7ZV2.js → LinkExternal01-D41WE0Cl.js} +1 -1
  24. package/dist/client/assets/{List-D2PJPXod.js → List-hTdqyLGB.js} +1 -1
  25. package/dist/client/assets/{Loading01-BhuF3K1g.js → Loading01-Bq_7Os6T.js} +1 -1
  26. package/dist/client/assets/{Lock01-jUZQmYfl.js → Lock01-DOJDUqUZ.js} +1 -1
  27. package/dist/client/assets/{Play-BxDRmyN-.js → Play-CoxjBx7-.js} +1 -1
  28. package/dist/client/assets/{Plus-DCVckKM0.js → Plus-C4F6mby2.js} +1 -1
  29. package/dist/client/assets/{SearchMd-tLR3QB8E.js → SearchMd-B_A85eif.js} +1 -1
  30. package/dist/client/assets/{Terminal-DwE3k3eb.js → Terminal-BWurH474.js} +1 -1
  31. package/dist/client/assets/{Trash01-Dg5Q9OUO.js → Trash01-GrzirNvV.js} +1 -1
  32. package/dist/client/assets/{Upload01-BJUxi5ck.js → Upload01-Ba_zCXbQ.js} +1 -1
  33. package/dist/client/assets/{X-DKF1oh5v.js → X-D09jV0HO.js} +1 -1
  34. package/dist/client/assets/{XClose-BACMQGhN.js → XClose-D9UXYoHK.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-BryTAX-J.js → alert-dialog-Df8ZsItX.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-B3H5JOvc.js → auth-catchall-Bu_AmzqF.js} +1 -1
  37. package/dist/client/assets/{avatar-BtMYdv0U.js → avatar-CrVRRbJ7.js} +1 -1
  38. package/dist/client/assets/{badge-Do7WFlPI.js → badge-BPKvq16e.js} +1 -1
  39. package/dist/client/assets/{binder-B3GXUIAu.js → binder-BtPpbY4I.js} +1 -1
  40. package/dist/client/assets/{button-ClkQLR3o.js → button-Co_HOc3E.js} +1 -1
  41. package/dist/client/assets/{card-CwMKn79y.js → card-Rz2C5-Lx.js} +1 -1
  42. package/dist/client/assets/{checkbox-C6hBycBx.js → checkbox-DGIT6WZ3.js} +1 -1
  43. package/dist/client/assets/{collection-detail-C-m2H10s.js → collection-detail-CIorpvYQ.js} +1 -1
  44. package/dist/client/assets/{collection-display-button-CdHXoeVD.js → collection-display-button-C_GfVLwh.js} +1 -1
  45. package/dist/client/assets/{collection-header-CeBQhXWy.js → collection-header-Dl8Ii13M.js} +1 -1
  46. package/dist/client/assets/{collection-page-pMUw63Yr.js → collection-page-C75JriCh.js} +1 -1
  47. package/dist/client/assets/{collection-search-CF1o4yO7.js → collection-search-D67e9ppe.js} +1 -1
  48. package/dist/client/assets/{collection-tab-ChPNT80-.js → collection-tab-DVmiR956.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-jfSAC6dF.js → collection-table-wrapper-DDHrDWif.js} +1 -1
  50. package/dist/client/assets/{connection-BcYehfdK.js → connection-CmMMEDBY.js} +1 -1
  51. package/dist/client/assets/{connection-card-DO3ahSdV.js → connection-card-BuCHeT4K.js} +1 -1
  52. package/dist/client/assets/{connection-detail-i_lj-oMr.js → connection-detail-BsC5t8hY.js} +1 -1
  53. package/dist/client/assets/{connections-CMzrwOZS.js → connections-B3RW87mz.js} +1 -1
  54. package/dist/client/assets/constants-B5NZDm4s.js +1 -0
  55. package/dist/client/assets/{create-organization-dialog-BydMMM5g.js → create-organization-dialog-DQ5uy2r0.js} +1 -1
  56. package/dist/client/assets/{dialog-Y0g8yyzz.js → dialog-bW33A1d_.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-C4Ypstre.js → dropdown-menu-dsr_wyw0.js} +1 -1
  58. package/dist/client/assets/{dynamic-plugin-layout-Cds2rM_Z.js → dynamic-plugin-layout-IH0Gl52A.js} +1 -1
  59. package/dist/client/assets/{empty-state-C0gi-aAx.js → empty-state-B1DU5702.js} +1 -1
  60. package/dist/client/assets/{empty-state-Dx0NLAxy.js → empty-state-By_kA__m.js} +1 -1
  61. package/dist/client/assets/{env-vars-editor-GTn7Eu5T.js → env-vars-editor-BjH5KdVc.js} +1 -1
  62. package/dist/client/assets/{error-boundary-D2ZJQHnD.js → error-boundary-BOBkDZ1Y.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-nsOyk4eb.js → extract-connection-data-CNcw3HV2.js} +1 -1
  64. package/dist/client/assets/{file-browser-s8pLbWaW.js → file-browser-BDyBPrc6.js} +2 -2
  65. package/dist/client/assets/{form-DDdl0439.js → form-ChO7tWCF.js} +1 -1
  66. package/dist/client/assets/{gateway-detail-NHGkjgTy.js → gateway-detail-CzuSbsFr.js} +1 -1
  67. package/dist/client/assets/{gateways-Bv1uyRdE.js → gateways-ckyn_Uas.js} +1 -1
  68. package/dist/client/assets/{grid-view-DNPq1Y__.js → grid-view-CTAOtRDs.js} +1 -1
  69. package/dist/client/assets/{home-9eTtEa0h.js → home-CpIhQ8D8.js} +1 -1
  70. package/dist/client/assets/{index-D6aVJNvm.js → index-BUdiVz6f.js} +1 -1
  71. package/dist/client/assets/{index-hEHbC4y4.js → index-Bc30BcYv.js} +3 -3
  72. package/dist/client/assets/{index-DqVdeyIE.js → index-CH2G6_zW.js} +1 -1
  73. package/dist/client/assets/{index-Cbsnfme0.js → index-ChF3uWl9.js} +1 -1
  74. package/dist/client/assets/{index-C5FDJtAp.js → index-ZiFjEqyT.js} +2 -2
  75. package/dist/client/assets/{infiniteQueryObserver-BnxPLCEe.js → infiniteQueryObserver-DEh2zauU.js} +1 -1
  76. package/dist/client/assets/{input-BbWUShhD.js → input-DEsmZ6es.js} +1 -1
  77. package/dist/client/assets/{layout-BnqnCJOk.js → layout-tF7tb_Qc.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-BHJogLPz.js → lazy-highlighter-B2TKQCpQ.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-BZEjwsD0.js → localstorage-keys-DhdYpXZj.js} +1 -1
  80. package/dist/client/assets/{login-DGLLQl3L.js → login-DtC787Hg.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-CkuEWYY4.js → mcp-oauth-D8a9d38x.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-D4bCdTAY.js → mcp-server-card-DSQZ-b3I.js} +1 -1
  83. package/dist/client/assets/{mcp-server-detail-Cy2l0hPz.js → mcp-server-detail-rW4PqaOO.js} +1 -1
  84. package/dist/client/assets/members-C4HTAJHG.js +3 -0
  85. package/dist/client/assets/{monaco-editor-BnXEGbzY.js → monaco-editor-BYgR7J38.js} +1 -1
  86. package/dist/client/assets/{monitoring-vPlAvNfN.js → monitoring-BGY0w02b.js} +1 -1
  87. package/dist/client/assets/{oauth-callback-I_aRwsB5.js → oauth-callback-BSZdPTYI.js} +1 -1
  88. package/dist/client/assets/{page-fWJ76jbj.js → page-DcQoSvJk.js} +1 -1
  89. package/dist/client/assets/{page-DPsdZaOi.js → page-DxMYdFSw.js} +1 -1
  90. package/dist/client/assets/{pin-to-sidebar-button-DTR_Oj1s.js → pin-to-sidebar-button-BahvsjHH.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-RYQHQ0B6.js → plugin-empty-state-CIiB0IAw.js} +1 -1
  92. package/dist/client/assets/{plugin-header-BPW1tb_d.js → plugin-header-CvDO4WmD.js} +1 -1
  93. package/dist/client/assets/{plugins-DN4-aMVD.js → plugins-CyUBsABC.js} +1 -1
  94. package/dist/client/assets/{popover-DLFe45bO.js → popover-DW05feED.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-DH0iqA5D.js → project-context-provider-BPo-49FO.js} +1 -1
  96. package/dist/client/assets/{registry-utils-BPPApxjf.js → registry-utils-DzI73csj.js} +1 -1
  97. package/dist/client/assets/{resizable-C6uSLZAk.js → resizable-BAPLF4RD.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-CKatVKnl.js → resource-tabs-CC5dHHUl.js} +1 -1
  99. package/dist/client/assets/{select-CSzUpxmC.js → select-CVEPeRAQ.js} +1 -1
  100. package/dist/client/assets/{settings-Dk6-Mm8r.js → settings-BfbdOKrl.js} +1 -1
  101. package/dist/client/assets/{shell-layout-P7XxC3ZF.js → shell-layout-DJjajsTY.js} +1 -1
  102. package/dist/client/assets/{spinner-CUAQv_4V.js → spinner-DqooIng7.js} +1 -1
  103. package/dist/client/assets/{switch-ZAqg3LbP.js → switch-dZML6kqo.js} +1 -1
  104. package/dist/client/assets/{textarea-BDJhX5-9.js → textarea-DFRypKCQ.js} +1 -1
  105. package/dist/client/assets/{tool-set-selector-D26m7PpE.js → tool-set-selector-DRx4AOzy.js} +1 -1
  106. package/dist/client/assets/{tools-list-pl3Bsjpf.js → tools-list-C8nSsOKD.js} +1 -1
  107. package/dist/client/assets/{tooltip-DXYcokUT.js → tooltip-BJO9sFhZ.js} +1 -1
  108. package/dist/client/assets/{use-binding-Cmi2FEqF.js → use-binding-C8KxuIY6.js} +1 -1
  109. package/dist/client/assets/{use-collections-DxMxR_jZ.js → use-collections-g067BPxP.js} +1 -1
  110. package/dist/client/assets/{use-connection-ClVfoZWG.js → use-connection-BskZam-G.js} +1 -1
  111. package/dist/client/assets/{use-connection-resources-nXRlJNhx.js → use-connection-resources-YXIBGXnm.js} +1 -1
  112. package/dist/client/assets/{use-create-gateway-UkmAQbcu.js → use-create-gateway-CCmt4GT8.js} +1 -1
  113. package/dist/client/assets/{use-gateway-system-prompt-CYi0Zo4K.js → use-gateway-system-prompt-DoCpWoeh.js} +1 -1
  114. package/dist/client/assets/{use-gateway-D_zdUoI4.js → use-gateway-v7etejE8.js} +1 -1
  115. package/dist/client/assets/{use-list-state-G6sniPDx.js → use-list-state-C5pgFF_z.js} +1 -1
  116. package/dist/client/assets/{use-mcp-hlkUt7pz.js → use-mcp-ZNQ-iMEF.js} +1 -1
  117. package/dist/client/assets/{use-members-3RqzErHO.js → use-members-dVasH0ez.js} +1 -1
  118. package/dist/client/assets/{use-mobile-DT1cwytU.js → use-mobile-Co7MtEW-.js} +1 -1
  119. package/dist/client/assets/{use-model-state-Bc4MpPVu.js → use-model-state-B8hL-q1r.js} +2 -2
  120. package/dist/client/assets/{use-organization-settings-D46q7SyU.js → use-organization-settings-K7SU43aD.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-BH-yOcTy.js → use-tool-call-BbfSyOCz.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +1 -0
  123. package/dist/client/assets/{useMutation-DEocBykZ.js → useMutation-4fnzP4bc.js} +1 -1
  124. package/dist/client/assets/useQuery-Bn2Wcch_.js +1 -0
  125. package/dist/client/assets/{value-C9Bb1t7X.js → value-zEqR5KPg.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-C5hz9T3M.js → view-mode-toggle-tlrhMsiy.js} +1 -1
  127. package/dist/client/assets/{workflow-BJoyVBBY.js → workflow-B8_jtBci.js} +1 -1
  128. package/dist/client/index.html +1 -1
  129. package/dist/server/cli.js +216 -216
  130. package/dist/server/migrate.js +154 -144
  131. package/dist/server/server.js +212 -212
  132. package/package.json +1 -1
  133. package/dist/client/assets/constants-BIwbIZhE.js +0 -1
  134. package/dist/client/assets/members-CXuNIHGD.js +0 -3
  135. package/dist/client/assets/useInfiniteQuery-Dl93eV8h.js +0 -1
  136. package/dist/client/assets/useQuery-Dakt0IBq.js +0 -1
  137. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +0 -47
  138. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +0 -82
  139. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +0 -11
  140. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +0 -43
  141. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +0 -45
  142. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +0 -46
  143. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +0 -11
  144. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +0 -11
  145. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +0 -46
  146. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
  147. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +0 -83
  148. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +0 -83
  149. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +0 -2
  150. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +0 -1
  151. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +0 -2
  152. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +0 -1
  153. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +0 -20
  154. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +0 -20
  155. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +0 -2
  156. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +0 -1
  157. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +0 -2
  158. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +0 -1
  159. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +0 -61
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-BHJogLPz.js","assets/index-C5FDJtAp.js","assets/index-JAPwCHXJ.css"])))=>i.map(i=>d[i]);
2
- import{r as Y,c as W,j as p,x as Xs,K as Le,v as Zs,a4 as Js,aT as $o,ai as Yo,an as qo,aF as Vo,aj as zr,ak as Wo,al as Go,ag as Qo,am as Ko}from"./index-C5FDJtAp.js";import{I as ea}from"./empty-state-C0gi-aAx.js";import{c as le,B as ze}from"./button-ClkQLR3o.js";import{I as ta}from"./input-BbWUShhD.js";import{a as na,b as ra,P as ia}from"./popover-DLFe45bO.js";import{T as $r,b as Yr,a as Xo,c as qr}from"./tooltip-DXYcokUT.js";import{i as Hn}from"./Check-LvJ1lSFr.js";import{i as sa,u as Zo}from"./use-gateway-D_zdUoI4.js";import{i as Vr}from"./SearchMd-tLR3QB8E.js";import{u as Jo}from"./use-create-gateway-UkmAQbcu.js";import{i as aa}from"./AlertCircle-CIFhWg2i.js";import{i as el}from"./error-boundary-D2ZJQHnD.js";import{i as tl}from"./X-DKF1oh5v.js";import{i as nl}from"./ArrowUp-MjJJcV-O.js";import{T as rl}from"./textarea-BDJhX5-9.js";import{u as gt}from"./useMutation-DEocBykZ.js";import{u as Mt}from"./project-context-provider-DH0iqA5D.js";import{u as ua,L as oa}from"./localstorage-keys-BZEjwsD0.js";import{i as la,c as il}from"./Grid01-DwtrqYPx.js";import{a as Wr}from"./Copy01-CunLN8rc.js";import{i as sl}from"./Terminal-DwE3k3eb.js";import{M as ca}from"./monaco-editor-BnXEGbzY.js";import{b as al,c as ul,d as ol,A as ll,a as cl,e as fl,g as hl,f as dl}from"./alert-dialog-BryTAX-J.js";import{U as ml,c as pl}from"./connection-BcYehfdK.js";import{S as gl,a as El,b as bl,c as Tl,d as xl}from"./select-CSzUpxmC.js";import{i as _l}from"./File06-BM3BX-NC.js";import{a as Al}from"./Image01-Bw2o5F05.js";import{b as kl}from"./use-collections-DxMxR_jZ.js";import{u as Cl}from"./use-connection-ClVfoZWG.js";import{b as Nl}from"./use-binding-Cmi2FEqF.js";const fa=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));fa.displayName="Atom02";const Gr=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Gr.displayName="ChevronSelectorVertical";const ha=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));ha.displayName="Coins01";const da=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));da.displayName="CornerUpLeft";const ma=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ma.displayName="CurrencyDollar";const pa=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));pa.displayName="Edit02";const ga=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));ga.displayName="Lightbulb01";const Ea=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ea.displayName="LogOut04";const Un=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Un.displayName="Stars01";const ba=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));ba.displayName="Stop";const Ta=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Ta.displayName="Target04";function Me(t){const e=W.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=le("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function yl(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=oa.developerMode(),t[0]=e):e=t[0],ua(e,!1)}function Sl(t,e){const n=W.c(4);let r;n[0]!==e?(r=e===void 0?{}:e,n[0]=e,n[1]=r):r=n[1];const i=r,s=t??ml;let a;return n[2]!==s?(a=pl(s),n[2]=s,n[3]=a):a=n[3],kl(s,"LLM",a,i)}function xa(){const t=W.c(2),e=Cl();let n;return t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1],Nl(n)}function Tt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Il(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Tt(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let rr;function jn(){return rr||(rr=Il("keyval-store","keyval")),rr}function Qr(t,e=jn()){return e("readonly",n=>Tt(n.get(t)))}function Zt(t,e,n=jn()){return n("readwrite",r=>(r.put(e,t),Tt(r.transaction)))}function _a(t,e=jn()){return e("readwrite",n=>(n.delete(t),Tt(n.transaction)))}function Ll(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Tt(t.transaction)}function Aa(t=jn()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Tt(e.getAllKeys()),Tt(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>Ll(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Vb(t,e){const n=`${t}:threads:${e}`;return await Qr(n)??null}async function wl(t){const e=`${t}:threads:`;return(await Aa()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,s)=>String(s.updated_at).localeCompare(String(i.updated_at)))}function ka(t,e){const n=`${t}:messages:`;return Aa().then(r=>r.filter(([s])=>typeof s=="string"&&s.startsWith(n)).map(([,s])=>s).filter(s=>s.metadata?.thread_id===e||s.threadId===e).sort((s,a)=>{const u=s.metadata?.created_at||s.createdAt||"",o=a.metadata?.created_at||a.createdAt||"";return String(u).localeCompare(String(o))}))}function Wb(t){const e=W.c(14),{locator:n}=Mt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Le.threads(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==n?(s=async()=>await wl(n),e[3]=r,e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i||e[7]!==s?(a={queryKey:i,queryFn:s,staleTime:3e4},e[6]=i,e[7]=s,e[8]=a):a=e[8];const{data:u,refetch:o}=Zs(a);let c;e[9]!==u?(c=u??[],e[9]=u,e[10]=c):c=e[10];let f;return e[11]!==o||e[12]!==c?(f={threads:c,refetch:o},e[11]=o,e[12]=c,e[13]=f):f=e[13],f}function Gb(t){const e=W.c(11),{locator:n}=Mt();let r;e[0]!==n||e[1]!==t?(r=Le.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>ka(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let s;e[6]!==r||e[7]!==i?(s={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=s):s=e[8];const{data:a}=Zs(s);let u;return e[9]!==a?(u=a??[],e[9]=a,e[10]=u):u=e[10],u}function Ca(){const t=W.c(28),{locator:e}=Mt(),n=Xs();let r;t[0]!==e?(r=async _=>{const T=`${e}:threads:${_.id}`;return await Zt(T,_),_},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=_=>{n.invalidateQueries({queryKey:Le.threads(e)}),_.gatewayId&&n.invalidateQueries({queryKey:Le.gatewayThreads(e,_.gatewayId)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=gt(s);let u;t[8]!==e?(u=async _=>{const{id:T,updates:y}=_,N=`${e}:threads:${T}`,w=await Qr(N);if(!w)throw new Error(`Thread ${T} not found`);const O={...w,...y};return await Zt(N,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=_=>{n.invalidateQueries({queryKey:Le.threads(e)}),n.invalidateQueries({queryKey:Le.thread(e,_.id)}),_.gatewayId&&n.invalidateQueries({queryKey:Le.gatewayThreads(e,_.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let c;t[13]!==u||t[14]!==o?(c={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=c):c=t[15];const f=gt(c);let h;t[16]!==e?(h=async _=>{const T=`${e}:threads:${_}`;return await _a(T),_},t[16]=e,t[17]=h):h=t[17];let m;t[18]!==e||t[19]!==n?(m=()=>{n.invalidateQueries({queryKey:Le.threads(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let d;t[21]!==h||t[22]!==m?(d={mutationFn:h,onSuccess:m},t[21]=h,t[22]=m,t[23]=d):d=t[23];const g=gt(d);let k;return t[24]!==g||t[25]!==a||t[26]!==f?(k={insert:a,update:f,delete:g},t[24]=g,t[25]=a,t[26]=f,t[27]=k):k=t[27],k}function Rl(){const t=W.c(37),{locator:e}=Mt(),n=Xs();let r;t[0]!==e?(r=async w=>{const O=`${e}:messages:${w.id}`;return await Zt(O,w),w},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=w=>{const O=w.metadata?.thread_id||w.threadId;O&&n.invalidateQueries({queryKey:Le.threadMessages(e,O)}),n.invalidateQueries({queryKey:Le.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=gt(s);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(O=>{const I=`${e}:messages:${O.id}`;return Zt(I,O)})),w),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=w=>{const O=new Set;for(const I of w){const F=I.metadata?.thread_id||I.threadId;F&&O.add(F)}for(const I of O)n.invalidateQueries({queryKey:Le.threadMessages(e,I)});n.invalidateQueries({queryKey:Le.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let c;t[13]!==u||t[14]!==o?(c={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=c):c=t[15];const f=gt(c);let h;t[16]!==e?(h=async w=>{const{id:O,updates:I}=w,F=`${e}:messages:${O}`,H=await Qr(F);if(!H)throw new Error(`Message ${O} not found`);const P={...H,...I};return await Zt(F,P),P},t[16]=e,t[17]=h):h=t[17];let m;t[18]!==e||t[19]!==n?(m=w=>{const O=w.metadata?.thread_id||w.threadId;O&&n.invalidateQueries({queryKey:Le.threadMessages(e,O)}),n.invalidateQueries({queryKey:Le.messages(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let d;t[21]!==h||t[22]!==m?(d={mutationFn:h,onSuccess:m},t[21]=h,t[22]=m,t[23]=d):d=t[23];const g=gt(d);let k;t[24]!==e?(k=async w=>{const O=`${e}:messages:${w}`;return await _a(O),w},t[24]=e,t[25]=k):k=t[25];let _;t[26]!==e||t[27]!==n?(_=()=>{n.invalidateQueries({queryKey:Le.messages(e)})},t[26]=e,t[27]=n,t[28]=_):_=t[28];let T;t[29]!==_||t[30]!==k?(T={mutationFn:k,onSuccess:_},t[29]=_,t[30]=k,t[31]=T):T=t[31];const y=gt(T);let N;return t[32]!==y||t[33]!==a||t[34]!==f||t[35]!==g?(N={insert:a,insertMany:f,update:g,delete:y},t[32]=y,t[33]=a,t[34]=f,t[35]=g,t[36]=N):N=t[36],N}const Na={inputValue:"",branchContext:null,pendingSubmit:!1};function Ol(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_PENDING_SUBMIT":return{...t,pendingSubmit:e.payload};case"RESET":return Na;default:return t}}const ya=Y.createContext(null),Sa=()=>crypto.randomUUID();function Dl(t){const e=W.c(16),{children:n}=t,{locator:r}=Mt(),[i,s]=Y.useReducer(Ol,Na),a=Ca(),[u,o]=ua(oa.threadManagerState(r)+":active-id",Pl);let c;e[0]!==o||e[1]!==a?(c=_=>{const T=_?.id||crypto.randomUUID(),y=new Date().toISOString(),N={id:T,title:_?.title||"",created_at:_?.created_at||y,updated_at:_?.updated_at||y,hidden:_?.hidden??!1,gatewayId:_?.gatewayId};return a.insert.mutate(N),o(T),N},e[0]=o,e[1]=a,e[2]=c):c=e[2];const f=c;let h;e[3]!==u||e[4]!==o||e[5]!==a?(h=_=>{a.update.mutate({id:_,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===_&&o(Sa())},e[3]=u,e[4]=o,e[5]=a,e[6]=h):h=e[6];const m=h;let d;e[7]!==u||e[8]!==f||e[9]!==m||e[10]!==i||e[11]!==o?(d={interactionState:i,interactionDispatch:s,activeThreadId:u,createThread:f,setActiveThreadId:o,hideThread:m},e[7]=u,e[8]=f,e[9]=m,e[10]=i,e[11]=o,e[12]=d):d=e[12];const g=d;let k;return e[13]!==n||e[14]!==g?(k=p.jsx(ya.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=k):k=e[15],k}function Pl(t){return t||Sa()}function Ml(){const t=W.c(19),e=Y.useContext(ya);if(!e)throw new Error("useChat must be used within a ChatProvider");const{interactionState:n,interactionDispatch:r}=e;let i,s,a,u,o;t[0]!==r?(i=f=>r({type:"SET_INPUT",payload:f}),s=f=>r({type:"START_BRANCH",payload:f}),a=()=>r({type:"CLEAR_BRANCH"}),u=f=>r({type:"SET_PENDING_SUBMIT",payload:f}),o=()=>r({type:"RESET"}),t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=u,t[5]=o):(i=t[1],s=t[2],a=t[3],u=t[4],o=t[5]);let c;return t[6]!==e.activeThreadId||t[7]!==e.createThread||t[8]!==e.hideThread||t[9]!==e.setActiveThreadId||t[10]!==n.branchContext||t[11]!==n.inputValue||t[12]!==n.pendingSubmit||t[13]!==i||t[14]!==s||t[15]!==a||t[16]!==u||t[17]!==o?(c={inputValue:n.inputValue,branchContext:n.branchContext,pendingSubmit:n.pendingSubmit,setInputValue:i,startBranch:s,clearBranch:a,setPendingSubmit:u,reset:o,activeThreadId:e.activeThreadId,createThread:e.createThread,setActiveThreadId:e.setActiveThreadId,hideThread:e.hideThread},t[6]=e.activeThreadId,t[7]=e.createThread,t[8]=e.hideThread,t[9]=e.setActiveThreadId,t[10]=n.branchContext,t[11]=n.inputValue,t[12]=n.pendingSubmit,t[13]=i,t[14]=s,t[15]=a,t[16]=u,t[17]=o,t[18]=c):c=t[18],c}function Bl(){const t=W.c(2),e=Zo();let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function vl(t){const e=W.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let s;e[0]!==i?(s=le("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",i),e[0]=i,e[1]=s):s=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??p.jsx(sa,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(u=p.jsx(ea,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10 rounded-xl border border-stone-200/60 shadow-sm shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=u):u=e[7];let o;e[8]!==n.title?(o=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=o):o=e[9];let c;e[10]!==r?(c=r&&p.jsx(Hn,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=c):c=e[11];let f;e[12]!==o||e[13]!==c?(f=p.jsxs("div",{className:"flex items-center justify-between",children:[o,c]}),e[12]=o,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==n.description?(h=n.description&&p.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=h):h=e[16];let m;e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[f,h]}),e[17]=f,e[18]=h,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==u||e[22]!==m?(d=p.jsxs("div",{className:s,children:[u,m]}),e[20]=s,e[21]=u,e[22]=m,e[23]=d):d=e[23],d}function Fl(t){const e=W.c(25),{gateways:n,selectedGatewayId:r,onGatewayChange:i,searchInputRef:s}=t,[a,u]=Y.useState(""),o=Y.useRef(null),c=s??o;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[0]=f):f=e[0];const{createGateway:h,isCreating:m}=Jo(f);let d;e:{if(!a.trim()){d=n;break e}let P;if(e[1]!==n||e[2]!==a){const S=a.toLowerCase();P=n.filter(U=>U.title.toLowerCase().includes(S)||U.description?.toLowerCase().includes(S)),e[1]=n,e[2]=a,e[3]=P}else P=e[3];d=P}const g=d;let k;e[4]!==i?(k=P=>{i(P),u("")},e[4]=i,e[5]=k):k=e[5];const _=k;let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(Vr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[6]=T):T=e[6];let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=P=>u(P.target.value),e[7]=y):y=e[7];let N;e[8]!==c||e[9]!==a?(N=p.jsx(ta,{ref:c,type:"text",placeholder:"Search for an agent...",value:a,onChange:y,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[8]=c,e[9]=a,e[10]=N):N=e[10];const w=m?"Creating...":"Create Agent";let O;e[11]!==h||e[12]!==m||e[13]!==w?(O=p.jsx(ze,{onClick:h,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:m,children:w}),e[11]=h,e[12]=m,e[13]=w,e[14]=O):O=e[14];let I;e[15]!==N||e[16]!==O?(I=p.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:p.jsxs("div",{className:"relative flex items-center gap-2",children:[T,N,O]})}),e[15]=N,e[16]=O,e[17]=I):I=e[17];let F;e[18]!==g||e[19]!==_||e[20]!==r?(F=p.jsx("div",{className:"overflow-y-auto p-1.5",children:g.length>0?p.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:g.map(P=>p.jsx("div",{role:"button",tabIndex:0,onClick:()=>_(P.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),_(P.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:p.jsx(vl,{gateway:P,isSelected:P.id===r})},P.id))}):p.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"})}),e[18]=g,e[19]=_,e[20]=r,e[21]=F):F=e[21];let H;return e[22]!==F||e[23]!==I?(H=p.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[I,F]}),e[22]=F,e[23]=I,e[24]=H):H=e[24],H}function Qb(t){const e=W.c(37),{selectedGatewayId:n,onGatewayChange:r,className:i,placeholder:s,showTooltip:a,disabled:u}=t,o=s===void 0?"Select Agent":s,c=a===void 0?!0:a,f=u===void 0?!1:u,[h,m]=Y.useState(!1),d=Y.useRef(null),g=Bl();let k,_;e[0]!==h?(k=()=>{h&&setTimeout(()=>{d.current?.focus()},0)},_=[h],e[0]=h,e[1]=k,e[2]=_):(k=e[1],_=e[2]),Y.useEffect(k,_);let T;e[3]!==g||e[4]!==n?(T=n?g.find(ae=>ae.id===n):null,e[3]=g,e[4]=n,e[5]=T):T=e[5];const y=T;let N;e[6]!==r?(N=ae=>{r(ae),m(!1)},e[6]=r,e[7]=N):N=e[7];const w=N;let O;e[8]===Symbol.for("react.memo_cache_sentinel")?(O=ae=>{m(ae)},e[8]=O):O=e[8];const I=O,F=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent";let H;e[9]!==i||e[10]!==F?(H=le("flex items-center justify-center p-1 rounded-md transition-colors shrink-0",F,i),e[9]=i,e[10]=F,e[11]=H):H=e[11];let P;e[12]!==y?(P=y?p.jsx(ea,{icon:y.icon,name:y.title,size:"xs",fallbackIcon:y.fallbackIcon??p.jsx(sa,{size:12}),className:"size-5 rounded-md"}):p.jsx("img",{src:"/favicon.svg",alt:"Default Agent",className:"size-5 rounded-md"}),e[12]=y,e[13]=P):P=e[13];let S;e[14]!==f||e[15]!==o||e[16]!==H||e[17]!==P?(S=p.jsx("button",{type:"button",disabled:f,className:H,"aria-label":o,children:P}),e[14]=f,e[15]=o,e[16]=H,e[17]=P,e[18]=S):S=e[18];const U=S,z=f?!1:h,G=f?void 0:I;let q;e[19]!==U?(q=p.jsx(Yr,{asChild:!0,children:p.jsx(na,{asChild:!0,children:U})}),e[19]=U,e[20]=q):q=e[20];let B;e[21]!==h||e[22]!==y?.title||e[23]!==c?(B=c&&!h&&p.jsx($r,{side:"top",className:"text-xs",children:y?.title??"Choose an agent to chat with"}),e[21]=h,e[22]=y?.title,e[23]=c,e[24]=B):B=e[24];let Q;e[25]!==q||e[26]!==B?(Q=p.jsx(Xo,{children:p.jsxs(qr,{children:[q,B]})}),e[25]=q,e[26]=B,e[27]=Q):Q=e[27];let V;e[28]!==g||e[29]!==w||e[30]!==n?(V=p.jsx(ra,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:p.jsx(Fl,{gateways:g,selectedGatewayId:n,onGatewayChange:w,searchInputRef:d})}),e[28]=g,e[29]=w,e[30]=n,e[31]=V):V=e[31];let J;return e[32]!==z||e[33]!==G||e[34]!==Q||e[35]!==V?(J=p.jsxs(ia,{open:z,onOpenChange:G,children:[Q,V]}),e[32]=z,e[33]=G,e[34]=Q,e[35]=V,e[36]=J):J=e[36],J}function Hl(t){const e=W.c(65),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:u,placeholder:o,className:c,centered:f,contextContent:h,leftActions:m,rightActions:d,maxTextHeight:g,children:k}=t,_=o===void 0?"Ask anything or @ for context":o,T=g===void 0?"164px":g;let y;e[0]!==a||e[1]!==u||e[2]!==n?(y=!a&&!u&&n.trim().length>0,e[0]=a,e[1]=u,e[2]=n,e[3]=y):y=e[3];const N=y;let w;e[4]!==N||e[5]!==u||e[6]!==s||e[7]!==i?(w=xe=>{xe.preventDefault(),u&&s?s():N&&i()},e[4]=N,e[5]=u,e[6]=s,e[7]=i,e[8]=w):w=e[8];const O=w;let I;e[9]!==N||e[10]!==i?(I=xe=>{xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),N&&i())},e[9]=N,e[10]=i,e[11]=I):I=e[11];const F=I;let H;e[12]!==c?(H=le("w-full",c),e[12]=c,e[13]=H):H=e[13];let P;e[14]!==h?(P=h&&p.jsx("div",{className:"mb-1",children:h}),e[14]=h,e[15]=P):P=e[15];let S;e[16]!==T?(S={maxHeight:T},e[16]=T,e[17]=S):S=e[17];let U;e[18]!==r?(U=xe=>r(xe.target.value),e[18]=r,e[19]=U):U=e[19];const z=a||u;let G;e[20]===Symbol.for("react.memo_cache_sentinel")?(G=le("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 !text-[15px] min-h-[20px] w-full","rounded-none shadow-none"),e[20]=G):G=e[20];let q;e[21]===Symbol.for("react.memo_cache_sentinel")?(q={minHeight:"20px",height:"auto",overflow:"hidden"},e[21]=q):q=e[21];let B;e[22]!==F||e[23]!==_||e[24]!==U||e[25]!==z||e[26]!==n?(B=p.jsx(rl,{value:n,onChange:U,onKeyDown:F,placeholder:_,disabled:z,className:G,rows:1,style:q}),e[22]=F,e[23]=_,e[24]=U,e[25]=z,e[26]=n,e[27]=B):B=e[27];let Q;e[28]!==B||e[29]!==S?(Q=p.jsx("div",{className:"overflow-y-auto relative flex-1",style:S,children:B}),e[28]=B,e[29]=S,e[30]=Q):Q=e[30];let V;e[31]!==Q||e[32]!==P?(V=p.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[P,Q]}),e[31]=Q,e[32]=P,e[33]=V):V=e[33];let J;e[34]!==k||e[35]!==m?(J=p.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[m,k]}),e[34]=k,e[35]=m,e[36]=J):J=e[36];const ae=u?"button":"submit";let A;e[37]!==u||e[38]!==s?(A=xe=>{u&&(xe.preventDefault(),xe.stopPropagation(),s?.())},e[37]=u,e[38]=s,e[39]=A):A=e[39];const me=N||u?"default":"ghost",ge=!N&&!u,C=!N&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let de;e[40]!==C?(de=le("size-8 rounded-full transition-all",C),e[40]=C,e[41]=de):de=e[41];const Ie=u?"Stop generating":"Send message (Enter)";let ue;e[42]!==u?(ue=u?p.jsx(ba,{size:20}):p.jsx(nl,{size:20}),e[42]=u,e[43]=ue):ue=e[43];let Ce;e[44]!==ae||e[45]!==A||e[46]!==me||e[47]!==ge||e[48]!==de||e[49]!==Ie||e[50]!==ue?(Ce=p.jsx(ze,{type:ae,onClick:A,variant:me,size:"icon",disabled:ge,className:de,title:Ie,children:ue}),e[44]=ae,e[45]=A,e[46]=me,e[47]=ge,e[48]=de,e[49]=Ie,e[50]=ue,e[51]=Ce):Ce=e[51];let Te;e[52]!==d||e[53]!==Ce?(Te=p.jsxs("div",{className:"flex items-center gap-1",children:[d,Ce]}),e[52]=d,e[53]=Ce,e[54]=Te):Te=e[54];let ke;e[55]!==J||e[56]!==Te?(ke=p.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[J,Te]}),e[55]=J,e[56]=Te,e[57]=ke):ke=e[57];let Ee;e[58]!==V||e[59]!==ke?(Ee=p.jsxs("div",{className:"relative rounded-xl w-full min-h-[130px] flex flex-col border border-border bg-background",children:[V,ke]}),e[58]=V,e[59]=ke,e[60]=Ee):Ee=e[60];let Oe;return e[61]!==O||e[62]!==Ee||e[63]!==H?(Oe=p.jsx("form",{onSubmit:O,className:H,children:Ee}),e[61]=O,e[62]=Ee,e[63]=H,e[64]=Oe):Oe=e[64],Oe}function Ul(){const t=W.c(3),[e,n]=Y.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function Kr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var At=Kr();function Ia(t){At=t}var Jt={exec:()=>null};function ie(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Re.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var Re={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},jl=/^(?:[ \t]*(?:\n|$))+/,zl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$l=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,dn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xr=/(?:[*+-]|\d{1,9}[.)])/,La=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wa=ie(La).replace(/bull/g,Xr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ql=ie(La).replace(/bull/g,Xr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vl=/^[^\n]+/,Jr=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Wl=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gl=ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xr).getRegex(),zn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ei=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ql=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ei).replace("tag",zn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ra=ie(Zr).replace("hr",dn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex(),Kl=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ra).getRegex(),ti={blockquote:Kl,code:zl,def:Wl,fences:$l,heading:Yl,hr:dn,html:Ql,lheading:wa,list:Gl,newline:jl,paragraph:Ra,table:Jt,text:Vl},Mi=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex(),Xl={...ti,lheading:ql,table:Mi,paragraph:ie(Zr).replace("hr",dn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex()},Zl={...ti,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ei).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Zr).replace("hr",dn).replace("heading",` *#{1,6} *[^
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-B2TKQCpQ.js","assets/index-ZiFjEqyT.js","assets/index-JAPwCHXJ.css"])))=>i.map(i=>d[i]);
2
+ import{r as Y,c as W,j as p,x as Xs,K as Le,v as Zs,a4 as Js,aT as $o,ai as Yo,an as qo,aF as Vo,aj as zr,ak as Wo,al as Go,ag as Qo,am as Ko}from"./index-ZiFjEqyT.js";import{I as ea}from"./empty-state-B1DU5702.js";import{c as le,B as ze}from"./button-Co_HOc3E.js";import{I as ta}from"./input-DEsmZ6es.js";import{a as na,b as ra,P as ia}from"./popover-DW05feED.js";import{T as $r,b as Yr,a as Xo,c as qr}from"./tooltip-BJO9sFhZ.js";import{i as Hn}from"./Check-D4dBNJmC.js";import{i as sa,u as Zo}from"./use-gateway-v7etejE8.js";import{i as Vr}from"./SearchMd-B_A85eif.js";import{u as Jo}from"./use-create-gateway-CCmt4GT8.js";import{i as aa}from"./AlertCircle-DlBo4Xw9.js";import{i as el}from"./error-boundary-BOBkDZ1Y.js";import{i as tl}from"./X-D09jV0HO.js";import{i as nl}from"./ArrowUp-KvHCnFh3.js";import{T as rl}from"./textarea-DFRypKCQ.js";import{u as gt}from"./useMutation-4fnzP4bc.js";import{u as Mt}from"./project-context-provider-BPo-49FO.js";import{u as ua,L as oa}from"./localstorage-keys-DhdYpXZj.js";import{i as la,c as il}from"./Grid01-BgBQwtBY.js";import{a as Wr}from"./Copy01-Rf_P7R5F.js";import{i as sl}from"./Terminal-BWurH474.js";import{M as ca}from"./monaco-editor-BYgR7J38.js";import{b as al,c as ul,d as ol,A as ll,a as cl,e as fl,g as hl,f as dl}from"./alert-dialog-Df8ZsItX.js";import{U as ml,c as pl}from"./connection-CmMMEDBY.js";import{S as gl,a as El,b as bl,c as Tl,d as xl}from"./select-CVEPeRAQ.js";import{i as _l}from"./File06-Dir7h2_j.js";import{a as Al}from"./Image01-B8cj-qoF.js";import{b as kl}from"./use-collections-g067BPxP.js";import{u as Cl}from"./use-connection-BskZam-G.js";import{b as Nl}from"./use-binding-C8KxuIY6.js";const fa=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));fa.displayName="Atom02";const Gr=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Gr.displayName="ChevronSelectorVertical";const ha=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));ha.displayName="Coins01";const da=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));da.displayName="CornerUpLeft";const ma=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ma.displayName="CurrencyDollar";const pa=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));pa.displayName="Edit02";const ga=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));ga.displayName="Lightbulb01";const Ea=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ea.displayName="LogOut04";const Un=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Un.displayName="Stars01";const ba=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));ba.displayName="Stop";const Ta=({size:t=24,color:e="currentColor",...n})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},Y.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Ta.displayName="Target04";function Me(t){const e=W.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=le("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function yl(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=oa.developerMode(),t[0]=e):e=t[0],ua(e,!1)}function Sl(t,e){const n=W.c(4);let r;n[0]!==e?(r=e===void 0?{}:e,n[0]=e,n[1]=r):r=n[1];const i=r,s=t??ml;let a;return n[2]!==s?(a=pl(s),n[2]=s,n[3]=a):a=n[3],kl(s,"LLM",a,i)}function xa(){const t=W.c(2),e=Cl();let n;return t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1],Nl(n)}function Tt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Il(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Tt(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let rr;function jn(){return rr||(rr=Il("keyval-store","keyval")),rr}function Qr(t,e=jn()){return e("readonly",n=>Tt(n.get(t)))}function Zt(t,e,n=jn()){return n("readwrite",r=>(r.put(e,t),Tt(r.transaction)))}function _a(t,e=jn()){return e("readwrite",n=>(n.delete(t),Tt(n.transaction)))}function Ll(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Tt(t.transaction)}function Aa(t=jn()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Tt(e.getAllKeys()),Tt(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>Ll(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Vb(t,e){const n=`${t}:threads:${e}`;return await Qr(n)??null}async function wl(t){const e=`${t}:threads:`;return(await Aa()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,s)=>String(s.updated_at).localeCompare(String(i.updated_at)))}function ka(t,e){const n=`${t}:messages:`;return Aa().then(r=>r.filter(([s])=>typeof s=="string"&&s.startsWith(n)).map(([,s])=>s).filter(s=>s.metadata?.thread_id===e||s.threadId===e).sort((s,a)=>{const u=s.metadata?.created_at||s.createdAt||"",o=a.metadata?.created_at||a.createdAt||"";return String(u).localeCompare(String(o))}))}function Wb(t){const e=W.c(14),{locator:n}=Mt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Le.threads(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==n?(s=async()=>await wl(n),e[3]=r,e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i||e[7]!==s?(a={queryKey:i,queryFn:s,staleTime:3e4},e[6]=i,e[7]=s,e[8]=a):a=e[8];const{data:u,refetch:o}=Zs(a);let c;e[9]!==u?(c=u??[],e[9]=u,e[10]=c):c=e[10];let f;return e[11]!==o||e[12]!==c?(f={threads:c,refetch:o},e[11]=o,e[12]=c,e[13]=f):f=e[13],f}function Gb(t){const e=W.c(11),{locator:n}=Mt();let r;e[0]!==n||e[1]!==t?(r=Le.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>ka(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let s;e[6]!==r||e[7]!==i?(s={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=s):s=e[8];const{data:a}=Zs(s);let u;return e[9]!==a?(u=a??[],e[9]=a,e[10]=u):u=e[10],u}function Ca(){const t=W.c(28),{locator:e}=Mt(),n=Xs();let r;t[0]!==e?(r=async _=>{const T=`${e}:threads:${_.id}`;return await Zt(T,_),_},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=_=>{n.invalidateQueries({queryKey:Le.threads(e)}),_.gatewayId&&n.invalidateQueries({queryKey:Le.gatewayThreads(e,_.gatewayId)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=gt(s);let u;t[8]!==e?(u=async _=>{const{id:T,updates:y}=_,N=`${e}:threads:${T}`,w=await Qr(N);if(!w)throw new Error(`Thread ${T} not found`);const O={...w,...y};return await Zt(N,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=_=>{n.invalidateQueries({queryKey:Le.threads(e)}),n.invalidateQueries({queryKey:Le.thread(e,_.id)}),_.gatewayId&&n.invalidateQueries({queryKey:Le.gatewayThreads(e,_.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let c;t[13]!==u||t[14]!==o?(c={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=c):c=t[15];const f=gt(c);let h;t[16]!==e?(h=async _=>{const T=`${e}:threads:${_}`;return await _a(T),_},t[16]=e,t[17]=h):h=t[17];let m;t[18]!==e||t[19]!==n?(m=()=>{n.invalidateQueries({queryKey:Le.threads(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let d;t[21]!==h||t[22]!==m?(d={mutationFn:h,onSuccess:m},t[21]=h,t[22]=m,t[23]=d):d=t[23];const g=gt(d);let k;return t[24]!==g||t[25]!==a||t[26]!==f?(k={insert:a,update:f,delete:g},t[24]=g,t[25]=a,t[26]=f,t[27]=k):k=t[27],k}function Rl(){const t=W.c(37),{locator:e}=Mt(),n=Xs();let r;t[0]!==e?(r=async w=>{const O=`${e}:messages:${w.id}`;return await Zt(O,w),w},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=w=>{const O=w.metadata?.thread_id||w.threadId;O&&n.invalidateQueries({queryKey:Le.threadMessages(e,O)}),n.invalidateQueries({queryKey:Le.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=gt(s);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(O=>{const I=`${e}:messages:${O.id}`;return Zt(I,O)})),w),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=w=>{const O=new Set;for(const I of w){const F=I.metadata?.thread_id||I.threadId;F&&O.add(F)}for(const I of O)n.invalidateQueries({queryKey:Le.threadMessages(e,I)});n.invalidateQueries({queryKey:Le.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let c;t[13]!==u||t[14]!==o?(c={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=c):c=t[15];const f=gt(c);let h;t[16]!==e?(h=async w=>{const{id:O,updates:I}=w,F=`${e}:messages:${O}`,H=await Qr(F);if(!H)throw new Error(`Message ${O} not found`);const P={...H,...I};return await Zt(F,P),P},t[16]=e,t[17]=h):h=t[17];let m;t[18]!==e||t[19]!==n?(m=w=>{const O=w.metadata?.thread_id||w.threadId;O&&n.invalidateQueries({queryKey:Le.threadMessages(e,O)}),n.invalidateQueries({queryKey:Le.messages(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let d;t[21]!==h||t[22]!==m?(d={mutationFn:h,onSuccess:m},t[21]=h,t[22]=m,t[23]=d):d=t[23];const g=gt(d);let k;t[24]!==e?(k=async w=>{const O=`${e}:messages:${w}`;return await _a(O),w},t[24]=e,t[25]=k):k=t[25];let _;t[26]!==e||t[27]!==n?(_=()=>{n.invalidateQueries({queryKey:Le.messages(e)})},t[26]=e,t[27]=n,t[28]=_):_=t[28];let T;t[29]!==_||t[30]!==k?(T={mutationFn:k,onSuccess:_},t[29]=_,t[30]=k,t[31]=T):T=t[31];const y=gt(T);let N;return t[32]!==y||t[33]!==a||t[34]!==f||t[35]!==g?(N={insert:a,insertMany:f,update:g,delete:y},t[32]=y,t[33]=a,t[34]=f,t[35]=g,t[36]=N):N=t[36],N}const Na={inputValue:"",branchContext:null,pendingSubmit:!1};function Ol(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_PENDING_SUBMIT":return{...t,pendingSubmit:e.payload};case"RESET":return Na;default:return t}}const ya=Y.createContext(null),Sa=()=>crypto.randomUUID();function Dl(t){const e=W.c(16),{children:n}=t,{locator:r}=Mt(),[i,s]=Y.useReducer(Ol,Na),a=Ca(),[u,o]=ua(oa.threadManagerState(r)+":active-id",Pl);let c;e[0]!==o||e[1]!==a?(c=_=>{const T=_?.id||crypto.randomUUID(),y=new Date().toISOString(),N={id:T,title:_?.title||"",created_at:_?.created_at||y,updated_at:_?.updated_at||y,hidden:_?.hidden??!1,gatewayId:_?.gatewayId};return a.insert.mutate(N),o(T),N},e[0]=o,e[1]=a,e[2]=c):c=e[2];const f=c;let h;e[3]!==u||e[4]!==o||e[5]!==a?(h=_=>{a.update.mutate({id:_,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===_&&o(Sa())},e[3]=u,e[4]=o,e[5]=a,e[6]=h):h=e[6];const m=h;let d;e[7]!==u||e[8]!==f||e[9]!==m||e[10]!==i||e[11]!==o?(d={interactionState:i,interactionDispatch:s,activeThreadId:u,createThread:f,setActiveThreadId:o,hideThread:m},e[7]=u,e[8]=f,e[9]=m,e[10]=i,e[11]=o,e[12]=d):d=e[12];const g=d;let k;return e[13]!==n||e[14]!==g?(k=p.jsx(ya.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=k):k=e[15],k}function Pl(t){return t||Sa()}function Ml(){const t=W.c(19),e=Y.useContext(ya);if(!e)throw new Error("useChat must be used within a ChatProvider");const{interactionState:n,interactionDispatch:r}=e;let i,s,a,u,o;t[0]!==r?(i=f=>r({type:"SET_INPUT",payload:f}),s=f=>r({type:"START_BRANCH",payload:f}),a=()=>r({type:"CLEAR_BRANCH"}),u=f=>r({type:"SET_PENDING_SUBMIT",payload:f}),o=()=>r({type:"RESET"}),t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=u,t[5]=o):(i=t[1],s=t[2],a=t[3],u=t[4],o=t[5]);let c;return t[6]!==e.activeThreadId||t[7]!==e.createThread||t[8]!==e.hideThread||t[9]!==e.setActiveThreadId||t[10]!==n.branchContext||t[11]!==n.inputValue||t[12]!==n.pendingSubmit||t[13]!==i||t[14]!==s||t[15]!==a||t[16]!==u||t[17]!==o?(c={inputValue:n.inputValue,branchContext:n.branchContext,pendingSubmit:n.pendingSubmit,setInputValue:i,startBranch:s,clearBranch:a,setPendingSubmit:u,reset:o,activeThreadId:e.activeThreadId,createThread:e.createThread,setActiveThreadId:e.setActiveThreadId,hideThread:e.hideThread},t[6]=e.activeThreadId,t[7]=e.createThread,t[8]=e.hideThread,t[9]=e.setActiveThreadId,t[10]=n.branchContext,t[11]=n.inputValue,t[12]=n.pendingSubmit,t[13]=i,t[14]=s,t[15]=a,t[16]=u,t[17]=o,t[18]=c):c=t[18],c}function Bl(){const t=W.c(2),e=Zo();let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function vl(t){const e=W.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let s;e[0]!==i?(s=le("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",i),e[0]=i,e[1]=s):s=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??p.jsx(sa,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(u=p.jsx(ea,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10 rounded-xl border border-stone-200/60 shadow-sm shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=u):u=e[7];let o;e[8]!==n.title?(o=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=o):o=e[9];let c;e[10]!==r?(c=r&&p.jsx(Hn,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=c):c=e[11];let f;e[12]!==o||e[13]!==c?(f=p.jsxs("div",{className:"flex items-center justify-between",children:[o,c]}),e[12]=o,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==n.description?(h=n.description&&p.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=h):h=e[16];let m;e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[f,h]}),e[17]=f,e[18]=h,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==u||e[22]!==m?(d=p.jsxs("div",{className:s,children:[u,m]}),e[20]=s,e[21]=u,e[22]=m,e[23]=d):d=e[23],d}function Fl(t){const e=W.c(25),{gateways:n,selectedGatewayId:r,onGatewayChange:i,searchInputRef:s}=t,[a,u]=Y.useState(""),o=Y.useRef(null),c=s??o;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[0]=f):f=e[0];const{createGateway:h,isCreating:m}=Jo(f);let d;e:{if(!a.trim()){d=n;break e}let P;if(e[1]!==n||e[2]!==a){const S=a.toLowerCase();P=n.filter(U=>U.title.toLowerCase().includes(S)||U.description?.toLowerCase().includes(S)),e[1]=n,e[2]=a,e[3]=P}else P=e[3];d=P}const g=d;let k;e[4]!==i?(k=P=>{i(P),u("")},e[4]=i,e[5]=k):k=e[5];const _=k;let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(Vr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[6]=T):T=e[6];let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=P=>u(P.target.value),e[7]=y):y=e[7];let N;e[8]!==c||e[9]!==a?(N=p.jsx(ta,{ref:c,type:"text",placeholder:"Search for an agent...",value:a,onChange:y,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[8]=c,e[9]=a,e[10]=N):N=e[10];const w=m?"Creating...":"Create Agent";let O;e[11]!==h||e[12]!==m||e[13]!==w?(O=p.jsx(ze,{onClick:h,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:m,children:w}),e[11]=h,e[12]=m,e[13]=w,e[14]=O):O=e[14];let I;e[15]!==N||e[16]!==O?(I=p.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:p.jsxs("div",{className:"relative flex items-center gap-2",children:[T,N,O]})}),e[15]=N,e[16]=O,e[17]=I):I=e[17];let F;e[18]!==g||e[19]!==_||e[20]!==r?(F=p.jsx("div",{className:"overflow-y-auto p-1.5",children:g.length>0?p.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:g.map(P=>p.jsx("div",{role:"button",tabIndex:0,onClick:()=>_(P.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),_(P.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:p.jsx(vl,{gateway:P,isSelected:P.id===r})},P.id))}):p.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"})}),e[18]=g,e[19]=_,e[20]=r,e[21]=F):F=e[21];let H;return e[22]!==F||e[23]!==I?(H=p.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[I,F]}),e[22]=F,e[23]=I,e[24]=H):H=e[24],H}function Qb(t){const e=W.c(37),{selectedGatewayId:n,onGatewayChange:r,className:i,placeholder:s,showTooltip:a,disabled:u}=t,o=s===void 0?"Select Agent":s,c=a===void 0?!0:a,f=u===void 0?!1:u,[h,m]=Y.useState(!1),d=Y.useRef(null),g=Bl();let k,_;e[0]!==h?(k=()=>{h&&setTimeout(()=>{d.current?.focus()},0)},_=[h],e[0]=h,e[1]=k,e[2]=_):(k=e[1],_=e[2]),Y.useEffect(k,_);let T;e[3]!==g||e[4]!==n?(T=n?g.find(ae=>ae.id===n):null,e[3]=g,e[4]=n,e[5]=T):T=e[5];const y=T;let N;e[6]!==r?(N=ae=>{r(ae),m(!1)},e[6]=r,e[7]=N):N=e[7];const w=N;let O;e[8]===Symbol.for("react.memo_cache_sentinel")?(O=ae=>{m(ae)},e[8]=O):O=e[8];const I=O,F=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent";let H;e[9]!==i||e[10]!==F?(H=le("flex items-center justify-center p-1 rounded-md transition-colors shrink-0",F,i),e[9]=i,e[10]=F,e[11]=H):H=e[11];let P;e[12]!==y?(P=y?p.jsx(ea,{icon:y.icon,name:y.title,size:"xs",fallbackIcon:y.fallbackIcon??p.jsx(sa,{size:12}),className:"size-5 rounded-md"}):p.jsx("img",{src:"/favicon.svg",alt:"Default Agent",className:"size-5 rounded-md"}),e[12]=y,e[13]=P):P=e[13];let S;e[14]!==f||e[15]!==o||e[16]!==H||e[17]!==P?(S=p.jsx("button",{type:"button",disabled:f,className:H,"aria-label":o,children:P}),e[14]=f,e[15]=o,e[16]=H,e[17]=P,e[18]=S):S=e[18];const U=S,z=f?!1:h,G=f?void 0:I;let q;e[19]!==U?(q=p.jsx(Yr,{asChild:!0,children:p.jsx(na,{asChild:!0,children:U})}),e[19]=U,e[20]=q):q=e[20];let B;e[21]!==h||e[22]!==y?.title||e[23]!==c?(B=c&&!h&&p.jsx($r,{side:"top",className:"text-xs",children:y?.title??"Choose an agent to chat with"}),e[21]=h,e[22]=y?.title,e[23]=c,e[24]=B):B=e[24];let Q;e[25]!==q||e[26]!==B?(Q=p.jsx(Xo,{children:p.jsxs(qr,{children:[q,B]})}),e[25]=q,e[26]=B,e[27]=Q):Q=e[27];let V;e[28]!==g||e[29]!==w||e[30]!==n?(V=p.jsx(ra,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:p.jsx(Fl,{gateways:g,selectedGatewayId:n,onGatewayChange:w,searchInputRef:d})}),e[28]=g,e[29]=w,e[30]=n,e[31]=V):V=e[31];let J;return e[32]!==z||e[33]!==G||e[34]!==Q||e[35]!==V?(J=p.jsxs(ia,{open:z,onOpenChange:G,children:[Q,V]}),e[32]=z,e[33]=G,e[34]=Q,e[35]=V,e[36]=J):J=e[36],J}function Hl(t){const e=W.c(65),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:u,placeholder:o,className:c,centered:f,contextContent:h,leftActions:m,rightActions:d,maxTextHeight:g,children:k}=t,_=o===void 0?"Ask anything or @ for context":o,T=g===void 0?"164px":g;let y;e[0]!==a||e[1]!==u||e[2]!==n?(y=!a&&!u&&n.trim().length>0,e[0]=a,e[1]=u,e[2]=n,e[3]=y):y=e[3];const N=y;let w;e[4]!==N||e[5]!==u||e[6]!==s||e[7]!==i?(w=xe=>{xe.preventDefault(),u&&s?s():N&&i()},e[4]=N,e[5]=u,e[6]=s,e[7]=i,e[8]=w):w=e[8];const O=w;let I;e[9]!==N||e[10]!==i?(I=xe=>{xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),N&&i())},e[9]=N,e[10]=i,e[11]=I):I=e[11];const F=I;let H;e[12]!==c?(H=le("w-full",c),e[12]=c,e[13]=H):H=e[13];let P;e[14]!==h?(P=h&&p.jsx("div",{className:"mb-1",children:h}),e[14]=h,e[15]=P):P=e[15];let S;e[16]!==T?(S={maxHeight:T},e[16]=T,e[17]=S):S=e[17];let U;e[18]!==r?(U=xe=>r(xe.target.value),e[18]=r,e[19]=U):U=e[19];const z=a||u;let G;e[20]===Symbol.for("react.memo_cache_sentinel")?(G=le("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 !text-[15px] min-h-[20px] w-full","rounded-none shadow-none"),e[20]=G):G=e[20];let q;e[21]===Symbol.for("react.memo_cache_sentinel")?(q={minHeight:"20px",height:"auto",overflow:"hidden"},e[21]=q):q=e[21];let B;e[22]!==F||e[23]!==_||e[24]!==U||e[25]!==z||e[26]!==n?(B=p.jsx(rl,{value:n,onChange:U,onKeyDown:F,placeholder:_,disabled:z,className:G,rows:1,style:q}),e[22]=F,e[23]=_,e[24]=U,e[25]=z,e[26]=n,e[27]=B):B=e[27];let Q;e[28]!==B||e[29]!==S?(Q=p.jsx("div",{className:"overflow-y-auto relative flex-1",style:S,children:B}),e[28]=B,e[29]=S,e[30]=Q):Q=e[30];let V;e[31]!==Q||e[32]!==P?(V=p.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[P,Q]}),e[31]=Q,e[32]=P,e[33]=V):V=e[33];let J;e[34]!==k||e[35]!==m?(J=p.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[m,k]}),e[34]=k,e[35]=m,e[36]=J):J=e[36];const ae=u?"button":"submit";let A;e[37]!==u||e[38]!==s?(A=xe=>{u&&(xe.preventDefault(),xe.stopPropagation(),s?.())},e[37]=u,e[38]=s,e[39]=A):A=e[39];const me=N||u?"default":"ghost",ge=!N&&!u,C=!N&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let de;e[40]!==C?(de=le("size-8 rounded-full transition-all",C),e[40]=C,e[41]=de):de=e[41];const Ie=u?"Stop generating":"Send message (Enter)";let ue;e[42]!==u?(ue=u?p.jsx(ba,{size:20}):p.jsx(nl,{size:20}),e[42]=u,e[43]=ue):ue=e[43];let Ce;e[44]!==ae||e[45]!==A||e[46]!==me||e[47]!==ge||e[48]!==de||e[49]!==Ie||e[50]!==ue?(Ce=p.jsx(ze,{type:ae,onClick:A,variant:me,size:"icon",disabled:ge,className:de,title:Ie,children:ue}),e[44]=ae,e[45]=A,e[46]=me,e[47]=ge,e[48]=de,e[49]=Ie,e[50]=ue,e[51]=Ce):Ce=e[51];let Te;e[52]!==d||e[53]!==Ce?(Te=p.jsxs("div",{className:"flex items-center gap-1",children:[d,Ce]}),e[52]=d,e[53]=Ce,e[54]=Te):Te=e[54];let ke;e[55]!==J||e[56]!==Te?(ke=p.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[J,Te]}),e[55]=J,e[56]=Te,e[57]=ke):ke=e[57];let Ee;e[58]!==V||e[59]!==ke?(Ee=p.jsxs("div",{className:"relative rounded-xl w-full min-h-[130px] flex flex-col border border-border bg-background",children:[V,ke]}),e[58]=V,e[59]=ke,e[60]=Ee):Ee=e[60];let Oe;return e[61]!==O||e[62]!==Ee||e[63]!==H?(Oe=p.jsx("form",{onSubmit:O,className:H,children:Ee}),e[61]=O,e[62]=Ee,e[63]=H,e[64]=Oe):Oe=e[64],Oe}function Ul(){const t=W.c(3),[e,n]=Y.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function Kr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var At=Kr();function Ia(t){At=t}var Jt={exec:()=>null};function ie(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Re.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var Re={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},jl=/^(?:[ \t]*(?:\n|$))+/,zl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$l=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,dn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xr=/(?:[*+-]|\d{1,9}[.)])/,La=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wa=ie(La).replace(/bull/g,Xr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ql=ie(La).replace(/bull/g,Xr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vl=/^[^\n]+/,Jr=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Wl=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gl=ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xr).getRegex(),zn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ei=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ql=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ei).replace("tag",zn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ra=ie(Zr).replace("hr",dn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex(),Kl=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ra).getRegex(),ti={blockquote:Kl,code:zl,def:Wl,fences:$l,heading:Yl,hr:dn,html:Ql,lheading:wa,list:Gl,newline:jl,paragraph:Ra,table:Jt,text:Vl},Mi=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex(),Xl={...ti,lheading:ql,table:Mi,paragraph:ie(Zr).replace("hr",dn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zn).getRegex()},Zl={...ti,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ei).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Zr).replace("hr",dn).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",wa).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Jl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ec=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oa=/^( {2,}|\\)\n(?!\s*$)/,tc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$n=/[\p{P}\p{S}]/u,ni=/[\s\p{P}\p{S}]/u,Da=/[^\s\p{P}\p{S}]/u,nc=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ni).getRegex(),Pa=/(?!~)[\p{P}\p{S}]/u,rc=/(?!~)[\s\p{P}\p{S}]/u,ic=/(?:[^\s\p{P}\p{S}]|~)/u,sc=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ma=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ac=ie(Ma,"u").replace(/punct/g,$n).getRegex(),uc=ie(Ma,"u").replace(/punct/g,Pa).getRegex(),Ba="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oc=ie(Ba,"gu").replace(/notPunctSpace/g,Da).replace(/punctSpace/g,ni).replace(/punct/g,$n).getRegex(),lc=ie(Ba,"gu").replace(/notPunctSpace/g,ic).replace(/punctSpace/g,rc).replace(/punct/g,Pa).getRegex(),cc=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Da).replace(/punctSpace/g,ni).replace(/punct/g,$n).getRegex(),fc=ie(/\\(punct)/,"gu").replace(/punct/g,$n).getRegex(),hc=ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dc=ie(ei).replace("(?:-->|$)","-->").getRegex(),mc=ie("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",dc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,pc=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",wn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),va=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",wn).replace("ref",Jr).getRegex(),Fa=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Jr).getRegex(),gc=ie("reflink|nolink(?!\\()","g").replace("reflink",va).replace("nolink",Fa).getRegex(),ri={_backpedal:Jt,anyPunctuation:fc,autolink:hc,blockSkip:sc,br:Oa,code:ec,del:Jt,emStrongLDelim:ac,emStrongRDelimAst:oc,emStrongRDelimUnd:cc,escape:Jl,link:pc,nolink:Fa,punctuation:nc,reflink:va,reflinkSearch:gc,tag:mc,text:tc,url:Jt},Ec={...ri,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",wn).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wn).getRegex()},kr={...ri,emStrongRDelimAst:lc,emStrongLDelim:uc,url:ie(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},bc={...kr,br:ie(Oa).replace("{2,}","*").getRegex(),text:ie(kr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xn={normal:ti,gfm:Xl,pedantic:Zl},$t={normal:ri,gfm:kr,breaks:bc,pedantic:Ec},Tc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Bi=t=>Tc[t];function Ve(t,e){if(e){if(Re.escapeTest.test(t))return t.replace(Re.escapeReplace,Bi)}else if(Re.escapeTestNoEncode.test(t))return t.replace(Re.escapeReplaceNoEncode,Bi);return t}function vi(t){try{t=encodeURI(t).replace(Re.percentDecode,"%")}catch{return null}return t}function Fi(t,e){const n=t.replace(Re.findPipe,(s,a,u)=>{let o=!1,c=a;for(;--c>=0&&u[c]==="\\";)o=!o;return o?"|":" |"}),r=n.split(Re.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Re.slashPipe,"|");return r}function Yt(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function xc(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Hi(t,e,n,r,i){const s=e.href,a=e.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,o}function _c(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
4
4
  `).map(s=>{const a=s.match(n.other.beginningSpace);if(a===null)return s;const[u]=a;return u.length>=i.length?s.slice(i.length):s}).join(`
5
5
  `)}var Rn=class{options;rules;lexer;constructor(t){this.options=t||At}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Yt(n,`
@@ -83,6 +83,6 @@ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An err
83
83
  `))+1))}const a="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");s.move(a+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
84
84
  `,...s.current()});return/^[\t ]/.test(c)&&(c=hn(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),o(),u(),c}oo.peek=Yg;function oo(t){return t.value||""}function Yg(){return"<"}lo.peek=qg;function lo(t,e,n,r){const i=ki(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");return c+=o.move(n.safe(t.alt,{before:c,after:"]",...o.current()})),c+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(t.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(t.url,{before:c,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(t.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),c+=o.move(")"),a(),c}function qg(){return"!"}co.peek=Vg;function co(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const c=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(c+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return a(),n.stack=f,s(),i==="full"||!c||c!==h?o+=u.move(h+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Vg(){return"!"}fo.peek=Wg;function fo(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],u=n.compilePattern(a);let o;if(a.atBreak)for(;o=u.exec(r);){let c=o.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(o.index+1)}}return i+r+i}function Wg(){return"`"}function ho(t,e){const n=li(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}mo.peek=Gg;function mo(t,e,n,r){const i=ki(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,o;if(ho(t,n)){const f=n.stack;n.stack=[],u=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(t,{before:h,after:">",...a.current()})),h+=a.move(">"),u(),n.stack=f,h}u=n.enter("link"),o=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(t,{before:c,after:"](",...a.current()})),c+=a.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(t.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(o=n.enter("destinationRaw"),c+=a.move(n.safe(t.url,{before:c,after:t.title?" ":")",...a.current()}))),o(),t.title&&(o=n.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(n.safe(t.title,{before:c,after:i,...a.current()})),c+=a.move(i),o()),c+=a.move(")"),u(),c}function Gg(t,e,n){return ho(t,n)?"<":"["}po.peek=Qg;function po(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const c=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(c+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return a(),n.stack=f,s(),i==="full"||!c||c!==h?o+=u.move(h+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Qg(){return"["}function Ci(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Kg(t){const e=Ci(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Xg(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function go(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Zg(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?Xg(n):Ci(n);const u=t.ordered?a==="."?")":".":Kg(n);let o=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),go(n)===a&&f){let h=-1;for(;++h<t.children.length;){const m=t.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(a=u),n.bulletCurrent=a;const c=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),c}function Jg(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function eE(t,e,n,r){const i=Jg(n);let s=n.bulletCurrent||Ci(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(s+" ".repeat(a-s.length)),u.shift(a);const o=n.enter("listItem"),c=n.indentLines(n.containerFlow(t,u.current()),f);return o(),c;function f(h,m,d){return m?(d?"":" ".repeat(a))+h:(d?s:s+" ".repeat(a-s.length))+h}}function tE(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const nE=Qn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rE(t,e,n,r){return(t.children.some(function(a){return nE(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function iE(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Eo.peek=sE;function Eo(t,e,n,r){const i=iE(n),s=n.enter("strong"),a=n.createTracker(r),u=a.move(i+i);let o=a.move(n.containerPhrasing(t,{after:i,before:u,...a.current()}));const c=o.charCodeAt(0),f=Fn(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(o=hn(c)+o.slice(1));const h=o.charCodeAt(o.length-1),m=Fn(r.after.charCodeAt(0),h,i);m.inside&&(o=o.slice(0,-1)+hn(h));const d=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},u+o+d}function sE(t,e,n){return n.options.strong||"*"}function aE(t,e,n,r){return n.safe(t.value,r)}function uE(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function oE(t,e,n){const r=(go(n)+(n.options.ruleSpaces?" ":"")).repeat(uE(n));return n.options.ruleSpaces?r.slice(0,-1):r}const bo={blockquote:Rg,break:qs,code:vg,definition:Hg,emphasis:uo,hardBreak:qs,heading:$g,html:oo,image:lo,imageReference:co,inlineCode:fo,link:mo,linkReference:po,list:Zg,listItem:eE,paragraph:tE,root:rE,strong:Eo,text:aE,thematicBreak:oE};function lE(){return{enter:{table:cE,tableData:Vs,tableHeader:Vs,tableRow:hE},exit:{codeText:dE,table:fE,tableData:Ar,tableHeader:Ar,tableRow:Ar}}}function cE(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function fE(t){this.exit(t),this.data.inTable=void 0}function hE(t){this.enter({type:"tableRow",children:[]},t)}function Ar(t){this.exit(t)}function Vs(t){this.enter({type:"tableCell",children:[]},t)}function dE(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,mE));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function mE(t,e){return e==="|"?e:t}function pE(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
85
85
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:a,tableCell:o,tableRow:u}};function a(d,g,k,_){return c(f(d,k,_),d.align)}function u(d,g,k,_){const T=h(d,k,_),y=c([T]);return y.slice(0,y.indexOf(`
86
- `))}function o(d,g,k,_){const T=k.enter("tableCell"),y=k.enter("phrasing"),N=k.containerPhrasing(d,{..._,before:s,after:s});return y(),T(),N}function c(d,g){return Lg(d,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(d,g,k){const _=d.children;let T=-1;const y=[],N=g.enter("table");for(;++T<_.length;)y[T]=h(_[T],g,k);return N(),y}function h(d,g,k){const _=d.children;let T=-1;const y=[],N=g.enter("tableRow");for(;++T<_.length;)y[T]=o(_[T],d,g,k);return N(),y}function m(d,g,k){let _=bo.inlineCode(d,g,k);return k.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function gE(){return{exit:{taskListCheckValueChecked:Ws,taskListCheckValueUnchecked:Ws,paragraph:bE}}}function EE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:TE}}}function Ws(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function bE(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const u=i[s];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function TE(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(a);let o=bo.listItem(t,e,n,{...r,...u.current()});return s&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),o;function c(f){return f+a}}function xE(){return[Z1(),Tg(),kg(),lE(),gE()]}function _E(t){return{extensions:[J1(),xg(t),Cg(),pE(t),EE()]}}const AE={tokenize:IE,partial:!0},To={tokenize:LE,partial:!0},xo={tokenize:wE,partial:!0},_o={tokenize:RE,partial:!0},kE={tokenize:OE,partial:!0},Ao={name:"wwwAutolink",tokenize:yE,previous:Co},ko={name:"protocolAutolink",tokenize:SE,previous:No},st={name:"emailAutolink",tokenize:NE,previous:yo},Ke={};function CE(){return{text:Ke}}let pt=48;for(;pt<123;)Ke[pt]=st,pt++,pt===58?pt=65:pt===91&&(pt=97);Ke[43]=st;Ke[45]=st;Ke[46]=st;Ke[95]=st;Ke[72]=[st,ko];Ke[104]=[st,ko];Ke[87]=[st,Ao];Ke[119]=[st,Ao];function NE(t,e,n){const r=this;let i,s;return a;function a(h){return!Ur(h)||!yo.call(r,r.previous)||Ni(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(h))}function u(h){return Ur(h)?(t.consume(h),u):h===64?(t.consume(h),o):n(h)}function o(h){return h===46?t.check(kE,f,c)(h):h===45||h===95||Ne(h)?(s=!0,t.consume(h),o):f(h)}function c(h){return t.consume(h),i=!0,o}function f(h){return s&&i&&we(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function yE(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Co.call(r,r.previous)||Ni(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(AE,t.attempt(To,t.attempt(xo,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function SE(t,e,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&No.call(r,r.previous)&&!Ni(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),t.consume(h),u):n(h)}function u(h){if(we(h)&&i.length<5)return i+=String.fromCodePoint(h),t.consume(h),u;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return t.consume(h),o}return n(h)}function o(h){return h===47?(t.consume(h),s?c:(s=!0,o)):n(h)}function c(h){return h===null||Dn(h)||ce(h)||_t(h)||Vn(h)?n(h):t.attempt(To,t.attempt(xo,f),n)(h)}function f(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function IE(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function LE(t,e,n){let r,i,s;return a;function a(c){return c===46||c===95?t.check(_o,o,u)(c):c===null||ce(c)||_t(c)||c!==45&&Vn(c)?o(c):(s=!0,t.consume(c),a)}function u(c){return c===95?r=!0:(i=r,r=void 0),t.consume(c),a}function o(c){return i||r||!s?n(c):e(c)}}function wE(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(_o,e,s)(a):a===null||ce(a)||_t(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function RE(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),s):u===93?(t.consume(u),i):u===60||u===null||ce(u)||_t(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||ce(u)||_t(u)?e(u):r(u)}function s(u){return we(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):we(u)?(t.consume(u),a):n(u)}}function OE(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Ne(s)?n(s):e(s)}}function Co(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ce(t)}function No(t){return!we(t)}function yo(t){return!(t===47||Ur(t))}function Ur(t){return t===43||t===45||t===46||t===95||Ne(t)}function Ni(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DE={tokenize:jE,partial:!0};function PE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FE,continuation:{tokenize:HE},exit:UE}},text:{91:{name:"gfmFootnoteCall",tokenize:vE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ME,resolveTo:BE}}}}function ME(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){a=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!a||!a._balanced)return n(o);const c=Ye(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function BE(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function vE(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return u;function u(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),o}function o(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!a||h===null||h===91||ce(h))return n(h);if(h===93){t.exit("chunkString");const m=t.exit("gfmFootnoteCallString");return i.includes(Ye(r.sliceSerialize(m)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return ce(h)||(a=!0),s++,t.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(t.consume(h),s++,c):c(h)}}function FE(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(g)}function f(g){if(a>999||g===93&&!u||g===null||g===91||ce(g))return n(g);if(g===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return s=Ye(r.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),m}return ce(g)||(u=!0),a++,t.consume(g),g===92?h:f}function h(g){return g===91||g===92||g===93?(t.consume(g),a++,f):f(g)}function m(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(s)||i.push(s),re(t,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return e(g)}}function HE(t,e,n){return t.check(gn,e,t.attempt(DE,e,n))}function UE(t){t.exit("gfmFootnoteDefinition")}function jE(t,e,n){const r=this;return re(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function zE(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,u){let o=-1;for(;++o<a.length;)if(a[o][0]==="enter"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._close){let c=o;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[o][1].end.offset-a[o][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[o][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[o][1].end)},h={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[o][1].start)},m=[["enter",f,u],["enter",a[c][1],u],["exit",a[c][1],u],["enter",h,u]],d=u.parser.constructs.insideSpan.null;d&&He(m,m.length,0,Wn(d,a.slice(c+1,o),u)),He(m,m.length,0,[["exit",h,u],["enter",a[o][1],u],["exit",a[o][1],u],["exit",f,u]]),He(a,c-1,o-c+3,m),o=c+m.length-2;break}}for(o=-1;++o<a.length;)a[o][1].type==="strikethroughSequenceTemporary"&&(a[o][1].type="data");return a}function s(a,u,o){const c=this.previous,f=this.events;let h=0;return m;function m(g){return c===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(a.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const k=Ot(c);if(g===126)return h>1?o(g):(a.consume(g),h++,d);if(h<2&&!n)return o(g);const _=a.exit("strikethroughSequenceTemporary"),T=Ot(g);return _._open=!T||T===2&&!!k,_._close=!k||k===2&&!!T,u(g)}}}class $E{constructor(){this.map=[]}add(e,n,r){YE(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function YE(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function qE(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function VE(){return{flow:{null:{name:"table",tokenize:WE,resolveAll:GE}}}}function WE(t,e,n){const r=this;let i=0,s=0,a;return u;function u(S){let U=r.events.length-1;for(;U>-1;){const q=r.events[U][1].type;if(q==="lineEnding"||q==="linePrefix")U--;else break}const z=U>-1?r.events[U][1].type:null,G=z==="tableHead"||z==="tableRow"?I:o;return G===I&&r.parser.lazy[r.now().line]?n(S):G(S)}function o(S){return t.enter("tableHead"),t.enter("tableRow"),c(S)}function c(S){return S===124||(a=!0,s+=1),f(S)}function f(S){return S===null?n(S):K(S)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),d):n(S):te(S)?re(t,f,"whitespace")(S):(s+=1,a&&(a=!1,i+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),h(S)))}function h(S){return S===null||S===124||ce(S)?(t.exit("data"),f(S)):(t.consume(S),S===92?m:h)}function m(S){return S===92||S===124?(t.consume(S),h):h(S)}function d(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,te(S)?re(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?_(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),k):O(S)}function k(S){return te(S)?re(t,_,"whitespace")(S):_(S)}function _(S){return S===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),T):S===45?(s+=1,T(S)):S===null||K(S)?w(S):O(S)}function T(S){return S===45?(t.enter("tableDelimiterFiller"),y(S)):O(S)}function y(S){return S===45?(t.consume(S),y):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(S))}function N(S){return te(S)?re(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||K(S)?!a||i!==s?O(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):O(S)}function O(S){return n(S)}function I(S){return t.enter("tableRow"),F(S)}function F(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),F):S===null||K(S)?(t.exit("tableRow"),e(S)):te(S)?re(t,F,"whitespace")(S):(t.enter("data"),H(S))}function H(S){return S===null||S===124||ce(S)?(t.exit("data"),F(S)):(t.consume(S),S===92?P:H)}function P(S){return S===92||S===124?(t.consume(S),H):H(S)}}function GE(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],u=!1,o=0,c,f,h;const m=new $E;for(;++n<t.length;){const d=t[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Gs(m,e,o,c,f),f=void 0,o=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",c,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",f,e]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=Nn(m,e,s,i,void 0,h),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],h=Nn(m,e,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,s[1]!==0?(a[0]=a[1],h=Nn(m,e,s,i,n,h)):a[1]!==0&&(h=Nn(m,e,a,i,n,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(o!==0&&Gs(m,e,o,c,f),m.consume(e.events),n=-1;++n<e.events.length;){const d=e.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=qE(e.events,n))}return t}function Nn(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},Lt(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const o=Lt(e.events,n[1]);if(s={type:a,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const c=Lt(e.events,n[2]),f=Lt(e.events,n[3]),h={type:u,start:Object.assign({},c),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const m=e.events[n[2]],d=e.events[n[3]];if(m[1].end=Object.assign({},d[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;t.add(g,k,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return i!==void 0&&(s.end=Object.assign({},Lt(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function Gs(t,e,n,r,i){const s=[],a=Lt(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function Lt(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const QE={name:"tasklistCheck",tokenize:XE};function KE(){return{text:{91:QE}}}function XE(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),s)}function s(o){return ce(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),a):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),a):n(o)}function a(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return K(o)?e(o):te(o)?t.check({tokenize:ZE},e,n)(o):n(o)}}function ZE(t,e,n){return re(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function JE(t){return eu([CE(),PE(),zE(t),VE(),KE()])}const e2={};function t2(t){const e=this,n=t||e2,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(JE(n)),s.push(xE()),a.push(_E(n))}const n2=Y.lazy(()=>$o(()=>import("./lazy-highlighter-BHJogLPz.js"),__vite__mapDeps([0,1,2])));function So(){const t=W.c(3),[e,n]=Y.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function r2(){const t=W.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(i2)}),t[1]=r):r=t[1],r}function i2(t,e){return p.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&p.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function s2(t){const e=W.c(12),n=Y.useRef(null),{handleCopy:r,copied:i}=So(),s=a2;let a;e[0]!==r?(a=async()=>{const m=s(n.current);await r(m)},e[0]=r,e[1]=a):a=e[1];const u=a;let o;e[2]!==i?(o=i?p.jsx(Hn,{size:12}):p.jsx(Wr,{size:12}),e[2]=i,e[3]=o):o=e[3];let c;e[4]!==u||e[5]!==o?(c=p.jsx("div",{className:"flex justify-end items-center",children:p.jsxs(ze,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=c):c=e[6];let f;e[7]!==t?(f=p.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:p.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let h;return e[9]!==c||e[10]!==f?(h=p.jsxs(p.Fragment,{children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11],h}function a2(t){return t?Array.from(t.querySelectorAll("tr")).map(u2).join(`
86
+ `))}function o(d,g,k,_){const T=k.enter("tableCell"),y=k.enter("phrasing"),N=k.containerPhrasing(d,{..._,before:s,after:s});return y(),T(),N}function c(d,g){return Lg(d,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(d,g,k){const _=d.children;let T=-1;const y=[],N=g.enter("table");for(;++T<_.length;)y[T]=h(_[T],g,k);return N(),y}function h(d,g,k){const _=d.children;let T=-1;const y=[],N=g.enter("tableRow");for(;++T<_.length;)y[T]=o(_[T],d,g,k);return N(),y}function m(d,g,k){let _=bo.inlineCode(d,g,k);return k.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function gE(){return{exit:{taskListCheckValueChecked:Ws,taskListCheckValueUnchecked:Ws,paragraph:bE}}}function EE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:TE}}}function Ws(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function bE(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const u=i[s];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function TE(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(a);let o=bo.listItem(t,e,n,{...r,...u.current()});return s&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),o;function c(f){return f+a}}function xE(){return[Z1(),Tg(),kg(),lE(),gE()]}function _E(t){return{extensions:[J1(),xg(t),Cg(),pE(t),EE()]}}const AE={tokenize:IE,partial:!0},To={tokenize:LE,partial:!0},xo={tokenize:wE,partial:!0},_o={tokenize:RE,partial:!0},kE={tokenize:OE,partial:!0},Ao={name:"wwwAutolink",tokenize:yE,previous:Co},ko={name:"protocolAutolink",tokenize:SE,previous:No},st={name:"emailAutolink",tokenize:NE,previous:yo},Ke={};function CE(){return{text:Ke}}let pt=48;for(;pt<123;)Ke[pt]=st,pt++,pt===58?pt=65:pt===91&&(pt=97);Ke[43]=st;Ke[45]=st;Ke[46]=st;Ke[95]=st;Ke[72]=[st,ko];Ke[104]=[st,ko];Ke[87]=[st,Ao];Ke[119]=[st,Ao];function NE(t,e,n){const r=this;let i,s;return a;function a(h){return!Ur(h)||!yo.call(r,r.previous)||Ni(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(h))}function u(h){return Ur(h)?(t.consume(h),u):h===64?(t.consume(h),o):n(h)}function o(h){return h===46?t.check(kE,f,c)(h):h===45||h===95||Ne(h)?(s=!0,t.consume(h),o):f(h)}function c(h){return t.consume(h),i=!0,o}function f(h){return s&&i&&we(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function yE(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Co.call(r,r.previous)||Ni(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(AE,t.attempt(To,t.attempt(xo,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function SE(t,e,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&No.call(r,r.previous)&&!Ni(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),t.consume(h),u):n(h)}function u(h){if(we(h)&&i.length<5)return i+=String.fromCodePoint(h),t.consume(h),u;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return t.consume(h),o}return n(h)}function o(h){return h===47?(t.consume(h),s?c:(s=!0,o)):n(h)}function c(h){return h===null||Dn(h)||ce(h)||_t(h)||Vn(h)?n(h):t.attempt(To,t.attempt(xo,f),n)(h)}function f(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function IE(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function LE(t,e,n){let r,i,s;return a;function a(c){return c===46||c===95?t.check(_o,o,u)(c):c===null||ce(c)||_t(c)||c!==45&&Vn(c)?o(c):(s=!0,t.consume(c),a)}function u(c){return c===95?r=!0:(i=r,r=void 0),t.consume(c),a}function o(c){return i||r||!s?n(c):e(c)}}function wE(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(_o,e,s)(a):a===null||ce(a)||_t(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function RE(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),s):u===93?(t.consume(u),i):u===60||u===null||ce(u)||_t(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||ce(u)||_t(u)?e(u):r(u)}function s(u){return we(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):we(u)?(t.consume(u),a):n(u)}}function OE(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Ne(s)?n(s):e(s)}}function Co(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ce(t)}function No(t){return!we(t)}function yo(t){return!(t===47||Ur(t))}function Ur(t){return t===43||t===45||t===46||t===95||Ne(t)}function Ni(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DE={tokenize:jE,partial:!0};function PE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FE,continuation:{tokenize:HE},exit:UE}},text:{91:{name:"gfmFootnoteCall",tokenize:vE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ME,resolveTo:BE}}}}function ME(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){a=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!a||!a._balanced)return n(o);const c=Ye(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function BE(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function vE(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return u;function u(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),o}function o(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!a||h===null||h===91||ce(h))return n(h);if(h===93){t.exit("chunkString");const m=t.exit("gfmFootnoteCallString");return i.includes(Ye(r.sliceSerialize(m)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return ce(h)||(a=!0),s++,t.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(t.consume(h),s++,c):c(h)}}function FE(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(g)}function f(g){if(a>999||g===93&&!u||g===null||g===91||ce(g))return n(g);if(g===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return s=Ye(r.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),m}return ce(g)||(u=!0),a++,t.consume(g),g===92?h:f}function h(g){return g===91||g===92||g===93?(t.consume(g),a++,f):f(g)}function m(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(s)||i.push(s),re(t,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return e(g)}}function HE(t,e,n){return t.check(gn,e,t.attempt(DE,e,n))}function UE(t){t.exit("gfmFootnoteDefinition")}function jE(t,e,n){const r=this;return re(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function zE(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,u){let o=-1;for(;++o<a.length;)if(a[o][0]==="enter"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._close){let c=o;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[o][1].end.offset-a[o][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[o][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[o][1].end)},h={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[o][1].start)},m=[["enter",f,u],["enter",a[c][1],u],["exit",a[c][1],u],["enter",h,u]],d=u.parser.constructs.insideSpan.null;d&&He(m,m.length,0,Wn(d,a.slice(c+1,o),u)),He(m,m.length,0,[["exit",h,u],["enter",a[o][1],u],["exit",a[o][1],u],["exit",f,u]]),He(a,c-1,o-c+3,m),o=c+m.length-2;break}}for(o=-1;++o<a.length;)a[o][1].type==="strikethroughSequenceTemporary"&&(a[o][1].type="data");return a}function s(a,u,o){const c=this.previous,f=this.events;let h=0;return m;function m(g){return c===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(a.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const k=Ot(c);if(g===126)return h>1?o(g):(a.consume(g),h++,d);if(h<2&&!n)return o(g);const _=a.exit("strikethroughSequenceTemporary"),T=Ot(g);return _._open=!T||T===2&&!!k,_._close=!k||k===2&&!!T,u(g)}}}class $E{constructor(){this.map=[]}add(e,n,r){YE(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function YE(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function qE(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function VE(){return{flow:{null:{name:"table",tokenize:WE,resolveAll:GE}}}}function WE(t,e,n){const r=this;let i=0,s=0,a;return u;function u(S){let U=r.events.length-1;for(;U>-1;){const q=r.events[U][1].type;if(q==="lineEnding"||q==="linePrefix")U--;else break}const z=U>-1?r.events[U][1].type:null,G=z==="tableHead"||z==="tableRow"?I:o;return G===I&&r.parser.lazy[r.now().line]?n(S):G(S)}function o(S){return t.enter("tableHead"),t.enter("tableRow"),c(S)}function c(S){return S===124||(a=!0,s+=1),f(S)}function f(S){return S===null?n(S):K(S)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),d):n(S):te(S)?re(t,f,"whitespace")(S):(s+=1,a&&(a=!1,i+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),h(S)))}function h(S){return S===null||S===124||ce(S)?(t.exit("data"),f(S)):(t.consume(S),S===92?m:h)}function m(S){return S===92||S===124?(t.consume(S),h):h(S)}function d(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,te(S)?re(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?_(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),k):O(S)}function k(S){return te(S)?re(t,_,"whitespace")(S):_(S)}function _(S){return S===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),T):S===45?(s+=1,T(S)):S===null||K(S)?w(S):O(S)}function T(S){return S===45?(t.enter("tableDelimiterFiller"),y(S)):O(S)}function y(S){return S===45?(t.consume(S),y):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(S))}function N(S){return te(S)?re(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||K(S)?!a||i!==s?O(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):O(S)}function O(S){return n(S)}function I(S){return t.enter("tableRow"),F(S)}function F(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),F):S===null||K(S)?(t.exit("tableRow"),e(S)):te(S)?re(t,F,"whitespace")(S):(t.enter("data"),H(S))}function H(S){return S===null||S===124||ce(S)?(t.exit("data"),F(S)):(t.consume(S),S===92?P:H)}function P(S){return S===92||S===124?(t.consume(S),H):H(S)}}function GE(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],u=!1,o=0,c,f,h;const m=new $E;for(;++n<t.length;){const d=t[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Gs(m,e,o,c,f),f=void 0,o=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",c,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",f,e]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=Nn(m,e,s,i,void 0,h),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],h=Nn(m,e,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,s[1]!==0?(a[0]=a[1],h=Nn(m,e,s,i,n,h)):a[1]!==0&&(h=Nn(m,e,a,i,n,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(o!==0&&Gs(m,e,o,c,f),m.consume(e.events),n=-1;++n<e.events.length;){const d=e.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=qE(e.events,n))}return t}function Nn(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},Lt(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const o=Lt(e.events,n[1]);if(s={type:a,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const c=Lt(e.events,n[2]),f=Lt(e.events,n[3]),h={type:u,start:Object.assign({},c),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const m=e.events[n[2]],d=e.events[n[3]];if(m[1].end=Object.assign({},d[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;t.add(g,k,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return i!==void 0&&(s.end=Object.assign({},Lt(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function Gs(t,e,n,r,i){const s=[],a=Lt(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function Lt(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const QE={name:"tasklistCheck",tokenize:XE};function KE(){return{text:{91:QE}}}function XE(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),s)}function s(o){return ce(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),a):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),a):n(o)}function a(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return K(o)?e(o):te(o)?t.check({tokenize:ZE},e,n)(o):n(o)}}function ZE(t,e,n){return re(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function JE(t){return eu([CE(),PE(),zE(t),VE(),KE()])}const e2={};function t2(t){const e=this,n=t||e2,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(JE(n)),s.push(xE()),a.push(_E(n))}const n2=Y.lazy(()=>$o(()=>import("./lazy-highlighter-B2TKQCpQ.js"),__vite__mapDeps([0,1,2])));function So(){const t=W.c(3),[e,n]=Y.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function r2(){const t=W.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(i2)}),t[1]=r):r=t[1],r}function i2(t,e){return p.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&p.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function s2(t){const e=W.c(12),n=Y.useRef(null),{handleCopy:r,copied:i}=So(),s=a2;let a;e[0]!==r?(a=async()=>{const m=s(n.current);await r(m)},e[0]=r,e[1]=a):a=e[1];const u=a;let o;e[2]!==i?(o=i?p.jsx(Hn,{size:12}):p.jsx(Wr,{size:12}),e[2]=i,e[3]=o):o=e[3];let c;e[4]!==u||e[5]!==o?(c=p.jsx("div",{className:"flex justify-end items-center",children:p.jsxs(ze,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=c):c=e[6];let f;e[7]!==t?(f=p.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:p.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let h;return e[9]!==c||e[10]!==f?(h=p.jsxs(p.Fragment,{children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11],h}function a2(t){return t?Array.from(t.querySelectorAll("tr")).map(u2).join(`
87
87
  `):""}function u2(t){return Array.from(t.querySelectorAll("th,td")).map(o2).join(",")}function o2(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const l2=[t2],c2=[V1],f2={p:t=>p.jsx("p",{...t,className:"leading-relaxed text-[15px] mb-2 last:mb-0"}),strong:t=>p.jsx("strong",{...t,className:"font-bold"}),em:t=>p.jsx("em",{...t,className:"italic"}),a:t=>p.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>p.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>p.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>p.jsx("li",{...t,className:"leading-relaxed text-[15px]"}),code:t=>p.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-[15px] font-mono break-all"}),pre:t=>p.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:p.jsx("code",{className:"flex-1 min-w-0 p-4 text-[15px] font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>p.jsx(s2,{...t}),thead:t=>p.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>p.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>p.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>p.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Io=Y.memo(t=>{const e=W.c(2),{content:n}=t;let r;return e[0]!==n?(r=p.jsx(wd,{remarkPlugins:l2,rehypePlugins:c2,components:f2,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function h2(t){const e=W.c(20),{language:n,content:r}=t,{handleCopy:i,copied:s}=So(),a=n||"text";let u;e[0]!==a?(u=p.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let c;e[5]!==s?(c=s?p.jsx(Hn,{size:14}):p.jsx(Wr,{size:14}),e[5]=s,e[6]=c):c=e[6];let f;e[7]!==o||e[8]!==c?(f=p.jsx(ze,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:c}),e[7]=o,e[8]=c,e[9]=f):f=e[9];let h;e[10]!==u||e[11]!==f?(h=p.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,f]}),e[10]=u,e[11]=f,e[12]=h):h=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx(r2,{}),e[13]=m):m=e[13];let d;e[14]!==r||e[15]!==n?(d=p.jsx(Y.Suspense,{fallback:m,children:p.jsx(n2,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=d):d=e[16];let g;return e[17]!==h||e[18]!==d?(g=p.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[h,d]}),e[17]=h,e[18]=d,e[19]=g):g=e[19],g}Io.displayName="MemoizedMarkdownBlock";const yi=t=>{const e=W.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=se.lexer(r),e[0]=r,e[1]=i):i=e[1];const s=i;let a;if(e[2]!==s||e[3]!==n){let u;e[5]!==n?(u=(o,c)=>o.type==="code"?p.jsx(h2,{language:o.lang,content:o.text},`${n}-block_${c}`):p.jsx(Io,{content:o.raw},`${n}-block_${c}`),e[5]=n,e[6]=u):u=e[6],a=s.map(u),e[2]=s,e[3]=n,e[4]=a}else a=e[4];return a};yi.displayName="MemoizedMarkdown";function Lo(t){const e=W.c(18),{id:n,part:r,copyable:i,extraActions:s,hasToolCallAfter:a}=t,u=i===void 0?!1:i,o=a===void 0?!1:a,{handleCopy:c}=Ul(),[f,h]=Y.useState(!1);let m;e[0]!==c||e[1]!==r.text?(m=async()=>{await c(r.text),h(!0),setTimeout(()=>h(!1),2e3)},e[0]=c,e[1]=r.text,e[2]=m):m=e[2];const d=m,g=u&&s,k=g||s,_=!o&&"mb-2";let T;e[3]!==_?(T=le("group/part relative",_),e[3]=_,e[4]=T):T=e[4];let y;e[5]!==n||e[6]!==r.text?(y=p.jsx(yi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=y):y=e[7];let N;e[8]!==s||e[9]!==d||e[10]!==f||e[11]!==k||e[12]!==g?(N=k&&p.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:p.jsxs("div",{className:"flex items-center gap-1",children:[g&&p.jsx(ze,{onClick:d,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:f?p.jsx(Hn,{size:12}):p.jsx(Wr,{size:12})}),s]})}),e[8]=s,e[9]=d,e[10]=f,e[11]=k,e[12]=g,e[13]=N):N=e[13];let w;return e[14]!==T||e[15]!==y||e[16]!==N?(w=p.jsxs("div",{className:T,children:[y,N]}),e[14]=T,e[15]=y,e[16]=N,e[17]=w):w=e[17],w}function d2(t){const e=W.c(4),{output:n}=t;let r;if(e[0]!==n){const a=JSON.stringify(n,null,2);r=a.length>2e3?a.slice(0,2e3)+"...[TRUNCATED]":a,e[0]=n,e[1]=r}else r=e[1];const i=r;let s;return e[2]!==i?(s=p.jsx("div",{className:"h-full",children:p.jsx(ca,{code:i,language:"json",height:"100%",readOnly:!0})}),e[2]=i,e[3]=s):s=e[3],s}var nr="Collapsible",[m2,Kb]=Yo(nr),[p2,Si]=m2(nr),wo=Y.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...u}=t,[o,c]=qo({prop:r,defaultProp:i??!1,onChange:a,caller:nr});return p.jsx(p2,{scope:n,disabled:s,contentId:Vo(),open:o,onOpenToggle:Y.useCallback(()=>c(f=>!f),[c]),children:p.jsx(zr.div,{"data-state":Ri(o),"data-disabled":s?"":void 0,...u,ref:e})})});wo.displayName=nr;var Ro="CollapsibleTrigger",Ii=Y.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=Si(Ro,n);return p.jsx(zr.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ri(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Go(t.onClick,i.onOpenToggle)})});Ii.displayName=Ro;var Li="CollapsibleContent",wi=Y.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Si(Li,t.__scopeCollapsible);return p.jsx(Wo,{present:n||i.open,children:({present:s})=>p.jsx(g2,{...r,ref:e,present:s})})});wi.displayName=Li;var g2=Y.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=t,a=Si(Li,n),[u,o]=Y.useState(r),c=Y.useRef(null),f=Qo(e,c),h=Y.useRef(0),m=h.current,d=Y.useRef(0),g=d.current,k=a.open||u,_=Y.useRef(k),T=Y.useRef(void 0);return Y.useEffect(()=>{const y=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(y)},[]),Ko(()=>{const y=c.current;if(y){T.current=T.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const N=y.getBoundingClientRect();h.current=N.height,d.current=N.width,_.current||(y.style.transitionDuration=T.current.transitionDuration,y.style.animationName=T.current.animationName),o(r)}},[a.open,r]),p.jsx(zr.div,{"data-state":Ri(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!k,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:k&&i})});function Ri(t){return t?"open":"closed"}var E2=wo,Xb=Ii,Zb=wi;function b2(t){const e=W.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(E2,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function T2(t){const e=W.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(Ii,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function x2(t){const e=W.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(wi,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function _2(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Qs(t){const e=W.c(70),{part:n,isFirstInSequence:r,isLastInSequence:i,hasNextToolCall:s}=t,a=r===void 0?!1:r,u=i===void 0?!1:i,o=s===void 0?!1:s,{state:c}=n;let f;e[0]!==n?(f="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=f):f=e[1];const h=f;let m;e[2]!==h?(m=_2(h),e[2]=h,e[3]=m):m=e[3];const d=m,[g,k]=Y.useState(!1),[_]=yl(),T=(c==="input-streaming"||c==="input-available"||c==="output-available")&&!!n.input,y=c==="output-available",N=c==="output-error";if(!_){const Ie=c==="input-streaming"||c==="input-available",ue=c==="output-available",Ce=c==="output-error",Te=a&&"mt-2",ke=u&&"mb-2";let Ee;e[4]!==Te||e[5]!==ke?(Ee=le("flex items-center gap-1.5 py-2 opacity-75 relative",Te,ke),e[4]=Te,e[5]=ke,e[6]=Ee):Ee=e[6];let Oe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Oe=p.jsx(fa,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Oe):Oe=e[7];let xe;e[8]!==o?(xe=o&&p.jsx("div",{className:"absolute left-1/2 top-full w-px bg-border -translate-x-1/2",style:{height:"calc(100% + 1rem)"}}),e[8]=o,e[9]=xe):xe=e[9];let at;e[10]!==xe?(at=p.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Oe,xe]}),e[10]=xe,e[11]=at):at=e[11];let ut;e[12]!==d||e[13]!==Ie?(ut=Ie&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground shimmer",children:"Calling"})," ",p.jsxs("span",{className:"text-muted-foreground/75 shimmer",children:[d,"..."]})]}),e[12]=d,e[13]=Ie,e[14]=ut):ut=e[14];let Xe;e[15]!==d||e[16]!==ue?(Xe=ue&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",p.jsx("span",{className:"text-muted-foreground/75",children:d})]}),e[15]=d,e[16]=ue,e[17]=Xe):Xe=e[17];let Ze;e[18]!==d||e[19]!==Ce?(Ze=Ce&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",p.jsx("span",{className:"text-destructive/75",children:d})]}),e[18]=d,e[19]=Ce,e[20]=Ze):Ze=e[20];let Je;e[21]!==ut||e[22]!==Xe||e[23]!==Ze?(Je=p.jsxs("span",{className:"text-[15px]",children:[ut,Xe,Ze]}),e[21]=ut,e[22]=Xe,e[23]=Ze,e[24]=Je):Je=e[24];let Nt;return e[25]!==at||e[26]!==Je||e[27]!==Ee?(Nt=p.jsxs("div",{className:Ee,children:[at,Je]}),e[25]=at,e[26]=Je,e[27]=Ee,e[28]=Nt):Nt=e[28],Nt}let w;e[29]!==c?(w=c==="output-error"?p.jsx(aa,{className:"size-4 text-destructive shrink-0"}):p.jsx(sl,{className:le("size-4 text-muted-foreground shrink-0",(c==="input-streaming"||c==="input-available")&&"shimmer")}),e[29]=c,e[30]=w):w=e[30];const O=c==="output-error"&&"text-destructive/90",I=(c==="input-streaming"||c==="input-available")&&"shimmer";let F;e[31]!==O||e[32]!==I?(F=le("text-[15px] font-medium text-muted-foreground truncate",O,I),e[31]=O,e[32]=I,e[33]=F):F=e[33];const H=c==="input-streaming"&&`Streaming ${h} arguments`,P=c==="input-available"&&`Calling ${h}`,S=c==="output-available"&&`Called ${h}`,U=c==="output-error"&&`Error calling ${h}`;let z;e[34]!==H||e[35]!==P||e[36]!==S||e[37]!==U||e[38]!==F?(z=p.jsxs("span",{className:F,children:[H,P,S,U]}),e[34]=H,e[35]=P,e[36]=S,e[37]=U,e[38]=F,e[39]=z):z=e[39];let G;e[40]!==z||e[41]!==w?(G=p.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w,z]}),e[40]=z,e[41]=w,e[42]=G):G=e[42];const q=g&&"rotate-90";let B;e[43]!==q?(B=le("size-4 text-muted-foreground transition-transform duration-200",q),e[43]=q,e[44]=B):B=e[44];let Q;e[45]!==B?(Q=p.jsx("div",{className:"flex items-center gap-2 shrink-0",children:p.jsx(la,{className:B})}),e[45]=B,e[46]=Q):Q=e[46];let V;e[47]!==G||e[48]!==Q?(V=p.jsxs(T2,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[G,Q]}),e[47]=G,e[48]=Q,e[49]=V):V=e[49];let J;e[50]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx("div",{className:"w-4 relative shrink-0",children:p.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[50]=J):J=e[50];let ae;e[51]!==n.input||e[52]!==T?(ae=T&&p.jsxs("div",{className:"flex flex-col gap-0.5",children:[p.jsx("div",{className:"px-1 h-5 flex items-center",children:p.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),p.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:p.jsx(ca,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),e[51]=n.input,e[52]=T,e[53]=ae):ae=e[53];let A;e[54]!==n.output||e[55]!==y?(A=y&&p.jsxs("div",{className:"flex flex-col gap-0.5",children:[p.jsx("div",{className:"px-1 h-5 flex items-center",children:p.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),p.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:p.jsx(d2,{output:n.output})})]}),e[54]=n.output,e[55]=y,e[56]=A):A=e[56];let me;e[57]!==n||e[58]!==N?(me=N&&p.jsxs("div",{className:"flex flex-col gap-0.5",children:[p.jsx("div",{className:"px-1 h-5 flex items-center",children:p.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),p.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:p.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[57]=n,e[58]=N,e[59]=me):me=e[59];let ge;e[60]!==ae||e[61]!==A||e[62]!==me?(ge=p.jsx(x2,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[J,p.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[ae,A,me]})]})}),e[60]=ae,e[61]=A,e[62]=me,e[63]=ge):ge=e[63];let C;e[64]!==V||e[65]!==ge?(C=p.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[V,ge]}),e[64]=V,e[65]=ge,e[66]=C):C=e[66];let de;return e[67]!==g||e[68]!==C?(de=p.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:p.jsx(b2,{open:g,onOpenChange:k,children:C})}),e[67]=g,e[68]=C,e[69]=de):de=e[69],de}const A2={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function k2(t){if(!t?.providerMetadata)return null;for(const e of Object.values(A2)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function C2(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(k2(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function N2(t){const e=W.c(38),{messages:n}=t;let r,i,s,a,u,o,c,f,h,m,d,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=C2(n);if(!w){g=null;break e}const{totalTokens:O,inputTokens:I,outputTokens:F,cost:H}=w;if(s=H,!O&&!I&&!F){g=null;break e}i=qr;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=p.jsx(ha,{size:12}),e[13]=P):P=e[13];const S=p.jsxs(ze,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[P,p.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:O.toLocaleString()})]});e[14]!==S?(d=p.jsx(Yr,{asChild:!0,children:S}),e[14]=S,e[15]=d):d=e[15],r=$r,h="top",m="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],c=p.jsx("span",{children:I.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(f=p.jsx("span",{className:"text-muted",children:"out"}),e[17]=f):f=e[17],a=F.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=u,e[6]=o,e[7]=c,e[8]=f,e[9]=h,e[10]=m,e[11]=d,e[12]=g}else r=e[1],i=e[2],s=e[3],a=e[4],u=e[5],o=e[6],c=e[7],f=e[8],h=e[9],m=e[10],d=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let k;e[18]!==a?(k=p.jsx("span",{children:a}),e[18]=a,e[19]=k):k=e[19];let _;e[20]!==s?(_=s>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cost"}),p.jsxs("span",{children:["$",s.toFixed(4)]})]}),e[20]=s,e[21]=_):_=e[21];let T;e[22]!==k||e[23]!==_||e[24]!==u||e[25]!==o||e[26]!==c||e[27]!==f?(T=p.jsxs("div",{className:u,children:[o,c,f,k,_]}),e[22]=k,e[23]=_,e[24]=u,e[25]=o,e[26]=c,e[27]=f,e[28]=T):T=e[28];let y;e[29]!==r||e[30]!==T||e[31]!==h||e[32]!==m?(y=p.jsx(r,{side:h,className:m,children:T}),e[29]=r,e[30]=T,e[31]=h,e[32]=m,e[33]=y):y=e[33];let N;return e[34]!==i||e[35]!==y||e[36]!==d?(N=p.jsxs(i,{children:[d,y]}),e[34]=i,e[35]=y,e[36]=d,e[37]=N):N=e[37],N}const y2={planning:{icon:p.jsx(Ta,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:p.jsx(Un,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},S2=1200;function I2(){const t=W.c(7),[e,n]=Y.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},S2);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),Y.useEffect(r,i);const s=y2[e];let a;t[2]!==s.label?(a=p.jsxs("span",{className:"text-[15px] text-muted-foreground shimmer",children:[s.label,"..."]}),t[2]=s.label,t[3]=a):a=t[3];let u;return t[4]!==s.icon||t[5]!==a?(u=p.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:p.jsxs("span",{className:"flex items-center gap-1.5",children:[s.icon,a]})}),t[4]=s.icon,t[5]=a,t[6]=u):u=t[6],u}function L2(t){const e=W.c(10),{duration:n,parts:r,id:i}=t,s=n/1e3;let a;e[0]!==s?(a=s.toFixed(1),e[0]=s,e[1]=a):a=e[1];const u=a,[o,c]=Y.useState(!1),[f,h]=Y.useState(!1);let m;if(e[2]!==i||e[3]!==f||e[4]!==o||e[5]!==r||e[6]!==u){const d=r.filter(R2),g=d.some(w2),k=g||f;let _,T;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=()=>c(!0),T=()=>c(!1),e[8]=_,e[9]=T):(_=e[8],T=e[9]),m=p.jsxs("div",{className:"flex flex-col mb-2",children:[p.jsx("button",{type:"button",onClick:()=>!g&&h(!f),onMouseEnter:_,onMouseLeave:T,className:le("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:p.jsxs("span",{className:"flex items-center gap-1.5",children:[g?p.jsx(Un,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?p.jsx(la,{className:le("text-muted-foreground transition-transform shrink-0",f&&"rotate-90"),size:14}):p.jsx(ga,{className:"text-muted-foreground shrink-0",size:14}),p.jsx("span",{className:le("text-[15px] text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),k&&p.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:d.map((y,N)=>p.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:p.jsx(yi,{id:`${i}-reasoning-${N}`,text:y.text})},`${i}-reasoning-${N}`))})]}),e[2]=i,e[3]=f,e[4]=o,e[5]=r,e[6]=u,e[7]=m}else m=e[7];return m}function w2(t){return t.state==="streaming"}function R2(t){return t.type==="reasoning"}function O2(t){const e=W.c(17),{part:n,id:r,usageStats:i,isFollowedByToolCall:s,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:o}=t;switch(n.type){case"dynamic-tool":{let c;return e[0]!==o||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(c=p.jsx(Qs,{part:n,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:o}),e[0]=o,e[1]=r,e[2]=a,e[3]=u,e[4]=n,e[5]=c):c=e[5],c}case"text":{let c;return e[6]!==r||e[7]!==s||e[8]!==n||e[9]!==i?(c=p.jsx(Lo,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:s}),e[6]=r,e[7]=s,e[8]=n,e[9]=i,e[10]=c):c=e[10],c}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const c=n;let f;return e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==c?(f=p.jsx(Qs,{part:c,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:o}),e[11]=o,e[12]=r,e[13]=a,e[14]=u,e[15]=c,e[16]=f):f=e[16],f}}throw new Error(`Unknown part type: ${n.type}`)}function D2(t){const e=W.c(24),{message:n,status:r,className:i}=t,{id:s,parts:a}=n,c=r==="streaming"||r==="submitted",f=a.length>0;let h;e[0]!==a?(h=a.some(M2),e[0]=a,e[1]=h):h=e[1];const m=h;let d;e[2]!==c||e[3]!==a?(d=c&&a.some(P2),e[2]=c,e[3]=a,e[4]=d):d=e[4];const g=d;let k;if(e[5]!==n.metadata){const H=n.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,P=n.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):null;k=H!==null?(P??new Date).getTime()-H.getTime():null,e[5]=n.metadata,e[6]=k}else k=e[6];const _=k,T=f&&(m||g)&&_!==null;let y;e[7]!==n?(y=p.jsx(N2,{messages:[n]}),e[7]=n,e[8]=y):y=e[8];const N=y;let w;e[9]!==i?(w=le("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[9]=i,e[10]=w):w=e[10];let O;e[11]!==_||e[12]!==f||e[13]!==s||e[14]!==c||e[15]!==a||e[16]!==T||e[17]!==N?(O=f?p.jsxs(p.Fragment,{children:[T&&p.jsx(L2,{duration:_,parts:a,id:s}),a.map((H,P)=>{const S=a[P+1],U=a[P-1],z=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),G=H.type==="dynamic-tool"||H.type.startsWith("tool-"),q=U&&(U.type==="dynamic-tool"||U.type.startsWith("tool-")),B=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),Q=G&&!q,V=G&&!B,J=G&&B;return p.jsx(O2,{part:H,id:s,usageStats:P===a.length-1?N:void 0,isFollowedByToolCall:z,isFirstToolCallInSequence:Q,isLastToolCallInSequence:V,hasNextToolCall:J},`${s}-${P}`)})]}):c?p.jsx(I2,{}):null,e[11]=_,e[12]=f,e[13]=s,e[14]=c,e[15]=a,e[16]=T,e[17]=N,e[18]=O):O=e[18];let I;e[19]!==O?(I=p.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:p.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[15px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:O})}),e[19]=O,e[20]=I):I=e[20];let F;return e[21]!==w||e[22]!==I?(F=p.jsx("div",{className:w,children:I}),e[21]=w,e[22]=I,e[23]=F):F=e[23],F}function P2(t){return t.type==="reasoning"&&t.state==="streaming"}function M2(t){return t.type==="reasoning"}const Oo=Y.createContext(null);function Do(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=p.jsx(p.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function B2(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!Y.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const s=t[n-1],a=Y.isValidElement(s)&&s.props?.message?.role,u=s&&Y.isValidElement(s)&&a==="user"?s:null;e.push({user:u,assistant:r})}}return e}function v2(t){const e=W.c(27),{children:n,className:r,minHeightOffset:i}=t,s=Y.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=Y.useRef(a);let o,c,f,h,m,d,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const y=Y.Children.toArray(n),N=y[y.length-1];c=N&&Y.isValidElement(N)&&N.type===Do?N:null;const w=c?y.slice(0,-1):y,O=B2(w);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=H=>{const P=u.current[H];if(P&&s.current){const S=s.current.offsetTop,U=P.offsetTop;s.current.scrollTo({top:U-S,behavior:"smooth"})}},e[11]=I):I=e[11];const F=I;o=Oo.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:F},e[12]=g):g=e[12],m=s,e[13]!==r?(d=le("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=d):d=e[14],f="flex flex-col min-w-0 max-w-2xl mx-auto w-full",h=O.map((H,P)=>{const S=P===O.length-1;return p.jsxs("div",{ref:U=>{u.current[P]=U},className:"flex flex-col pb-2",style:S&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[p.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),p.jsx("div",{className:"sticky mb-3 top-4 z-50",children:H.user&&Y.isValidElement(H.user)?Y.cloneElement(H.user,{pairIndex:P}):H.user}),H.assistant]},P)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=c,e[6]=f,e[7]=h,e[8]=m,e[9]=d,e[10]=g}else o=e[4],c=e[5],f=e[6],h=e[7],m=e[8],d=e[9],g=e[10];let k;e[15]!==c||e[16]!==f||e[17]!==h?(k=p.jsxs("div",{className:f,children:[h,c]}),e[15]=c,e[16]=f,e[17]=h,e[18]=k):k=e[18];let _;e[19]!==m||e[20]!==d||e[21]!==k?(_=p.jsx("div",{ref:m,className:d,children:k}),e[19]=m,e[20]=d,e[21]=k,e[22]=_):_=e[22];let T;return e[23]!==o||e[24]!==g||e[25]!==_?(T=p.jsx(o,{value:g,children:_}),e[23]=o,e[24]=g,e[25]=_,e[26]=T):T=e[26],T}function F2(t){const e=W.c(5),{locator:n}=Mt(),r=Rl(),i=Ca();let s;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(s=async(u,o,c)=>{const f=await ka(n,c),h=f.findIndex(_=>_.id===u);if(h===-1){console.warn(`[branch] Message ${u} not found in thread ${c}`);return}const m=f.slice(0,h).filter(H2),d=crypto.randomUUID(),g=new Date().toISOString(),k={id:d,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(k),m.length>0){const _=m.map(T=>({...T,id:crypto.randomUUID(),metadata:{...T.metadata,thread_id:d,created_at:T.metadata?.created_at||g}}));await r.insertMany.mutateAsync(_)}t(d)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=s):s=e[4],s}function H2(t){return t.role!=="system"}function U2(t){const e=W.c(18),{messageId:n,parts:r}=t,[i,s]=Y.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:o,activeThreadId:c}=Ml(),f=F2(o);let h;e[0]!==r?(h=r.filter(z2).map(j2).join(`
88
88
  `),e[0]=r,e[1]=h):h=e[1];const m=h;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=I=>{I.stopPropagation(),s(!0)},e[2]=d):d=e[2];const g=d;let k;e[3]!==c||e[4]!==f||e[5]!==n||e[6]!==m||e[7]!==a||e[8]!==u?(k=async()=>{await f(n,m,c),a(m),u({originalThreadId:c,originalMessageId:n,originalMessageText:m}),s(!1)},e[3]=c,e[4]=f,e[5]=n,e[6]=m,e[7]=a,e[8]=u,e[9]=k):k=e[9];const _=k;let T;e[10]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:p.jsxs(qr,{children:[p.jsx(Yr,{asChild:!0,children:p.jsx(ze,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:p.jsx(pa,{size:16,className:"p-0.5"})})}),p.jsx($r,{side:"bottom",children:"Edit message"})]})}),e[10]=T):T=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=p.jsxs(al,{children:[p.jsx(ul,{children:"Edit message?"}),p.jsx(ol,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=y):y=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=p.jsx(ll,{children:"Cancel"}),e[12]=N):N=e[12];let w;e[13]!==_?(w=p.jsxs(cl,{children:[y,p.jsxs(fl,{children:[N,p.jsx(hl,{onClick:_,children:"Confirm"})]})]}),e[13]=_,e[14]=w):w=e[14];let O;return e[15]!==i||e[16]!==w?(O=p.jsxs(p.Fragment,{children:[T,p.jsx(dl,{open:i,onOpenChange:s,children:w})]}),e[15]=i,e[16]=w,e[17]=O):O=e[17],O}function j2(t){return t.text}function z2(t){return t.type==="text"}function $2(t){const e=W.c(29),{message:n,className:r,pairIndex:i}=t,{id:s,parts:a}=n,u=Y.useContext(Oo),[o,c]=Y.useState(!1);if(!a||a.length===0)return null;let f;e[0]!==u||e[1]!==i?(f=()=>{c(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=f):f=e[2];const h=f;let m;e[3]!==r?(m=le("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=m):m=e[4];let d,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=()=>c(!0),g=()=>c(!1),e[5]=d,e[6]=g):(d=e[5],g=e[6]);const k=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let _;e[7]!==k?(_=le("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",k),e[7]=k,e[8]=_):_=e[8];let T;if(e[9]!==s||e[10]!==a){let F;e[12]!==s?(F=(H,P)=>H.type==="text"?p.jsx(Lo,{id:s,part:H},`${s}-${P}`):null,e[12]=s,e[13]=F):F=e[13],T=a.map(F),e[9]=s,e[10]=a,e[11]=T}else T=e[11];let y;e[14]!==T?(y=p.jsx("div",{children:T}),e[14]=T,e[15]=y):y=e[15];let N;e[16]!==_||e[17]!==y?(N=p.jsx("div",{className:_,children:y}),e[16]=_,e[17]=y,e[18]=N):N=e[18];let w;e[19]!==s||e[20]!==a?(w=p.jsx(U2,{messageId:s,parts:a}),e[19]=s,e[20]=a,e[21]=w):w=e[21];let O;e[22]!==h||e[23]!==w||e[24]!==N?(O=p.jsxs("div",{tabIndex:0,onClick:h,onFocus:d,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[N,w]}),e[22]=h,e[23]=w,e[24]=N,e[25]=O):O=e[25];let I;return e[26]!==O||e[27]!==m?(I=p.jsx(p.Fragment,{children:p.jsx("div",{className:m,children:O})}),e[26]=O,e[27]=m,e[28]=I):I=e[28],I}const Y2=["x-ai/grok-code-fast-1","anthropic/claude-sonnet-4.5","google/gemini-2.5-flash","xiaomi/mimo-v2-flash:free","google/gemini-3-flash-preview","deepseek/deepseek-v3.2","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","google/gemini-2.5-flash-lite","google/gemini-2.0-flash-001"],jr=new Map;Y2.forEach((t,e)=>{jr.set(t,e)});function Po(t){const e=W.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={pageSize:999},e[0]=n):n=e[0];const r=Sl(t??void 0,n);let i;return e[1]!==r?(i=r.filter(V2).sort(q2),e[1]=r,e[2]=i):i=e[2],i}function q2(t,e){const n=jr.get(t.id),r=jr.get(e.id);return n!==void 0&&r!==void 0?n-r:n!==void 0?-1:r!==void 0?1:t.title.localeCompare(e.title)}function V2(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const W2={reasoning:{icon:p.jsx(Un,{className:"size-4"}),label:"Reasoning"},"image-upload":{icon:p.jsx(Al,{className:"size-4"}),label:"Can analyze images"},"file-upload":{icon:p.jsx(_l,{className:"size-4"}),label:"Can analyze files"},"web-search":{icon:p.jsx(Vr,{className:"size-4"}),label:"Can search the web to answer questions"}};function Mo(t){const e=W.c(10),{capability:n}=t,r=W2[n];let i,s;e[0]!==n||e[1]!==r?(i=r||{icon:null,label:n},s=i.label.split("-").map(G2).join(" "),e[0]=n,e[1]=r,e[2]=i,e[3]=s):(i=e[2],s=e[3]);const a=s;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={backgroundColor:"color-mix(in oklch, var(--chart-1) 15%, transparent)",color:"var(--chart-1)"},e[4]=u):u=e[4];let o;e[5]!==a?(o=p.jsx("span",{children:a}),e[5]=a,e[6]=o):o=e[6];let c;return e[7]!==i.icon||e[8]!==o?(c=p.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md text-xs font-medium",style:u,children:[i.icon,o]}),e[7]=i.icon,e[8]=o,e[9]=c):c=e[9],c}function G2(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Q2(t){const e=W.c(53),{model:n,compact:r}=t,i=r===void 0?!1:r;if(!n){let _;return e[0]===Symbol.for("react.memo_cache_sentinel")?(_=p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=_):_=e[0],_}const s=n.limits?.contextWindow||n.costs?.input||n.costs?.output||n.limits?.maxOutputTokens;if(!s&&!i){let _;e[1]!==n.logo||e[2]!==n.title?(_=n.logo&&p.jsx("img",{src:n.logo,className:"w-6 h-6",alt:n.title}),e[1]=n.logo,e[2]=n.title,e[3]=_):_=e[3];let T;e[4]!==n.title?(T=p.jsx("p",{className:"text-lg font-medium leading-7",children:n.title}),e[4]=n.title,e[5]=T):T=e[5];let y;e[6]!==_||e[7]!==T?(y=p.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[_,T]}),e[6]=_,e[7]=T,e[8]=y):y=e[8];let N;e[9]!==n.description?(N=n.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[9]=n.description,e[10]=N):N=e[10];let w;return e[11]!==y||e[12]!==N?(w=p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[y,N]}),e[11]=y,e[12]=N,e[13]=w):w=e[13],w}if(!s&&i)return null;if(i){let _;e[14]!==n.limits?(_=n.limits?.contextWindow&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Context"}),p.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[14]=n.limits,e[15]=_):_=e[15];let T;e[16]!==n.costs?(T=n.costs?.input&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),p.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.input.toFixed(2)," / 1M"]})]}),e[16]=n.costs,e[17]=T):T=e[17];let y;e[18]!==n.costs?(y=n.costs?.output&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),p.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.output.toFixed(2)," / 1M"]})]}),e[18]=n.costs,e[19]=y):y=e[19];let N;e[20]!==n.limits?(N=n.limits?.maxOutputTokens&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),p.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[20]=n.limits,e[21]=N):N=e[21];let w;return e[22]!==_||e[23]!==T||e[24]!==y||e[25]!==N?(w=p.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[_,T,y,N]}),e[22]=_,e[23]=T,e[24]=y,e[25]=N,e[26]=w):w=e[26],w}let a;e[27]!==n.logo||e[28]!==n.title?(a=n.logo&&p.jsx("img",{src:n.logo,className:"w-6 h-6 shrink-0",alt:n.title}),e[27]=n.logo,e[28]=n.title,e[29]=a):a=e[29];let u;e[30]!==n.title?(u=p.jsx("p",{className:"text-lg font-medium leading-7 wrap-break-word min-w-0",children:n.title}),e[30]=n.title,e[31]=u):u=e[31];let o;e[32]!==a||e[33]!==u?(o=p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a,u]}),e[32]=a,e[33]=u,e[34]=o):o=e[34];let c;e[35]!==n.capabilities?(c=n.capabilities&&n.capabilities.length>0&&p.jsx("div",{className:"flex items-center gap-2",children:n.capabilities.map(K2)}),e[35]=n.capabilities,e[36]=c):c=e[36];let f;e[37]!==o||e[38]!==c?(f=p.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[o,c]}),e[37]=o,e[38]=c,e[39]=f):f=e[39];let h;e[40]!==n.limits?(h=n.limits?.contextWindow&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(il,{className:"w-3.5 h-3.5 text-muted-foreground"}),p.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),p.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[40]=n.limits,e[41]=h):h=e[41];let m;e[42]!==n.costs?(m=(n.costs?.input||n.costs?.output)&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ma,{className:"w-3.5 h-3.5 text-muted-foreground"}),p.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),p.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.costs?.input!==null&&n.costs?.input!==void 0&&p.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.input.toFixed(2)," / 1M tokens (input)"]}),n.costs?.output!==null&&n.costs?.output!==void 0&&p.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.output.toFixed(2)," / 1M tokens (output)"]})]})]}),e[42]=n.costs,e[43]=m):m=e[43];let d;e[44]!==n.limits?(d=n.limits?.maxOutputTokens&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Ea,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),p.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),p.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.maxOutputTokens.toLocaleString()," token limit"]})]}),e[44]=n.limits,e[45]=d):d=e[45];let g;e[46]!==h||e[47]!==m||e[48]!==d?(g=p.jsxs("div",{className:"flex flex-col gap-4",children:[h,m,d]}),e[46]=h,e[47]=m,e[48]=d,e[49]=g):g=e[49];let k;return e[50]!==g||e[51]!==f?(k=p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[f,g]}),e[50]=g,e[51]=f,e[52]=k):k=e[52],k}function K2(t){return p.jsx(Mo,{capability:t},t)}function X2(t){const e=W.c(15),{model:n,onHover:r}=t;let i;e[0]!==n||e[1]!==r?(i=()=>r(n),e[0]=n,e[1]=r,e[2]=i):i=e[2];let s;e[3]!==n.logo||e[4]!==n.title?(s=n.logo&&p.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0",alt:n.title}),e[3]=n.logo,e[4]=n.title,e[5]=s):s=e[5];let a;e[6]!==n.title?(a=p.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let u;e[8]!==n.capabilities?(u=n.capabilities&&n.capabilities.length>0&&p.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:n.capabilities.slice(0,2).map(Z2)}),e[8]=n.capabilities,e[9]=u):u=e[9];let o;return e[10]!==i||e[11]!==s||e[12]!==a||e[13]!==u?(o=p.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:i,children:[s,a,u]}),e[10]=i,e[11]=s,e[12]=a,e[13]=u,e[14]=o):o=e[14],o}function Z2(t){return p.jsx(Mo,{capability:t},t)}function J2(t){const e=W.c(10),{model:n,placeholder:r}=t,i=r===void 0?"Select model":r;if(!n){let o;return e[0]!==i?(o=p.jsx("span",{className:"text-sm text-muted-foreground",children:i}),e[0]=i,e[1]=o):o=e[1],o}let s;e[2]!==n.logo||e[3]!==n.title?(s=n.logo&&p.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.title}),e[2]=n.logo,e[3]=n.title,e[4]=s):s=e[4];let a;e[5]!==n.title?(a=p.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.title}),e[5]=n.title,e[6]=a):a=e[6];let u;return e[7]!==s||e[8]!==a?(u=p.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[s,a]}),e[7]=s,e[8]=a,e[9]=u):u=e[9],u}function eb(){const t=W.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:p.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[p.jsx(Me,{className:"size-4 shrink-0"}),p.jsx(Me,{className:"flex-1 h-6"}),p.jsx(Me,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[e,p.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(tb)})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[p.jsx(Me,{className:"size-6 shrink-0"}),p.jsx(Me,{className:"h-6 w-32"})]}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[r,p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Me,{className:"h-6 w-20 rounded-md"}),p.jsx(Me,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=i):i=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsx(Me,{className:"h-4 w-24"}),p.jsx(Me,{className:"h-4 w-32"})]}),t[4]=s):s=t[4];let a;return t[5]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[n,p.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[i,p.jsxs("div",{className:"flex flex-col gap-4",children:[s,p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsx(Me,{className:"h-4 w-16"}),p.jsx(Me,{className:"h-4 w-40"})]})]})]})})]}),t[5]=a):a=t[5],a}function tb(t,e){return p.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[p.jsx(Me,{className:"size-5 shrink-0 rounded-sm"}),p.jsx(Me,{className:"flex-1 h-4"}),p.jsx(Me,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function nb(t){const e=W.c(39),{selectedModel:n,onModelChange:r,onClose:i}=t,[s,a]=Y.useState(null),[u,o]=Y.useState(""),c=Y.useRef(null),[f,h]=Y.useState(n?.connectionId??null),m=xa(),d=Po(f);let g,k;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{setTimeout(()=>{c.current?.focus()},0)},k=[],e[0]=g,e[1]=k):(g=e[0],k=e[1]),Y.useEffect(g,k);let _;e[2]!==d||e[3]!==u?(_=u.trim()?d.filter(V=>{const J=u.toLowerCase();return V.title.toLowerCase().includes(J)||V.provider?.toLowerCase().includes(J)||V.description?.toLowerCase().includes(J)}):d,e[2]=d,e[3]=u,e[4]=_):_=e[4];const T=_;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=V=>{h(V)},e[5]=y):y=e[5];const N=y;let w;e[6]!==d||e[7]!==i||e[8]!==r||e[9]!==f?(w=V=>{const J=d.find(ae=>ae.id===V);!J||!f||(r({id:J.id,connectionId:f,provider:J.provider??void 0}),o(""),i())},e[6]=d,e[7]=i,e[8]=r,e[9]=f,e[10]=w):w=e[10];const O=w;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=p.jsx(Vr,{size:16,className:"text-muted-foreground shrink-0"}),e[11]=I):I=e[11];let F;e[12]===Symbol.for("react.memo_cache_sentinel")?(F=V=>o(V.target.value),e[12]=F):F=e[12];let H;e[13]!==u?(H=p.jsx(ta,{ref:c,type:"text",placeholder:"Search for a model...",value:u,onChange:F,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[13]=u,e[14]=H):H=e[14];let P;e[15]!==m||e[16]!==f?(P=m.length>0&&p.jsxs(gl,{value:f??"",onValueChange:N,children:[p.jsxs(El,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:ib,children:[p.jsx(bl,{placeholder:"Select connection"}),p.jsx(Gr,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),p.jsx(Tl,{children:m.map(rb)})]}),e[15]=m,e[16]=f,e[17]=P):P=e[17];let S;e[18]!==H||e[19]!==P?(S=p.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:p.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[I,H,P]})}),e[18]=H,e[19]=P,e[20]=S):S=e[20];let U;e[21]!==T||e[22]!==O||e[23]!==n?.id?(U=T.length>0?T.map(V=>{const J=V.id===n?.id;return p.jsx("div",{onClick:()=>O(V.id),className:le("rounded-lg mb-1",J&&"bg-accent"),children:p.jsx(X2,{model:V,onHover:a})},V.id)}):p.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[21]=T,e[22]=O,e[23]=n?.id,e[24]=U):U=e[24];let z;e[25]!==U?(z=p.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2",children:U}),e[25]=U,e[26]=z):z=e[26];let G;e[27]!==S||e[28]!==z?(G=p.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[S,z]}),e[27]=S,e[28]=z,e[29]=G):G=e[29];let q;e[30]!==s||e[31]!==d||e[32]!==n?(q=s||(n?d.find(V=>V.id===n.id):null)||null,e[30]=s,e[31]=d,e[32]=n,e[33]=q):q=e[33];let B;e[34]!==q?(B=p.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:p.jsx(Q2,{model:q})}),e[34]=q,e[35]=B):B=e[35];let Q;return e[36]!==G||e[37]!==B?(Q=p.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[G,B]}),e[36]=G,e[37]=B,e[38]=Q):Q=e[38],Q}function rb(t){return p.jsx(xl,{value:t.id,children:p.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?p.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):p.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),p.jsx("span",{children:t.title})]})},t.id)}function ib(t){return t.stopPropagation()}function Jb(t){const e=W.c(23),{selectedModel:n,onModelChange:r,variant:i,className:s,placeholder:a}=t,u=i===void 0?"borderless":i,o=a===void 0?"Select model":a,[c,f]=Y.useState(!1),h=xa(),m=n?.connectionId??null,d=Po(m);let g;e[0]!==d||e[1]!==n?(g=n?d.find(S=>S.id===n.id):void 0,e[0]=d,e[1]=n,e[2]=g):g=e[2];const k=g;if(h.length===0)return null;const _=u==="borderless"?"ghost":"outline",T=u==="borderless"&&"md:border-none";let y;e[3]!==s||e[4]!==T?(y=le("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full justify-start",T,s),e[3]=s,e[4]=T,e[5]=y):y=e[5];let N;e[6]!==k||e[7]!==o?(N=p.jsx(J2,{model:k,placeholder:o}),e[6]=k,e[7]=o,e[8]=N):N=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=p.jsx(Gr,{className:"size-4 opacity-50 shrink-0"}),e[9]=w):w=e[9];let O;e[10]!==_||e[11]!==y||e[12]!==N?(O=p.jsx(na,{asChild:!0,children:p.jsxs(ze,{variant:_,size:"sm",className:y,children:[N,w]})}),e[10]=_,e[11]=y,e[12]=N,e[13]=O):O=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=p.jsx(eb,{}),e[14]=I):I=e[14];let F;e[15]===Symbol.for("react.memo_cache_sentinel")?(F=()=>f(!1),e[15]=F):F=e[15];let H;e[16]!==r||e[17]!==n?(H=p.jsx(ra,{className:"w-full md:w-auto p-0",align:"start",side:"bottom",sideOffset:8,children:p.jsx(Y.Suspense,{fallback:I,children:p.jsx(nb,{selectedModel:n,onModelChange:r,onClose:F})})}),e[16]=r,e[17]=n,e[18]=H):H=e[18];let P;return e[19]!==c||e[20]!==H||e[21]!==O?(P=p.jsxs(ia,{open:c,onOpenChange:f,children:[O,H]}),e[19]=c,e[20]=H,e[21]=O,e[22]=P):P=e[22],P}function sb({messageCount:t,sentinelRef:e}){const n=Y.useRef(t),r=Y.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function Ks(t,e){const n=Y.Children.toArray(t);for(const r of n)if(Y.isValidElement(r)&&r.type===e)return r;return null}function ab(t){const e=W.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=le("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=i):i=e[1];let s;return e[2]!==r||e[3]!==i?(s=p.jsx("div",{className:i,children:r}),e[2]=r,e[3]=i,e[4]=s):s=e[4],s}function ub(t){const e=W.c(11),{children:n}=t;let r;e[0]!==n?(r=Ks(n,Bo),e[0]=n,e[1]=r):r=e[1];const i=r;let s;e[2]!==n?(s=Ks(n,vo),e[2]=n,e[3]=s):s=e[3];const a=s,u=i?.props.children;let o;e[4]!==u?(o=p.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const c=a?.props.children;let f;e[6]!==c?(f=p.jsx("div",{className:"flex items-center gap-1",children:c}),e[6]=c,e[7]=f):f=e[7];let h;return e[8]!==o||e[9]!==f?(h=p.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4 flex-none",children:[o,f]}),e[8]=o,e[9]=f,e[10]=h):h=e[10],h}function Bo(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=p.jsx(p.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function vo(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=p.jsx(p.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function ob(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=le("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function lb(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=p.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function cb(t){const e=W.c(12),{messages:n,status:r,minHeightOffset:i}=t,s=i===void 0?240:i,a=Y.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:a},e[0]=n.length,e[1]=u):u=e[1],sb(u);let o;if(e[2]!==n||e[3]!==r){let h;e[5]!==n.length||e[6]!==r?(h=(m,d)=>m.role==="user"?p.jsx($2,{message:m},m.id):m.role==="assistant"?p.jsx(D2,{message:m,status:d===n.length-1?r:void 0},m.id):null,e[5]=n.length,e[6]=r,e[7]=h):h=e[7],o=n.map(h),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=p.jsx(Do,{children:p.jsx("div",{ref:a,className:"h-0"})}),e[8]=c):c=e[8];let f;return e[9]!==s||e[10]!==o?(f=p.jsxs(v2,{minHeightOffset:s,children:[o,c]}),e[9]=s,e[10]=o,e[11]=f):f=e[11],f}function fb(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=le("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function Oi(t){const e=W.c(24),{title:n,description:r,icon:i,variant:s,onDismiss:a,children:u}=t,o=s===void 0?"default":s;let c,f,h,m,d;if(e[0]!==u||e[1]!==r||e[2]!==i||e[3]!==n||e[4]!==o){const N={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[o];m=le("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",N.container),d=i&&p.jsx("div",{className:le("mt-0.5 shrink-0",N.icon),children:i}),c="flex-1 min-w-0",f=n&&p.jsx("div",{className:le("text-xs mb-1",N.title),children:n}),h=r&&p.jsx("div",{className:le("text-xs line-clamp-2",N.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=c,e[6]=f,e[7]=h,e[8]=m,e[9]=d}else c=e[5],f=e[6],h=e[7],m=e[8],d=e[9];let g;e[10]!==u?(g=u&&p.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let k;e[12]!==c||e[13]!==f||e[14]!==h||e[15]!==g?(k=p.jsxs("div",{className:c,children:[f,h,g]}),e[12]=c,e[13]=f,e[14]=h,e[15]=g,e[16]=k):k=e[16];let _;e[17]!==a?(_=a&&p.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:p.jsx(tl,{size:14})}),e[17]=a,e[18]=_):_=e[18];let T;return e[19]!==m||e[20]!==d||e[21]!==k||e[22]!==_?(T=p.jsxs("div",{className:m,children:[d,k,_]}),e[19]=m,e[20]=d,e[21]=k,e[22]=_,e[23]=T):T=e[23],T}function hb(t){const e=W.c(10),{branchContext:n,clearBranchContext:r,onGoToOriginalMessage:i,setInputValue:s}=t;if(!n)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(da,{size:14}),e[0]=a):a=e[0];let u;e[1]!==r||e[2]!==s?(u=()=>{r(),s("")},e[1]=r,e[2]=s,e[3]=u):u=e[3];let o;e[4]!==i?(o=p.jsx(ze,{size:"sm",variant:"outline",onClick:i,className:"h-7 text-xs",children:"View original"}),e[4]=i,e[5]=o):o=e[5];let c;return e[6]!==n.originalMessageText||e[7]!==u||e[8]!==o?(c=p.jsx(Oi,{variant:"default",title:"Editing message (click to view original)",description:n.originalMessageText,icon:a,onDismiss:u,children:o}),e[6]=n.originalMessageText,e[7]=u,e[8]=o,e[9]=c):c=e[9],c}function db(t){const e=W.c(8),{error:n,onFixInChat:r,onDismiss:i}=t;if(!n)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(aa,{size:16}),e[0]=s):s=e[0];let a;e[1]!==r?(a=p.jsx(ze,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Fix in chat"}),e[1]=r,e[2]=a):a=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(ze,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"}),e[3]=u):u=e[3];let o;return e[4]!==n.message||e[5]!==i||e[6]!==a?(o=p.jsxs(Oi,{variant:"danger",title:"Error occurred",description:n.message,icon:s,onDismiss:i,children:[a,u]}),e[4]=n.message,e[5]=i,e[6]=a,e[7]=o):o=e[7],o}function mb(t){const e=W.c(7),{finishReason:n,onContinue:r,onDismiss:i}=t;if(!n||n==="stop")return null;const a=pb(n);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(el,{size:16}),e[0]=u):u=e[0];let o;e[1]!==r?(o=p.jsx(ze,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Continue"}),e[1]=r,e[2]=o):o=e[2];let c;return e[3]!==i||e[4]!==a||e[5]!==o?(c=p.jsx(Oi,{variant:"warning",title:"Response incomplete",description:a,icon:u,onDismiss:i,children:o}),e[3]=i,e[4]=a,e[5]=o,e[6]=c):c=e[6],c}function pb(t){switch(t){case"length":return"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.";case"content-filter":return"Response was filtered due to content policy.";case"tool-calls":return"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.";default:return`Response stopped unexpectedly: ${t}`}}const eT=Object.assign(ab,{Header:Object.assign(ub,{Left:Bo,Right:vo}),Main:ob,Messages:cb,EmptyState:lb,Footer:fb,Input:Hl,BranchPreview:hb,ErrorBanner:db,FinishReasonWarning:mb,Provider:Dl});export{eT as C,Qb as G,Jb as M,E2 as R,Me as S,Xb as T,N2 as U,Ml as a,Wb as b,Bl as c,xa as d,Dl as e,Hl as f,Ca as g,Rl as h,Gr as i,Gb as j,Vb as k,Fl as l,Po as m,ba as n,Kb as o,Zb as p,yl as u};
@@ -1 +1 @@
1
- import{a$ as K,b0 as C,b1 as V,b2 as z,b3 as _,x as W,b4 as X,b5 as Y,r as h,b6 as $,b7 as J,b8 as Z,b9 as ee,ba as k,bb as P,bc as se,bd as te,ao as A,ah as re,an as oe,j as m,ai as Q,aq as ne,aj as g,ag as O,ap as ae,al as w,ak as ie,aS as ue,aR as ce}from"./index-C5FDJtAp.js";function I(r,s){const t=new Set(s);return r.filter(o=>!t.has(o))}function de(r,s,t){const o=r.slice(0);return o[s]=t,o}var le=class extends K{#r;#e;#o;#n;#s;#t;#a;#i;#u=[];constructor(r,s,t){super(),this.#r=r,this.#n=t,this.#o=[],this.#s=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(s=>{this.#h(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,s){this.#o=r,this.#n=s,C.batch(()=>{const t=this.#s,o=this.#l(this.#o);o.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const e=o.map(i=>i.observer),n=e.map(i=>i.getCurrentResult()),a=t.length!==e.length,c=e.some((i,d)=>i!==t[d]),l=a||c,b=l?!0:n.some((i,d)=>{const v=this.#e[d];return!v||!V(i,v)});!l&&!b||(l&&(this.#u=o,this.#s=e),this.#e=n,this.hasListeners()&&(l&&(I(t,e).forEach(i=>{i.destroy()}),I(e,t).forEach(i=>{i.subscribe(d=>{this.#h(i,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,s){const t=this.#l(r),o=t.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[o,e=>this.#d(e??o,s),()=>this.#c(o,t)]}#c(r,s){return s.map((t,o)=>{const e=r[o];return t.defaultedQueryOptions.notifyOnChangeProps?e:t.observer.trackResult(e,n=>{s.forEach(a=>{a.observer.trackProp(n)})})})}#d(r,s){return s?((!this.#t||this.#e!==this.#i||s!==this.#a)&&(this.#a=s,this.#i=this.#e,this.#t=z(this.#t,s(r))),this.#t):r}#l(r){const s=new Map;this.#s.forEach(o=>{const e=o.options.queryHash;if(!e)return;const n=s.get(e);n?n.push(o):s.set(e,[o])});const t=[];return r.forEach(o=>{const e=this.#r.defaultQueryOptions(o),a=s.get(e.queryHash)?.shift()??new _(this.#r,e);t.push({defaultedQueryOptions:e,observer:a})}),t}#h(r,s){const t=this.#s.indexOf(r);t!==-1&&(this.#e=de(this.#e,t,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#t,s=this.#c(this.#e,this.#u),t=this.#d(s,this.#n?.combine);r!==t&&C.batch(()=>{this.listeners.forEach(o=>{o(this.#e)})})}}};function Ce({queries:r,...s},t){const o=W(t),e=X(),n=Y(),a=h.useMemo(()=>r.map(u=>{const p=o.defaultQueryOptions(u);return p._optimisticResults=e?"isRestoring":"optimistic",p}),[r,o,e]);a.forEach(u=>{$(u);const p=o.getQueryCache().get(u.queryHash);J(u,n,p)}),Z(n);const[c]=h.useState(()=>new le(o,a,s)),[l,b,i]=c.getOptimisticResult(a,s.combine),d=!e&&s.subscribed!==!1;h.useSyncExternalStore(h.useCallback(u=>d?c.subscribe(C.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setQueries(a,s)},[a,s,c]);const f=l.some((u,p)=>k(a[p],u))?l.flatMap((u,p)=>{const y=a[p];if(y){const x=new _(o,y);if(k(y,u))return P(y,x,n);se(u,e)&&P(y,x,n)}return[]}):[];if(f.length>0)throw Promise.all(f);const R=l.find((u,p)=>{const y=a[p];return y&&te({result:u,errorResetBoundary:n,throwOnError:y.throwOnError,query:o.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return b(i())}var S="Radio",[he,j]=Q(S),[pe,fe]=he(S),G=h.forwardRef((r,s)=>{const{__scopeRadio:t,name:o,checked:e=!1,required:n,disabled:a,value:c="on",onCheck:l,form:b,...i}=r,[d,v]=h.useState(null),f=O(s,p=>v(p)),R=h.useRef(!1),u=d?b||!!d.closest("form"):!0;return m.jsxs(pe,{scope:t,checked:e,disabled:a,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":e,"data-state":D(e),"data-disabled":a?"":void 0,disabled:a,value:c,...i,ref:f,onClick:w(r.onClick,p=>{e||l?.(),u&&(R.current=p.isPropagationStopped(),R.current||p.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:o,value:c,checked:e,required:n,disabled:a,form:b,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var M="RadioIndicator",N=h.forwardRef((r,s)=>{const{__scopeRadio:t,forceMount:o,...e}=r,n=fe(M,t);return m.jsx(ie,{present:o||n.checked,children:m.jsx(g.span,{"data-state":D(n.checked),"data-disabled":n.disabled?"":void 0,...e,ref:s})})});N.displayName=M;var Re="RadioBubbleInput",q=h.forwardRef(({__scopeRadio:r,control:s,checked:t,bubbles:o=!0,...e},n)=>{const a=h.useRef(null),c=O(a,n),l=ue(t),b=ce(s);return h.useEffect(()=>{const i=a.current;if(!i)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==t&&f){const R=new Event("click",{bubbles:o});f.call(i,t),i.dispatchEvent(R)}},[l,t,o]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...e,tabIndex:-1,ref:c,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function D(r){return r?"checked":"unchecked"}var be=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E="RadioGroup",[ve]=Q(E,[A,j]),L=A(),B=j(),[me,ye]=ve(E),F=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,name:o,defaultValue:e,value:n,required:a=!1,disabled:c=!1,orientation:l,dir:b,loop:i=!0,onValueChange:d,...v}=r,f=L(t),R=re(b),[u,p]=oe({prop:n,defaultProp:e??null,onChange:d,caller:E});return m.jsx(me,{scope:t,name:o,required:a,disabled:c,value:u,onValueChange:p,children:m.jsx(ne,{asChild:!0,...f,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...v,ref:s})})})});F.displayName=E;var T="RadioGroupItem",H=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,disabled:o,...e}=r,n=ye(T,t),a=n.disabled||o,c=L(t),l=B(t),b=h.useRef(null),i=O(s,b),d=n.value===e.value,v=h.useRef(!1);return h.useEffect(()=>{const f=u=>{be.includes(u.key)&&(v.current=!0)},R=()=>v.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",R)}},[]),m.jsx(ae,{asChild:!0,...c,focusable:!a,active:d,children:m.jsx(G,{disabled:a,required:n.required,checked:d,...l,...e,name:n.name,ref:i,onCheck:()=>n.onValueChange(e.value),onKeyDown:w(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:w(e.onFocus,()=>{v.current&&b.current?.click()})})})});H.displayName=T;var ge="RadioGroupIndicator",U=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,...o}=r,e=B(t);return m.jsx(N,{...e,...o,ref:s})});U.displayName=ge;var we=F,Oe=H,Se=U;export{Oe as I,we as R,Se as a,Ce as u};
1
+ import{b0 as K,b1 as C,b2 as V,b3 as z,b4 as _,x as W,b5 as X,b6 as Y,r as h,b7 as J,b8 as Z,b9 as $,ba as ee,bb as k,bc as P,bd as se,be as te,ao as A,ah as re,an as oe,j as m,ai as Q,aq as ne,aj as g,ag as O,ap as ae,al as w,ak as ie,aS as ue,aR as ce}from"./index-ZiFjEqyT.js";function I(r,s){const t=new Set(s);return r.filter(o=>!t.has(o))}function de(r,s,t){const o=r.slice(0);return o[s]=t,o}var le=class extends K{#r;#e;#o;#n;#s;#t;#a;#i;#u=[];constructor(r,s,t){super(),this.#r=r,this.#n=t,this.#o=[],this.#s=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(s=>{this.#h(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,s){this.#o=r,this.#n=s,C.batch(()=>{const t=this.#s,o=this.#l(this.#o);o.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const e=o.map(i=>i.observer),n=e.map(i=>i.getCurrentResult()),a=t.length!==e.length,c=e.some((i,d)=>i!==t[d]),l=a||c,b=l?!0:n.some((i,d)=>{const v=this.#e[d];return!v||!V(i,v)});!l&&!b||(l&&(this.#u=o,this.#s=e),this.#e=n,this.hasListeners()&&(l&&(I(t,e).forEach(i=>{i.destroy()}),I(e,t).forEach(i=>{i.subscribe(d=>{this.#h(i,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,s){const t=this.#l(r),o=t.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[o,e=>this.#d(e??o,s),()=>this.#c(o,t)]}#c(r,s){return s.map((t,o)=>{const e=r[o];return t.defaultedQueryOptions.notifyOnChangeProps?e:t.observer.trackResult(e,n=>{s.forEach(a=>{a.observer.trackProp(n)})})})}#d(r,s){return s?((!this.#t||this.#e!==this.#i||s!==this.#a)&&(this.#a=s,this.#i=this.#e,this.#t=z(this.#t,s(r))),this.#t):r}#l(r){const s=new Map;this.#s.forEach(o=>{const e=o.options.queryHash;if(!e)return;const n=s.get(e);n?n.push(o):s.set(e,[o])});const t=[];return r.forEach(o=>{const e=this.#r.defaultQueryOptions(o),a=s.get(e.queryHash)?.shift()??new _(this.#r,e);t.push({defaultedQueryOptions:e,observer:a})}),t}#h(r,s){const t=this.#s.indexOf(r);t!==-1&&(this.#e=de(this.#e,t,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#t,s=this.#c(this.#e,this.#u),t=this.#d(s,this.#n?.combine);r!==t&&C.batch(()=>{this.listeners.forEach(o=>{o(this.#e)})})}}};function Ce({queries:r,...s},t){const o=W(t),e=X(),n=Y(),a=h.useMemo(()=>r.map(u=>{const p=o.defaultQueryOptions(u);return p._optimisticResults=e?"isRestoring":"optimistic",p}),[r,o,e]);a.forEach(u=>{J(u);const p=o.getQueryCache().get(u.queryHash);Z(u,n,p)}),$(n);const[c]=h.useState(()=>new le(o,a,s)),[l,b,i]=c.getOptimisticResult(a,s.combine),d=!e&&s.subscribed!==!1;h.useSyncExternalStore(h.useCallback(u=>d?c.subscribe(C.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setQueries(a,s)},[a,s,c]);const f=l.some((u,p)=>k(a[p],u))?l.flatMap((u,p)=>{const y=a[p];if(y){const x=new _(o,y);if(k(y,u))return P(y,x,n);se(u,e)&&P(y,x,n)}return[]}):[];if(f.length>0)throw Promise.all(f);const R=l.find((u,p)=>{const y=a[p];return y&&te({result:u,errorResetBoundary:n,throwOnError:y.throwOnError,query:o.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return b(i())}var S="Radio",[he,j]=Q(S),[pe,fe]=he(S),G=h.forwardRef((r,s)=>{const{__scopeRadio:t,name:o,checked:e=!1,required:n,disabled:a,value:c="on",onCheck:l,form:b,...i}=r,[d,v]=h.useState(null),f=O(s,p=>v(p)),R=h.useRef(!1),u=d?b||!!d.closest("form"):!0;return m.jsxs(pe,{scope:t,checked:e,disabled:a,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":e,"data-state":D(e),"data-disabled":a?"":void 0,disabled:a,value:c,...i,ref:f,onClick:w(r.onClick,p=>{e||l?.(),u&&(R.current=p.isPropagationStopped(),R.current||p.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:o,value:c,checked:e,required:n,disabled:a,form:b,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var M="RadioIndicator",N=h.forwardRef((r,s)=>{const{__scopeRadio:t,forceMount:o,...e}=r,n=fe(M,t);return m.jsx(ie,{present:o||n.checked,children:m.jsx(g.span,{"data-state":D(n.checked),"data-disabled":n.disabled?"":void 0,...e,ref:s})})});N.displayName=M;var Re="RadioBubbleInput",q=h.forwardRef(({__scopeRadio:r,control:s,checked:t,bubbles:o=!0,...e},n)=>{const a=h.useRef(null),c=O(a,n),l=ue(t),b=ce(s);return h.useEffect(()=>{const i=a.current;if(!i)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==t&&f){const R=new Event("click",{bubbles:o});f.call(i,t),i.dispatchEvent(R)}},[l,t,o]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...e,tabIndex:-1,ref:c,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function D(r){return r?"checked":"unchecked"}var be=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E="RadioGroup",[ve]=Q(E,[A,j]),L=A(),B=j(),[me,ye]=ve(E),F=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,name:o,defaultValue:e,value:n,required:a=!1,disabled:c=!1,orientation:l,dir:b,loop:i=!0,onValueChange:d,...v}=r,f=L(t),R=re(b),[u,p]=oe({prop:n,defaultProp:e??null,onChange:d,caller:E});return m.jsx(me,{scope:t,name:o,required:a,disabled:c,value:u,onValueChange:p,children:m.jsx(ne,{asChild:!0,...f,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...v,ref:s})})})});F.displayName=E;var T="RadioGroupItem",H=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,disabled:o,...e}=r,n=ye(T,t),a=n.disabled||o,c=L(t),l=B(t),b=h.useRef(null),i=O(s,b),d=n.value===e.value,v=h.useRef(!1);return h.useEffect(()=>{const f=u=>{be.includes(u.key)&&(v.current=!0)},R=()=>v.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",R)}},[]),m.jsx(ae,{asChild:!0,...c,focusable:!a,active:d,children:m.jsx(G,{disabled:a,required:n.required,checked:d,...l,...e,name:n.name,ref:i,onCheck:()=>n.onValueChange(e.value),onKeyDown:w(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:w(e.onFocus,()=>{v.current&&b.current?.click()})})})});H.displayName=T;var ge="RadioGroupIndicator",U=h.forwardRef((r,s)=>{const{__scopeRadioGroup:t,...o}=r,e=B(t);return m.jsx(N,{...e,...o,ref:s})});U.displayName=ge;var we=F,Oe=H,Se=U;export{Oe as I,we as R,Se as a,Ce as u};