@decocms/mesh 2.9.0 → 2.11.0

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 (109) hide show
  1. package/dist/client/assets/{AlertCircle-DST9a9vh.js → AlertCircle-C-YsmNug.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DPtymxR-.js → ArrowLeft-I0eE0ajz.js} +1 -1
  3. package/dist/client/assets/{Check-B3jZM0OP.js → Check-Bn7iaq_h.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-Bi1kqv-9.js → ChevronDown-CXsTFOR4.js} +1 -1
  5. package/dist/client/assets/{Clock-BynE89Zl.js → Clock-7YlOAEqw.js} +1 -1
  6. package/dist/client/assets/{Code01-BMUDEJ4t.js → Code01-Dp2-HwWV.js} +1 -1
  7. package/dist/client/assets/{Copy01-DUDgHeaT.js → Copy01-Cufxb7u1.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-DO21zZi8.js → DotsHorizontal-Cq3m_A8z.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-DikAa5AR.js → DotsVertical-BIpduKLf.js} +1 -1
  10. package/dist/client/assets/{File06-7Osp6kua.js → File06-DD5RANl_.js} +1 -1
  11. package/dist/client/assets/{FilterLines-DieVG1pT.js → FilterLines-1Ine1y4n.js} +1 -1
  12. package/dist/client/assets/{FlipBackward-U1Nw6QGY.js → FlipBackward-DBqfxU3c.js} +1 -1
  13. package/dist/client/assets/{GitBranch01-CTCXO68x.js → GitBranch01-BHo3ByP2.js} +1 -1
  14. package/dist/client/assets/{Grid01-DI-Q2VEp.js → Grid01-C578o4mm.js} +1 -1
  15. package/dist/client/assets/{Inbox01-Cme2B_Za.js → Inbox01-BtHWN2dX.js} +1 -1
  16. package/dist/client/assets/{InfoCircle-Bz1TUoGx.js → InfoCircle-BkGKY7qc.js} +1 -1
  17. package/dist/client/assets/{Key01-COwuV6OE.js → Key01-DYP1HQKa.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BaHJAM0O.js → LinkExternal01-d5tCjGRk.js} +1 -1
  19. package/dist/client/assets/{Loading01-C5e9Xing.js → Loading01-BGeWv0Kv.js} +1 -1
  20. package/dist/client/assets/{Lock01-BLY_4cHD.js → Lock01-jWWo80rN.js} +1 -1
  21. package/dist/client/assets/{Play-BSr93GMI.js → Play-B3EbuXEZ.js} +1 -1
  22. package/dist/client/assets/{Plus-pmQCIiux.js → Plus-CgN71ZpK.js} +1 -1
  23. package/dist/client/assets/{SearchMd-C8MbVAuA.js → SearchMd-u2U3iAnY.js} +1 -1
  24. package/dist/client/assets/{Terminal-BSyq_KGG.js → Terminal-Fj__rdxn.js} +1 -1
  25. package/dist/client/assets/{Trash01-DqQrX192.js → Trash01-Vutqn1RC.js} +1 -1
  26. package/dist/client/assets/{X-CJAJyKbZ.js → X-P1RHfgBU.js} +1 -1
  27. package/dist/client/assets/{XClose-CF1lddkv.js → XClose-DeI9b46h.js} +1 -1
  28. package/dist/client/assets/{alert-dialog-BnwjYq4n.js → alert-dialog-BApkfnBU.js} +1 -1
  29. package/dist/client/assets/{auth-DhJcJDq8.js → auth-B4yoGafc.js} +1 -1
  30. package/dist/client/assets/{auth-catchall-C2IFDAAQ.js → auth-catchall-CbILVwsO.js} +1 -1
  31. package/dist/client/assets/{avatar-Cd72kdsa.js → avatar-HUmJyCrO.js} +1 -1
  32. package/dist/client/assets/{badge-iCoQ1dgD.js → badge-_9VZKl7s.js} +1 -1
  33. package/dist/client/assets/{card-CjWJyjfT.js → card-DUrBojml.js} +1 -1
  34. package/dist/client/assets/{checkbox-5O25feEA.js → checkbox-y4VvHU-Y.js} +1 -1
  35. package/dist/client/assets/{collection-detail-BCydbsMr.js → collection-detail-o5P4OEwm.js} +1 -1
  36. package/dist/client/assets/{collection-display-button-D1R0tnBY.js → collection-display-button-D_pspwv8.js} +1 -1
  37. package/dist/client/assets/{collection-header-0lxlEg2I.js → collection-header-DjAukiYw.js} +1 -1
  38. package/dist/client/assets/{collection-page-s3MvuRc-.js → collection-page-DUwIO-4_.js} +1 -1
  39. package/dist/client/assets/{collection-search-Btyw61UY.js → collection-search-C8qrPxpe.js} +1 -1
  40. package/dist/client/assets/{collection-tab-DWktiPIU.js → collection-tab-BtKR4Bs-.js} +1 -1
  41. package/dist/client/assets/{collection-table-wrapper-gfEw2g5n.js → collection-table-wrapper-m6-zCmZ8.js} +1 -1
  42. package/dist/client/assets/{connection-card-DfdBq4FD.js → connection-card-Bho36DLV.js} +1 -1
  43. package/dist/client/assets/{connection-detail--2aMjf2x.js → connection-detail-DzUkx3x6.js} +1 -1
  44. package/dist/client/assets/{connections-B3fFvefT.js → connections-CGjqBYcN.js} +1 -1
  45. package/dist/client/assets/constants-CDd5Bb9b.js +1 -0
  46. package/dist/client/assets/{create-organization-dialog-DWi5c4Eh.js → create-organization-dialog-DJCSaeq_.js} +1 -1
  47. package/dist/client/assets/{dialog-D76JDRim.js → dialog-DPjf1g07.js} +1 -1
  48. package/dist/client/assets/{dropdown-menu-BjkFG8SE.js → dropdown-menu-JqpADJWR.js} +1 -1
  49. package/dist/client/assets/{empty-state-V7JRwEdF.js → empty-state-B1YgYZRX.js} +1 -1
  50. package/dist/client/assets/{env-vars-editor-BJ7tjYIq.js → env-vars-editor-58M0X5HW.js} +1 -1
  51. package/dist/client/assets/{error-boundary-D0j0sONw.js → error-boundary-swyLIuj9.js} +1 -1
  52. package/dist/client/assets/{extract-connection-data-BrdC23jw.js → extract-connection-data-yHByD-hG.js} +1 -1
  53. package/dist/client/assets/{form-B8Xq72cU.js → form-BNePwzri.js} +1 -1
  54. package/dist/client/assets/{gateway-detail-5Qd5lfiW.js → gateway-detail-7_rs5-Bk.js} +1 -1
  55. package/dist/client/assets/{gateways-CEtb1fnf.js → gateways-LhzXTNdU.js} +1 -1
  56. package/dist/client/assets/{home-nnEPBFaz.js → home-Dge_UN-5.js} +1 -1
  57. package/dist/client/assets/{index-xkjtAq50.js → index-CZYkP-qE.js} +1 -1
  58. package/dist/client/assets/{index-Cqq-bHxo.js → index-D825aBGT.js} +2 -2
  59. package/dist/client/assets/{index-DdOgSb-W.js → index-Dd-uCtJP.js} +1 -1
  60. package/dist/client/assets/{index-B01CV87W.js → index-DfsK7wxC.js} +3 -3
  61. package/dist/client/assets/{index-Dv5zkaTK.js → index-sXi95TSr.js} +1 -1
  62. package/dist/client/assets/{input-DJ7wqUvo.js → input-CUSLU-5Y.js} +1 -1
  63. package/dist/client/assets/{layout-CfefGJu5.js → layout-DiLh4D4s.js} +1 -1
  64. package/dist/client/assets/{lazy-highlighter-CaSijfHb.js → lazy-highlighter-Bva2qxQ8.js} +1 -1
  65. package/dist/client/assets/{localstorage-keys-TnX0RxDe.js → localstorage-keys-DCk__Bcu.js} +1 -1
  66. package/dist/client/assets/{login-CGyq3Vs1.js → login-5v9kcVjq.js} +1 -1
  67. package/dist/client/assets/{mcp-oauth-CJD4q5rM.js → mcp-oauth-2LWG2fNF.js} +1 -1
  68. package/dist/client/assets/{mcp-server-detail-CbOhDFHk.js → mcp-server-detail-Bl4-1OcQ.js} +1 -1
  69. package/dist/client/assets/{members-DLByeMDT.js → members-DUjkcn9b.js} +1 -1
  70. package/dist/client/assets/{monaco-editor-CoD_oW78.js → monaco-editor-CXJFCG3L.js} +1 -1
  71. package/dist/client/assets/{monitoring-5cDa-J-b.js → monitoring-BxS1M7G9.js} +1 -1
  72. package/dist/client/assets/{oauth-callback-Cgb1o01u.js → oauth-callback-D352dL7W.js} +1 -1
  73. package/dist/client/assets/{page-COBajbLE.js → page-DJ2XmEDk.js} +1 -1
  74. package/dist/client/assets/{page-Dlp1hzYF.js → page-DlLPoWnp.js} +1 -1
  75. package/dist/client/assets/{pin-to-sidebar-button-Cp43fkli.js → pin-to-sidebar-button-CxO4Rtia.js} +1 -1
  76. package/dist/client/assets/{popover-mdWNDupQ.js → popover-CiuXmEMm.js} +1 -1
  77. package/dist/client/assets/{project-context-provider-Gi9sytDH.js → project-context-provider-Y7j1MLG3.js} +1 -1
  78. package/dist/client/assets/{resizable-BdJcZRXn.js → resizable-CpuhJlAj.js} +1 -1
  79. package/dist/client/assets/{resource-tabs-DlB9LUax.js → resource-tabs-DzYdyOT8.js} +1 -1
  80. package/dist/client/assets/{select-B5Ou5lZC.js → select-BiK6lA7A.js} +1 -1
  81. package/dist/client/assets/{settings-CjdyGe2Y.js → settings-BydLLEEd.js} +1 -1
  82. package/dist/client/assets/{shell-layout-DftkJMI3.js → shell-layout-hT1WnhFU.js} +1 -1
  83. package/dist/client/assets/{spinner-CchSlqhZ.js → spinner-D8JOERWZ.js} +1 -1
  84. package/dist/client/assets/{switch-17EJ9BZl.js → switch-CHSRGx1X.js} +1 -1
  85. package/dist/client/assets/{textarea-BngAuS5G.js → textarea-DA688jdJ.js} +1 -1
  86. package/dist/client/assets/{thread-history-popover-BNoPu7hE.js → thread-history-popover-d49eUsmE.js} +2 -2
  87. package/dist/client/assets/{tool-set-selector-ia7ItE5G.js → tool-set-selector-qCxd45H-.js} +1 -1
  88. package/dist/client/assets/{tools-list-HOpPAfsi.js → tools-list-aRycV8Sk.js} +1 -1
  89. package/dist/client/assets/{use-binding-iszUdbOZ.js → use-binding-pQGzNysE.js} +1 -1
  90. package/dist/client/assets/{use-connection-Dp5C8sLQ.js → use-connection-CJ5nWy0c.js} +1 -1
  91. package/dist/client/assets/{use-connection-resources-DU3H93Az.js → use-connection-resources-CrBNfIuI.js} +1 -1
  92. package/dist/client/assets/{use-gateway-CSxRa3Bg.js → use-gateway-Cov2sDNb.js} +1 -1
  93. package/dist/client/assets/{use-gateway-system-prompt-BqldEOSK.js → use-gateway-system-prompt-D3bv_TPR.js} +1 -1
  94. package/dist/client/assets/{use-list-state-FSUrDOEN.js → use-list-state-CUahB2OC.js} +1 -1
  95. package/dist/client/assets/{use-mcp-D5TIO_2s.js → use-mcp-Wds2Jlc5.js} +1 -1
  96. package/dist/client/assets/{use-members-DlA8UjAf.js → use-members-BlHxrgPJ.js} +1 -1
  97. package/dist/client/assets/{use-mobile-D6_iVdHq.js → use-mobile-DSucR6ge.js} +1 -1
  98. package/dist/client/assets/{use-organization-settings-DVpbHPw1.js → use-organization-settings-zICyumVv.js} +1 -1
  99. package/dist/client/assets/{use-tool-call-DsLdhDUf.js → use-tool-call-CS4qR4o3.js} +1 -1
  100. package/dist/client/assets/useQuery-El_kGGDY.js +1 -0
  101. package/dist/client/assets/{value-Bc9uIuB3.js → value-BHNPJ9GX.js} +1 -1
  102. package/dist/client/assets/{view-mode-toggle-ljeOi0U5.js → view-mode-toggle-Do1cIl7g.js} +1 -1
  103. package/dist/client/assets/{workflow-DOWIsfb9.js → workflow-C_xTbZed.js} +1 -1
  104. package/dist/client/index.html +1 -1
  105. package/dist/server/cli.js +3 -3
  106. package/dist/server/server.js +1 -1
  107. package/package.json +1 -1
  108. package/dist/client/assets/constants-CjRmBn5H.js +0 -1
  109. package/dist/client/assets/useQuery-UvQ_L9Pc.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-CaSijfHb.js","assets/index-Cqq-bHxo.js","assets/index-KJvlasGf.css"])))=>i.map(i=>d[i]);
2
- import{r as U,ag as ea,c as V,j as p,aU as vt,s as ta,K as Me,p as na,a0 as ra,aV as Wo,ac as Go,ai as Qo,at as Ko,ad as $r,ae as Xo,af as Zo,aa as Jo,ah as el}from"./index-Cqq-bHxo.js";import{i as xt}from"./Check-B3jZM0OP.js";import{u as tl,i as Yr}from"./use-gateway-CSxRa3Bg.js";import{i as qr}from"./SearchMd-C8MbVAuA.js";import{I as ia,U as nl,f as rl,c as il,u as sl}from"./use-connection-Dp5C8sLQ.js";import{c as ae,u as Et,B as Qe,I as sa}from"./input-DJ7wqUvo.js";import{i as aa}from"./AlertCircle-DST9a9vh.js";import{i as al}from"./error-boundary-D0j0sONw.js";import{i as ul}from"./X-CJAJyKbZ.js";import{a as ol,i as ua,c as ll}from"./Grid01-DI-Q2VEp.js";import{T as cl}from"./textarea-BngAuS5G.js";import{u as Bt,c as Vr,b as Wr,T as Gr}from"./project-context-provider-Gi9sytDH.js";import{u as oa,L as la}from"./localstorage-keys-TnX0RxDe.js";import{a as Qr}from"./Copy01-DUDgHeaT.js";import{i as fl}from"./Terminal-BSyq_KGG.js";import{M as ca}from"./monaco-editor-CoD_oW78.js";import{b as dl,c as hl,d as ml,A as pl,a as gl,e as El,g as bl,f as Tl}from"./alert-dialog-BnwjYq4n.js";import{b as xl,a as _l,c as Al,S as kl}from"./select-B5Ou5lZC.js";import{u as Cl}from"./use-mobile-D6_iVdHq.js";import{i as Nl}from"./File06-7Osp6kua.js";import{i as Sl}from"./InfoCircle-Bz1TUoGx.js";import{u as yl}from"./use-binding-iszUdbOZ.js";const fa=({size:t=24,color:e="currentColor",...n})=>U.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},U.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 da=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));da.displayName="Coins01";const ha=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));ha.displayName="CornerUpLeft";const ma=({size:t=24,color:e="currentColor",...n})=>U.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},U.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})=>U.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},U.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})=>U.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},U.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.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.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.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));ga.displayName="Image01";const Ea=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));Ea.displayName="Lightbulb01";const ba=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));ba.displayName="LogOut04";const jn=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));jn.displayName="Stars01";const Ta=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));Ta.displayName="Stop";const xa=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));xa.displayName="Target04";function vi({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=Il({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,u=ea(n),o=U.useCallback(l=>{if(s){const d=typeof l=="function"?l(t):l;d!==t&&u(d)}else i(l)},[s,t,i,u]);return[a,o]}function Il({defaultProp:t,onChange:e}){const n=U.useState(t),[r]=n,i=U.useRef(r),s=ea(e);return U.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function wl(t){const e=V.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(vt.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ll(t){const e=V.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(vt.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Rl(t){const e=V.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(vt.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ol(t){const e=V.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=ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(vt.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Dl(t){const e=V.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(Ol,{}),e[4]=s):s=e[4];let a;e[5]!==r?(a=ae("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=u):u=e[7];let o;return e[8]!==n||e[9]!==i||e[10]!==a?(o=p.jsxs(Rl,{"data-slot":"drawer-portal",children:[s,p.jsxs(vt.Content,{"data-slot":"drawer-content",className:a,...i,children:[u,n]})]}),e[8]=n,e[9]=i,e[10]=a,e[11]=o):o=e[11],o}function Pl(t){const e=V.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=ae("flex flex-col gap-1.5 px-4 py-2",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":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ml(t){const e=V.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=ae("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(vt.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function vl(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=la.developerMode(),t[0]=e):e=t[0],oa(e,!1)}function _t(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Bl(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=_t(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let ir;function zn(){return ir||(ir=Bl("keyval-store","keyval")),ir}function Kr(t,e=zn()){return e("readonly",n=>_t(n.get(t)))}function en(t,e,n=zn()){return n("readwrite",r=>(r.put(e,t),_t(r.transaction)))}function _a(t,e=zn()){return e("readwrite",n=>(n.delete(t),_t(n.transaction)))}function Fl(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},_t(t.transaction)}function Aa(t=zn()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([_t(e.getAllKeys()),_t(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>Fl(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function $b(t,e){const n=`${t}:threads:${e}`;return await Kr(n)??null}async function Hl(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 Yb(t){const e=V.c(14),{locator:n}=Bt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Me.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 Hl(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}=na(a);let l;e[9]!==u?(l=u??[],e[9]=u,e[10]=l):l=e[10];let f;return e[11]!==o||e[12]!==l?(f={threads:l,refetch:o},e[11]=o,e[12]=l,e[13]=f):f=e[13],f}function qb(t){const e=V.c(11),{locator:n}=Bt();let r;e[0]!==n||e[1]!==t?(r=Me.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}=na(s);let u;return e[9]!==a?(u=a??[],e[9]=a,e[10]=u):u=e[10],u}function Ca(){const t=V.c(28),{locator:e}=Bt(),n=ta();let r;t[0]!==e?(r=async C=>{const T=`${e}:threads:${C.id}`;return await en(T,C),C},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=C=>{n.invalidateQueries({queryKey:Me.threads(e)}),C.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,C.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=Et(s);let u;t[8]!==e?(u=async C=>{const{id:T,updates:S}=C,N=`${e}:threads:${T}`,L=await Kr(N);if(!L)throw new Error(`Thread ${T} not found`);const O={...L,...S};return await en(N,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=C=>{n.invalidateQueries({queryKey:Me.threads(e)}),n.invalidateQueries({queryKey:Me.thread(e,C.id)}),C.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,C.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Et(l);let d;t[16]!==e?(d=async C=>{const T=`${e}:threads:${C}`;return await _a(T),C},t[16]=e,t[17]=d):d=t[17];let m;t[18]!==e||t[19]!==n?(m=()=>{n.invalidateQueries({queryKey:Me.threads(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let h;t[21]!==d||t[22]!==m?(h={mutationFn:d,onSuccess:m},t[21]=d,t[22]=m,t[23]=h):h=t[23];const g=Et(h);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 Ul(){const t=V.c(37),{locator:e}=Bt(),n=ta();let r;t[0]!==e?(r=async L=>{const O=`${e}:messages:${L.id}`;return await en(O,L),L},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=L=>{const O=L.metadata?.thread_id||L.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.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=Et(s);let u;t[8]!==e?(u=async L=>(await Promise.all(L.map(O=>{const y=`${e}:messages:${O.id}`;return en(y,O)})),L),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=L=>{const O=new Set;for(const y of L){const j=y.metadata?.thread_id||y.threadId;j&&O.add(j)}for(const y of O)n.invalidateQueries({queryKey:Me.threadMessages(e,y)});n.invalidateQueries({queryKey:Me.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Et(l);let d;t[16]!==e?(d=async L=>{const{id:O,updates:y}=L,j=`${e}:messages:${O}`,Y=await Kr(j);if(!Y)throw new Error(`Message ${O} not found`);const q={...Y,...y};return await en(j,q),q},t[16]=e,t[17]=d):d=t[17];let m;t[18]!==e||t[19]!==n?(m=L=>{const O=L.metadata?.thread_id||L.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let h;t[21]!==d||t[22]!==m?(h={mutationFn:d,onSuccess:m},t[21]=d,t[22]=m,t[23]=h):h=t[23];const g=Et(h);let k;t[24]!==e?(k=async L=>{const O=`${e}:messages:${L}`;return await _a(O),L},t[24]=e,t[25]=k):k=t[25];let C;t[26]!==e||t[27]!==n?(C=()=>{n.invalidateQueries({queryKey:Me.messages(e)})},t[26]=e,t[27]=n,t[28]=C):C=t[28];let T;t[29]!==C||t[30]!==k?(T={mutationFn:k,onSuccess:C},t[29]=C,t[30]=k,t[31]=T):T=t[31];const S=Et(T);let N;return t[32]!==S||t[33]!==a||t[34]!==f||t[35]!==g?(N={insert:a,insertMany:f,update:g,delete:S},t[32]=S,t[33]=a,t[34]=f,t[35]=g,t[36]=N):N=t[36],N}const Na={inputValue:"",branchContext:null,pendingSubmit:!1};function jl(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 Sa=U.createContext(null),ya=()=>crypto.randomUUID();function zl(t){const e=V.c(16),{children:n}=t,{locator:r}=Bt(),[i,s]=U.useReducer(jl,Na),a=Ca(),[u,o]=oa(la.threadManagerState(r)+":active-id",$l);let l;e[0]!==o||e[1]!==a?(l=C=>{const T=C?.id||crypto.randomUUID(),S=new Date().toISOString(),N={id:T,title:C?.title||"",created_at:C?.created_at||S,updated_at:C?.updated_at||S,hidden:C?.hidden??!1,gatewayId:C?.gatewayId};return a.insert.mutate(N),o(T),N},e[0]=o,e[1]=a,e[2]=l):l=e[2];const f=l;let d;e[3]!==u||e[4]!==o||e[5]!==a?(d=C=>{a.update.mutate({id:C,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===C&&o(ya())},e[3]=u,e[4]=o,e[5]=a,e[6]=d):d=e[6];const m=d;let h;e[7]!==u||e[8]!==f||e[9]!==m||e[10]!==i||e[11]!==o?(h={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]=h):h=e[12];const g=h;let k;return e[13]!==n||e[14]!==g?(k=p.jsx(Sa.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=k):k=e[15],k}function $l(t){return t||ya()}function Yl(){const t=V.c(19),e=U.useContext(Sa);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 l;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?(l={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]=l):l=t[18],l}function ql(t){const e=V.c(66),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:u,placeholder:o,className:l,centered:f,contextContent:d,leftActions:m,rightActions:h,maxTextHeight:g,children:k}=t,C=o===void 0?"Ask anything or @ for context":o,T=g===void 0?"164px":g;let S;e[0]!==a||e[1]!==u||e[2]!==n?(S=!a&&!u&&n.trim().length>0,e[0]=a,e[1]=u,e[2]=n,e[3]=S):S=e[3];const N=S;let L;e[4]!==N||e[5]!==u||e[6]!==s||e[7]!==i?(L=be=>{be.preventDefault(),u&&s?s():N&&i()},e[4]=N,e[5]=u,e[6]=s,e[7]=i,e[8]=L):L=e[8];const O=L;let y;e[9]!==N||e[10]!==i?(y=be=>{be.key==="Enter"&&!be.shiftKey&&(be.preventDefault(),N&&i())},e[9]=N,e[10]=i,e[11]=y):y=e[11];const j=y;let Y;e[12]!==l?(Y=ae("w-full",l),e[12]=l,e[13]=Y):Y=e[13];let q;e[14]===Symbol.for("react.memo_cache_sentinel")?(q=ae("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col"),e[14]=q):q=e[14];let I;e[15]!==d?(I=d&&p.jsx("div",{className:"mb-1",children:d}),e[15]=d,e[16]=I):I=e[16];let B;e[17]!==T?(B={maxHeight:T},e[17]=T,e[18]=B):B=e[18];let F;e[19]!==r?(F=be=>r(be.target.value),e[19]=r,e[20]=F):F=e[20];const G=a||u;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=ae("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[21]=z):z=e[21];let M;e[22]===Symbol.for("react.memo_cache_sentinel")?(M={minHeight:"20px",height:"auto",overflow:"hidden"},e[22]=M):M=e[22];let W;e[23]!==j||e[24]!==C||e[25]!==F||e[26]!==G||e[27]!==n?(W=p.jsx(cl,{value:n,onChange:F,onKeyDown:j,placeholder:C,disabled:G,className:z,rows:1,style:M}),e[23]=j,e[24]=C,e[25]=F,e[26]=G,e[27]=n,e[28]=W):W=e[28];let K;e[29]!==B||e[30]!==W?(K=p.jsx("div",{className:"overflow-y-auto relative flex-1",style:B,children:W}),e[29]=B,e[30]=W,e[31]=K):K=e[31];let te;e[32]!==K||e[33]!==I?(te=p.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[I,K]}),e[32]=K,e[33]=I,e[34]=te):te=e[34];let J;e[35]!==k||e[36]!==m?(J=p.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[m,k]}),e[35]=k,e[36]=m,e[37]=J):J=e[37];const A=u?"button":"submit";let Z;e[38]!==u||e[39]!==s?(Z=be=>{u&&(be.preventDefault(),be.stopPropagation(),s?.())},e[38]=u,e[39]=s,e[40]=Z):Z=e[40];const le=N||u?"default":"ghost",x=!N&&!u,ue=!N&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let he;e[41]!==ue?(he=ae("size-8 rounded-full transition-all",ue),e[41]=ue,e[42]=he):he=e[42];const ce=u?"Stop generating":"Send message (Enter)";let ke;e[43]!==u?(ke=u?p.jsx(Ta,{size:20}):p.jsx(ol,{size:20}),e[43]=u,e[44]=ke):ke=e[44];let Ee;e[45]!==A||e[46]!==Z||e[47]!==le||e[48]!==x||e[49]!==he||e[50]!==ce||e[51]!==ke?(Ee=p.jsx(Qe,{type:A,onClick:Z,variant:le,size:"icon",disabled:x,className:he,title:ce,children:ke}),e[45]=A,e[46]=Z,e[47]=le,e[48]=x,e[49]=he,e[50]=ce,e[51]=ke,e[52]=Ee):Ee=e[52];let xe;e[53]!==h||e[54]!==Ee?(xe=p.jsxs("div",{className:"flex items-center gap-1",children:[h,Ee]}),e[53]=h,e[54]=Ee,e[55]=xe):xe=e[55];let me;e[56]!==J||e[57]!==xe?(me=p.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[J,xe]}),e[56]=J,e[57]=xe,e[58]=me):me=e[58];let Ae;e[59]!==te||e[60]!==me?(Ae=p.jsxs("div",{className:q,children:[te,me]}),e[59]=te,e[60]=me,e[61]=Ae):Ae=e[61];let Ie;return e[62]!==O||e[63]!==Ae||e[64]!==Y?(Ie=p.jsx("form",{onSubmit:O,className:Y,children:Ae}),e[62]=O,e[63]=Ae,e[64]=Y,e[65]=Ie):Ie=e[65],Ie}function Vl(){const t=V.c(3),[e,n]=U.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 Xr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ct=Xr();function Ia(t){Ct=t}var tn={exec:()=>null};function fe(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(Be.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var Be={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")},Wl=/^(?:[ \t]*(?:\n|$))+/,Gl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ql=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Zr=/(?:[*+-]|\d{1,9}[.)])/,wa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,La=fe(wa).replace(/bull/g,Zr).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(),Xl=fe(wa).replace(/bull/g,Zr).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(),Jr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zl=/^[^\n]+/,ei=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jl=fe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ei).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ec=fe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Zr).getRegex(),$n="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",ti=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tc=fe("^ {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",ti).replace("tag",$n).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ra=fe(Jr).replace("hr",pn).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",$n).getRegex(),nc=fe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ra).getRegex(),ni={blockquote:nc,code:Gl,def:Jl,fences:Ql,heading:Kl,hr:pn,html:tc,lheading:La,list:ec,newline:Wl,paragraph:Ra,table:tn,text:Zl},Bi=fe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",pn).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",$n).getRegex(),rc={...ni,lheading:Xl,table:Bi,paragraph:fe(Jr).replace("hr",pn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bi).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",$n).getRegex()},ic={...ni,html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ti).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:tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:fe(Jr).replace("hr",pn).replace("heading",` *#{1,6} *[^
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-Bva2qxQ8.js","assets/index-D825aBGT.js","assets/index-KJvlasGf.css"])))=>i.map(i=>d[i]);
2
+ import{r as U,ag as ea,c as V,j as p,aU as vt,s as ta,K as Me,p as na,a0 as ra,aV as Wo,ac as Go,ai as Qo,at as Ko,ad as $r,ae as Xo,af as Zo,aa as Jo,ah as el}from"./index-D825aBGT.js";import{i as xt}from"./Check-Bn7iaq_h.js";import{u as tl,i as Yr}from"./use-gateway-Cov2sDNb.js";import{i as qr}from"./SearchMd-u2U3iAnY.js";import{I as ia,U as nl,f as rl,c as il,u as sl}from"./use-connection-CJ5nWy0c.js";import{c as ae,u as Et,B as Qe,I as sa}from"./input-CUSLU-5Y.js";import{i as aa}from"./AlertCircle-C-YsmNug.js";import{i as al}from"./error-boundary-swyLIuj9.js";import{i as ul}from"./X-P1RHfgBU.js";import{a as ol,i as ua,c as ll}from"./Grid01-C578o4mm.js";import{T as cl}from"./textarea-DA688jdJ.js";import{u as Bt,c as Vr,b as Wr,T as Gr}from"./project-context-provider-Y7j1MLG3.js";import{u as oa,L as la}from"./localstorage-keys-DCk__Bcu.js";import{a as Qr}from"./Copy01-Cufxb7u1.js";import{i as fl}from"./Terminal-Fj__rdxn.js";import{M as ca}from"./monaco-editor-CXJFCG3L.js";import{b as dl,c as hl,d as ml,A as pl,a as gl,e as El,g as bl,f as Tl}from"./alert-dialog-BApkfnBU.js";import{b as xl,a as _l,c as Al,S as kl}from"./select-BiK6lA7A.js";import{u as Cl}from"./use-mobile-DSucR6ge.js";import{i as Nl}from"./File06-DD5RANl_.js";import{i as Sl}from"./InfoCircle-BkGKY7qc.js";import{u as yl}from"./use-binding-pQGzNysE.js";const fa=({size:t=24,color:e="currentColor",...n})=>U.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},U.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 da=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));da.displayName="Coins01";const ha=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));ha.displayName="CornerUpLeft";const ma=({size:t=24,color:e="currentColor",...n})=>U.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},U.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})=>U.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},U.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})=>U.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},U.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.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.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.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));ga.displayName="Image01";const Ea=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));Ea.displayName="Lightbulb01";const ba=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));ba.displayName="LogOut04";const jn=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));jn.displayName="Stars01";const Ta=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));Ta.displayName="Stop";const xa=({size:t=24,color:e="currentColor",...n})=>U.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},U.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"}));xa.displayName="Target04";function vi({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=Il({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,u=ea(n),o=U.useCallback(l=>{if(s){const d=typeof l=="function"?l(t):l;d!==t&&u(d)}else i(l)},[s,t,i,u]);return[a,o]}function Il({defaultProp:t,onChange:e}){const n=U.useState(t),[r]=n,i=U.useRef(r),s=ea(e);return U.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function wl(t){const e=V.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(vt.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ll(t){const e=V.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(vt.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Rl(t){const e=V.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(vt.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ol(t){const e=V.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=ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(vt.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Dl(t){const e=V.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(Ol,{}),e[4]=s):s=e[4];let a;e[5]!==r?(a=ae("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=u):u=e[7];let o;return e[8]!==n||e[9]!==i||e[10]!==a?(o=p.jsxs(Rl,{"data-slot":"drawer-portal",children:[s,p.jsxs(vt.Content,{"data-slot":"drawer-content",className:a,...i,children:[u,n]})]}),e[8]=n,e[9]=i,e[10]=a,e[11]=o):o=e[11],o}function Pl(t){const e=V.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=ae("flex flex-col gap-1.5 px-4 py-2",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":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ml(t){const e=V.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=ae("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(vt.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function vl(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=la.developerMode(),t[0]=e):e=t[0],oa(e,!1)}function _t(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Bl(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=_t(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let ir;function zn(){return ir||(ir=Bl("keyval-store","keyval")),ir}function Kr(t,e=zn()){return e("readonly",n=>_t(n.get(t)))}function en(t,e,n=zn()){return n("readwrite",r=>(r.put(e,t),_t(r.transaction)))}function _a(t,e=zn()){return e("readwrite",n=>(n.delete(t),_t(n.transaction)))}function Fl(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},_t(t.transaction)}function Aa(t=zn()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([_t(e.getAllKeys()),_t(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>Fl(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function $b(t,e){const n=`${t}:threads:${e}`;return await Kr(n)??null}async function Hl(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 Yb(t){const e=V.c(14),{locator:n}=Bt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Me.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 Hl(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}=na(a);let l;e[9]!==u?(l=u??[],e[9]=u,e[10]=l):l=e[10];let f;return e[11]!==o||e[12]!==l?(f={threads:l,refetch:o},e[11]=o,e[12]=l,e[13]=f):f=e[13],f}function qb(t){const e=V.c(11),{locator:n}=Bt();let r;e[0]!==n||e[1]!==t?(r=Me.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}=na(s);let u;return e[9]!==a?(u=a??[],e[9]=a,e[10]=u):u=e[10],u}function Ca(){const t=V.c(28),{locator:e}=Bt(),n=ta();let r;t[0]!==e?(r=async C=>{const T=`${e}:threads:${C.id}`;return await en(T,C),C},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=C=>{n.invalidateQueries({queryKey:Me.threads(e)}),C.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,C.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=Et(s);let u;t[8]!==e?(u=async C=>{const{id:T,updates:S}=C,N=`${e}:threads:${T}`,L=await Kr(N);if(!L)throw new Error(`Thread ${T} not found`);const O={...L,...S};return await en(N,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=C=>{n.invalidateQueries({queryKey:Me.threads(e)}),n.invalidateQueries({queryKey:Me.thread(e,C.id)}),C.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,C.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Et(l);let d;t[16]!==e?(d=async C=>{const T=`${e}:threads:${C}`;return await _a(T),C},t[16]=e,t[17]=d):d=t[17];let m;t[18]!==e||t[19]!==n?(m=()=>{n.invalidateQueries({queryKey:Me.threads(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let h;t[21]!==d||t[22]!==m?(h={mutationFn:d,onSuccess:m},t[21]=d,t[22]=m,t[23]=h):h=t[23];const g=Et(h);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 Ul(){const t=V.c(37),{locator:e}=Bt(),n=ta();let r;t[0]!==e?(r=async L=>{const O=`${e}:messages:${L.id}`;return await en(O,L),L},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=L=>{const O=L.metadata?.thread_id||L.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.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=Et(s);let u;t[8]!==e?(u=async L=>(await Promise.all(L.map(O=>{const y=`${e}:messages:${O.id}`;return en(y,O)})),L),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=L=>{const O=new Set;for(const y of L){const j=y.metadata?.thread_id||y.threadId;j&&O.add(j)}for(const y of O)n.invalidateQueries({queryKey:Me.threadMessages(e,y)});n.invalidateQueries({queryKey:Me.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=Et(l);let d;t[16]!==e?(d=async L=>{const{id:O,updates:y}=L,j=`${e}:messages:${O}`,Y=await Kr(j);if(!Y)throw new Error(`Message ${O} not found`);const q={...Y,...y};return await en(j,q),q},t[16]=e,t[17]=d):d=t[17];let m;t[18]!==e||t[19]!==n?(m=L=>{const O=L.metadata?.thread_id||L.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[18]=e,t[19]=n,t[20]=m):m=t[20];let h;t[21]!==d||t[22]!==m?(h={mutationFn:d,onSuccess:m},t[21]=d,t[22]=m,t[23]=h):h=t[23];const g=Et(h);let k;t[24]!==e?(k=async L=>{const O=`${e}:messages:${L}`;return await _a(O),L},t[24]=e,t[25]=k):k=t[25];let C;t[26]!==e||t[27]!==n?(C=()=>{n.invalidateQueries({queryKey:Me.messages(e)})},t[26]=e,t[27]=n,t[28]=C):C=t[28];let T;t[29]!==C||t[30]!==k?(T={mutationFn:k,onSuccess:C},t[29]=C,t[30]=k,t[31]=T):T=t[31];const S=Et(T);let N;return t[32]!==S||t[33]!==a||t[34]!==f||t[35]!==g?(N={insert:a,insertMany:f,update:g,delete:S},t[32]=S,t[33]=a,t[34]=f,t[35]=g,t[36]=N):N=t[36],N}const Na={inputValue:"",branchContext:null,pendingSubmit:!1};function jl(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 Sa=U.createContext(null),ya=()=>crypto.randomUUID();function zl(t){const e=V.c(16),{children:n}=t,{locator:r}=Bt(),[i,s]=U.useReducer(jl,Na),a=Ca(),[u,o]=oa(la.threadManagerState(r)+":active-id",$l);let l;e[0]!==o||e[1]!==a?(l=C=>{const T=C?.id||crypto.randomUUID(),S=new Date().toISOString(),N={id:T,title:C?.title||"",created_at:C?.created_at||S,updated_at:C?.updated_at||S,hidden:C?.hidden??!1,gatewayId:C?.gatewayId};return a.insert.mutate(N),o(T),N},e[0]=o,e[1]=a,e[2]=l):l=e[2];const f=l;let d;e[3]!==u||e[4]!==o||e[5]!==a?(d=C=>{a.update.mutate({id:C,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===C&&o(ya())},e[3]=u,e[4]=o,e[5]=a,e[6]=d):d=e[6];const m=d;let h;e[7]!==u||e[8]!==f||e[9]!==m||e[10]!==i||e[11]!==o?(h={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]=h):h=e[12];const g=h;let k;return e[13]!==n||e[14]!==g?(k=p.jsx(Sa.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=k):k=e[15],k}function $l(t){return t||ya()}function Yl(){const t=V.c(19),e=U.useContext(Sa);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 l;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?(l={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]=l):l=t[18],l}function ql(t){const e=V.c(66),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:u,placeholder:o,className:l,centered:f,contextContent:d,leftActions:m,rightActions:h,maxTextHeight:g,children:k}=t,C=o===void 0?"Ask anything or @ for context":o,T=g===void 0?"164px":g;let S;e[0]!==a||e[1]!==u||e[2]!==n?(S=!a&&!u&&n.trim().length>0,e[0]=a,e[1]=u,e[2]=n,e[3]=S):S=e[3];const N=S;let L;e[4]!==N||e[5]!==u||e[6]!==s||e[7]!==i?(L=be=>{be.preventDefault(),u&&s?s():N&&i()},e[4]=N,e[5]=u,e[6]=s,e[7]=i,e[8]=L):L=e[8];const O=L;let y;e[9]!==N||e[10]!==i?(y=be=>{be.key==="Enter"&&!be.shiftKey&&(be.preventDefault(),N&&i())},e[9]=N,e[10]=i,e[11]=y):y=e[11];const j=y;let Y;e[12]!==l?(Y=ae("w-full",l),e[12]=l,e[13]=Y):Y=e[13];let q;e[14]===Symbol.for("react.memo_cache_sentinel")?(q=ae("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col"),e[14]=q):q=e[14];let I;e[15]!==d?(I=d&&p.jsx("div",{className:"mb-1",children:d}),e[15]=d,e[16]=I):I=e[16];let B;e[17]!==T?(B={maxHeight:T},e[17]=T,e[18]=B):B=e[18];let F;e[19]!==r?(F=be=>r(be.target.value),e[19]=r,e[20]=F):F=e[20];const G=a||u;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=ae("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[21]=z):z=e[21];let M;e[22]===Symbol.for("react.memo_cache_sentinel")?(M={minHeight:"20px",height:"auto",overflow:"hidden"},e[22]=M):M=e[22];let W;e[23]!==j||e[24]!==C||e[25]!==F||e[26]!==G||e[27]!==n?(W=p.jsx(cl,{value:n,onChange:F,onKeyDown:j,placeholder:C,disabled:G,className:z,rows:1,style:M}),e[23]=j,e[24]=C,e[25]=F,e[26]=G,e[27]=n,e[28]=W):W=e[28];let K;e[29]!==B||e[30]!==W?(K=p.jsx("div",{className:"overflow-y-auto relative flex-1",style:B,children:W}),e[29]=B,e[30]=W,e[31]=K):K=e[31];let te;e[32]!==K||e[33]!==I?(te=p.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[I,K]}),e[32]=K,e[33]=I,e[34]=te):te=e[34];let J;e[35]!==k||e[36]!==m?(J=p.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[m,k]}),e[35]=k,e[36]=m,e[37]=J):J=e[37];const A=u?"button":"submit";let Z;e[38]!==u||e[39]!==s?(Z=be=>{u&&(be.preventDefault(),be.stopPropagation(),s?.())},e[38]=u,e[39]=s,e[40]=Z):Z=e[40];const le=N||u?"default":"ghost",x=!N&&!u,ue=!N&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let he;e[41]!==ue?(he=ae("size-8 rounded-full transition-all",ue),e[41]=ue,e[42]=he):he=e[42];const ce=u?"Stop generating":"Send message (Enter)";let ke;e[43]!==u?(ke=u?p.jsx(Ta,{size:20}):p.jsx(ol,{size:20}),e[43]=u,e[44]=ke):ke=e[44];let Ee;e[45]!==A||e[46]!==Z||e[47]!==le||e[48]!==x||e[49]!==he||e[50]!==ce||e[51]!==ke?(Ee=p.jsx(Qe,{type:A,onClick:Z,variant:le,size:"icon",disabled:x,className:he,title:ce,children:ke}),e[45]=A,e[46]=Z,e[47]=le,e[48]=x,e[49]=he,e[50]=ce,e[51]=ke,e[52]=Ee):Ee=e[52];let xe;e[53]!==h||e[54]!==Ee?(xe=p.jsxs("div",{className:"flex items-center gap-1",children:[h,Ee]}),e[53]=h,e[54]=Ee,e[55]=xe):xe=e[55];let me;e[56]!==J||e[57]!==xe?(me=p.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[J,xe]}),e[56]=J,e[57]=xe,e[58]=me):me=e[58];let Ae;e[59]!==te||e[60]!==me?(Ae=p.jsxs("div",{className:q,children:[te,me]}),e[59]=te,e[60]=me,e[61]=Ae):Ae=e[61];let Ie;return e[62]!==O||e[63]!==Ae||e[64]!==Y?(Ie=p.jsx("form",{onSubmit:O,className:Y,children:Ae}),e[62]=O,e[63]=Ae,e[64]=Y,e[65]=Ie):Ie=e[65],Ie}function Vl(){const t=V.c(3),[e,n]=U.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 Xr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ct=Xr();function Ia(t){Ct=t}var tn={exec:()=>null};function fe(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(Be.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var Be={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")},Wl=/^(?:[ \t]*(?:\n|$))+/,Gl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ql=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Zr=/(?:[*+-]|\d{1,9}[.)])/,wa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,La=fe(wa).replace(/bull/g,Zr).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(),Xl=fe(wa).replace(/bull/g,Zr).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(),Jr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zl=/^[^\n]+/,ei=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jl=fe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ei).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ec=fe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Zr).getRegex(),$n="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",ti=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tc=fe("^ {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",ti).replace("tag",$n).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ra=fe(Jr).replace("hr",pn).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",$n).getRegex(),nc=fe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ra).getRegex(),ni={blockquote:nc,code:Gl,def:Jl,fences:Ql,heading:Kl,hr:pn,html:tc,lheading:La,list:ec,newline:Wl,paragraph:Ra,table:tn,text:Zl},Bi=fe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",pn).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",$n).getRegex(),rc={...ni,lheading:Xl,table:Bi,paragraph:fe(Jr).replace("hr",pn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bi).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",$n).getRegex()},ic={...ni,html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ti).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:tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:fe(Jr).replace("hr",pn).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",La).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sc=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ac=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oa=/^( {2,}|\\)\n(?!\s*$)/,uc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Yn=/[\p{P}\p{S}]/u,ri=/[\s\p{P}\p{S}]/u,Da=/[^\s\p{P}\p{S}]/u,oc=fe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ri).getRegex(),Pa=/(?!~)[\p{P}\p{S}]/u,lc=/(?!~)[\s\p{P}\p{S}]/u,cc=/(?:[^\s\p{P}\p{S}]|~)/u,fc=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ma=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dc=fe(Ma,"u").replace(/punct/g,Yn).getRegex(),hc=fe(Ma,"u").replace(/punct/g,Pa).getRegex(),va="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mc=fe(va,"gu").replace(/notPunctSpace/g,Da).replace(/punctSpace/g,ri).replace(/punct/g,Yn).getRegex(),pc=fe(va,"gu").replace(/notPunctSpace/g,cc).replace(/punctSpace/g,lc).replace(/punct/g,Pa).getRegex(),gc=fe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Da).replace(/punctSpace/g,ri).replace(/punct/g,Yn).getRegex(),Ec=fe(/\\(punct)/,"gu").replace(/punct/g,Yn).getRegex(),bc=fe(/^<(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(),Tc=fe(ti).replace("(?:-->|$)","-->").getRegex(),xc=fe("^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",Tc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),On=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_c=fe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",On).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ba=fe(/^!?\[(label)\]\[(ref)\]/).replace("label",On).replace("ref",ei).getRegex(),Fa=fe(/^!?\[(ref)\](?:\[\])?/).replace("ref",ei).getRegex(),Ac=fe("reflink|nolink(?!\\()","g").replace("reflink",Ba).replace("nolink",Fa).getRegex(),ii={_backpedal:tn,anyPunctuation:Ec,autolink:bc,blockSkip:fc,br:Oa,code:ac,del:tn,emStrongLDelim:dc,emStrongRDelimAst:mc,emStrongRDelimUnd:gc,escape:sc,link:_c,nolink:Fa,punctuation:oc,reflink:Ba,reflinkSearch:Ac,tag:xc,text:uc,url:tn},kc={...ii,link:fe(/^!?\[(label)\]\((.*?)\)/).replace("label",On).getRegex(),reflink:fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",On).getRegex()},Cr={...ii,emStrongRDelimAst:pc,emStrongLDelim:hc,url:fe(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Cc={...Cr,br:fe(Oa).replace("{2,}","*").getRegex(),text:fe(Cr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},An={normal:ni,gfm:rc,pedantic:ic},qt={normal:ii,gfm:Cr,breaks:Cc,pedantic:kc},Nc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Fi=t=>Nc[t];function Xe(t,e){if(e){if(Be.escapeTest.test(t))return t.replace(Be.escapeReplace,Fi)}else if(Be.escapeTestNoEncode.test(t))return t.replace(Be.escapeReplaceNoEncode,Fi);return t}function Hi(t){try{t=encodeURI(t).replace(Be.percentDecode,"%")}catch{return null}return t}function Ui(t,e){const n=t.replace(Be.findPipe,(s,a,u)=>{let o=!1,l=a;for(;--l>=0&&u[l]==="\\";)o=!o;return o?"|":" |"}),r=n.split(Be.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(Be.slashPipe,"|");return r}function Vt(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 Sc(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 ji(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 yc(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 Dn=class{options;rules;lexer;constructor(t){this.options=t||Ct}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:Vt(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 l=n.containerPhrasing(t,{before:"# ",after:`
84
84
  `,...s.current()});return/^[\t ]/.test(l)&&(l=mn(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),o(),u(),l}oo.peek=Kg;function oo(t){return t.value||""}function Kg(){return"<"}lo.peek=Xg;function lo(t,e,n,r){const i=Ci(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("![");return l+=o.move(n.safe(t.alt,{before:l,after:"]",...o.current()})),l+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${s}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),a(),l}function Xg(){return"!"}co.peek=Zg;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 l=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return a(),n.stack=f,s(),i==="full"||!l||l!==d?o+=u.move(d+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Zg(){return"!"}fo.peek=Jg;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 l=o.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(o.index+1)}}return i+r+i}function Jg(){return"`"}function ho(t,e){const n=ci(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=e2;function mo(t,e,n,r){const i=Ci(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 d=a.move("<");return d+=a.move(n.containerPhrasing(t,{before:d,after:">",...a.current()})),d+=a.move(">"),u(),n.stack=f,d}u=n.enter("link"),o=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(t,{before:l,after:"](",...a.current()})),l+=a.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(t.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(o=n.enter("destinationRaw"),l+=a.move(n.safe(t.url,{before:l,after:t.title?" ":")",...a.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=a.move(" "+i),l+=a.move(n.safe(t.title,{before:l,after:i,...a.current()})),l+=a.move(i),o()),l+=a.move(")"),u(),l}function e2(t,e,n){return ho(t,n)?"<":"["}po.peek=t2;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 l=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return a(),n.stack=f,s(),i==="full"||!l||l!==d?o+=u.move(d+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function t2(){return"["}function Ni(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 n2(t){const e=Ni(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 r2(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 i2(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?r2(n):Ni(n);const u=t.ordered?a==="."?")":".":n2(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 d=-1;for(;++d<t.children.length;){const m=t.children[d];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 l=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),l}function s2(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 a2(t,e,n,r){const i=s2(n);let s=n.bulletCurrent||Ni(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"),l=n.indentLines(n.containerFlow(t,u.current()),f);return o(),l;function f(d,m,h){return m?(h?"":" ".repeat(a))+d:(h?s:s+" ".repeat(a-s.length))+d}}function u2(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const o2=Kn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function l2(t,e,n,r){return(t.children.some(function(a){return o2(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function c2(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=f2;function Eo(t,e,n,r){const i=c2(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 l=o.charCodeAt(0),f=Un(r.before.charCodeAt(r.before.length-1),l,i);f.inside&&(o=mn(l)+o.slice(1));const d=o.charCodeAt(o.length-1),m=Un(r.after.charCodeAt(0),d,i);m.inside&&(o=o.slice(0,-1)+mn(d));const h=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},u+o+h}function f2(t,e,n){return n.options.strong||"*"}function d2(t,e,n,r){return n.safe(t.value,r)}function h2(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 m2(t,e,n){const r=(go(n)+(n.options.ruleSpaces?" ":"")).repeat(h2(n));return n.options.ruleSpaces?r.slice(0,-1):r}const bo={blockquote:Bg,break:Ws,code:$g,definition:qg,emphasis:uo,hardBreak:Ws,heading:Qg,html:oo,image:lo,imageReference:co,inlineCode:fo,link:mo,linkReference:po,list:i2,listItem:a2,paragraph:u2,root:l2,strong:Eo,text:d2,thematicBreak:m2};function p2(){return{enter:{table:g2,tableData:Gs,tableHeader:Gs,tableRow:b2},exit:{codeText:T2,table:E2,tableData:kr,tableHeader:kr,tableRow:kr}}}function g2(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 E2(t){this.exit(t),this.data.inTable=void 0}function b2(t){this.enter({type:"tableRow",children:[]},t)}function kr(t){this.exit(t)}function Gs(t){this.enter({type:"tableCell",children:[]},t)}function T2(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,x2));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function x2(t,e){return e==="|"?e:t}function _2(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(h,g,k,C){return l(f(h,k,C),h.align)}function u(h,g,k,C){const T=d(h,k,C),S=l([T]);return S.slice(0,S.indexOf(`
86
- `))}function o(h,g,k,C){const T=k.enter("tableCell"),S=k.enter("phrasing"),N=k.containerPhrasing(h,{...C,before:s,after:s});return S(),T(),N}function l(h,g){return Mg(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(h,g,k){const C=h.children;let T=-1;const S=[],N=g.enter("table");for(;++T<C.length;)S[T]=d(C[T],g,k);return N(),S}function d(h,g,k){const C=h.children;let T=-1;const S=[],N=g.enter("tableRow");for(;++T<C.length;)S[T]=o(C[T],h,g,k);return N(),S}function m(h,g,k){let C=bo.inlineCode(h,g,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function A2(){return{exit:{taskListCheckValueChecked:Qs,taskListCheckValueUnchecked:Qs,paragraph:C2}}}function k2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:N2}}}function Qs(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function C2(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 N2(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})/,l)),o;function l(f){return f+a}}function S2(){return[ig(),Ng(),wg(),p2(),A2()]}function y2(t){return{extensions:[sg(),Sg(t),Lg(),_2(t),k2()]}}const I2={tokenize:P2,partial:!0},To={tokenize:M2,partial:!0},xo={tokenize:v2,partial:!0},_o={tokenize:B2,partial:!0},w2={tokenize:F2,partial:!0},Ao={name:"wwwAutolink",tokenize:O2,previous:Co},ko={name:"protocolAutolink",tokenize:D2,previous:No},ut={name:"emailAutolink",tokenize:R2,previous:So},tt={};function L2(){return{text:tt}}let gt=48;for(;gt<123;)tt[gt]=ut,gt++,gt===58?gt=65:gt===91&&(gt=97);tt[43]=ut;tt[45]=ut;tt[46]=ut;tt[95]=ut;tt[72]=[ut,ko];tt[104]=[ut,ko];tt[87]=[ut,Ao];tt[119]=[ut,Ao];function R2(t,e,n){const r=this;let i,s;return a;function a(d){return!jr(d)||!So.call(r,r.previous)||Si(r.events)?n(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(d))}function u(d){return jr(d)?(t.consume(d),u):d===64?(t.consume(d),o):n(d)}function o(d){return d===46?t.check(w2,f,l)(d):d===45||d===95||Re(d)?(s=!0,t.consume(d),o):f(d)}function l(d){return t.consume(d),i=!0,o}function f(d){return s&&i&&ve(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):n(d)}}function O2(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Co.call(r,r.previous)||Si(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(I2,t.attempt(To,t.attempt(xo,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function D2(t,e,n){const r=this;let i="",s=!1;return a;function a(d){return(d===72||d===104)&&No.call(r,r.previous)&&!Si(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),t.consume(d),u):n(d)}function u(d){if(ve(d)&&i.length<5)return i+=String.fromCodePoint(d),t.consume(d),u;if(d===58){const m=i.toLowerCase();if(m==="http"||m==="https")return t.consume(d),o}return n(d)}function o(d){return d===47?(t.consume(d),s?l:(s=!0,o)):n(d)}function l(d){return d===null||Mn(d)||ge(d)||kt(d)||Wn(d)?n(d):t.attempt(To,t.attempt(xo,f),n)(d)}function f(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function P2(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 M2(t,e,n){let r,i,s;return a;function a(l){return l===46||l===95?t.check(_o,o,u)(l):l===null||ge(l)||kt(l)||l!==45&&Wn(l)?o(l):(s=!0,t.consume(l),a)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),a}function o(l){return i||r||!s?n(l):e(l)}}function v2(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||ge(a)||kt(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function B2(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||ge(u)||kt(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||ge(u)||kt(u)?e(u):r(u)}function s(u){return ve(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):ve(u)?(t.consume(u),a):n(u)}}function F2(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Re(s)?n(s):e(s)}}function Co(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ge(t)}function No(t){return!ve(t)}function So(t){return!(t===47||jr(t))}function jr(t){return t===43||t===45||t===46||t===95||Re(t)}function Si(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 H2={tokenize:W2,partial:!0};function U2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Y2,continuation:{tokenize:q2},exit:V2}},text:{91:{name:"gfmFootnoteCall",tokenize:$2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j2,resolveTo:z2}}}}function j2(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 l=Ge(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function z2(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 $2(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return u;function u(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),o}function o(d){return d!==94?n(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(d){if(s>999||d===93&&!a||d===null||d===91||ge(d))return n(d);if(d===93){t.exit("chunkString");const m=t.exit("gfmFootnoteCallString");return i.includes(Ge(r.sliceSerialize(m)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(d)}return ge(d)||(a=!0),s++,t.consume(d),d===92?f:l}function f(d){return d===91||d===92||d===93?(t.consume(d),s++,l):l(d)}}function Y2(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"),l}function l(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||ge(g))return n(g);if(g===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return s=Ge(r.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),m}return ge(g)||(u=!0),a++,t.consume(g),g===92?d:f}function d(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),oe(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function q2(t,e,n){return t.check(bn,e,t.attempt(H2,e,n))}function V2(t){t.exit("gfmFootnoteDefinition")}function W2(t,e,n){const r=this;return oe(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 G2(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 l=o;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[o][1].end.offset-a[o][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[o][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[o][1].end)},d={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[o][1].start)},m=[["enter",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["enter",d,u]],h=u.parser.constructs.insideSpan.null;h&&Ye(m,m.length,0,Gn(h,a.slice(l+1,o),u)),Ye(m,m.length,0,[["exit",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["exit",f,u]]),Ye(a,l-1,o-l+3,m),o=l+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 l=this.previous,f=this.events;let d=0;return m;function m(g){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const k=Dt(l);if(g===126)return d>1?o(g):(a.consume(g),d++,h);if(d<2&&!n)return o(g);const C=a.exit("strikethroughSequenceTemporary"),T=Dt(g);return C._open=!T||T===2&&!!k,C._close=!k||k===2&&!!T,u(g)}}}class Q2{constructor(){this.map=[]}add(e,n,r){K2(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 K2(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 X2(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 Z2(){return{flow:{null:{name:"table",tokenize:J2,resolveAll:eE}}}}function J2(t,e,n){const r=this;let i=0,s=0,a;return u;function u(I){let B=r.events.length-1;for(;B>-1;){const z=r.events[B][1].type;if(z==="lineEnding"||z==="linePrefix")B--;else break}const F=B>-1?r.events[B][1].type:null,G=F==="tableHead"||F==="tableRow"?y:o;return G===y&&r.parser.lazy[r.now().line]?n(I):G(I)}function o(I){return t.enter("tableHead"),t.enter("tableRow"),l(I)}function l(I){return I===124||(a=!0,s+=1),f(I)}function f(I){return I===null?n(I):Q(I)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),h):n(I):re(I)?oe(t,f,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),d(I)))}function d(I){return I===null||I===124||ge(I)?(t.exit("data"),f(I)):(t.consume(I),I===92?m:d)}function m(I){return I===92||I===124?(t.consume(I),d):d(I)}function h(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(t.enter("tableDelimiterRow"),a=!1,re(I)?oe(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?C(I):I===124?(a=!0,t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),k):O(I)}function k(I){return re(I)?oe(t,C,"whitespace")(I):C(I)}function C(I){return I===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),T):I===45?(s+=1,T(I)):I===null||Q(I)?L(I):O(I)}function T(I){return I===45?(t.enter("tableDelimiterFiller"),S(I)):O(I)}function S(I){return I===45?(t.consume(I),S):I===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(I))}function N(I){return re(I)?oe(t,L,"whitespace")(I):L(I)}function L(I){return I===124?g(I):I===null||Q(I)?!a||i!==s?O(I):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(I)):O(I)}function O(I){return n(I)}function y(I){return t.enter("tableRow"),j(I)}function j(I){return I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),j):I===null||Q(I)?(t.exit("tableRow"),e(I)):re(I)?oe(t,j,"whitespace")(I):(t.enter("data"),Y(I))}function Y(I){return I===null||I===124||ge(I)?(t.exit("data"),j(I)):(t.consume(I),I===92?q:Y)}function q(I){return I===92||I===124?(t.consume(I),Y):Y(I)}}function eE(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],u=!1,o=0,l,f,d;const m=new Q2;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Ks(m,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=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],d=yn(m,e,s,i,void 0,d),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],d=yn(m,e,s,i,void 0,d)),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],d=yn(m,e,s,i,n,d)):a[1]!==0&&(d=yn(m,e,a,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(o!==0&&Ks(m,e,o,l,f),m.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=X2(e.events,n))}return t}function yn(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 l=Lt(e.events,n[2]),f=Lt(e.events,n[3]),d={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",d,e]]),r!==2){const m=e.events[n[2]],h=e.events[n[3]];if(m[1].end=Object.assign({},h[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",d,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 Ks(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 tE={name:"tasklistCheck",tokenize:rE};function nE(){return{text:{91:tE}}}function rE(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 ge(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 Q(o)?e(o):re(o)?t.check({tokenize:iE},e,n)(o):n(o)}}function iE(t,e,n){return oe(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function sE(t){return eu([L2(),U2(),G2(t),Z2(),nE()])}const aE={};function uE(t){const e=this,n=t||aE,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(sE(n)),s.push(S2()),a.push(y2(n))}const oE=U.lazy(()=>Wo(()=>import("./lazy-highlighter-CaSijfHb.js"),__vite__mapDeps([0,1,2])));function yo(){const t=V.c(3),[e,n]=U.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 lE(){const t=V.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(cE)}),t[1]=r):r=t[1],r}function cE(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 fE(t){const e=V.c(12),n=U.useRef(null),{handleCopy:r,copied:i}=yo(),s=dE;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(xt,{size:12}):p.jsx(Qr,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=p.jsx("div",{className:"flex justify-end items-center",children:p.jsxs(Qe,{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]=l):l=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 d;return e[9]!==l||e[10]!==f?(d=p.jsxs(p.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=d):d=e[11],d}function dE(t){return t?Array.from(t.querySelectorAll("tr")).map(hE).join(`
86
+ `))}function o(h,g,k,C){const T=k.enter("tableCell"),S=k.enter("phrasing"),N=k.containerPhrasing(h,{...C,before:s,after:s});return S(),T(),N}function l(h,g){return Mg(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(h,g,k){const C=h.children;let T=-1;const S=[],N=g.enter("table");for(;++T<C.length;)S[T]=d(C[T],g,k);return N(),S}function d(h,g,k){const C=h.children;let T=-1;const S=[],N=g.enter("tableRow");for(;++T<C.length;)S[T]=o(C[T],h,g,k);return N(),S}function m(h,g,k){let C=bo.inlineCode(h,g,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function A2(){return{exit:{taskListCheckValueChecked:Qs,taskListCheckValueUnchecked:Qs,paragraph:C2}}}function k2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:N2}}}function Qs(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function C2(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 N2(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})/,l)),o;function l(f){return f+a}}function S2(){return[ig(),Ng(),wg(),p2(),A2()]}function y2(t){return{extensions:[sg(),Sg(t),Lg(),_2(t),k2()]}}const I2={tokenize:P2,partial:!0},To={tokenize:M2,partial:!0},xo={tokenize:v2,partial:!0},_o={tokenize:B2,partial:!0},w2={tokenize:F2,partial:!0},Ao={name:"wwwAutolink",tokenize:O2,previous:Co},ko={name:"protocolAutolink",tokenize:D2,previous:No},ut={name:"emailAutolink",tokenize:R2,previous:So},tt={};function L2(){return{text:tt}}let gt=48;for(;gt<123;)tt[gt]=ut,gt++,gt===58?gt=65:gt===91&&(gt=97);tt[43]=ut;tt[45]=ut;tt[46]=ut;tt[95]=ut;tt[72]=[ut,ko];tt[104]=[ut,ko];tt[87]=[ut,Ao];tt[119]=[ut,Ao];function R2(t,e,n){const r=this;let i,s;return a;function a(d){return!jr(d)||!So.call(r,r.previous)||Si(r.events)?n(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(d))}function u(d){return jr(d)?(t.consume(d),u):d===64?(t.consume(d),o):n(d)}function o(d){return d===46?t.check(w2,f,l)(d):d===45||d===95||Re(d)?(s=!0,t.consume(d),o):f(d)}function l(d){return t.consume(d),i=!0,o}function f(d){return s&&i&&ve(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):n(d)}}function O2(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Co.call(r,r.previous)||Si(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(I2,t.attempt(To,t.attempt(xo,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function D2(t,e,n){const r=this;let i="",s=!1;return a;function a(d){return(d===72||d===104)&&No.call(r,r.previous)&&!Si(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),t.consume(d),u):n(d)}function u(d){if(ve(d)&&i.length<5)return i+=String.fromCodePoint(d),t.consume(d),u;if(d===58){const m=i.toLowerCase();if(m==="http"||m==="https")return t.consume(d),o}return n(d)}function o(d){return d===47?(t.consume(d),s?l:(s=!0,o)):n(d)}function l(d){return d===null||Mn(d)||ge(d)||kt(d)||Wn(d)?n(d):t.attempt(To,t.attempt(xo,f),n)(d)}function f(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function P2(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 M2(t,e,n){let r,i,s;return a;function a(l){return l===46||l===95?t.check(_o,o,u)(l):l===null||ge(l)||kt(l)||l!==45&&Wn(l)?o(l):(s=!0,t.consume(l),a)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),a}function o(l){return i||r||!s?n(l):e(l)}}function v2(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||ge(a)||kt(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function B2(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||ge(u)||kt(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||ge(u)||kt(u)?e(u):r(u)}function s(u){return ve(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):ve(u)?(t.consume(u),a):n(u)}}function F2(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Re(s)?n(s):e(s)}}function Co(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ge(t)}function No(t){return!ve(t)}function So(t){return!(t===47||jr(t))}function jr(t){return t===43||t===45||t===46||t===95||Re(t)}function Si(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 H2={tokenize:W2,partial:!0};function U2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Y2,continuation:{tokenize:q2},exit:V2}},text:{91:{name:"gfmFootnoteCall",tokenize:$2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j2,resolveTo:z2}}}}function j2(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 l=Ge(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function z2(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 $2(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return u;function u(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),o}function o(d){return d!==94?n(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(d){if(s>999||d===93&&!a||d===null||d===91||ge(d))return n(d);if(d===93){t.exit("chunkString");const m=t.exit("gfmFootnoteCallString");return i.includes(Ge(r.sliceSerialize(m)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(d)}return ge(d)||(a=!0),s++,t.consume(d),d===92?f:l}function f(d){return d===91||d===92||d===93?(t.consume(d),s++,l):l(d)}}function Y2(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"),l}function l(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||ge(g))return n(g);if(g===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return s=Ge(r.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),m}return ge(g)||(u=!0),a++,t.consume(g),g===92?d:f}function d(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),oe(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function q2(t,e,n){return t.check(bn,e,t.attempt(H2,e,n))}function V2(t){t.exit("gfmFootnoteDefinition")}function W2(t,e,n){const r=this;return oe(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 G2(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 l=o;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[o][1].end.offset-a[o][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[o][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[o][1].end)},d={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[o][1].start)},m=[["enter",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["enter",d,u]],h=u.parser.constructs.insideSpan.null;h&&Ye(m,m.length,0,Gn(h,a.slice(l+1,o),u)),Ye(m,m.length,0,[["exit",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["exit",f,u]]),Ye(a,l-1,o-l+3,m),o=l+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 l=this.previous,f=this.events;let d=0;return m;function m(g){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const k=Dt(l);if(g===126)return d>1?o(g):(a.consume(g),d++,h);if(d<2&&!n)return o(g);const C=a.exit("strikethroughSequenceTemporary"),T=Dt(g);return C._open=!T||T===2&&!!k,C._close=!k||k===2&&!!T,u(g)}}}class Q2{constructor(){this.map=[]}add(e,n,r){K2(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 K2(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 X2(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 Z2(){return{flow:{null:{name:"table",tokenize:J2,resolveAll:eE}}}}function J2(t,e,n){const r=this;let i=0,s=0,a;return u;function u(I){let B=r.events.length-1;for(;B>-1;){const z=r.events[B][1].type;if(z==="lineEnding"||z==="linePrefix")B--;else break}const F=B>-1?r.events[B][1].type:null,G=F==="tableHead"||F==="tableRow"?y:o;return G===y&&r.parser.lazy[r.now().line]?n(I):G(I)}function o(I){return t.enter("tableHead"),t.enter("tableRow"),l(I)}function l(I){return I===124||(a=!0,s+=1),f(I)}function f(I){return I===null?n(I):Q(I)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),h):n(I):re(I)?oe(t,f,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),d(I)))}function d(I){return I===null||I===124||ge(I)?(t.exit("data"),f(I)):(t.consume(I),I===92?m:d)}function m(I){return I===92||I===124?(t.consume(I),d):d(I)}function h(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(t.enter("tableDelimiterRow"),a=!1,re(I)?oe(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?C(I):I===124?(a=!0,t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),k):O(I)}function k(I){return re(I)?oe(t,C,"whitespace")(I):C(I)}function C(I){return I===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),T):I===45?(s+=1,T(I)):I===null||Q(I)?L(I):O(I)}function T(I){return I===45?(t.enter("tableDelimiterFiller"),S(I)):O(I)}function S(I){return I===45?(t.consume(I),S):I===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(I))}function N(I){return re(I)?oe(t,L,"whitespace")(I):L(I)}function L(I){return I===124?g(I):I===null||Q(I)?!a||i!==s?O(I):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(I)):O(I)}function O(I){return n(I)}function y(I){return t.enter("tableRow"),j(I)}function j(I){return I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),j):I===null||Q(I)?(t.exit("tableRow"),e(I)):re(I)?oe(t,j,"whitespace")(I):(t.enter("data"),Y(I))}function Y(I){return I===null||I===124||ge(I)?(t.exit("data"),j(I)):(t.consume(I),I===92?q:Y)}function q(I){return I===92||I===124?(t.consume(I),Y):Y(I)}}function eE(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],u=!1,o=0,l,f,d;const m=new Q2;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(Ks(m,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=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],d=yn(m,e,s,i,void 0,d),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],d=yn(m,e,s,i,void 0,d)),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],d=yn(m,e,s,i,n,d)):a[1]!==0&&(d=yn(m,e,a,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(o!==0&&Ks(m,e,o,l,f),m.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=X2(e.events,n))}return t}function yn(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 l=Lt(e.events,n[2]),f=Lt(e.events,n[3]),d={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",d,e]]),r!==2){const m=e.events[n[2]],h=e.events[n[3]];if(m[1].end=Object.assign({},h[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",d,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 Ks(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 tE={name:"tasklistCheck",tokenize:rE};function nE(){return{text:{91:tE}}}function rE(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 ge(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 Q(o)?e(o):re(o)?t.check({tokenize:iE},e,n)(o):n(o)}}function iE(t,e,n){return oe(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function sE(t){return eu([L2(),U2(),G2(t),Z2(),nE()])}const aE={};function uE(t){const e=this,n=t||aE,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(sE(n)),s.push(S2()),a.push(y2(n))}const oE=U.lazy(()=>Wo(()=>import("./lazy-highlighter-Bva2qxQ8.js"),__vite__mapDeps([0,1,2])));function yo(){const t=V.c(3),[e,n]=U.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 lE(){const t=V.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(cE)}),t[1]=r):r=t[1],r}function cE(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 fE(t){const e=V.c(12),n=U.useRef(null),{handleCopy:r,copied:i}=yo(),s=dE;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(xt,{size:12}):p.jsx(Qr,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=p.jsx("div",{className:"flex justify-end items-center",children:p.jsxs(Qe,{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]=l):l=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 d;return e[9]!==l||e[10]!==f?(d=p.jsxs(p.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=d):d=e[11],d}function dE(t){return t?Array.from(t.querySelectorAll("tr")).map(hE).join(`
87
87
  `):""}function hE(t){return Array.from(t.querySelectorAll("th,td")).map(mE).join(",")}function mE(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const pE=[uE],gE=[Zp],EE={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(fE,{...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=U.memo(t=>{const e=V.c(2),{content:n}=t;let r;return e[0]!==n?(r=p.jsx(vh,{remarkPlugins:pE,rehypePlugins:gE,components:EE,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function bE(t){const e=V.c(20),{language:n,content:r}=t,{handleCopy:i,copied:s}=yo(),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 l;e[5]!==s?(l=s?p.jsx(xt,{size:14}):p.jsx(Qr,{size:14}),e[5]=s,e[6]=l):l=e[6];let f;e[7]!==o||e[8]!==l?(f=p.jsx(Qe,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=f):f=e[9];let d;e[10]!==u||e[11]!==f?(d=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]=d):d=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx(lE,{}),e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==n?(h=p.jsx(U.Suspense,{fallback:m,children:p.jsx(oE,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==d||e[18]!==h?(g=p.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[d,h]}),e[17]=d,e[18]=h,e[19]=g):g=e[19],g}Io.displayName="MemoizedMarkdownBlock";const yi=t=>{const e=V.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=de.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,l)=>o.type==="code"?p.jsx(bE,{language:o.lang,content:o.text},`${n}-block_${l}`):p.jsx(Io,{content:o.raw},`${n}-block_${l}`),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 wo(t){const e=V.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:l}=Vl(),[f,d]=U.useState(!1);let m;e[0]!==l||e[1]!==r.text?(m=async()=>{await l(r.text),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=l,e[1]=r.text,e[2]=m):m=e[2];const h=m,g=u&&s,k=g||s,C=!o&&"mb-2";let T;e[3]!==C?(T=ae("group/part relative",C),e[3]=C,e[4]=T):T=e[4];let S;e[5]!==n||e[6]!==r.text?(S=p.jsx(yi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=S):S=e[7];let N;e[8]!==s||e[9]!==h||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(Qe,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:f?p.jsx(xt,{size:12}):p.jsx(Qr,{size:12})}),s]})}),e[8]=s,e[9]=h,e[10]=f,e[11]=k,e[12]=g,e[13]=N):N=e[13];let L;return e[14]!==T||e[15]!==S||e[16]!==N?(L=p.jsxs("div",{className:T,children:[S,N]}),e[14]=T,e[15]=S,e[16]=N,e[17]=L):L=e[17],L}function TE(t){const e=V.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 rr="Collapsible",[xE,Vb]=Go(rr),[_E,Ii]=xE(rr),Lo=U.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...u}=t,[o,l]=Qo({prop:r,defaultProp:i??!1,onChange:a,caller:rr});return p.jsx(_E,{scope:n,disabled:s,contentId:Ko(),open:o,onOpenToggle:U.useCallback(()=>l(f=>!f),[l]),children:p.jsx($r.div,{"data-state":Oi(o),"data-disabled":s?"":void 0,...u,ref:e})})});Lo.displayName=rr;var Ro="CollapsibleTrigger",wi=U.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=Ii(Ro,n);return p.jsx($r.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Oi(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Zo(t.onClick,i.onOpenToggle)})});wi.displayName=Ro;var Li="CollapsibleContent",Ri=U.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ii(Li,t.__scopeCollapsible);return p.jsx(Xo,{present:n||i.open,children:({present:s})=>p.jsx(AE,{...r,ref:e,present:s})})});Ri.displayName=Li;var AE=U.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=t,a=Ii(Li,n),[u,o]=U.useState(r),l=U.useRef(null),f=Jo(e,l),d=U.useRef(0),m=d.current,h=U.useRef(0),g=h.current,k=a.open||u,C=U.useRef(k),T=U.useRef(void 0);return U.useEffect(()=>{const S=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(S)},[]),el(()=>{const S=l.current;if(S){T.current=T.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const N=S.getBoundingClientRect();d.current=N.height,h.current=N.width,C.current||(S.style.transitionDuration=T.current.transitionDuration,S.style.animationName=T.current.animationName),o(r)}},[a.open,r]),p.jsx($r.div,{"data-state":Oi(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 Oi(t){return t?"open":"closed"}var kE=Lo,Wb=wi,Gb=Ri;function CE(t){const e=V.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(kE,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function NE(t){const e=V.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-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function SE(t){const e=V.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(Ri,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function yE(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Xs(t){const e=V.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:l}=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 d=f;let m;e[2]!==d?(m=yE(d),e[2]=d,e[3]=m):m=e[3];const h=m,[g,k]=U.useState(!1),[C]=vl(),T=(l==="input-streaming"||l==="input-available"||l==="output-available")&&!!n.input,S=l==="output-available",N=l==="output-error";if(!C){const he=l==="input-streaming"||l==="input-available",ce=l==="output-available",ke=l==="output-error",Ee=a&&"mt-2",xe=u&&"mb-2";let me;e[4]!==Ee||e[5]!==xe?(me=ae("flex items-center gap-1.5 py-2 opacity-75 relative",Ee,xe),e[4]=Ee,e[5]=xe,e[6]=me):me=e[6];let Ae;e[7]===Symbol.for("react.memo_cache_sentinel")?(Ae=p.jsx(fa,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Ae):Ae=e[7];let Ie;e[8]!==o?(Ie=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]=Ie):Ie=e[9];let be;e[10]!==Ie?(be=p.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Ae,Ie]}),e[10]=Ie,e[11]=be):be=e[11];let Pe;e[12]!==h||e[13]!==he?(Pe=he&&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:[h,"..."]})]}),e[12]=h,e[13]=he,e[14]=Pe):Pe=e[14];let Le;e[15]!==h||e[16]!==ce?(Le=ce&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",p.jsx("span",{className:"text-muted-foreground/75",children:h})]}),e[15]=h,e[16]=ce,e[17]=Le):Le=e[17];let Fe;e[18]!==h||e[19]!==ke?(Fe=ke&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",p.jsx("span",{className:"text-destructive/75",children:h})]}),e[18]=h,e[19]=ke,e[20]=Fe):Fe=e[20];let ie;e[21]!==Pe||e[22]!==Le||e[23]!==Fe?(ie=p.jsxs("span",{className:"text-[15px]",children:[Pe,Le,Fe]}),e[21]=Pe,e[22]=Le,e[23]=Fe,e[24]=ie):ie=e[24];let we;return e[25]!==be||e[26]!==ie||e[27]!==me?(we=p.jsxs("div",{className:me,children:[be,ie]}),e[25]=be,e[26]=ie,e[27]=me,e[28]=we):we=e[28],we}let L;e[29]!==l?(L=l==="output-error"?p.jsx(aa,{className:"size-4 text-destructive shrink-0"}):p.jsx(fl,{className:ae("size-4 text-muted-foreground shrink-0",(l==="input-streaming"||l==="input-available")&&"shimmer")}),e[29]=l,e[30]=L):L=e[30];const O=l==="output-error"&&"text-destructive/90",y=(l==="input-streaming"||l==="input-available")&&"shimmer";let j;e[31]!==O||e[32]!==y?(j=ae("text-[15px] font-medium text-muted-foreground truncate",O,y),e[31]=O,e[32]=y,e[33]=j):j=e[33];const Y=l==="input-streaming"&&`Streaming ${d} arguments`,q=l==="input-available"&&`Calling ${d}`,I=l==="output-available"&&`Called ${d}`,B=l==="output-error"&&`Error calling ${d}`;let F;e[34]!==Y||e[35]!==q||e[36]!==I||e[37]!==B||e[38]!==j?(F=p.jsxs("span",{className:j,children:[Y,q,I,B]}),e[34]=Y,e[35]=q,e[36]=I,e[37]=B,e[38]=j,e[39]=F):F=e[39];let G;e[40]!==F||e[41]!==L?(G=p.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[L,F]}),e[40]=F,e[41]=L,e[42]=G):G=e[42];const z=g&&"rotate-90";let M;e[43]!==z?(M=ae("size-4 text-muted-foreground transition-transform duration-200",z),e[43]=z,e[44]=M):M=e[44];let W;e[45]!==M?(W=p.jsx("div",{className:"flex items-center gap-2 shrink-0",children:p.jsx(ua,{className:M})}),e[45]=M,e[46]=W):W=e[46];let K;e[47]!==G||e[48]!==W?(K=p.jsxs(NE,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[G,W]}),e[47]=G,e[48]=W,e[49]=K):K=e[49];let te;e[50]===Symbol.for("react.memo_cache_sentinel")?(te=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]=te):te=e[50];let J;e[51]!==n.input||e[52]!==T?(J=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]=J):J=e[53];let A;e[54]!==n.output||e[55]!==S?(A=S&&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(TE,{output:n.output})})]}),e[54]=n.output,e[55]=S,e[56]=A):A=e[56];let Z;e[57]!==n||e[58]!==N?(Z=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]=Z):Z=e[59];let le;e[60]!==J||e[61]!==A||e[62]!==Z?(le=p.jsx(SE,{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:[te,p.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[J,A,Z]})]})}),e[60]=J,e[61]=A,e[62]=Z,e[63]=le):le=e[63];let x;e[64]!==K||e[65]!==le?(x=p.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[K,le]}),e[64]=K,e[65]=le,e[66]=x):x=e[66];let ue;return e[67]!==g||e[68]!==x?(ue=p.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:p.jsx(CE,{open:g,onOpenChange:k,children:x})}),e[67]=g,e[68]=x,e[69]=ue):ue=e[69],ue}const IE={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 wE(t){if(!t?.providerMetadata)return null;for(const e of Object.values(IE)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function LE(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+(wE(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function RE(t){const e=V.c(38),{messages:n}=t;let r,i,s,a,u,o,l,f,d,m,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const L=LE(n);if(!L){g=null;break e}const{totalTokens:O,inputTokens:y,outputTokens:j,cost:Y}=L;if(s=Y,!O&&!y&&!j){g=null;break e}i=Vr;let q;e[13]===Symbol.for("react.memo_cache_sentinel")?(q=p.jsx(da,{size:12}),e[13]=q):q=e[13];const I=p.jsxs(Qe,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[q,p.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:O.toLocaleString()})]});e[14]!==I?(h=p.jsx(Wr,{asChild:!0,children:I}),e[14]=I,e[15]=h):h=e[15],r=Gr,d="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],l=p.jsx("span",{children:y.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=j.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=u,e[6]=o,e[7]=l,e[8]=f,e[9]=d,e[10]=m,e[11]=h,e[12]=g}else r=e[1],i=e[2],s=e[3],a=e[4],u=e[5],o=e[6],l=e[7],f=e[8],d=e[9],m=e[10],h=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 C;e[20]!==s?(C=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]=C):C=e[21];let T;e[22]!==k||e[23]!==C||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==f?(T=p.jsxs("div",{className:u,children:[o,l,f,k,C]}),e[22]=k,e[23]=C,e[24]=u,e[25]=o,e[26]=l,e[27]=f,e[28]=T):T=e[28];let S;e[29]!==r||e[30]!==T||e[31]!==d||e[32]!==m?(S=p.jsx(r,{side:d,className:m,children:T}),e[29]=r,e[30]=T,e[31]=d,e[32]=m,e[33]=S):S=e[33];let N;return e[34]!==i||e[35]!==S||e[36]!==h?(N=p.jsxs(i,{children:[h,S]}),e[34]=i,e[35]=S,e[36]=h,e[37]=N):N=e[37],N}const OE={planning:{icon:p.jsx(xa,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:p.jsx(jn,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},DE=1200;function PE(){const t=V.c(7),[e,n]=U.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},DE);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),U.useEffect(r,i);const s=OE[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 ME(t){const e=V.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,l]=U.useState(!1),[f,d]=U.useState(!1);let m;if(e[2]!==i||e[3]!==f||e[4]!==o||e[5]!==r||e[6]!==u){const h=r.filter(BE),g=h.some(vE),k=g||f;let C,T;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>l(!0),T=()=>l(!1),e[8]=C,e[9]=T):(C=e[8],T=e[9]),m=p.jsxs("div",{className:"flex flex-col mb-2",children:[p.jsx("button",{type:"button",onClick:()=>!g&&d(!f),onMouseEnter:C,onMouseLeave:T,className:ae("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(jn,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?p.jsx(ua,{className:ae("text-muted-foreground transition-transform shrink-0",f&&"rotate-90"),size:14}):p.jsx(Ea,{className:"text-muted-foreground shrink-0",size:14}),p.jsx("span",{className:ae("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:h.map((S,N)=>p.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:p.jsx(yi,{id:`${i}-reasoning-${N}`,text:S.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 vE(t){return t.state==="streaming"}function BE(t){return t.type==="reasoning"}function FE(t){const e=V.c(17),{part:n,id:r,usageStats:i,isFollowedByToolCall:s,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:o}=t;switch(n.type){case"dynamic-tool":{let l;return e[0]!==o||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(l=p.jsx(Xs,{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]=l):l=e[5],l}case"text":{let l;return e[6]!==r||e[7]!==s||e[8]!==n||e[9]!==i?(l=p.jsx(wo,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:s}),e[6]=r,e[7]=s,e[8]=n,e[9]=i,e[10]=l):l=e[10],l}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const l=n;let f;return e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==l?(f=p.jsx(Xs,{part:l,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:o}),e[11]=o,e[12]=r,e[13]=a,e[14]=u,e[15]=l,e[16]=f):f=e[16],f}}throw new Error(`Unknown part type: ${n.type}`)}function HE(t){const e=V.c(32),{message:n,status:r,className:i}=t,{id:s,parts:a}=n,l=r==="streaming"||r==="submitted",f=U.useRef(null);let d;e[0]!==s?(d=()=>{const z=localStorage.getItem(`msg-duration-${s}`);return z?Number(z):null},e[0]=s,e[1]=d):d=e[1];const[m,h]=U.useState(d);let g,k;e[2]!==l?(g=()=>{l&&f.current===null&&(f.current=Date.now())},k=[l],e[2]=l,e[3]=g,e[4]=k):(g=e[3],k=e[4]),U.useEffect(g,k);let C,T;e[5]!==m||e[6]!==s||e[7]!==a.length?(C=()=>{if(a.length>0&&m===null&&f.current!==null){const z=Date.now()-f.current;h(z),localStorage.setItem(`msg-duration-${s}`,z.toString())}},T=[a.length,m,s],e[5]=m,e[6]=s,e[7]=a.length,e[8]=C,e[9]=T):(C=e[8],T=e[9]),U.useEffect(C,T);const S=a.length>0;let N;e[10]!==a?(N=a.some(jE),e[10]=a,e[11]=N):N=e[11];const L=N;let O;e[12]!==l||e[13]!==a?(O=l&&a.some(UE),e[12]=l,e[13]=a,e[14]=O):O=e[14];const j=S&&(L||O)&&m!==null;let Y;e[15]!==n?(Y=p.jsx(RE,{messages:[n]}),e[15]=n,e[16]=Y):Y=e[16];const q=Y;let I;e[17]!==i?(I=ae("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[17]=i,e[18]=I):I=e[18];let B;e[19]!==m||e[20]!==S||e[21]!==s||e[22]!==l||e[23]!==a||e[24]!==j||e[25]!==q?(B=S?p.jsxs(p.Fragment,{children:[j&&p.jsx(ME,{duration:m,parts:a,id:s}),a.map((z,M)=>{const W=a[M+1],K=a[M-1],te=W&&(W.type==="dynamic-tool"||W.type.startsWith("tool-")),J=z.type==="dynamic-tool"||z.type.startsWith("tool-"),A=K&&(K.type==="dynamic-tool"||K.type.startsWith("tool-")),Z=W&&(W.type==="dynamic-tool"||W.type.startsWith("tool-")),le=J&&!A,x=J&&!Z,ue=J&&Z;return p.jsx(FE,{part:z,id:s,usageStats:M===a.length-1?q:void 0,isFollowedByToolCall:te,isFirstToolCallInSequence:le,isLastToolCallInSequence:x,hasNextToolCall:ue},`${s}-${M}`)})]}):l?p.jsx(PE,{}):null,e[19]=m,e[20]=S,e[21]=s,e[22]=l,e[23]=a,e[24]=j,e[25]=q,e[26]=B):B=e[26];let F;e[27]!==B?(F=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:B})}),e[27]=B,e[28]=F):F=e[28];let G;return e[29]!==F||e[30]!==I?(G=p.jsx("div",{className:I,children:F}),e[29]=F,e[30]=I,e[31]=G):G=e[31],G}function UE(t){return t.type==="reasoning"&&t.state==="streaming"}function jE(t){return t.type==="reasoning"}const Oo=U.createContext(null);function Do(t){const e=V.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 zE(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!U.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const s=t[n-1],a=U.isValidElement(s)&&s.props?.message?.role,u=s&&U.isValidElement(s)&&a==="user"?s:null;e.push({user:u,assistant:r})}}return e}function $E(t){const e=V.c(27),{children:n,className:r,minHeightOffset:i}=t,s=U.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=U.useRef(a);let o,l,f,d,m,h,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const S=U.Children.toArray(n),N=S[S.length-1];l=N&&U.isValidElement(N)&&N.type===Do?N:null;const L=l?S.slice(0,-1):S,O=zE(L);let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=Y=>{const q=u.current[Y];if(q&&s.current){const I=s.current.offsetTop,B=q.offsetTop;s.current.scrollTo({top:B-I,behavior:"smooth"})}},e[11]=y):y=e[11];const j=y;o=Oo.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:j},e[12]=g):g=e[12],m=s,e[13]!==r?(h=ae("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],f="flex flex-col min-w-0 max-w-2xl mx-auto w-full",d=O.map((Y,q)=>{const I=q===O.length-1;return p.jsxs("div",{ref:B=>{u.current[q]=B},className:"flex flex-col pb-2",style:I&&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:Y.user&&U.isValidElement(Y.user)?U.cloneElement(Y.user,{pairIndex:q}):Y.user}),Y.assistant]},q)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=f,e[7]=d,e[8]=m,e[9]=h,e[10]=g}else o=e[4],l=e[5],f=e[6],d=e[7],m=e[8],h=e[9],g=e[10];let k;e[15]!==l||e[16]!==f||e[17]!==d?(k=p.jsxs("div",{className:f,children:[d,l]}),e[15]=l,e[16]=f,e[17]=d,e[18]=k):k=e[18];let C;e[19]!==m||e[20]!==h||e[21]!==k?(C=p.jsx("div",{ref:m,className:h,children:k}),e[19]=m,e[20]=h,e[21]=k,e[22]=C):C=e[22];let T;return e[23]!==o||e[24]!==g||e[25]!==C?(T=p.jsx(o,{value:g,children:C}),e[23]=o,e[24]=g,e[25]=C,e[26]=T):T=e[26],T}function YE(t){const e=V.c(5),{locator:n}=Bt(),r=Ul(),i=Ca();let s;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(s=async(u,o,l)=>{const f=await ka(n,l),d=f.findIndex(C=>C.id===u);if(d===-1){console.warn(`[branch] Message ${u} not found in thread ${l}`);return}const m=f.slice(0,d).filter(qE),h=crypto.randomUUID(),g=new Date().toISOString(),k={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(k),m.length>0){const C=m.map(T=>({...T,id:crypto.randomUUID(),metadata:{...T.metadata,thread_id:h,created_at:T.metadata?.created_at||g}}));await r.insertMany.mutateAsync(C)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=s):s=e[4],s}function qE(t){return t.role!=="system"}function VE(t){const e=V.c(18),{messageId:n,parts:r}=t,[i,s]=U.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:o,activeThreadId:l}=Yl(),f=YE(o);let d;e[0]!==r?(d=r.filter(GE).map(WE).join(`
88
88
  `),e[0]=r,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=y=>{y.stopPropagation(),s(!0)},e[2]=h):h=e[2];const g=h;let k;e[3]!==l||e[4]!==f||e[5]!==n||e[6]!==m||e[7]!==a||e[8]!==u?(k=async()=>{await f(n,m,l),a(m),u({originalThreadId:l,originalMessageId:n,originalMessageText:m}),s(!1)},e[3]=l,e[4]=f,e[5]=n,e[6]=m,e[7]=a,e[8]=u,e[9]=k):k=e[9];const C=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(Vr,{children:[p.jsx(Wr,{asChild:!0,children:p.jsx(Qe,{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(Gr,{side:"bottom",children:"Edit message"})]})}),e[10]=T):T=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=p.jsxs(dl,{children:[p.jsx(hl,{children:"Edit message?"}),p.jsx(ml,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=S):S=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=p.jsx(pl,{children:"Cancel"}),e[12]=N):N=e[12];let L;e[13]!==C?(L=p.jsxs(gl,{children:[S,p.jsxs(El,{children:[N,p.jsx(bl,{onClick:C,children:"Confirm"})]})]}),e[13]=C,e[14]=L):L=e[14];let O;return e[15]!==i||e[16]!==L?(O=p.jsxs(p.Fragment,{children:[T,p.jsx(Tl,{open:i,onOpenChange:s,children:L})]}),e[15]=i,e[16]=L,e[17]=O):O=e[17],O}function WE(t){return t.text}function GE(t){return t.type==="text"}function QE(t){const e=V.c(29),{message:n,className:r,pairIndex:i}=t,{id:s,parts:a}=n,u=U.useContext(Oo),[o,l]=U.useState(!1);if(!a||a.length===0)return null;let f;e[0]!==u||e[1]!==i?(f=()=>{l(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=f):f=e[2];const d=f;let m;e[3]!==r?(m=ae("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 h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>l(!0),g=()=>l(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const k=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let C;e[7]!==k?(C=ae("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",k),e[7]=k,e[8]=C):C=e[8];let T;if(e[9]!==s||e[10]!==a){let j;e[12]!==s?(j=(Y,q)=>Y.type==="text"?p.jsx(wo,{id:s,part:Y},`${s}-${q}`):null,e[12]=s,e[13]=j):j=e[13],T=a.map(j),e[9]=s,e[10]=a,e[11]=T}else T=e[11];let S;e[14]!==T?(S=p.jsx("div",{children:T}),e[14]=T,e[15]=S):S=e[15];let N;e[16]!==C||e[17]!==S?(N=p.jsx("div",{className:C,children:S}),e[16]=C,e[17]=S,e[18]=N):N=e[18];let L;e[19]!==s||e[20]!==a?(L=p.jsx(VE,{messageId:s,parts:a}),e[19]=s,e[20]=a,e[21]=L):L=e[21];let O;e[22]!==d||e[23]!==L||e[24]!==N?(O=p.jsxs("div",{tabIndex:0,onClick:d,onFocus:h,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,L]}),e[22]=d,e[23]=L,e[24]=N,e[25]=O):O=e[25];let y;return e[26]!==O||e[27]!==m?(y=p.jsx(p.Fragment,{children:p.jsx("div",{className:m,children:O})}),e[26]=O,e[27]=m,e[28]=y):y=e[28],y}const Po=U.createContext({isMobile:!1,setValue:()=>{}}),Di=()=>U.useContext(Po),Mo=t=>{const e=V.c(37);let n,r,i,s,a,u,o,l;e[0]!==t?({children:n,defaultOpen:r,open:u,onOpenChange:s,defaultValue:i,value:l,onValueChange:a,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=u,e[7]=o,e[8]=l):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],u=e[6],o=e[7],l=e[8]);const f=Cl(),d=r??!1;let m;e[9]!==s||e[10]!==u||e[11]!==d?(m={prop:u,defaultProp:d,onChange:s},e[9]=s,e[10]=u,e[11]=d,e[12]=m):m=e[12];const[h,g]=vi(m);let k;e[13]!==i||e[14]!==a||e[15]!==l?(k={prop:l,defaultProp:i,onChange:a},e[13]=i,e[14]=a,e[15]=l,e[16]=k):k=e[16];const[C,T]=vi(k);let S;e[17]!==T?(S=Y=>{Y&&T(Y)},e[17]=T,e[18]=S):S=e[18];const N=S;let L;e[19]!==f||e[20]!==N?(L={isMobile:f,setValue:N},e[19]=f,e[20]=N,e[21]=L):L=e[21];let O;e[22]!==n||e[23]!==h||e[24]!==o||e[25]!==g?(O=p.jsx(wl,{open:h,onOpenChange:g,...o,children:n}),e[22]=n,e[23]=h,e[24]=o,e[25]=g,e[26]=O):O=e[26];let y;e[27]!==h||e[28]!==o||e[29]!==g||e[30]!==N||e[31]!==O||e[32]!==C?(y=p.jsx(kl,{open:h,onOpenChange:g,value:C,onValueChange:N,...o,children:O}),e[27]=h,e[28]=o,e[29]=g,e[30]=N,e[31]=O,e[32]=C,e[33]=y):y=e[33];let j;return e[34]!==L||e[35]!==y?(j=p.jsx(Po.Provider,{value:L,children:y}),e[34]=L,e[35]=y,e[36]=j):j=e[36],j},vo=t=>{const{children:e,title:n,headerActions:r,...i}=t,{isMobile:s}=Di(),{className:a,...u}=i;return s?p.jsxs(Dl,{...u,children:[p.jsxs(Pl,{className:ae(r?"flex flex-row items-center justify-between":"hidden"),children:[p.jsx(Ml,{children:n}),r]}),p.jsx("div",{className:ae("flex flex-col gap-2 p-2 py-4",a),children:e})]}):p.jsx(Al,{...i,children:e})},Bo=t=>{const e=V.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=Di();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?p.jsx(Ll,{asChild:!0,children:p.jsx(Qe,{variant:"outline",...r,children:n})}):p.jsx(_l,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},Fo=t=>{const e=V.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=Di();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?p.jsx("span",{...r,children:n}):p.jsx(xl,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s};function KE(){const t=V.c(4),e=tl();let n;t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1];let r;return t[2]!==n?(r=n.map(XE),t[2]=n,t[3]=r):r=t[3],r}function XE(t){return{id:t.id,title:t.title,description:t.description??null,icon:t.icon??null,fallbackIcon:p.jsx(Yr,{})}}function ZE(t){const e=V.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let s;e[0]!==i?(s=ae("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",i),e[0]=i,e[1]=s):s=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??p.jsx(Yr,{}),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(ia,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10"}),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 l;e[10]!==r?(l=r&&p.jsx(xt,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=l):l=e[11];let f;e[12]!==o||e[13]!==l?(f=p.jsxs("div",{className:"flex items-center justify-between",children:[o,l]}),e[12]=o,e[13]=l,e[14]=f):f=e[14];let d;e[15]!==n.description?(d=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]=d):d=e[16];let m;e[17]!==f||e[18]!==d?(m=p.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[f,d]}),e[17]=f,e[18]=d,e[19]=m):m=e[19];let h;return e[20]!==s||e[21]!==u||e[22]!==m?(h=p.jsxs("div",{className:s,children:[u,m]}),e[20]=s,e[21]=u,e[22]=m,e[23]=h):h=e[23],h}function JE(t){const e=V.c(12),{gateway:n}=t;if(!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Select agent"}),e[0]=u):u=e[0],u}let r;e[1]!==n.fallbackIcon?(r=n.fallbackIcon??p.jsx(Yr,{}),e[1]=n.fallbackIcon,e[2]=r):r=e[2];let i;e[3]!==n.icon||e[4]!==n.title||e[5]!==r?(i=p.jsx(ia,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=n.icon,e[4]=n.title,e[5]=r,e[6]=i):i=e[6];let s;e[7]!==n.title?(s=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[7]=n.title,e[8]=s):s=e[8];let a;return e[9]!==i||e[10]!==s?(a=p.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[i,s]}),e[9]=i,e[10]=s,e[11]=a):a=e[11],a}function Qb(t){const e=V.c(47),{selectedGatewayId:n,onGatewayChange:r,variant:i,className:s,placeholder:a}=t,u=i===void 0?"bordered":i,o=a===void 0?"Select Agent":a,[l,f]=U.useState(!1),[d,m]=U.useState(""),h=U.useRef(null),g=KE();let k,C;e[0]!==l?(k=()=>{l&&setTimeout(()=>{h.current?.focus()},0)},C=[l],e[0]=l,e[1]=k,e[2]=C):(k=e[1],C=e[2]),U.useEffect(k,C);let T;if(e[3]!==g||e[4]!==n){let x;e[6]!==n?(x=ue=>ue.id===n,e[6]=n,e[7]=x):x=e[7],T=g.find(x),e[3]=g,e[4]=n,e[5]=T}else T=e[5];const S=T;let N;e:{if(!d.trim()){N=g;break e}let x;if(e[8]!==g||e[9]!==d){const ue=d.toLowerCase();x=g.filter(he=>he.title.toLowerCase().includes(ue)||he.description?.toLowerCase().includes(ue)),e[8]=g,e[9]=d,e[10]=x}else x=e[10];N=x}const L=N;let O;e[11]!==r?(O=x=>{r(x),m(""),f(!1)},e[11]=r,e[12]=O):O=e[12];const y=O;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=x=>{f(x),x||m("")},e[13]=j):j=e[13];const Y=j,q=n||"",I=u==="borderless"&&"border-0 md:border-none";let B;e[14]!==s||e[15]!==I?(B=ae("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",I,s),e[14]=s,e[15]=I,e[16]=B):B=e[16];let F;e[17]!==S?(F=p.jsx(JE,{gateway:S}),e[17]=S,e[18]=F):F=e[18];let G;e[19]!==o||e[20]!==F?(G=p.jsx(Fo,{placeholder:o,className:"min-w-0 max-w-full",children:F}),e[19]=o,e[20]=F,e[21]=G):G=e[21];let z;e[22]!==B||e[23]!==G?(z=p.jsx(Bo,{size:"sm",className:B,children:G}),e[22]=B,e[23]=G,e[24]=z):z=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=p.jsx(qr,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[25]=M):M=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=x=>m(x.target.value),e[26]=W):W=e[26];let K;e[27]!==d?(K=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",children:[M,p.jsx(sa,{ref:h,type:"text",placeholder:"Search for an agent...",value:d,onChange:W,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[27]=d,e[28]=K):K=e[28];let te;e[29]!==L||e[30]!==y||e[31]!==n?(te=L.length>0?L.map(x=>p.jsx("div",{onClick:()=>y(x.id),className:"outline-none",children:p.jsx(ZE,{gateway:x,isSelected:x.id===n})},x.id)):p.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[29]=L,e[30]=y,e[31]=n,e[32]=te):te=e[32];let J;e[33]!==te?(J=p.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:te}),e[33]=te,e[34]=J):J=e[34];let A;e[35]!==K||e[36]!==J?(A=p.jsxs("div",{className:"flex flex-col max-h-[300px]",children:[K,J]}),e[35]=K,e[36]=J,e[37]=A):A=e[37];let Z;e[38]!==o||e[39]!==A?(Z=p.jsx(vo,{title:o,className:"w-full md:w-[400px] p-0",side:"bottom",children:A}),e[38]=o,e[39]=A,e[40]=Z):Z=e[40];let le;return e[41]!==y||e[42]!==l||e[43]!==z||e[44]!==Z||e[45]!==q?(le=p.jsxs(Mo,{open:l,onOpenChange:Y,value:q,onValueChange:y,children:[z,Z]}),e[41]=y,e[42]=l,e[43]=z,e[44]=Z,e[45]=q,e[46]=le):le=e[46],le}function eb(t,e){const n=V.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??nl;let a;return n[2]!==s?(a=il(s),n[2]=s,n[3]=a):a=n[3],rl(s,"LLM",a,i)}const tb=["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"],zr=new Map;tb.forEach((t,e)=>{zr.set(t,e)});function nb(){const t=V.c(9),e=sl();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=yl(n);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={pageSize:999},t[2]=i):i=t[2];const s=eb(r?.id,i);if(!s||!r){let o;return t[3]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[3]=o):o=t[3],o}let a;if(t[4]!==r||t[5]!==s){let o;t[7]!==r?(o=l=>({...l,name:l.title,contextWindow:l.limits?.contextWindow,outputLimit:l.limits?.maxOutputTokens,inputCost:l.costs?.input,outputCost:l.costs?.output,provider:l.provider,connectionId:r.id,connectionName:r.title}),t[7]=r,t[8]=o):o=t[8],a=s.filter(ib).map(o).sort(rb),t[4]=r,t[5]=s,t[6]=a}else a=t[6];return a}function rb(t,e){const n=zr.get(t.id),r=zr.get(e.id);return n!==void 0&&r!==void 0?n-r:n!==void 0?-1:r!==void 0?1:t.name.localeCompare(e.name)}function ib(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const sb={reasoning:{icon:p.jsx(jn,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:p.jsx(ga,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:p.jsx(Nl,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:p.jsx(qr,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},Ho=U.memo(function(e){const n=V.c(11),{capability:r}=e,i=sb[r];let s;n[0]!==r||n[1]!==i?(s=i||{icon:p.jsx(xt,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=s):s=n[2];const a=s,u=`flex items-center justify-center h-6 w-6 rounded-sm ${a.bg} ${a.text}`;let o;n[3]!==a.icon||n[4]!==u?(o=p.jsx(Wr,{asChild:!0,children:p.jsx("div",{className:u,children:a.icon})}),n[3]=a.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==a.label?(l=p.jsx(Gr,{children:p.jsx("p",{children:a.label})}),n[6]=a.label,n[7]=l):l=n[7];let f;return n[8]!==o||n[9]!==l?(f=p.jsxs(Vr,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=f):f=n[10],f}),Zs=U.memo(function(e){const n=V.c(54),{model:r,compact:i}=e,s=i===void 0?!1:i;if(!r){let T;return n[0]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=T):T=n[0],T}const a=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!a&&!s){let T;n[1]!==r.logo||n[2]!==r.name?(T=r.logo&&p.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=T):T=n[3];let S;n[4]!==r.name?(S=p.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=S):S=n[5];let N;n[6]!==T||n[7]!==S?(N=p.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,S]}),n[6]=T,n[7]=S,n[8]=N):N=n[8];let L;n[9]!==r.description?(L=r.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=L):L=n[10];let O;return n[11]!==N||n[12]!==L?(O=p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[N,L]}),n[11]=N,n[12]=L,n[13]=O):O=n[13],O}if(!a&&s)return null;if(s){let T;n[14]!==r.contextWindow?(T=r.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:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=T):T=n[15];let S;n[16]!==r.inputCost?(S=r.inputCost&&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:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=S):S=n[17];let N;n[18]!==r.outputCost?(N=r.outputCost&&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:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=N):N=n[19];let L;n[20]!==r.outputLimit?(L=r.outputLimit&&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:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=L):L=n[21];let O;return n[22]!==T||n[23]!==S||n[24]!==N||n[25]!==L?(O=p.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,S,N,L]}),n[22]=T,n[23]=S,n[24]=N,n[25]=L,n[26]=O):O=n[26],O}let u;n[27]!==r.logo||n[28]!==r.name?(u=r.logo&&p.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=u):u=n[29];let o;n[30]!==r.name?(o=p.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=p.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,n[34]=l):l=n[34];let f;n[35]!==r.capabilities?(f=r.capabilities&&r.capabilities.length>0&&p.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(ob)}),n[35]=r.capabilities,n[36]=f):f=n[36];let d;n[37]!==l||n[38]!==f?(d=p.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,f]}),n[37]=l,n[38]=f,n[39]=d):d=n[39];let m;n[40]!==r.contextWindow?(m=r.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(ll,{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:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=m):m=n[41];let h;n[42]!==r.inputCost||n[43]!==r.outputCost?(h=(r.inputCost||r.outputCost)&&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:[r.inputCost!==null&&r.inputCost!==void 0&&p.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&p.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=h):h=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ba,{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:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let k;n[47]!==m||n[48]!==h||n[49]!==g?(k=p.jsxs("div",{className:"flex flex-col gap-4",children:[m,h,g]}),n[47]=m,n[48]=h,n[49]=g,n[50]=k):k=n[50];let C;return n[51]!==k||n[52]!==d?(C=p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,k]}),n[51]=k,n[52]=d,n[53]=C):C=n[53],C}),ab=U.memo(function(e){const n=V.c(27),{model:r,onHover:i,isSelected:s,hasExpandedInfo:a}=e,u=a?"rounded-t-lg":"rounded-lg";let o;n[0]!==u?(o=ae("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let f;n[5]!==r.logo||n[6]!==r.name?(f=r.logo&&p.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=f):f=n[7];let d;n[8]!==r.name?(d=p.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=d):d=n[9];let m;n[10]!==a||n[11]!==r.capabilities?(m=a&&r.capabilities&&r.capabilities.length>0&&p.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(lb)}),n[10]=a,n[11]=r.capabilities,n[12]=m):m=n[12];let h;n[13]!==a||n[14]!==s?(h=s&&!a&&p.jsx(xt,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=a,n[14]=s,n[15]=h):h=n[15];let g;n[16]!==a||n[17]!==s?(g=s&&a&&p.jsx(xt,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=a,n[17]=s,n[18]=g):g=n[18];let k;return n[19]!==o||n[20]!==l||n[21]!==f||n[22]!==d||n[23]!==m||n[24]!==h||n[25]!==g?(k=p.jsxs("div",{className:o,onMouseEnter:l,children:[f,d,m,h,g]}),n[19]=o,n[20]=l,n[21]=f,n[22]=d,n[23]=m,n[24]=h,n[25]=g,n[26]=k):k=n[26],k});function ub(t){const e=V.c(9),{model:n}=t;if(!n){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=a):a=e[0],a}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&p.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=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.name}),e[4]=n.name,e[5]=i):i=e[5];let s;return e[6]!==r||e[7]!==i?(s=p.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[r,i]}),e[6]=r,e[7]=i,e[8]=s):s=e[8],s}function Kb(t){const e=V.c(67),{selectedModel:n,onModelChange:r,variant:i,className:s,placeholder:a}=t,u=i===void 0?"borderless":i,o=a===void 0?"Select model":a,[l,f]=U.useState(!1),[d,m]=U.useState(null),[h,g]=U.useState(!1),[k,C]=U.useState(""),T=U.useRef(null),S=nb();let N,L;e[0]!==l?(N=()=>{l&&setTimeout(()=>{T.current?.focus()},0)},L=[l],e[0]=l,e[1]=N,e[2]=L):(N=e[1],L=e[2]),U.useEffect(N,L);let O;e[3]!==S||e[4]!==n?(O=n?S.find(ie=>ie.id===n.id&&ie.connectionId===n.connectionId)?.id:void 0,e[3]=S,e[4]=n,e[5]=O):O=e[5];const y=O;let j;if(e[6]!==S||e[7]!==y){let ie;e[9]!==y?(ie=we=>we.id===y,e[9]=y,e[10]=ie):ie=e[10],j=S.find(ie),e[6]=S,e[7]=y,e[8]=j}else j=e[8];const Y=j;let q;e:{if(!k.trim()){q=S;break e}let ie;if(e[11]!==S||e[12]!==k){const we=k.toLowerCase();ie=S.filter(ot=>ot.name.toLowerCase().includes(we)||ot.provider?.toLowerCase().includes(we)||ot.description?.toLowerCase().includes(we)),e[11]=S,e[12]=k,e[13]=ie}else ie=e[13];q=ie}const I=q;let B;e[14]!==S||e[15]!==r?(B=ie=>{const we=S.find(ot=>ot.id===ie);we&&(r({id:we.id,connectionId:we.connectionId,provider:we.provider??void 0}),C(""),f(!1))},e[14]=S,e[15]=r,e[16]=B):B=e[16];const F=B;let G;e[17]===Symbol.for("react.memo_cache_sentinel")?(G=ie=>{f(ie),ie||C("")},e[17]=G):G=e[17];const z=G;if(S.length===0)return null;const M=y||"",W=u==="borderless"&&"md:border-none";let K;e[18]!==s||e[19]!==W?(K=ae("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",W,s),e[18]=s,e[19]=W,e[20]=K):K=e[20];let te;e[21]!==Y?(te=p.jsx(ub,{model:Y}),e[21]=Y,e[22]=te):te=e[22];let J;e[23]!==o||e[24]!==te?(J=p.jsx(Fo,{placeholder:o,className:"min-w-0 max-w-full",children:te}),e[23]=o,e[24]=te,e[25]=J):J=e[25];let A;e[26]!==K||e[27]!==J?(A=p.jsx(Bo,{size:"sm",className:K,children:J}),e[26]=K,e[27]=J,e[28]=A):A=e[28];let Z;e[29]!==h?(Z=()=>g(!h),e[29]=h,e[30]=Z):Z=e[30];const le=h?"text-foreground":"text-muted-foreground";let x;e[31]!==le?(x=ae("w-5 h-5 transition-colors",le),e[31]=le,e[32]=x):x=e[32];let ue;e[33]!==x?(ue=p.jsx(Sl,{className:x}),e[33]=x,e[34]=ue):ue=e[34];let he;e[35]!==Z||e[36]!==ue?(he=p.jsx("button",{type:"button",onClick:Z,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:ue}),e[35]=Z,e[36]=ue,e[37]=he):he=e[37];let ce;e[38]===Symbol.for("react.memo_cache_sentinel")?(ce=p.jsx(qr,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[38]=ce):ce=e[38];let ke;e[39]===Symbol.for("react.memo_cache_sentinel")?(ke=ie=>C(ie.target.value),e[39]=ke):ke=e[39];let Ee;e[40]!==k?(Ee=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",children:[ce,p.jsx(sa,{ref:T,type:"text",placeholder:"Search for a model...",value:k,onChange:ke,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[40]=k,e[41]=Ee):Ee=e[41];let xe;e[42]!==I||e[43]!==F||e[44]!==y||e[45]!==h?(xe=I.length>0?I.map(ie=>p.jsxs("div",{onClick:()=>F(ie.id),className:ae("rounded-lg mb-1",ie.id===y&&"bg-accent"),children:[p.jsx(ab,{model:ie,onHover:m,isSelected:ie.id===y,hasExpandedInfo:h}),h&&p.jsx("div",{className:"md:hidden",children:p.jsx(Zs,{model:ie,compact:!0})})]},ie.id)):p.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[42]=I,e[43]=F,e[44]=y,e[45]=h,e[46]=xe):xe=e[46];let me;e[47]!==xe?(me=p.jsx("div",{className:"flex-1 overflow-y-auto px-0.5",children:xe}),e[47]=xe,e[48]=me):me=e[48];let Ae;e[49]!==Ee||e[50]!==me?(Ae=p.jsxs("div",{className:"flex-1 flex flex-col md:border-r",children:[Ee,me]}),e[49]=Ee,e[50]=me,e[51]=Ae):Ae=e[51];const Ie=d||Y||null;let be;e[52]!==Ie?(be=p.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:p.jsx(Zs,{model:Ie})}),e[52]=Ie,e[53]=be):be=e[53];let Pe;e[54]!==Ae||e[55]!==be?(Pe=p.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[Ae,be]}),e[54]=Ae,e[55]=be,e[56]=Pe):Pe=e[56];let Le;e[57]!==o||e[58]!==he||e[59]!==Pe?(Le=p.jsx(vo,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:he,children:Pe}),e[57]=o,e[58]=he,e[59]=Pe,e[60]=Le):Le=e[60];let Fe;return e[61]!==F||e[62]!==l||e[63]!==M||e[64]!==A||e[65]!==Le?(Fe=p.jsxs(Mo,{open:l,onOpenChange:z,value:M,onValueChange:F,children:[A,Le]}),e[61]=F,e[62]=l,e[63]=M,e[64]=A,e[65]=Le,e[66]=Fe):Fe=e[66],Fe}function ob(t){return p.jsx(Ho,{capability:t},t)}function lb(t){return p.jsx(Ho,{capability:t},t)}function cb({messageCount:t,sentinelRef:e}){const n=U.useRef(t),r=U.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function Js(t,e){const n=U.Children.toArray(t);for(const r of n)if(U.isValidElement(r)&&r.type===e)return r;return null}function fb(t){const e=V.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=ae("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 db(t){const e=V.c(11),{children:n}=t;let r;e[0]!==n?(r=Js(n,Uo),e[0]=n,e[1]=r):r=e[1];const i=r;let s;e[2]!==n?(s=Js(n,jo),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 l=a?.props.children;let f;e[6]!==l?(f=p.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=f):f=e[7];let d;return e[8]!==o||e[9]!==f?(d=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]=d):d=e[10],d}function Uo(t){const e=V.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 jo(t){const e=V.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 hb(t){const e=V.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=ae("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 mb(t){const e=V.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 pb(t){const e=V.c(12),{messages:n,status:r,minHeightOffset:i}=t,s=i===void 0?240:i,a=U.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:a},e[0]=n.length,e[1]=u):u=e[1],cb(u);let o;if(e[2]!==n||e[3]!==r){let d;e[5]!==n.length||e[6]!==r?(d=(m,h)=>m.role==="user"?p.jsx(QE,{message:m},m.id):m.role==="assistant"?p.jsx(HE,{message:m,status:h===n.length-1?r:void 0},m.id):null,e[5]=n.length,e[6]=r,e[7]=d):d=e[7],o=n.map(d),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx(Do,{children:p.jsx("div",{ref:a,className:"h-0"})}),e[8]=l):l=e[8];let f;return e[9]!==s||e[10]!==o?(f=p.jsxs($E,{minHeightOffset:s,children:[o,l]}),e[9]=s,e[10]=o,e[11]=f):f=e[11],f}function gb(t){const e=V.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=ae("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 Pi(t){const e=V.c(24),{title:n,description:r,icon:i,variant:s,onDismiss:a,children:u}=t,o=s===void 0?"default":s;let l,f,d,m,h;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=ae("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",N.container),h=i&&p.jsx("div",{className:ae("mt-0.5 shrink-0",N.icon),children:i}),l="flex-1 min-w-0",f=n&&p.jsx("div",{className:ae("text-xs mb-1",N.title),children:n}),d=r&&p.jsx("div",{className:ae("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]=l,e[6]=f,e[7]=d,e[8]=m,e[9]=h}else l=e[5],f=e[6],d=e[7],m=e[8],h=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]!==l||e[13]!==f||e[14]!==d||e[15]!==g?(k=p.jsxs("div",{className:l,children:[f,d,g]}),e[12]=l,e[13]=f,e[14]=d,e[15]=g,e[16]=k):k=e[16];let C;e[17]!==a?(C=a&&p.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:p.jsx(ul,{size:14})}),e[17]=a,e[18]=C):C=e[18];let T;return e[19]!==m||e[20]!==h||e[21]!==k||e[22]!==C?(T=p.jsxs("div",{className:m,children:[h,k,C]}),e[19]=m,e[20]=h,e[21]=k,e[22]=C,e[23]=T):T=e[23],T}function Eb(t){const e=V.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(ha,{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(Qe,{size:"sm",variant:"outline",onClick:i,className:"h-7 text-xs",children:"View original"}),e[4]=i,e[5]=o):o=e[5];let l;return e[6]!==n.originalMessageText||e[7]!==u||e[8]!==o?(l=p.jsx(Pi,{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]=l):l=e[9],l}function bb(t){const e=V.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(Qe,{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(Qe,{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(Pi,{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 Tb(t){const e=V.c(7),{finishReason:n,onContinue:r,onDismiss:i}=t;if(!n||n==="stop")return null;const a=xb(n);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(al,{size:16}),e[0]=u):u=e[0];let o;e[1]!==r?(o=p.jsx(Qe,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Continue"}),e[1]=r,e[2]=o):o=e[2];let l;return e[3]!==i||e[4]!==a||e[5]!==o?(l=p.jsx(Pi,{variant:"warning",title:"Response incomplete",description:a,icon:u,onDismiss:i,children:o}),e[3]=i,e[4]=a,e[5]=o,e[6]=l):l=e[6],l}function xb(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 Xb=Object.assign(fb,{Header:Object.assign(db,{Left:Uo,Right:jo}),Main:hb,Messages:pb,EmptyState:mb,Footer:gb,Input:ql,BranchPreview:Eb,ErrorBanner:bb,FinishReasonWarning:Tb,Provider:zl});export{Xb as C,Ll as D,Qb as G,Kb as M,kE as R,Wb as T,RE as U,Dl as a,Pl as b,Ml as c,wl as d,vl as e,Yl as f,Yb as g,KE as h,nb as i,zl as j,ql as k,Ca as l,Ul as m,qb as n,$b as o,Ta as p,Vb as q,Gb as r,vi as u};