@decocms/mesh 2.20.0 → 2.20.2

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 (146) hide show
  1. package/dist/client/assets/{AlertCircle-CkNvGXW2.js → AlertCircle-CI2U-jkN.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-BsUDOBX0.js → ArrowLeft-B3km7toT.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Xq_0RBx_.js → ArrowUp-BF7mM4C2.js} +1 -1
  4. package/dist/client/assets/{Check-DijrPXQx.js → Check-BQkm1TiP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DASi-DMo.js → ChevronDown-DP6jvip7.js} +1 -1
  6. package/dist/client/assets/{Code01-C0ZFF6Hl.js → Code01-qXTn9GK9.js} +1 -1
  7. package/dist/client/assets/{Copy01-BQZg7H8u.js → Copy01-CEYn2daS.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-CjU9uXdh.js → DotsHorizontal-C2Nr-D-f.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-D6TZm5RT.js → DotsVertical-BPP4U4GQ.js} +1 -1
  10. package/dist/client/assets/{Download01-BTR8eSV6.js → Download01-BkDXja2z.js} +1 -1
  11. package/dist/client/assets/{Edit01-BsdLQ-QO.js → Edit01-Cq0mQDLh.js} +1 -1
  12. package/dist/client/assets/{File06-Bm9rDm48.js → File06-KMD38I-q.js} +1 -1
  13. package/dist/client/assets/{FilterLines-Dg_ubOas.js → FilterLines-Bojt6HPl.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-BZkXBjUF.js → FlipBackward-C-K9FamE.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-DYs19mSG.js → GitBranch01-DGTCzEh5.js} +1 -1
  16. package/dist/client/assets/{Grid01-CTb93Z2I.js → Grid01-D4lXvveX.js} +1 -1
  17. package/dist/client/assets/{Home02-CAgSUdC-.js → Home02-DPdZvu8L.js} +1 -1
  18. package/dist/client/assets/{Image01-CUinB3ac.js → Image01-C0R6SF_P.js} +1 -1
  19. package/dist/client/assets/{Inbox01-tMW4EgP4.js → Inbox01-BsOUYwQZ.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-DqeM4n2r.js → InfoCircle-BgIkbjJr.js} +1 -1
  21. package/dist/client/assets/{Key01-BDVEoltU.js → Key01-DTwk4FpG.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-C2ZOZHgx.js → LinkExternal01-DmruqAb9.js} +1 -1
  23. package/dist/client/assets/{List-jMJevXfS.js → List-BsSZz32j.js} +1 -1
  24. package/dist/client/assets/{Loading01-6JGza9Vp.js → Loading01-Ae5ezbtD.js} +1 -1
  25. package/dist/client/assets/{Lock01-DAc7yIAH.js → Lock01-BuQSktMF.js} +1 -1
  26. package/dist/client/assets/{Play-BWxFDrEk.js → Play-DKlNHVjf.js} +1 -1
  27. package/dist/client/assets/{Plus-Dcgso5EP.js → Plus-CdG75X26.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CbnCIalV.js → SearchMd-GFaonOaJ.js} +1 -1
  29. package/dist/client/assets/{Terminal-DNtUg1U7.js → Terminal-C6mZx-5A.js} +1 -1
  30. package/dist/client/assets/{Trash01-CzA8mxf_.js → Trash01-BWIN9RL_.js} +1 -1
  31. package/dist/client/assets/{Upload01-BPJ4Vq2H.js → Upload01-CaBE4VYK.js} +1 -1
  32. package/dist/client/assets/{X-C7-BOCtk.js → X-C18ho617.js} +1 -1
  33. package/dist/client/assets/{XClose-COetRF8H.js → XClose-CfwoKknl.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-Mcf5ObRp.js → alert-dialog-CCJCsKzK.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-JCvomRO1.js → auth-catchall-C33VWmDE.js} +1 -1
  36. package/dist/client/assets/{avatar-D0pQKePK.js → avatar-B7xnPXuk.js} +1 -1
  37. package/dist/client/assets/{badge-9bzwrgbk.js → badge-BVO6I0sW.js} +1 -1
  38. package/dist/client/assets/{binder-B4r3FJOG.js → binder-By0LBK9Y.js} +1 -1
  39. package/dist/client/assets/{button-C_Xg9B1B.js → button-CGmrzkpY.js} +1 -1
  40. package/dist/client/assets/{card-BXLd4InC.js → card-DIjMh1NO.js} +1 -1
  41. package/dist/client/assets/{checkbox-z9w2qryt.js → checkbox-DYViXeUc.js} +1 -1
  42. package/dist/client/assets/{collection-detail-zSSQWfP2.js → collection-detail-DtlOJm8P.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-DNzo_eaI.js → collection-display-button-CtkxsCB_.js} +1 -1
  44. package/dist/client/assets/{collection-header-DMI-enxo.js → collection-header-B4qcjEt5.js} +1 -1
  45. package/dist/client/assets/{collection-page-CPVm36im.js → collection-page-s-RR5fU6.js} +1 -1
  46. package/dist/client/assets/{collection-search-NPXhv3P8.js → collection-search-BVb42O45.js} +1 -1
  47. package/dist/client/assets/{collection-tab-DoDfK_be.js → collection-tab-CvrhLJCU.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-CH0cDKjW.js → collection-table-wrapper-BohFZqii.js} +1 -1
  49. package/dist/client/assets/{connection-DoXpv3Ov.js → connection-ChwHK0-S.js} +1 -1
  50. package/dist/client/assets/{connection-card-zeRxy9uc.js → connection-card-DMMfNQUo.js} +1 -1
  51. package/dist/client/assets/{connection-detail-vV4L4jYp.js → connection-detail-D9bORT-_.js} +1 -1
  52. package/dist/client/assets/{connections-DNpwgzUU.js → connections-CRhyn7eO.js} +1 -1
  53. package/dist/client/assets/constants-J0aH6mLs.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-Ro3igzlR.js → create-organization-dialog-CtbMd6S_.js} +1 -1
  55. package/dist/client/assets/{dialog-C9Agm5JE.js → dialog-DJJ2cvEE.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-fQ8f1M5d.js → dropdown-menu-CAeD2aIb.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-B3cv12GM.js → dynamic-plugin-layout-BeSg8wRq.js} +1 -1
  58. package/dist/client/assets/{empty-state-DdUozeuW.js → empty-state-BkAB-hls.js} +1 -1
  59. package/dist/client/assets/{empty-state-DBRX3hef.js → empty-state-wP9uukGJ.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-BXw6d8cC.js → env-vars-editor-DuH6BBdA.js} +1 -1
  61. package/dist/client/assets/{error-boundary-yHT4ni_0.js → error-boundary-BUvK8Sry.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-PVjaut0P.js → extract-connection-data-BLs0SRok.js} +1 -1
  63. package/dist/client/assets/{file-browser-Bh7hl3h8.js → file-browser-DuR45yyf.js} +2 -2
  64. package/dist/client/assets/{form-D_wQlmgT.js → form-DiGzBnRK.js} +1 -1
  65. package/dist/client/assets/gateway-detail-BCBmyW-G.js +1 -0
  66. package/dist/client/assets/{gateways-B0QSXg4v.js → gateways-BgSVXbfx.js} +1 -1
  67. package/dist/client/assets/{grid-view-BsHjiotE.js → grid-view-Db741zGU.js} +1 -1
  68. package/dist/client/assets/{home-m3uBo7L5.js → home-BtJc_wcZ.js} +1 -1
  69. package/dist/client/assets/{index-QjJpaT60.js → index-CL_rL7XJ.js} +4 -4
  70. package/dist/client/assets/{index-Cg8UjPnN.js → index-D4QCsSzb.js} +1 -1
  71. package/dist/client/assets/index-DUA-vRuy.js +1 -0
  72. package/dist/client/assets/{index-DZBCLPmz.js → index-Diww4UW3.js} +2 -2
  73. package/dist/client/assets/{index-3IJwc3nu.js → index-DjRWdLI4.js} +1 -1
  74. package/dist/client/assets/index-H07QDM93.css +1 -0
  75. package/dist/client/assets/{infiniteQueryObserver-CB9iuYaY.js → infiniteQueryObserver-BmbQcWdI.js} +1 -1
  76. package/dist/client/assets/{input-DrOaW48H.js → input-CrURMEZe.js} +1 -1
  77. package/dist/client/assets/{layout-B4oQiZN6.js → layout-kp8TTJc9.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-CSmD3B45.js → lazy-highlighter-dN3WcL6s.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-ColTY5EO.js → localstorage-keys-BVANkONM.js} +1 -1
  80. package/dist/client/assets/{login-BdRlUNll.js → login-CnuJ6k4x.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-CcVuDlog.js → mcp-oauth-CdcIczUJ.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-BnclXini.js → mcp-server-card-VZUBDTRj.js} +1 -1
  83. package/dist/client/assets/{mcp-server-detail-DTSTQPDK.js → mcp-server-detail-CIR0FKMd.js} +1 -1
  84. package/dist/client/assets/{members-BAse2YpR.js → members-bQTH1spX.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-BtLswDg1.js → monaco-editor-CDRbE4GY.js} +1 -1
  86. package/dist/client/assets/{monitoring-FELvrXqN.js → monitoring-Cb41cf-X.js} +1 -1
  87. package/dist/client/assets/{oauth-callback-sXSk4y6N.js → oauth-callback-z6t0OToi.js} +1 -1
  88. package/dist/client/assets/{page-IVcVoGr6.js → page-CcKdSzCp.js} +1 -1
  89. package/dist/client/assets/{page-c25MW39x.js → page-SWPgLEpC.js} +1 -1
  90. package/dist/client/assets/{pin-to-sidebar-button-D7zfHxC-.js → pin-to-sidebar-button-DIwkO0Tx.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-DINK0udh.js → plugin-empty-state-B-glkOMH.js} +1 -1
  92. package/dist/client/assets/{plugin-header-BaOkI6uW.js → plugin-header-BA0z5mBU.js} +1 -1
  93. package/dist/client/assets/{plugins-DU28fvG7.js → plugins-Cq62fkYj.js} +1 -1
  94. package/dist/client/assets/{popover-DDq46px5.js → popover-Bx7diZ86.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-CwtkfEWe.js → project-context-provider-DulCVL2k.js} +1 -1
  96. package/dist/client/assets/{registry-utils-nz3H3-qh.js → registry-utils-8Lvx2XTy.js} +1 -1
  97. package/dist/client/assets/{resizable-ZYLqRZrr.js → resizable-Gk1RjNnW.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-Dv00g9SH.js → resource-tabs-ACbF96qo.js} +1 -1
  99. package/dist/client/assets/{select-Cgab7LNB.js → select-C8LOz7vA.js} +1 -1
  100. package/dist/client/assets/{settings-CUngx_cw.js → settings-BXJ6BGel.js} +1 -1
  101. package/dist/client/assets/shell-layout-CFRw9Ru3.js +3 -0
  102. package/dist/client/assets/{spinner-ISlo4YZH.js → spinner-BF56RAKQ.js} +1 -1
  103. package/dist/client/assets/{switch-BDCe2nGJ.js → switch-DJBd8Fzb.js} +1 -1
  104. package/dist/client/assets/{textarea-BL4bZEBo.js → textarea-C_zgj3Sp.js} +1 -1
  105. package/dist/client/assets/{tool-set-selector-CWxawPKU.js → tool-set-selector-B9rTBahU.js} +1 -1
  106. package/dist/client/assets/{tools-list-BAdvjUaK.js → tools-list-mr-l2d8l.js} +1 -1
  107. package/dist/client/assets/{tooltip-CpJ7mUzE.js → tooltip-Suu_Gpqh.js} +1 -1
  108. package/dist/client/assets/{typewriter-title-vVGiDyZ3.js → typewriter-title-DM-oRxie.js} +1 -1
  109. package/dist/client/assets/{use-binding-DGnotkAI.js → use-binding-D6wv_5fO.js} +1 -1
  110. package/dist/client/assets/{use-collections-BmF5uRR6.js → use-collections-CXETocKO.js} +1 -1
  111. package/dist/client/assets/{use-connection-CD3KQhdl.js → use-connection-CCXutWLD.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-Bk8Paqb0.js → use-connection-resources-D0st76bP.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-Buvj1BPg.js → use-create-gateway-BlLsktgc.js} +1 -1
  114. package/dist/client/assets/{use-gateway-HT97xIYl.js → use-gateway-DD-xEZju.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-DPiQIOlu.js → use-gateway-system-prompt-zGJSEzce.js} +1 -1
  116. package/dist/client/assets/{use-list-state-DceT21J-.js → use-list-state-AndcW8aD.js} +1 -1
  117. package/dist/client/assets/{use-mcp-C2xjgZVM.js → use-mcp-D9llr83X.js} +1 -1
  118. package/dist/client/assets/{use-members-D-h9QOxK.js → use-members-CB2ebBfn.js} +1 -1
  119. package/dist/client/assets/{use-mobile-BH2x5CB1.js → use-mobile-DssCtDl6.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-BMsrsPvw.js → use-organization-settings-CQXtXtZs.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-BmQnCqef.js → use-tool-call-BmvKn7jp.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-BttwTOfK.js +1 -0
  123. package/dist/client/assets/{useMutation-DV6K6Nze.js → useMutation-Dl1MMkEC.js} +1 -1
  124. package/dist/client/assets/useQuery-Bvk0U2ed.js +1 -0
  125. package/dist/client/assets/{value-BiYWDF0x.js → value-DaPOjTmC.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-DPk8_aIn.js → view-mode-toggle-BLClM-0g.js} +1 -1
  127. package/dist/client/assets/{workflow-B_8Qc7GH.js → workflow-CQ7PQ7Dg.js} +1 -1
  128. package/dist/client/index.html +2 -2
  129. package/dist/server/cli.js +1 -1
  130. package/dist/server/node_modules/kysely/README.md +3 -1
  131. package/dist/server/node_modules/kysely/dist/cjs/index.d.ts +3 -1
  132. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.d.ts +1 -1
  133. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.js +75 -68
  134. package/dist/server/node_modules/kysely/dist/esm/index.d.ts +3 -1
  135. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.d.ts +1 -1
  136. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.js +75 -68
  137. package/dist/server/node_modules/kysely/package.json +13 -13
  138. package/dist/server/server.js +1 -1
  139. package/package.json +1 -1
  140. package/dist/client/assets/constants-CBp9PjFO.js +0 -1
  141. package/dist/client/assets/gateway-detail-B6I6y-jz.js +0 -1
  142. package/dist/client/assets/index-Dh9ePU0t.css +0 -1
  143. package/dist/client/assets/index-DiisCGqz.js +0 -1
  144. package/dist/client/assets/shell-layout-IdYGAQZJ.js +0 -3
  145. package/dist/client/assets/useInfiniteQuery-hrzJXDha.js +0 -1
  146. package/dist/client/assets/useQuery-mZS4-X0F.js +0 -1
@@ -1,11 +1,11 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-CSmD3B45.js","assets/index-DZBCLPmz.js","assets/index-Dh9ePU0t.css"])))=>i.map(i=>d[i]);
2
- import{r as j,c as Q,j as m,aH as ud,aI as od,aJ as ld,aK as nt,z as G,aL as Lr,aM as $u,aN as cd,aO as dd,aP as fd,L as Xe,J as Zn,I as ar,y as Te,aQ as te,aG as Pt,aR as hd,aS as Ae,_ as pd,X as ai,v as ui,x as oi,K as je,d as Yu,t as Kn,a as qu,f as Vu,aT as md,aU as gd,B as bd,E as Ed,aV as Td,a5 as xd,a6 as li,a8 as _d,a7 as yd,aa as Ad,as as kd,a3 as Cd,a9 as Id}from"./index-DZBCLPmz.js";import{c as re,B as Me}from"./button-C_Xg9B1B.js";import{i as Nd}from"./X-C7-BOCtk.js";import{I as ci,E as Sd}from"./empty-state-DBRX3hef.js";import{u as zt}from"./project-context-provider-CwtkfEWe.js";import{a as ur,b as or,P as lr}from"./popover-DDq46px5.js";import{T as wd}from"./textarea-BL4bZEBo.js";import{i as Gu}from"./AlertCircle-CkNvGXW2.js";import{i as Rd,E as Od}from"./error-boundary-yHT4ni_0.js";import{i as Ld}from"./ArrowUp-Xq_0RBx_.js";import{t as vd}from"./ChevronDown-DASi-DMo.js";import{u as Dd,i as di}from"./use-gateway-HT97xIYl.js";import{i as Pd}from"./Edit01-BsdLQ-QO.js";import{U as Md,c as Bd}from"./connection-DoXpv3Ov.js";import{b as Fd}from"./use-collections-BmF5uRR6.js";import{u as Wu,a as Ud}from"./use-connection-CD3KQhdl.js";import{b as Hd}from"./use-binding-DGnotkAI.js";import{u as Xt}from"./useMutation-DV6K6Nze.js";import{a as jd,u as zd}from"./use-gateway-system-prompt-DPiQIOlu.js";import{u as vs,L as Qu}from"./localstorage-keys-ColTY5EO.js";import{I as fi}from"./input-DrOaW48H.js";import{T as xn,b as _n,a as hi,c as yn}from"./tooltip-CpJ7mUzE.js";import{i as $r}from"./Check-DijrPXQx.js";import{i as Yr}from"./SearchMd-CbnCIalV.js";import{u as $d}from"./use-create-gateway-Buvj1BPg.js";import{S as Yd,a as qd,b as Vd,c as Gd,d as Wd}from"./select-Cgab7LNB.js";import{i as Qd}from"./File06-Bm9rDm48.js";import{c as Xd,i as Xu}from"./Grid01-CTb93Z2I.js";import{a as Zd}from"./Image01-CUinB3ac.js";import{a as Kd,F as Jd,b as ef,c as tf,d as nf,e as rf,f as sf}from"./form-D_wQlmgT.js";import{S as Zu}from"./spinner-ISlo4YZH.js";import{a as pi}from"./Copy01-BQZg7H8u.js";import{i as af}from"./Terminal-DNtUg1U7.js";import{M as Ku,s as na}from"./monaco-editor-BtLswDg1.js";import{b as uf,c as of,d as lf,A as cf,a as df,e as ff,g as hf,f as pf}from"./alert-dialog-Mcf5ObRp.js";import{O as mf,b as gf,c as bf}from"./well-known-mcp-DOEdYmKO.js";import{g as Ef}from"./generate-id-Dyweu44Y.js";import{s as Tf}from"./Trash01-CzA8mxf_.js";var Jn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of i)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Jn||(Jn={}));var ra;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ra||(ra={}));Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class vr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,l=0;for(;l<a.path.length;){const o=a.path[l];l===a.path.length-1?(u[o]=u[o]||{_errors:[]},u[o]._errors.push(n(a))):u[o]=u[o]||{_errors:[]},u=u[o],l++}}};return s(this),r}static assert(e){if(!(e instanceof vr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}vr.create=t=>new vr(t);var sa;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(sa||(sa={}));var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));const Ju=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));Ju.displayName="Atom02";const eo=({size:t=24,color:e="currentColor",...n})=>j.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},j.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));eo.displayName="ChevronSelectorVertical";const to=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));to.displayName="Coins01";const no=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));no.displayName="CornerUpLeft";const ro=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));ro.displayName="CurrencyDollar";const so=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));so.displayName="Edit02";const io=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));io.displayName="Lightbulb01";const ao=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));ao.displayName="LogOut04";const qr=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));qr.displayName="Stars01";const uo=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));uo.displayName="Stop";const oo=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));oo.displayName="Target04";const lo=({size:t=24,color:e="currentColor",...n})=>j.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},j.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));lo.displayName="XCircle";function $e(t){const e=Q.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 s;e[3]!==n?(s=re("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==r||e[6]!==s?(i=m.jsx("div",{"data-slot":"skeleton",className:s,...r}),e[5]=r,e[6]=s,e[7]=i):i=e[7],i}const ia=[{border:"border-purple-400",bg:"bg-purple-400",text:"text-white",bgLight:"bg-purple-400/10"},{border:"border-blue-400",bg:"bg-blue-400",text:"text-white",bgLight:"bg-blue-400/10"},{border:"border-indigo-400",bg:"bg-indigo-400",text:"text-white",bgLight:"bg-indigo-400/10"},{border:"border-violet-400",bg:"bg-violet-400",text:"text-white",bgLight:"bg-violet-400/10"},{border:"border-pink-400",bg:"bg-pink-400",text:"text-white",bgLight:"bg-pink-400/10"},{border:"border-fuchsia-400",bg:"bg-fuchsia-400",text:"text-white",bgLight:"bg-fuchsia-400/10"},{border:"border-emerald-400",bg:"bg-emerald-400",text:"text-white",bgLight:"bg-emerald-400/10"},{border:"border-teal-400",bg:"bg-teal-400",text:"text-white",bgLight:"bg-teal-400/10"},{border:"border-cyan-400",bg:"bg-cyan-400",text:"text-white",bgLight:"bg-cyan-400/10"},{border:"border-sky-400",bg:"bg-sky-400",text:"text-white",bgLight:"bg-sky-400/10"},{border:"border-orange-400",bg:"bg-orange-400",text:"text-white",bgLight:"bg-orange-400/10"},{border:"border-amber-400",bg:"bg-amber-400",text:"text-white",bgLight:"bg-amber-400/10"},{border:"border-rose-400",bg:"bg-rose-400",text:"text-white",bgLight:"bg-rose-400/10"},{border:"border-lime-400",bg:"bg-lime-400",text:"text-white",bgLight:"bg-lime-400/10"}];function xf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e)}function co(t){if(t==null)return null;const n=xf(t)%ia.length;return ia[n]}var fo="vercel.ai.error",_f=Symbol.for(fo),aa,ua,Ct=class ho extends(ua=Error,aa=_f,ua){constructor({name:e,message:n,cause:r}){super(n),this[aa]=!0,this.name=e,this.cause=r}static isInstance(e){return ho.hasMarker(e,fo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function po(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var mo="AI_InvalidArgumentError",go=`vercel.ai.error.${mo}`,yf=Symbol.for(go),oa,la,Af=class extends(la=Ct,oa=yf,la){constructor({message:t,cause:e,argument:n}){super({name:mo,message:t,cause:e}),this[oa]=!0,this.argument=n}static isInstance(t){return Ct.hasMarker(t,go)}},bo="AI_JSONParseError",Eo=`vercel.ai.error.${bo}`,kf=Symbol.for(Eo),ca,da,fa=class extends(da=Ct,ca=kf,da){constructor({text:t,cause:e}){super({name:bo,message:`JSON parsing failed: Text: ${t}.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-dN3WcL6s.js","assets/index-Diww4UW3.js","assets/index-H07QDM93.css"])))=>i.map(i=>d[i]);
2
+ import{r as j,c as Q,j as m,aH as ud,aI as od,aJ as ld,aK as nt,z as G,aL as Lr,aM as $u,aN as cd,aO as dd,aP as fd,L as Xe,J as Zn,I as ar,y as Te,aQ as te,aG as Pt,aR as hd,aS as Ae,_ as pd,X as ai,v as ui,x as oi,K as je,d as Yu,t as Kn,a as qu,f as Vu,aT as md,aU as gd,B as bd,E as Ed,aV as Td,a5 as xd,a6 as li,a8 as _d,a7 as yd,aa as Ad,as as kd,a3 as Cd,a9 as Id}from"./index-Diww4UW3.js";import{c as re,B as Me}from"./button-CGmrzkpY.js";import{i as Nd}from"./X-C18ho617.js";import{I as ci,E as Sd}from"./empty-state-wP9uukGJ.js";import{u as zt}from"./project-context-provider-DulCVL2k.js";import{a as ur,b as or,P as lr}from"./popover-Bx7diZ86.js";import{T as wd}from"./textarea-C_zgj3Sp.js";import{i as Gu}from"./AlertCircle-CI2U-jkN.js";import{i as Rd,E as Od}from"./error-boundary-BUvK8Sry.js";import{i as Ld}from"./ArrowUp-BF7mM4C2.js";import{t as vd}from"./ChevronDown-DP6jvip7.js";import{u as Dd,i as di}from"./use-gateway-DD-xEZju.js";import{i as Pd}from"./Edit01-Cq0mQDLh.js";import{U as Md,c as Bd}from"./connection-ChwHK0-S.js";import{b as Fd}from"./use-collections-CXETocKO.js";import{u as Wu,a as Ud}from"./use-connection-CCXutWLD.js";import{b as Hd}from"./use-binding-D6wv_5fO.js";import{u as Xt}from"./useMutation-Dl1MMkEC.js";import{a as jd,u as zd}from"./use-gateway-system-prompt-zGJSEzce.js";import{u as vs,L as Qu}from"./localstorage-keys-BVANkONM.js";import{I as fi}from"./input-CrURMEZe.js";import{T as xn,b as _n,a as hi,c as yn}from"./tooltip-Suu_Gpqh.js";import{i as $r}from"./Check-BQkm1TiP.js";import{i as Yr}from"./SearchMd-GFaonOaJ.js";import{u as $d}from"./use-create-gateway-BlLsktgc.js";import{S as Yd,a as qd,b as Vd,c as Gd,d as Wd}from"./select-C8LOz7vA.js";import{i as Qd}from"./File06-KMD38I-q.js";import{c as Xd,i as Xu}from"./Grid01-D4lXvveX.js";import{a as Zd}from"./Image01-C0R6SF_P.js";import{a as Kd,F as Jd,b as ef,c as tf,d as nf,e as rf,f as sf}from"./form-DiGzBnRK.js";import{S as Zu}from"./spinner-BF56RAKQ.js";import{a as pi}from"./Copy01-CEYn2daS.js";import{i as af}from"./Terminal-C6mZx-5A.js";import{M as Ku,s as na}from"./monaco-editor-CDRbE4GY.js";import{b as uf,c as of,d as lf,A as cf,a as df,e as ff,g as hf,f as pf}from"./alert-dialog-CCJCsKzK.js";import{O as mf,b as gf,c as bf}from"./well-known-mcp-DOEdYmKO.js";import{g as Ef}from"./generate-id-Dyweu44Y.js";import{s as Tf}from"./Trash01-BWIN9RL_.js";var Jn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of i)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Jn||(Jn={}));var ra;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ra||(ra={}));Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class vr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,l=0;for(;l<a.path.length;){const o=a.path[l];l===a.path.length-1?(u[o]=u[o]||{_errors:[]},u[o]._errors.push(n(a))):u[o]=u[o]||{_errors:[]},u=u[o],l++}}};return s(this),r}static assert(e){if(!(e instanceof vr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}vr.create=t=>new vr(t);var sa;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(sa||(sa={}));var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));const Ju=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));Ju.displayName="Atom02";const eo=({size:t=24,color:e="currentColor",...n})=>j.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},j.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));eo.displayName="ChevronSelectorVertical";const to=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));to.displayName="Coins01";const no=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));no.displayName="CornerUpLeft";const ro=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));ro.displayName="CurrencyDollar";const so=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));so.displayName="Edit02";const io=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));io.displayName="Lightbulb01";const ao=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));ao.displayName="LogOut04";const qr=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));qr.displayName="Stars01";const uo=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));uo.displayName="Stop";const oo=({size:t=24,color:e="currentColor",...n})=>j.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},j.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"}));oo.displayName="Target04";const lo=({size:t=24,color:e="currentColor",...n})=>j.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},j.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));lo.displayName="XCircle";function $e(t){const e=Q.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 s;e[3]!==n?(s=re("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==r||e[6]!==s?(i=m.jsx("div",{"data-slot":"skeleton",className:s,...r}),e[5]=r,e[6]=s,e[7]=i):i=e[7],i}const ia=[{border:"border-purple-400",bg:"bg-purple-400",text:"text-white",bgLight:"bg-purple-400/10"},{border:"border-blue-400",bg:"bg-blue-400",text:"text-white",bgLight:"bg-blue-400/10"},{border:"border-indigo-400",bg:"bg-indigo-400",text:"text-white",bgLight:"bg-indigo-400/10"},{border:"border-violet-400",bg:"bg-violet-400",text:"text-white",bgLight:"bg-violet-400/10"},{border:"border-pink-400",bg:"bg-pink-400",text:"text-white",bgLight:"bg-pink-400/10"},{border:"border-fuchsia-400",bg:"bg-fuchsia-400",text:"text-white",bgLight:"bg-fuchsia-400/10"},{border:"border-emerald-400",bg:"bg-emerald-400",text:"text-white",bgLight:"bg-emerald-400/10"},{border:"border-teal-400",bg:"bg-teal-400",text:"text-white",bgLight:"bg-teal-400/10"},{border:"border-cyan-400",bg:"bg-cyan-400",text:"text-white",bgLight:"bg-cyan-400/10"},{border:"border-sky-400",bg:"bg-sky-400",text:"text-white",bgLight:"bg-sky-400/10"},{border:"border-orange-400",bg:"bg-orange-400",text:"text-white",bgLight:"bg-orange-400/10"},{border:"border-amber-400",bg:"bg-amber-400",text:"text-white",bgLight:"bg-amber-400/10"},{border:"border-rose-400",bg:"bg-rose-400",text:"text-white",bgLight:"bg-rose-400/10"},{border:"border-lime-400",bg:"bg-lime-400",text:"text-white",bgLight:"bg-lime-400/10"}];function xf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e)}function co(t){if(t==null)return null;const n=xf(t)%ia.length;return ia[n]}var fo="vercel.ai.error",_f=Symbol.for(fo),aa,ua,Ct=class ho extends(ua=Error,aa=_f,ua){constructor({name:e,message:n,cause:r}){super(n),this[aa]=!0,this.name=e,this.cause=r}static isInstance(e){return ho.hasMarker(e,fo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function po(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var mo="AI_InvalidArgumentError",go=`vercel.ai.error.${mo}`,yf=Symbol.for(go),oa,la,Af=class extends(la=Ct,oa=yf,la){constructor({message:t,cause:e,argument:n}){super({name:mo,message:t,cause:e}),this[oa]=!0,this.argument=n}static isInstance(t){return Ct.hasMarker(t,go)}},bo="AI_JSONParseError",Eo=`vercel.ai.error.${bo}`,kf=Symbol.for(Eo),ca,da,fa=class extends(da=Ct,ca=kf,da){constructor({text:t,cause:e}){super({name:bo,message:`JSON parsing failed: Text: ${t}.
3
3
  Error message: ${po(e)}`,cause:e}),this[ca]=!0,this.text=t}static isInstance(t){return Ct.hasMarker(t,Eo)}},To="AI_TypeValidationError",xo=`vercel.ai.error.${To}`,Cf=Symbol.for(xo),ha,pa,gn=class Ds extends(pa=Ct,ha=Cf,pa){constructor({value:e,cause:n}){super({name:To,message:`Type validation failed: Value: ${JSON.stringify(e)}.
4
4
  Error message: ${po(n)}`,cause:n}),this[ha]=!0,this.value=e}static isInstance(e){return Ct.hasMarker(e,xo)}static wrap({value:e,cause:n}){return Ds.isInstance(n)&&n.value===e?n:new Ds({value:e,cause:n})}},cr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const i=n.length,a=new Array(e);for(let u=0;u<e;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(t==null)return s;if(n.includes(r))throw new Af({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${s()}`},If=cr();function ma(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Qt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function ga(t,...e){const n=new Headers(Qt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Nf=/"__proto__"\s*:/,Sf=/"constructor"\s*:/;function ba(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Nf.test(t)===!1&&Sf.test(t)===!1?e:wf(e)}function wf(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const i=r[s];i&&typeof i=="object"&&e.push(i)}}}return t}function Rf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ba(t)}try{return ba(t)}finally{Error.stackTraceLimit=e}}function mi(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Gt(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Gt):Gt(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Gt)),t.allOf!=null&&(t.allOf=t.allOf.map(Gt)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Gt));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Gt(e[n]);return t}function Gt(t){return typeof t=="boolean"?t:mi(t)}var Of=Symbol("Let zodToJsonSchema decide on which parser to use"),Ea={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Lf=t=>typeof t=="string"?{...Ea,name:t}:{...Ea,...t};function ct(){return{}}function vf(t,e){var n,r,s;const i={type:"array"};return(n=t.type)!=null&&n._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==ne.ZodAny&&(i.items=be(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(i.minItems=t.minLength.value),t.maxLength&&(i.maxItems=t.maxLength.value),t.exactLength&&(i.minItems=t.exactLength.value,i.maxItems=t.exactLength.value),i}function Df(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Pf(){return{type:"boolean"}}function _o(t,e){return be(t.type._def,e)}var Mf=(t,e)=>be(t.innerType._def,e);function yo(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,i)=>yo(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Bf(t)}}var Bf=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Ff(t,e){return{...be(t.innerType._def,e),default:t.defaultValue()}}function Uf(t,e){return e.effectStrategy==="input"?be(t.schema._def,e):ct()}function Hf(t){return{type:"string",enum:Array.from(t.values)}}var jf=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function zf(t,e){const n=[be(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),be(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return n.forEach(s=>{if(jf(s))r.push(...s.allOf);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...u}=s;i=u}r.push(i)}}),r.length?{allOf:r}:void 0}function $f(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ls=void 0,mt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ls===void 0&&(ls=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ls),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ao(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":gt(n,"email",r.message,e);break;case"format:idn-email":gt(n,"idn-email",r.message,e);break;case"pattern:zod":Qe(n,mt.email,r.message,e);break}break;case"url":gt(n,"uri",r.message,e);break;case"uuid":gt(n,"uuid",r.message,e);break;case"regex":Qe(n,r.regex,r.message,e);break;case"cuid":Qe(n,mt.cuid,r.message,e);break;case"cuid2":Qe(n,mt.cuid2,r.message,e);break;case"startsWith":Qe(n,RegExp(`^${cs(r.value,e)}`),r.message,e);break;case"endsWith":Qe(n,RegExp(`${cs(r.value,e)}$`),r.message,e);break;case"datetime":gt(n,"date-time",r.message,e);break;case"date":gt(n,"date",r.message,e);break;case"time":gt(n,"time",r.message,e);break;case"duration":gt(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Qe(n,RegExp(cs(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&gt(n,"ipv4",r.message,e),r.version!=="v4"&&gt(n,"ipv6",r.message,e);break}case"base64url":Qe(n,mt.base64url,r.message,e);break;case"jwt":Qe(n,mt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Qe(n,mt.ipv4Cidr,r.message,e),r.version!=="v4"&&Qe(n,mt.ipv6Cidr,r.message,e);break}case"emoji":Qe(n,mt.emoji(),r.message,e);break;case"ulid":{Qe(n,mt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{gt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Qe(n,mt.base64,r.message,e);break}}break}case"nanoid":Qe(n,mt.nanoid,r.message,e)}return n}function cs(t,e){return e.patternStrategy==="escape"?qf(t):t}var Yf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qf(t){let e="";for(let n=0;n<t.length;n++)Yf.has(t[n])||(e+="\\"),e+=t[n];return e}function gt(t,e,n,r){var s;t.format||(s=t.anyOf)!=null&&s.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Qe(t,e,n,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ta(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Ta(e,r)}function Ta(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let i="",a=!1,u=!1,l=!1;for(let o=0;o<s.length;o++){if(a){i+=s[o],a=!1;continue}if(r.i){if(u){if(s[o].match(/[a-z]/)){l?(i+=s[o],i+=`${s[o-2]}-${s[o]}`.toUpperCase(),l=!1):s[o+1]==="-"&&((n=s[o+2])!=null&&n.match(/[a-z]/))?(i+=s[o],l=!0):i+=`${s[o]}${s[o].toUpperCase()}`;continue}}else if(s[o].match(/[a-z]/)){i+=`[${s[o]}${s[o].toUpperCase()}]`;continue}}if(r.m){if(s[o]==="^"){i+=`(^|(?<=[\r
5
5
  ]))`;continue}else if(s[o]==="$"){i+=`($|(?=[\r
6
6
  ]))`;continue}}if(r.s&&s[o]==="."){i+=u?`${s[o]}\r
7
7
  `:`[${s[o]}\r
8
- ]`;continue}i+=s[o],s[o]==="\\"?a=!0:u&&s[o]==="]"?u=!1:!u&&s[o]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return i}function ko(t,e){var n,r,s,i,a,u;const l={type:"object",additionalProperties:(n=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ne.ZodString&&((s=t.keyType._def.checks)!=null&&s.length)){const{type:o,...d}=Ao(t.keyType._def,e);return{...l,propertyNames:d}}else{if(((i=t.keyType)==null?void 0:i._def.typeName)===ne.ZodEnum)return{...l,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===ne.ZodBranded&&t.keyType._def.type._def.typeName===ne.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:o,...d}=_o(t.keyType._def,e);return{...l,propertyNames:d}}}return l}function Vf(t,e){if(e.mapStrategy==="record")return ko(t,e);const n=be(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ct(),r=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ct();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Gf(t){const e=t.values,r=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),s=Array.from(new Set(r.map(i=>typeof i)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Wf(){return{not:ct()}}function Qf(){return{type:"null"}}var Ps={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Xf(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Ps&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,i)=>{const a=Ps[i._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,i)=>{const a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...s,a];case"bigint":return[...s,"integer"];case"object":if(i._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((i,a,u)=>u.indexOf(i)===a);return{type:s.length>1?s:s[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(i=>!r.includes(i))],[])};return Zf(t,e)}var Zf=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,s)=>be(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Kf(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Ps[t.innerType._def.typeName],"null"]};const n=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Jf(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function eh(t,e){const n={type:"object",properties:{}},r=[],s=t.shape();for(const a in s){let u=s[a];if(u===void 0||u._def===void 0)continue;const l=nh(u),o=be(u._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});o!==void 0&&(n.properties[a]=o,l||r.push(a))}r.length&&(n.required=r);const i=th(t,e);return i!==void 0&&(n.additionalProperties=i),n}function th(t,e){if(t.catchall._def.typeName!=="ZodNever")return be(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function nh(t){try{return t.isOptional()}catch{return!0}}var rh=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return be(t.innerType._def,e);const r=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ct()},r]}:ct()},sh=(t,e)=>{if(e.pipeStrategy==="input")return be(t.in._def,e);if(e.pipeStrategy==="output")return be(t.out._def,e);const n=be(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=be(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function ih(t,e){return be(t.type._def,e)}function ah(t,e){const r={type:"array",uniqueItems:!0,items:be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function uh(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:be(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function oh(){return{not:ct()}}function lh(){return ct()}var ch=(t,e)=>be(t.innerType._def,e),dh=(t,e,n)=>{switch(e){case ne.ZodString:return Ao(t,n);case ne.ZodNumber:return Jf(t);case ne.ZodObject:return eh(t,n);case ne.ZodBigInt:return Df(t);case ne.ZodBoolean:return Pf();case ne.ZodDate:return yo(t,n);case ne.ZodUndefined:return oh();case ne.ZodNull:return Qf();case ne.ZodArray:return vf(t,n);case ne.ZodUnion:case ne.ZodDiscriminatedUnion:return Xf(t,n);case ne.ZodIntersection:return zf(t,n);case ne.ZodTuple:return uh(t,n);case ne.ZodRecord:return ko(t,n);case ne.ZodLiteral:return $f(t);case ne.ZodEnum:return Hf(t);case ne.ZodNativeEnum:return Gf(t);case ne.ZodNullable:return Kf(t,n);case ne.ZodOptional:return rh(t,n);case ne.ZodMap:return Vf(t,n);case ne.ZodSet:return ah(t,n);case ne.ZodLazy:return()=>t.getter()._def;case ne.ZodPromise:return ih(t,n);case ne.ZodNaN:case ne.ZodNever:return Wf();case ne.ZodEffects:return Uf(t,n);case ne.ZodAny:return ct();case ne.ZodUnknown:return lh();case ne.ZodDefault:return Ff(t,n);case ne.ZodBranded:return _o(t,n);case ne.ZodReadonly:return ch(t,n);case ne.ZodCatch:return Mf(t,n);case ne.ZodPipeline:return sh(t,n);case ne.ZodFunction:case ne.ZodVoid:case ne.ZodSymbol:return;default:return(r=>{})()}},fh=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function be(t,e,n=!1){var r;const s=e.seen.get(t);if(e.override){const l=(r=e.override)==null?void 0:r.call(e,t,e,s,n);if(l!==Of)return l}if(s&&!n){const l=hh(s,e);if(l!==void 0)return l}const i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);const a=dh(t,t.typeName,e),u=typeof a=="function"?be(a(),e):a;if(u&&ph(t,e,u),e.postProcess){const l=e.postProcess(u,t,e);return i.jsonSchema=u,l}return i.jsonSchema=u,u}var hh=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:fh(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),ct()):e.$refStrategy==="seen"?ct():void 0}},ph=(t,e,n)=>(t.description&&(n.description=t.description),n),mh=t=>{const e=Lf(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},gh=(t,e)=>{var n;const r=mh(e);let s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((o,[d,f])=>{var p;return{...o,[d]:(p=be(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:ct()}},{}):void 0;const i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=be(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))!=null?n:ct(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(a.title=u);const l=i===void 0?s?{...a,[r.definitionPath]:s}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...s,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},Ms=Symbol.for("vercel.ai.schema");function bh(t){let e;return()=>(e==null&&(e=t()),e)}function Vr(t,{validate:e}={}){return{[Ms]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Eh(t){return typeof t=="object"&&t!==null&&Ms in t&&t[Ms]===!0&&"jsonSchema"in t&&"validate"in t}function gi(t){return t==null?Vr({properties:{},additionalProperties:!1}):Eh(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Co(t):Th(t):t()}function Th(t){return Vr(()=>mi(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new gn({value:e,cause:n.issues})}}})}function xh(t,e){var n;const r=(n=void 0)!=null?n:!1;return Vr(()=>gh(t,{$refStrategy:r?"root":"none"}),{validate:async s=>{const i=await t.safeParseAsync(s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function _h(t,e){var n;const r=(n=void 0)!=null?n:!1;return Vr(()=>mi(ld(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async s=>{const i=await od(t,s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function yh(t){return"_zod"in t}function Co(t,e){return yh(t)?_h(t):xh(t)}async function xa({value:t,schema:e}){const n=await er({value:t,schema:e});if(!n.success)throw gn.wrap({value:t,cause:n.error});return n.value}async function er({value:t,schema:e}){const n=gi(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:gn.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:gn.wrap({value:t,cause:r}),rawValue:t}}}async function Jt({text:t,schema:e}){try{const n=Rf(t);return e==null?{success:!0,value:n,rawValue:n}:await er({value:n,schema:e})}catch(n){return{success:!1,error:fa.isInstance(n)?n:new fa({text:t,cause:n}),rawValue:void 0}}}function Ah({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new ud).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await Jt({text:n,schema:e}))}}))}async function Ut(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var kh=Object.defineProperty,Ch=(t,e)=>{for(var n in e)kh(t,n,{get:e[n],enumerable:!0})},Io="AI_NoObjectGeneratedError",No=`vercel.ai.error.${Io}`,Ih=Symbol.for(No),So,jt=class extends Ct{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:s,finishReason:i}){super({name:Io,message:t,cause:e}),this[So]=!0,this.text=n,this.response=r,this.usage=s,this.finishReason=i}static isInstance(t){return Ct.hasMarker(t,No)}};So=Ih;var wo="AI_UIMessageStreamError",Ro=`vercel.ai.error.${wo}`,Nh=Symbol.for(Ro),Oo,on=class extends Ct{constructor({chunkType:t,chunkId:e,message:n}){super({name:wo,message:n}),this[Oo]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return Ct.hasMarker(t,Ro)}};Oo=Nh;var _a="6.0.39",Lo=nt([G(),Lr(Uint8Array),Lr(ArrayBuffer),$u(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),tr=cd(()=>nt([dd(),G(),fd(),Xe(),Zn(G(),tr.optional()),ar(tr)])),ce=Zn(G(),Zn(G(),tr.optional())),vo=Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Sh=Te({type:te("image"),image:nt([Lo,Lr(URL)]),mediaType:G().optional(),providerOptions:ce.optional()}),Do=Te({type:te("file"),data:nt([Lo,Lr(URL)]),filename:G().optional(),mediaType:G(),providerOptions:ce.optional()}),wh=Te({type:te("reasoning"),text:G(),providerOptions:ce.optional()}),Rh=Te({type:te("tool-call"),toolCallId:G(),toolName:G(),input:Pt(),providerOptions:ce.optional(),providerExecuted:Xe().optional()}),Oh=hd("type",[Te({type:te("text"),value:G(),providerOptions:ce.optional()}),Te({type:te("json"),value:tr,providerOptions:ce.optional()}),Te({type:te("execution-denied"),reason:G().optional(),providerOptions:ce.optional()}),Te({type:te("error-text"),value:G(),providerOptions:ce.optional()}),Te({type:te("error-json"),value:tr,providerOptions:ce.optional()}),Te({type:te("content"),value:ar(nt([Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Te({type:te("media"),data:G(),mediaType:G()}),Te({type:te("file-data"),data:G(),mediaType:G(),filename:G().optional(),providerOptions:ce.optional()}),Te({type:te("file-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("image-data"),data:G(),mediaType:G(),providerOptions:ce.optional()}),Te({type:te("image-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("image-file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("custom"),providerOptions:ce.optional()})]))})]),Po=Te({type:te("tool-result"),toolCallId:G(),toolName:G(),output:Oh,providerOptions:ce.optional()}),Lh=Te({type:te("tool-approval-request"),approvalId:G(),toolCallId:G()}),vh=Te({type:te("tool-approval-response"),approvalId:G(),approved:Xe(),reason:G().optional()}),Dh=Te({role:te("system"),content:G(),providerOptions:ce.optional()}),Ph=Te({role:te("user"),content:nt([G(),ar(nt([vo,Sh,Do]))]),providerOptions:ce.optional()}),Mh=Te({role:te("assistant"),content:nt([G(),ar(nt([vo,Do,wh,Rh,Po,Lh]))]),providerOptions:ce.optional()}),Bh=Te({role:te("tool"),content:ar(nt([Po,vh])),providerOptions:ce.optional()});nt([Dh,Ph,Mh,Bh]);function Mo(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const s=e[r];if(s===void 0)continue;const i=r in t?t[r]:void 0,a=s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[r]=Mo(i,s):n[r]=s}return n}var Fh={};Ch(Fh,{array:()=>zh,choice:()=>$h,json:()=>Yh,object:()=>jh,text:()=>Hh});function Uh(t){const e=["ROOT"];let n=-1,r=null;function s(l,o,d){switch(l){case'"':{n=o,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=o,r=o,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=o,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=o,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function i(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=o,e.pop();break}}}function a(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}}}for(let l=0;l<t.length;l++){const o=t[l];switch(e[e.length-1]){case"ROOT":s(o,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(o){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{o===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(o,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(o,l);break}case"INSIDE_STRING":{switch(o){case'"':{e.pop(),n=l;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{o==="]"?(n=l,e.pop()):(n=l,s(o,l,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(o,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=l;break}case"INSIDE_NUMBER":{switch(o){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const f=t.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(o,l):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l)):n=l;break}}}let u=t.slice(0,n+1);for(let l=e.length-1;l>=0;l--)switch(e[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function dr(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await Jt({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await Jt({text:Uh(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Hh=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),jh=({schema:t,name:e,description:n})=>{const r=gi(t);return{name:"object",responseFormat:Ut(r.jsonSchema).then(s=>({type:"json",schema:s,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=await er({value:a.value,schema:r});if(!u.success)throw new jt({message:"No object generated: response did not match schema.",cause:u.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});return u.value},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},zh=({element:t,name:e,description:n})=>{const r=gi(t);return{name:"array",responseFormat:Ut(r.jsonSchema).then(s=>{const{$schema:i,...a}=s;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=a.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:u,cause:"response must be an object with an elements array"}),text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});for(const l of u.elements){const o=await er({value:l,schema:r});if(!o.success)throw new jt({message:"No object generated: response did not match schema.",cause:o.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason})}return u.elements},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const u=i.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,l=[];for(const o of u){const d=await er({value:o,schema:r});d.success&&l.push(d.value)}return{partial:l}}}},createElementStreamTransform(){let s=0;return new TransformStream({transform({partialOutput:i},a){if(i!=null)for(;s<i.length;s++)a.enqueue(i[s])}})}}},$h=({options:t,name:e,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},s){const i=await Jt({text:r});if(!i.success)throw new jt({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!t.includes(a.result))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});return a.result},async parsePartialOutput({text:r}){const s=await dr(r);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=s.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;const a=t.filter(u=>u.startsWith(i.result));return s.state==="successful-parse"?a.includes(i.result)?{partial:i.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),Yh=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const s=await Jt({text:n});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value},async parsePartialOutput({text:n}){const r=await dr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});cr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
8
+ ]`;continue}i+=s[o],s[o]==="\\"?a=!0:u&&s[o]==="]"?u=!1:!u&&s[o]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return i}function ko(t,e){var n,r,s,i,a,u;const l={type:"object",additionalProperties:(n=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ne.ZodString&&((s=t.keyType._def.checks)!=null&&s.length)){const{type:o,...d}=Ao(t.keyType._def,e);return{...l,propertyNames:d}}else{if(((i=t.keyType)==null?void 0:i._def.typeName)===ne.ZodEnum)return{...l,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===ne.ZodBranded&&t.keyType._def.type._def.typeName===ne.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:o,...d}=_o(t.keyType._def,e);return{...l,propertyNames:d}}}return l}function Vf(t,e){if(e.mapStrategy==="record")return ko(t,e);const n=be(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ct(),r=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ct();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Gf(t){const e=t.values,r=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),s=Array.from(new Set(r.map(i=>typeof i)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Wf(){return{not:ct()}}function Qf(){return{type:"null"}}var Ps={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Xf(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Ps&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,i)=>{const a=Ps[i._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,i)=>{const a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...s,a];case"bigint":return[...s,"integer"];case"object":if(i._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((i,a,u)=>u.indexOf(i)===a);return{type:s.length>1?s:s[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(i=>!r.includes(i))],[])};return Zf(t,e)}var Zf=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,s)=>be(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Kf(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Ps[t.innerType._def.typeName],"null"]};const n=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Jf(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function eh(t,e){const n={type:"object",properties:{}},r=[],s=t.shape();for(const a in s){let u=s[a];if(u===void 0||u._def===void 0)continue;const l=nh(u),o=be(u._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});o!==void 0&&(n.properties[a]=o,l||r.push(a))}r.length&&(n.required=r);const i=th(t,e);return i!==void 0&&(n.additionalProperties=i),n}function th(t,e){if(t.catchall._def.typeName!=="ZodNever")return be(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function nh(t){try{return t.isOptional()}catch{return!0}}var rh=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return be(t.innerType._def,e);const r=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ct()},r]}:ct()},sh=(t,e)=>{if(e.pipeStrategy==="input")return be(t.in._def,e);if(e.pipeStrategy==="output")return be(t.out._def,e);const n=be(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=be(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function ih(t,e){return be(t.type._def,e)}function ah(t,e){const r={type:"array",uniqueItems:!0,items:be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function uh(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:be(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function oh(){return{not:ct()}}function lh(){return ct()}var ch=(t,e)=>be(t.innerType._def,e),dh=(t,e,n)=>{switch(e){case ne.ZodString:return Ao(t,n);case ne.ZodNumber:return Jf(t);case ne.ZodObject:return eh(t,n);case ne.ZodBigInt:return Df(t);case ne.ZodBoolean:return Pf();case ne.ZodDate:return yo(t,n);case ne.ZodUndefined:return oh();case ne.ZodNull:return Qf();case ne.ZodArray:return vf(t,n);case ne.ZodUnion:case ne.ZodDiscriminatedUnion:return Xf(t,n);case ne.ZodIntersection:return zf(t,n);case ne.ZodTuple:return uh(t,n);case ne.ZodRecord:return ko(t,n);case ne.ZodLiteral:return $f(t);case ne.ZodEnum:return Hf(t);case ne.ZodNativeEnum:return Gf(t);case ne.ZodNullable:return Kf(t,n);case ne.ZodOptional:return rh(t,n);case ne.ZodMap:return Vf(t,n);case ne.ZodSet:return ah(t,n);case ne.ZodLazy:return()=>t.getter()._def;case ne.ZodPromise:return ih(t,n);case ne.ZodNaN:case ne.ZodNever:return Wf();case ne.ZodEffects:return Uf(t,n);case ne.ZodAny:return ct();case ne.ZodUnknown:return lh();case ne.ZodDefault:return Ff(t,n);case ne.ZodBranded:return _o(t,n);case ne.ZodReadonly:return ch(t,n);case ne.ZodCatch:return Mf(t,n);case ne.ZodPipeline:return sh(t,n);case ne.ZodFunction:case ne.ZodVoid:case ne.ZodSymbol:return;default:return(r=>{})()}},fh=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function be(t,e,n=!1){var r;const s=e.seen.get(t);if(e.override){const l=(r=e.override)==null?void 0:r.call(e,t,e,s,n);if(l!==Of)return l}if(s&&!n){const l=hh(s,e);if(l!==void 0)return l}const i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);const a=dh(t,t.typeName,e),u=typeof a=="function"?be(a(),e):a;if(u&&ph(t,e,u),e.postProcess){const l=e.postProcess(u,t,e);return i.jsonSchema=u,l}return i.jsonSchema=u,u}var hh=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:fh(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),ct()):e.$refStrategy==="seen"?ct():void 0}},ph=(t,e,n)=>(t.description&&(n.description=t.description),n),mh=t=>{const e=Lf(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},gh=(t,e)=>{var n;const r=mh(e);let s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((o,[d,f])=>{var p;return{...o,[d]:(p=be(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:ct()}},{}):void 0;const i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=be(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))!=null?n:ct(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(a.title=u);const l=i===void 0?s?{...a,[r.definitionPath]:s}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...s,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},Ms=Symbol.for("vercel.ai.schema");function bh(t){let e;return()=>(e==null&&(e=t()),e)}function Vr(t,{validate:e}={}){return{[Ms]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Eh(t){return typeof t=="object"&&t!==null&&Ms in t&&t[Ms]===!0&&"jsonSchema"in t&&"validate"in t}function gi(t){return t==null?Vr({properties:{},additionalProperties:!1}):Eh(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Co(t):Th(t):t()}function Th(t){return Vr(()=>mi(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new gn({value:e,cause:n.issues})}}})}function xh(t,e){var n;const r=(n=void 0)!=null?n:!1;return Vr(()=>gh(t,{$refStrategy:r?"root":"none"}),{validate:async s=>{const i=await t.safeParseAsync(s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function _h(t,e){var n;const r=(n=void 0)!=null?n:!1;return Vr(()=>mi(ld(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async s=>{const i=await od(t,s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function yh(t){return"_zod"in t}function Co(t,e){return yh(t)?_h(t):xh(t)}async function xa({value:t,schema:e}){const n=await er({value:t,schema:e});if(!n.success)throw gn.wrap({value:t,cause:n.error});return n.value}async function er({value:t,schema:e}){const n=gi(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:gn.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:gn.wrap({value:t,cause:r}),rawValue:t}}}async function Jt({text:t,schema:e}){try{const n=Rf(t);return e==null?{success:!0,value:n,rawValue:n}:await er({value:n,schema:e})}catch(n){return{success:!1,error:fa.isInstance(n)?n:new fa({text:t,cause:n}),rawValue:void 0}}}function Ah({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new ud).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await Jt({text:n,schema:e}))}}))}async function Ut(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var kh=Object.defineProperty,Ch=(t,e)=>{for(var n in e)kh(t,n,{get:e[n],enumerable:!0})},Io="AI_NoObjectGeneratedError",No=`vercel.ai.error.${Io}`,Ih=Symbol.for(No),So,jt=class extends Ct{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:s,finishReason:i}){super({name:Io,message:t,cause:e}),this[So]=!0,this.text=n,this.response=r,this.usage=s,this.finishReason=i}static isInstance(t){return Ct.hasMarker(t,No)}};So=Ih;var wo="AI_UIMessageStreamError",Ro=`vercel.ai.error.${wo}`,Nh=Symbol.for(Ro),Oo,on=class extends Ct{constructor({chunkType:t,chunkId:e,message:n}){super({name:wo,message:n}),this[Oo]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return Ct.hasMarker(t,Ro)}};Oo=Nh;var _a="6.0.41",Lo=nt([G(),Lr(Uint8Array),Lr(ArrayBuffer),$u(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),tr=cd(()=>nt([dd(),G(),fd(),Xe(),Zn(G(),tr.optional()),ar(tr)])),ce=Zn(G(),Zn(G(),tr.optional())),vo=Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Sh=Te({type:te("image"),image:nt([Lo,Lr(URL)]),mediaType:G().optional(),providerOptions:ce.optional()}),Do=Te({type:te("file"),data:nt([Lo,Lr(URL)]),filename:G().optional(),mediaType:G(),providerOptions:ce.optional()}),wh=Te({type:te("reasoning"),text:G(),providerOptions:ce.optional()}),Rh=Te({type:te("tool-call"),toolCallId:G(),toolName:G(),input:Pt(),providerOptions:ce.optional(),providerExecuted:Xe().optional()}),Oh=hd("type",[Te({type:te("text"),value:G(),providerOptions:ce.optional()}),Te({type:te("json"),value:tr,providerOptions:ce.optional()}),Te({type:te("execution-denied"),reason:G().optional(),providerOptions:ce.optional()}),Te({type:te("error-text"),value:G(),providerOptions:ce.optional()}),Te({type:te("error-json"),value:tr,providerOptions:ce.optional()}),Te({type:te("content"),value:ar(nt([Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Te({type:te("media"),data:G(),mediaType:G()}),Te({type:te("file-data"),data:G(),mediaType:G(),filename:G().optional(),providerOptions:ce.optional()}),Te({type:te("file-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("image-data"),data:G(),mediaType:G(),providerOptions:ce.optional()}),Te({type:te("image-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("image-file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("custom"),providerOptions:ce.optional()})]))})]),Po=Te({type:te("tool-result"),toolCallId:G(),toolName:G(),output:Oh,providerOptions:ce.optional()}),Lh=Te({type:te("tool-approval-request"),approvalId:G(),toolCallId:G()}),vh=Te({type:te("tool-approval-response"),approvalId:G(),approved:Xe(),reason:G().optional()}),Dh=Te({role:te("system"),content:G(),providerOptions:ce.optional()}),Ph=Te({role:te("user"),content:nt([G(),ar(nt([vo,Sh,Do]))]),providerOptions:ce.optional()}),Mh=Te({role:te("assistant"),content:nt([G(),ar(nt([vo,Do,wh,Rh,Po,Lh]))]),providerOptions:ce.optional()}),Bh=Te({role:te("tool"),content:ar(nt([Po,vh])),providerOptions:ce.optional()});nt([Dh,Ph,Mh,Bh]);function Mo(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const s=e[r];if(s===void 0)continue;const i=r in t?t[r]:void 0,a=s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[r]=Mo(i,s):n[r]=s}return n}var Fh={};Ch(Fh,{array:()=>zh,choice:()=>$h,json:()=>Yh,object:()=>jh,text:()=>Hh});function Uh(t){const e=["ROOT"];let n=-1,r=null;function s(l,o,d){switch(l){case'"':{n=o,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=o,r=o,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=o,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=o,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function i(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=o,e.pop();break}}}function a(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}}}for(let l=0;l<t.length;l++){const o=t[l];switch(e[e.length-1]){case"ROOT":s(o,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(o){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{o===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(o,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(o,l);break}case"INSIDE_STRING":{switch(o){case'"':{e.pop(),n=l;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{o==="]"?(n=l,e.pop()):(n=l,s(o,l,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(o,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=l;break}case"INSIDE_NUMBER":{switch(o){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const f=t.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(o,l):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l)):n=l;break}}}let u=t.slice(0,n+1);for(let l=e.length-1;l>=0;l--)switch(e[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function dr(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await Jt({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await Jt({text:Uh(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Hh=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),jh=({schema:t,name:e,description:n})=>{const r=gi(t);return{name:"object",responseFormat:Ut(r.jsonSchema).then(s=>({type:"json",schema:s,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=await er({value:a.value,schema:r});if(!u.success)throw new jt({message:"No object generated: response did not match schema.",cause:u.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});return u.value},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},zh=({element:t,name:e,description:n})=>{const r=gi(t);return{name:"array",responseFormat:Ut(r.jsonSchema).then(s=>{const{$schema:i,...a}=s;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=a.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:u,cause:"response must be an object with an elements array"}),text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});for(const l of u.elements){const o=await er({value:l,schema:r});if(!o.success)throw new jt({message:"No object generated: response did not match schema.",cause:o.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason})}return u.elements},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const u=i.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,l=[];for(const o of u){const d=await er({value:o,schema:r});d.success&&l.push(d.value)}return{partial:l}}}},createElementStreamTransform(){let s=0;return new TransformStream({transform({partialOutput:i},a){if(i!=null)for(;s<i.length;s++)a.enqueue(i[s])}})}}},$h=({options:t,name:e,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},s){const i=await Jt({text:r});if(!i.success)throw new jt({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!t.includes(a.result))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});return a.result},async parsePartialOutput({text:r}){const s=await dr(r);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=s.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;const a=t.filter(u=>u.startsWith(i.result));return s.state==="successful-parse"?a.includes(i.result)?{partial:i.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),Yh=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const s=await Jt({text:n});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value},async parsePartialOutput({text:n}){const r=await dr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});cr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
9
9
 
10
10
  `)},flush(t){t.enqueue(`data: [DONE]
11
11
 
@@ -102,6 +102,6 @@ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An err
102
102
  `))+1))}const a="#".repeat(s),u=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let o=n.containerPhrasing(t,{before:"# ",after:`
103
103
  `,...i.current()});return/^[\t ]/.test(o)&&(o=ir(o.charCodeAt(0))+o.slice(1)),o=o?a+" "+o:a,n.options.closeAtx&&(o+=" "+a),l(),u(),o}Dc.peek=c3;function Dc(t){return t.value||""}function c3(){return"<"}Pc.peek=d3;function Pc(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const l=n.createTracker(r);let o=l.move("![");return o+=l.move(n.safe(t.alt,{before:o,after:"]",...l.current()})),o+=l.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),o+=l.move("<"),o+=l.move(n.safe(t.url,{before:o,after:">",...l.current()})),o+=l.move(">")):(u=n.enter("destinationRaw"),o+=l.move(n.safe(t.url,{before:o,after:t.title?" ":")",...l.current()}))),u(),t.title&&(u=n.enter(`title${i}`),o+=l.move(" "+s),o+=l.move(n.safe(t.title,{before:o,after:s,...l.current()})),o+=l.move(s),u()),o+=l.move(")"),a(),o}function d3(){return"!"}Mc.peek=f3;function Mc(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("![");const o=n.safe(t.alt,{before:l,after:"]",...u.current()});l+=u.move(o+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...u.current()});return a(),n.stack=d,i(),s==="full"||!o||o!==f?l+=u.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=u.move("]"),l}function f3(){return"!"}Bc.peek=h3;function Bc(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],u=n.compilePattern(a);let l;if(a.atBreak)for(;l=u.exec(r);){let o=l.index;r.charCodeAt(o)===10&&r.charCodeAt(o-1)===13&&o--,r=r.slice(0,o)+" "+r.slice(l.index+1)}}return s+r+s}function h3(){return"`"}function Fc(t,e){const n=vi(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))}Uc.peek=p3;function Uc(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,l;if(Fc(t,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(t,{before:f,after:">",...a.current()})),f+=a.move(">"),u(),n.stack=d,f}u=n.enter("link"),l=n.enter("label");let o=a.move("[");return o+=a.move(n.containerPhrasing(t,{before:o,after:"](",...a.current()})),o+=a.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),o+=a.move("<"),o+=a.move(n.safe(t.url,{before:o,after:">",...a.current()})),o+=a.move(">")):(l=n.enter("destinationRaw"),o+=a.move(n.safe(t.url,{before:o,after:t.title?" ":")",...a.current()}))),l(),t.title&&(l=n.enter(`title${i}`),o+=a.move(" "+s),o+=a.move(n.safe(t.title,{before:o,after:s,...a.current()})),o+=a.move(s),l()),o+=a.move(")"),u(),o}function p3(t,e,n){return Fc(t,n)?"<":"["}Hc.peek=m3;function Hc(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("[");const o=n.containerPhrasing(t,{before:l,after:"]",...u.current()});l+=u.move(o+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...u.current()});return a(),n.stack=d,i(),s==="full"||!o||o!==f?l+=u.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=u.move("]"),l}function m3(){return"["}function Wi(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 g3(t){const e=Wi(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 b3(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 jc(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 E3(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?b3(n):Wi(n);const u=t.ordered?a==="."?")":".":g3(n);let l=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.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&&(l=!0),jc(n)===a&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=u),n.bulletCurrent=a;const o=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),o}function T3(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 x3(t,e,n,r){const s=T3(n);let i=n.bulletCurrent||Wi(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(i+" ".repeat(a-i.length)),u.shift(a);const l=n.enter("listItem"),o=n.indentLines(n.containerFlow(t,u.current()),d);return l(),o;function d(f,p,h){return p?(h?"":" ".repeat(a))+f:(h?i:i+" ".repeat(a-i.length))+f}}function _3(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const y3=ts(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function A3(t,e,n,r){return(t.children.some(function(a){return y3(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function k3(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}zc.peek=C3;function zc(t,e,n,r){const s=k3(n),i=n.enter("strong"),a=n.createTracker(r),u=a.move(s+s);let l=a.move(n.containerPhrasing(t,{after:s,before:u,...a.current()}));const o=l.charCodeAt(0),d=zr(r.before.charCodeAt(r.before.length-1),o,s);d.inside&&(l=ir(o)+l.slice(1));const f=l.charCodeAt(l.length-1),p=zr(r.after.charCodeAt(0),f,s);p.inside&&(l=l.slice(0,-1)+ir(f));const h=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+l+h}function C3(t,e,n){return n.options.strong||"*"}function I3(t,e,n,r){return n.safe(t.value,r)}function N3(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 S3(t,e,n){const r=(jc(n)+(n.options.ruleSpaces?" ":"")).repeat(N3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $c={blockquote:Zx,break:Bu,code:r3,definition:i3,emphasis:vc,hardBreak:Bu,heading:l3,html:Dc,image:Pc,imageReference:Mc,inlineCode:Bc,link:Uc,linkReference:Hc,list:E3,listItem:x3,paragraph:_3,root:A3,strong:zc,text:I3,thematicBreak:S3};function w3(){return{enter:{table:R3,tableData:Fu,tableHeader:Fu,tableRow:L3},exit:{codeText:v3,table:O3,tableData:Os,tableHeader:Os,tableRow:Os}}}function R3(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 O3(t){this.exit(t),this.data.inTable=void 0}function L3(t){this.enter({type:"tableRow",children:[]},t)}function Os(t){this.exit(t)}function Fu(t){this.enter({type:"tableCell",children:[]},t)}function v3(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,D3));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function D3(t,e){return e==="|"?e:t}function P3(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
104
104
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:u}};function a(h,g,_,T){return o(d(h,_,T),h.align)}function u(h,g,_,T){const E=f(h,_,T),A=o([E]);return A.slice(0,A.indexOf(`
105
- `))}function l(h,g,_,T){const E=_.enter("tableCell"),A=_.enter("phrasing"),b=_.containerPhrasing(h,{...T,before:i,after:i});return A(),E(),b}function o(h,g){return Qx(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function d(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("table");for(;++E<T.length;)A[E]=f(T[E],g,_);return b(),A}function f(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("tableRow");for(;++E<T.length;)A[E]=l(T[E],h,g,_);return b(),A}function p(h,g,_){let T=$c.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function M3(){return{exit:{taskListCheckValueChecked:Uu,taskListCheckValueUnchecked:Uu,paragraph:F3}}}function B3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:U3}}}function Uu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function F3(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 s=e.children;let i=-1,a;for(;++i<s.length;){const u=s[i];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 U3(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let l=$c.listItem(t,e,n,{...r,...u.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),l;function o(d){return d+a}}function H3(){return[Ex(),Ux(),$x(),w3(),M3()]}function j3(t){return{extensions:[Tx(),Hx(t),Yx(),P3(t),B3()]}}const z3={tokenize:W3,partial:!0},Yc={tokenize:Q3,partial:!0},qc={tokenize:X3,partial:!0},Vc={tokenize:Z3,partial:!0},$3={tokenize:K3,partial:!0},Gc={name:"wwwAutolink",tokenize:V3,previous:Qc},Wc={name:"protocolAutolink",tokenize:G3,previous:Xc},Lt={name:"emailAutolink",tokenize:q3,previous:Zc},Nt={};function Y3(){return{text:Nt}}let Wt=48;for(;Wt<123;)Nt[Wt]=Lt,Wt++,Wt===58?Wt=65:Wt===91&&(Wt=97);Nt[43]=Lt;Nt[45]=Lt;Nt[46]=Lt;Nt[95]=Lt;Nt[72]=[Lt,Wc];Nt[104]=[Lt,Wc];Nt[87]=[Lt,Gc];Nt[119]=[Lt,Gc];function q3(t,e,n){const r=this;let s,i;return a;function a(f){return!ii(f)||!Zc.call(r,r.previous)||Qi(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return ii(f)?(t.consume(f),u):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check($3,d,o)(f):f===45||f===95||Ye(f)?(i=!0,t.consume(f),l):d(f)}function o(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&Ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function V3(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!Qc.call(r,r.previous)||Qi(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(z3,t.attempt(Yc,t.attempt(qc,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function G3(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Xc.call(r,r.previous)&&!Qi(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Ze(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?o:(i=!0,l)):n(f)}function o(f){return f===null||Br(f)||xe(f)||nn(f)||Kr(f)?n(f):t.attempt(Yc,t.attempt(qc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function W3(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function Q3(t,e,n){let r,s,i;return a;function a(o){return o===46||o===95?t.check(Vc,l,u)(o):o===null||xe(o)||nn(o)||o!==45&&Kr(o)?l(o):(i=!0,t.consume(o),a)}function u(o){return o===95?r=!0:(s=r,r=void 0),t.consume(o),a}function l(o){return s||r||!i?n(o):e(o)}}function X3(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(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(Vc,e,i)(a):a===null||xe(a)||nn(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function Z3(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),i):u===93?(t.consume(u),s):u===60||u===null||xe(u)||nn(u)?e(u):n(u)}function s(u){return u===null||u===40||u===91||xe(u)||nn(u)?e(u):r(u)}function i(u){return Ze(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):Ze(u)?(t.consume(u),a):n(u)}}function K3(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Ye(i)?n(i):e(i)}}function Qc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||xe(t)}function Xc(t){return!Ze(t)}function Zc(t){return!(t===47||ii(t))}function ii(t){return t===43||t===45||t===46||t===95||Ye(t)}function Qi(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 J3={tokenize:u_,partial:!0};function e_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s_,continuation:{tokenize:i_},exit:a_}},text:{91:{name:"gfmFootnoteCall",tokenize:r_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t_,resolveTo:n_}}}}function t_(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return u;function u(l){if(!a||!a._balanced)return n(l);const o=bt(r.sliceSerialize({start:a.end,end:r.now()}));return o.codePointAt(0)!==94||!i.includes(o.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function n_(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function r_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",o)}function o(f){if(i>999||f===93&&!a||f===null||f===91||xe(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(bt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return xe(f)||(a=!0),i++,t.consume(f),f===92?d:o}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,o):o(f)}}function s_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!u||g===null||g===91||xe(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return i=bt(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return xe(g)||(u=!0),a++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),s.includes(i)||s.push(i),de(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function i_(t,e,n){return t.check(mr,e,t.attempt(J3,e,n))}function a_(t){t.exit("gfmFootnoteDefinition")}function u_(t,e,n){const r=this;return de(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let o=l;for(;o--;)if(a[o][0]==="exit"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[o][1].end.offset-a[o][1].start.offset){a[l][1].type="strikethroughSequence",a[o][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[o][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[o][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&lt(p,p.length,0,Jr(h,a.slice(o+1,l),u)),lt(p,p.length,0,[["exit",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["exit",d,u]]),lt(a,o-1,l-o+3,p),l=o+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,u,l){const o=this.previous,d=this.events;let f=0;return p;function p(g){return o===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=bn(o);if(g===126)return f>1?l(g):(a.consume(g),f++,h);if(f<2&&!n)return l(g);const T=a.exit("strikethroughSequenceTemporary"),E=bn(g);return T._open=!E||E===2&&!!_,T._close=!_||_===2&&!!E,u(g)}}}class l_{constructor(){this.map=[]}add(e,n,r){c_(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[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 s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c_(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function d_(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function f_(){return{flow:{null:{name:"table",tokenize:h_,resolveAll:p_}}}}function h_(t,e,n){const r=this;let s=0,i=0,a;return u;function u(S){let B=r.events.length-1;for(;B>-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,X=$==="tableHead"||$==="tableRow"?I:l;return X===I&&r.parser.lazy[r.now().line]?n(S):X(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),o(S)}function o(S){return S===124||(a=!0,i+=1),d(S)}function d(S){return S===null?n(S):ee(S)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):oe(S)?de(t,d,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||xe(S)?(t.exit("data"),d(S)):(t.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,oe(S)?de(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?T(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),_):R(S)}function _(S){return oe(S)?de(t,T,"whitespace")(S):T(S)}function T(S){return S===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),E):S===45?(i+=1,E(S)):S===null||ee(S)?w(S):R(S)}function E(S){return S===45?(t.enter("tableDelimiterFiller"),A(S)):R(S)}function A(S){return S===45?(t.consume(S),A):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(S))}function b(S){return oe(S)?de(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||ee(S)?!a||s!==i?R(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):R(S)}function R(S){return n(S)}function I(S){return t.enter("tableRow"),L(S)}function L(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),L):S===null||ee(S)?(t.exit("tableRow"),e(S)):oe(S)?de(t,L,"whitespace")(S):(t.enter("data"),M(S))}function M(S){return S===null||S===124||xe(S)?(t.exit("data"),L(S)):(t.consume(S),S===92?P:M)}function P(S){return S===92||S===124?(t.consume(S),M):M(S)}}function p_(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,l=0,o,d,f;const p=new l_;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,l!==0&&(Hu(p,e,l,o,d),d=void 0,l=0),o={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",o,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),s=g.type==="tableDelimiterRow"?2:d?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):g.type==="tableHead"?(u=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=kr(p,e,i,s,n,f)):a[1]!==0&&(f=kr(p,e,a,s,n,f)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Hu(p,e,l,o,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=d_(e.events,n))}return t}function kr(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=hn(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const o=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},o),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},hn(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function Hu(t,e,n,r,s){const i=[],a=hn(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m_={name:"tasklistCheck",tokenize:b_};function g_(){return{text:{91:m_}}}function b_(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(l)}function u(l){return ee(l)?e(l):oe(l)?t.check({tokenize:E_},e,n)(l):n(l)}}function E_(t,e,n){return de(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function T_(t){return Il([Y3(),e_(),o_(t),f_(),g_()])}const x_={};function __(t){const e=this,n=t||x_,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(T_(n)),i.push(H3()),a.push(j3(n))}const y_=j.lazy(()=>Td(()=>import("./lazy-highlighter-CSmD3B45.js"),__vite__mapDeps([0,1,2])));function Kc(){const t=Q.c(3),[e,n]=j.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 s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function A_(){const t=Q.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=m.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(k_)}),t[1]=r):r=t[1],r}function k_(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.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&&m.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&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.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&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function C_(t){const e=Q.c(12),n=j.useRef(null),{handleCopy:r,copied:s}=Kc(),i=I_;let a;e[0]!==r?(a=async()=>{const p=i(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const u=a;let l;e[2]!==s?(l=s?m.jsx($r,{size:12}):m.jsx(pi,{size:12}),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Me,{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",l]})}),e[4]=u,e[5]=l,e[6]=o):o=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==o||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[o,d]}),e[9]=o,e[10]=d,e[11]=f):f=e[11],f}function I_(t){return t?Array.from(t.querySelectorAll("tr")).map(N_).join(`
105
+ `))}function l(h,g,_,T){const E=_.enter("tableCell"),A=_.enter("phrasing"),b=_.containerPhrasing(h,{...T,before:i,after:i});return A(),E(),b}function o(h,g){return Qx(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function d(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("table");for(;++E<T.length;)A[E]=f(T[E],g,_);return b(),A}function f(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("tableRow");for(;++E<T.length;)A[E]=l(T[E],h,g,_);return b(),A}function p(h,g,_){let T=$c.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function M3(){return{exit:{taskListCheckValueChecked:Uu,taskListCheckValueUnchecked:Uu,paragraph:F3}}}function B3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:U3}}}function Uu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function F3(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 s=e.children;let i=-1,a;for(;++i<s.length;){const u=s[i];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 U3(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let l=$c.listItem(t,e,n,{...r,...u.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),l;function o(d){return d+a}}function H3(){return[Ex(),Ux(),$x(),w3(),M3()]}function j3(t){return{extensions:[Tx(),Hx(t),Yx(),P3(t),B3()]}}const z3={tokenize:W3,partial:!0},Yc={tokenize:Q3,partial:!0},qc={tokenize:X3,partial:!0},Vc={tokenize:Z3,partial:!0},$3={tokenize:K3,partial:!0},Gc={name:"wwwAutolink",tokenize:V3,previous:Qc},Wc={name:"protocolAutolink",tokenize:G3,previous:Xc},Lt={name:"emailAutolink",tokenize:q3,previous:Zc},Nt={};function Y3(){return{text:Nt}}let Wt=48;for(;Wt<123;)Nt[Wt]=Lt,Wt++,Wt===58?Wt=65:Wt===91&&(Wt=97);Nt[43]=Lt;Nt[45]=Lt;Nt[46]=Lt;Nt[95]=Lt;Nt[72]=[Lt,Wc];Nt[104]=[Lt,Wc];Nt[87]=[Lt,Gc];Nt[119]=[Lt,Gc];function q3(t,e,n){const r=this;let s,i;return a;function a(f){return!ii(f)||!Zc.call(r,r.previous)||Qi(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return ii(f)?(t.consume(f),u):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check($3,d,o)(f):f===45||f===95||Ye(f)?(i=!0,t.consume(f),l):d(f)}function o(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&Ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function V3(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!Qc.call(r,r.previous)||Qi(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(z3,t.attempt(Yc,t.attempt(qc,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function G3(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Xc.call(r,r.previous)&&!Qi(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Ze(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?o:(i=!0,l)):n(f)}function o(f){return f===null||Br(f)||xe(f)||nn(f)||Kr(f)?n(f):t.attempt(Yc,t.attempt(qc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function W3(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function Q3(t,e,n){let r,s,i;return a;function a(o){return o===46||o===95?t.check(Vc,l,u)(o):o===null||xe(o)||nn(o)||o!==45&&Kr(o)?l(o):(i=!0,t.consume(o),a)}function u(o){return o===95?r=!0:(s=r,r=void 0),t.consume(o),a}function l(o){return s||r||!i?n(o):e(o)}}function X3(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(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(Vc,e,i)(a):a===null||xe(a)||nn(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function Z3(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),i):u===93?(t.consume(u),s):u===60||u===null||xe(u)||nn(u)?e(u):n(u)}function s(u){return u===null||u===40||u===91||xe(u)||nn(u)?e(u):r(u)}function i(u){return Ze(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):Ze(u)?(t.consume(u),a):n(u)}}function K3(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Ye(i)?n(i):e(i)}}function Qc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||xe(t)}function Xc(t){return!Ze(t)}function Zc(t){return!(t===47||ii(t))}function ii(t){return t===43||t===45||t===46||t===95||Ye(t)}function Qi(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 J3={tokenize:u_,partial:!0};function e_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s_,continuation:{tokenize:i_},exit:a_}},text:{91:{name:"gfmFootnoteCall",tokenize:r_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t_,resolveTo:n_}}}}function t_(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return u;function u(l){if(!a||!a._balanced)return n(l);const o=bt(r.sliceSerialize({start:a.end,end:r.now()}));return o.codePointAt(0)!==94||!i.includes(o.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function n_(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function r_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",o)}function o(f){if(i>999||f===93&&!a||f===null||f===91||xe(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(bt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return xe(f)||(a=!0),i++,t.consume(f),f===92?d:o}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,o):o(f)}}function s_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!u||g===null||g===91||xe(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return i=bt(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return xe(g)||(u=!0),a++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),s.includes(i)||s.push(i),de(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function i_(t,e,n){return t.check(mr,e,t.attempt(J3,e,n))}function a_(t){t.exit("gfmFootnoteDefinition")}function u_(t,e,n){const r=this;return de(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let o=l;for(;o--;)if(a[o][0]==="exit"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[o][1].end.offset-a[o][1].start.offset){a[l][1].type="strikethroughSequence",a[o][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[o][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[o][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&lt(p,p.length,0,Jr(h,a.slice(o+1,l),u)),lt(p,p.length,0,[["exit",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["exit",d,u]]),lt(a,o-1,l-o+3,p),l=o+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,u,l){const o=this.previous,d=this.events;let f=0;return p;function p(g){return o===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=bn(o);if(g===126)return f>1?l(g):(a.consume(g),f++,h);if(f<2&&!n)return l(g);const T=a.exit("strikethroughSequenceTemporary"),E=bn(g);return T._open=!E||E===2&&!!_,T._close=!_||_===2&&!!E,u(g)}}}class l_{constructor(){this.map=[]}add(e,n,r){c_(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[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 s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c_(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function d_(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function f_(){return{flow:{null:{name:"table",tokenize:h_,resolveAll:p_}}}}function h_(t,e,n){const r=this;let s=0,i=0,a;return u;function u(S){let B=r.events.length-1;for(;B>-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,X=$==="tableHead"||$==="tableRow"?I:l;return X===I&&r.parser.lazy[r.now().line]?n(S):X(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),o(S)}function o(S){return S===124||(a=!0,i+=1),d(S)}function d(S){return S===null?n(S):ee(S)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):oe(S)?de(t,d,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||xe(S)?(t.exit("data"),d(S)):(t.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,oe(S)?de(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?T(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),_):R(S)}function _(S){return oe(S)?de(t,T,"whitespace")(S):T(S)}function T(S){return S===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),E):S===45?(i+=1,E(S)):S===null||ee(S)?w(S):R(S)}function E(S){return S===45?(t.enter("tableDelimiterFiller"),A(S)):R(S)}function A(S){return S===45?(t.consume(S),A):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(S))}function b(S){return oe(S)?de(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||ee(S)?!a||s!==i?R(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):R(S)}function R(S){return n(S)}function I(S){return t.enter("tableRow"),L(S)}function L(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),L):S===null||ee(S)?(t.exit("tableRow"),e(S)):oe(S)?de(t,L,"whitespace")(S):(t.enter("data"),M(S))}function M(S){return S===null||S===124||xe(S)?(t.exit("data"),L(S)):(t.consume(S),S===92?P:M)}function P(S){return S===92||S===124?(t.consume(S),M):M(S)}}function p_(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,l=0,o,d,f;const p=new l_;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,l!==0&&(Hu(p,e,l,o,d),d=void 0,l=0),o={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",o,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),s=g.type==="tableDelimiterRow"?2:d?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):g.type==="tableHead"?(u=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=kr(p,e,i,s,n,f)):a[1]!==0&&(f=kr(p,e,a,s,n,f)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Hu(p,e,l,o,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=d_(e.events,n))}return t}function kr(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=hn(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const o=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},o),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},hn(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function Hu(t,e,n,r,s){const i=[],a=hn(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m_={name:"tasklistCheck",tokenize:b_};function g_(){return{text:{91:m_}}}function b_(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(l)}function u(l){return ee(l)?e(l):oe(l)?t.check({tokenize:E_},e,n)(l):n(l)}}function E_(t,e,n){return de(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function T_(t){return Il([Y3(),e_(),o_(t),f_(),g_()])}const x_={};function __(t){const e=this,n=t||x_,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(T_(n)),i.push(H3()),a.push(j3(n))}const y_=j.lazy(()=>Td(()=>import("./lazy-highlighter-dN3WcL6s.js"),__vite__mapDeps([0,1,2])));function Kc(){const t=Q.c(3),[e,n]=j.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 s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function A_(){const t=Q.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=m.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(k_)}),t[1]=r):r=t[1],r}function k_(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.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&&m.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&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.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&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function C_(t){const e=Q.c(12),n=j.useRef(null),{handleCopy:r,copied:s}=Kc(),i=I_;let a;e[0]!==r?(a=async()=>{const p=i(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const u=a;let l;e[2]!==s?(l=s?m.jsx($r,{size:12}):m.jsx(pi,{size:12}),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Me,{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",l]})}),e[4]=u,e[5]=l,e[6]=o):o=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==o||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[o,d]}),e[9]=o,e[10]=d,e[11]=f):f=e[11],f}function I_(t){return t?Array.from(t.querySelectorAll("tr")).map(N_).join(`
106
106
  `):""}function N_(t){return Array.from(t.querySelectorAll("th,td")).map(S_).join(",")}function S_(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const w_=[__],R_=[fx],O_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[15px] mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[15px]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-[15px] font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-[15px] font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(C_,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Jc=j.memo(t=>{const e=Q.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Xb,{remarkPlugins:w_,rehypePlugins:R_,components:O_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function L_(t){const e=Q.c(20),{language:n,content:r}=t,{handleCopy:s,copied:i}=Kc(),a=n||"text";let u;e[0]!==a?(u=m.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 l;e[2]!==r||e[3]!==s?(l=()=>s(r),e[2]=r,e[3]=s,e[4]=l):l=e[4];let o;e[5]!==i?(o=i?m.jsx($r,{size:14}):m.jsx(pi,{size:14}),e[5]=i,e[6]=o):o=e[6];let d;e[7]!==l||e[8]!==o?(d=m.jsx(Me,{size:"icon",variant:"ghost",onClick:l,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:o}),e[7]=l,e[8]=o,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(A_,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(j.Suspense,{fallback:p,children:m.jsx(y_,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}Jc.displayName="MemoizedMarkdownBlock";const Xi=t=>{const e=Q.c(7),{id:n,text:r}=t;let s;e[0]!==r?(s=ge.lexer(r),e[0]=r,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==i||e[3]!==n){let u;e[5]!==n?(u=(l,o)=>l.type==="code"?m.jsx(L_,{language:l.lang,content:l.text},`${n}-block_${o}`):m.jsx(Jc,{content:l.raw},`${n}-block_${o}`),e[5]=n,e[6]=u):u=e[6],a=i.map(u),e[2]=i,e[3]=n,e[4]=a}else a=e[4];return a};Xi.displayName="MemoizedMarkdown";function ed(t){const e=Q.c(18),{id:n,part:r,copyable:s,extraActions:i,hasToolCallAfter:a}=t,u=s===void 0?!1:s,l=a===void 0?!1:a,{handleCopy:o}=up(),[d,f]=j.useState(!1);let p;e[0]!==o||e[1]!==r.text?(p=async()=>{await o(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=o,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&i,_=g||i,T=!l&&"mb-2";let E;e[3]!==T?(E=re("group/part relative",T),e[3]=T,e[4]=E):E=e[4];let A;e[5]!==n||e[6]!==r.text?(A=m.jsx(Xi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=A):A=e[7];let b;e[8]!==i||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(b=_&&m.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:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Me,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx($r,{size:12}):m.jsx(pi,{size:12})}),i]})}),e[8]=i,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=b):b=e[13];let w;return e[14]!==E||e[15]!==A||e[16]!==b?(w=m.jsxs("div",{className:E,children:[A,b]}),e[14]=E,e[15]=A,e[16]=b,e[17]=w):w=e[17],w}function v_(t){const e=Q.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 s=r;let i;return e[2]!==s?(i=m.jsx("div",{className:"h-full",children:m.jsx(Ku,{code:s,language:"json",height:"100%",readOnly:!0})}),e[2]=s,e[3]=i):i=e[3],i}var os="Collapsible",[D_,rA]=xd(os),[P_,Zi]=D_(os),td=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[l,o]=Ad({prop:r,defaultProp:s??!1,onChange:a,caller:os});return m.jsx(P_,{scope:n,disabled:i,contentId:kd(),open:l,onOpenToggle:j.useCallback(()=>o(d=>!d),[o]),children:m.jsx(li.div,{"data-state":ta(l),"data-disabled":i?"":void 0,...u,ref:e})})});td.displayName=os;var nd="CollapsibleTrigger",Ki=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Zi(nd,n);return m.jsx(li.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ta(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:_d(t.onClick,s.onOpenToggle)})});Ki.displayName=nd;var Ji="CollapsibleContent",ea=j.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Zi(Ji,t.__scopeCollapsible);return m.jsx(yd,{present:n||s.open,children:({present:i})=>m.jsx(M_,{...r,ref:e,present:i})})});ea.displayName=Ji;var M_=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Zi(Ji,n),[u,l]=j.useState(r),o=j.useRef(null),d=Cd(e,o),f=j.useRef(0),p=f.current,h=j.useRef(0),g=h.current,_=a.open||u,T=j.useRef(_),E=j.useRef(void 0);return j.useEffect(()=>{const A=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(A)},[]),Id(()=>{const A=o.current;if(A){E.current=E.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const b=A.getBoundingClientRect();f.current=b.height,h.current=b.width,T.current||(A.style.transitionDuration=E.current.transitionDuration,A.style.animationName=E.current.animationName),l(r)}},[a.open,r]),m.jsx(li.div,{"data-state":ta(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:_&&s})});function ta(t){return t?"open":"closed"}var B_=td,sA=Ki,iA=ea;function F_(t){const e=Q.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=m.jsx(B_,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function U_(t){const e=Q.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=m.jsx(Ki,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function H_(t){const e=Q.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=m.jsx(ea,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function j_(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function ju(t){const e=Q.c(70),{part:n,isFirstInSequence:r,isLastInSequence:s,hasNextToolCall:i}=t,a=r===void 0?!1:r,u=s===void 0?!1:s,l=i===void 0?!1:i,{state:o}=n;let d;e[0]!==n?(d="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=d):d=e[1];const f=d;let p;e[2]!==f?(p=j_(f),e[2]=f,e[3]=p):p=e[3];const h=p,[g,_]=j.useState(!1),[T]=zd(),E=(o==="input-streaming"||o==="input-available"||o==="output-available")&&!!n.input,A=o==="output-available",b=o==="output-error";if(!T){const ve=o==="input-streaming"||o==="input-available",fe=o==="output-available",Ge=o==="output-error",Ie=a&&"mt-2",Ne=u&&"mb-2";let ye;e[4]!==Ie||e[5]!==Ne?(ye=re("flex items-center gap-1.5 py-2 opacity-75 relative",Ie,Ne),e[4]=Ie,e[5]=Ne,e[6]=ye):ye=e[6];let Fe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Fe=m.jsx(Ju,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Fe):Fe=e[7];let Re;e[8]!==l?(Re=l&&m.jsx("div",{className:"absolute left-1/2 top-full w-px bg-border -translate-x-1/2",style:{height:"calc(100% + 1rem)"}}),e[8]=l,e[9]=Re):Re=e[9];let De;e[10]!==Re?(De=m.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Fe,Re]}),e[10]=Re,e[11]=De):De=e[11];let Oe;e[12]!==h||e[13]!==ve?(Oe=ve&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground shimmer",children:"Calling"})," ",m.jsxs("span",{className:"text-muted-foreground/75 shimmer",children:[h,"..."]})]}),e[12]=h,e[13]=ve,e[14]=Oe):Oe=e[14];let Ue;e[15]!==h||e[16]!==fe?(Ue=fe&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",m.jsx("span",{className:"text-muted-foreground/75",children:h})]}),e[15]=h,e[16]=fe,e[17]=Ue):Ue=e[17];let Se;e[18]!==h||e[19]!==Ge?(Se=Ge&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",m.jsx("span",{className:"text-destructive/75",children:h})]}),e[18]=h,e[19]=Ge,e[20]=Se):Se=e[20];let He;e[21]!==Oe||e[22]!==Ue||e[23]!==Se?(He=m.jsxs("span",{className:"text-[15px]",children:[Oe,Ue,Se]}),e[21]=Oe,e[22]=Ue,e[23]=Se,e[24]=He):He=e[24];let We;return e[25]!==De||e[26]!==He||e[27]!==ye?(We=m.jsxs("div",{className:ye,children:[De,He]}),e[25]=De,e[26]=He,e[27]=ye,e[28]=We):We=e[28],We}let w;e[29]!==o?(w=o==="output-error"?m.jsx(Gu,{className:"size-4 text-destructive shrink-0"}):m.jsx(af,{className:re("size-4 text-muted-foreground shrink-0",(o==="input-streaming"||o==="input-available")&&"shimmer")}),e[29]=o,e[30]=w):w=e[30];const R=o==="output-error"&&"text-destructive/90",I=(o==="input-streaming"||o==="input-available")&&"shimmer";let L;e[31]!==R||e[32]!==I?(L=re("text-[15px] font-medium text-muted-foreground truncate",R,I),e[31]=R,e[32]=I,e[33]=L):L=e[33];const M=o==="input-streaming"&&`Streaming ${f} arguments`,P=o==="input-available"&&`Calling ${f}`,S=o==="output-available"&&`Called ${f}`,B=o==="output-error"&&`Error calling ${f}`;let $;e[34]!==M||e[35]!==P||e[36]!==S||e[37]!==B||e[38]!==L?($=m.jsxs("span",{className:L,children:[M,P,S,B]}),e[34]=M,e[35]=P,e[36]=S,e[37]=B,e[38]=L,e[39]=$):$=e[39];let X;e[40]!==$||e[41]!==w?(X=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w,$]}),e[40]=$,e[41]=w,e[42]=X):X=e[42];const q=g&&"rotate-90";let U;e[43]!==q?(U=re("size-4 text-muted-foreground transition-transform duration-200",q),e[43]=q,e[44]=U):U=e[44];let W;e[45]!==U?(W=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(Xu,{className:U})}),e[45]=U,e[46]=W):W=e[46];let V;e[47]!==X||e[48]!==W?(V=m.jsxs(U_,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[X,W]}),e[47]=X,e[48]=W,e[49]=V):V=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[50]=K):K=e[50];let J;e[51]!==n.input||e[52]!==E?(J=E&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Ku,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),e[51]=n.input,e[52]=E,e[53]=J):J=e[53];let k;e[54]!==n.output||e[55]!==A?(k=A&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(v_,{output:n.output})})]}),e[54]=n.output,e[55]=A,e[56]=k):k=e[56];let se;e[57]!==n||e[58]!==b?(se=b&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.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]=b,e[59]=se):se=e[59];let he;e[60]!==J||e[61]!==k||e[62]!==se?(he=m.jsx(H_,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[K,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[J,k,se]})]})}),e[60]=J,e[61]=k,e[62]=se,e[63]=he):he=e[63];let N;e[64]!==V||e[65]!==he?(N=m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[V,he]}),e[64]=V,e[65]=he,e[66]=N):N=e[66];let Ee;return e[67]!==g||e[68]!==N?(Ee=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsx(F_,{open:g,onOpenChange:_,children:N})}),e[67]=g,e[68]=N,e[69]=Ee):Ee=e[69],Ee}const z_={planning:{icon:m.jsx(oo,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(qr,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},$_=1200;function Y_(){const t=Q.c(7),[e,n]=j.useState("planning");let r,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},$_);return()=>{clearTimeout(l)}},s=[],t[0]=r,t[1]=s):(r=t[0],s=t[1]),j.useEffect(r,s);const i=z_[e];let a;t[2]!==i.label?(a=m.jsxs("span",{className:"text-[15px] text-muted-foreground shimmer",children:[i.label,"..."]}),t[2]=i.label,t[3]=a):a=t[3];let u;return t[4]!==i.icon||t[5]!==a?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[i.icon,a]})}),t[4]=i.icon,t[5]=a,t[6]=u):u=t[6],u}function q_(t){const e=Q.c(10),{duration:n,parts:r,id:s}=t,i=n/1e3;let a;e[0]!==i?(a=i.toFixed(1),e[0]=i,e[1]=a):a=e[1];const u=a,[l,o]=j.useState(!1),[d,f]=j.useState(!1);let p;if(e[2]!==s||e[3]!==d||e[4]!==l||e[5]!==r||e[6]!==u){const h=r.filter(G_),g=h.some(V_),_=g||d;let T,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>o(!0),E=()=>o(!1),e[8]=T,e[9]=E):(T=e[8],E=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:T,onMouseLeave:E,className:re("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(qr,{className:"text-muted-foreground shrink-0 shimmer",size:14}):l?m.jsx(Xu,{className:re("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(io,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:re("text-[15px] text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((A,b)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Xi,{id:`${s}-reasoning-${b}`,text:A.text})},`${s}-reasoning-${b}`))})]}),e[2]=s,e[3]=d,e[4]=l,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function V_(t){return t.state==="streaming"}function G_(t){return t.type==="reasoning"}function W_(t){const e=Q.c(17),{part:n,id:r,usageStats:s,isFollowedByToolCall:i,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:l}=t;switch(n.type){case"dynamic-tool":{let o;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(o=m.jsx(ju,{part:n,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[0]=l,e[1]=r,e[2]=a,e[3]=u,e[4]=n,e[5]=o):o=e[5],o}case"text":{let o;return e[6]!==r||e[7]!==i||e[8]!==n||e[9]!==s?(o=m.jsx(ed,{id:r,part:n,extraActions:s,copyable:!0,hasToolCallAfter:i}),e[6]=r,e[7]=i,e[8]=n,e[9]=s,e[10]=o):o=e[10],o}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const o=n;let d;return e[11]!==l||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==o?(d=m.jsx(ju,{part:o,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[11]=l,e[12]=r,e[13]=a,e[14]=u,e[15]=o,e[16]=d):d=e[16],d}}throw new Error(`Unknown part type: ${n.type}`)}function Q_(t){const e=Q.c(24),{message:n,status:r,className:s}=t,{id:i,parts:a}=n,o=r==="streaming"||r==="submitted",d=a.length>0;let f;e[0]!==a?(f=a.some(Z_),e[0]=a,e[1]=f):f=e[1];const p=f;let h;e[2]!==o||e[3]!==a?(h=o&&a.some(X_),e[2]=o,e[3]=a,e[4]=h):h=e[4];const g=h;let _;if(e[5]!==n.metadata){const M=n.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,P=n.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):null;_=M!==null?(P??new Date).getTime()-M.getTime():null,e[5]=n.metadata,e[6]=_}else _=e[6];const T=_,E=d&&(p||g)&&T!==null;let A;e[7]!==n?(A=m.jsx(Zo,{messages:[n]}),e[7]=n,e[8]=A):A=e[8];const b=A;let w;e[9]!==s?(w=re("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",s),e[9]=s,e[10]=w):w=e[10];let R;e[11]!==T||e[12]!==d||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==E||e[17]!==b?(R=d?m.jsxs(m.Fragment,{children:[E&&m.jsx(q_,{duration:T,parts:a,id:i}),a.map((M,P)=>{const S=a[P+1],B=a[P-1],$=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),X=M.type==="dynamic-tool"||M.type.startsWith("tool-"),q=B&&(B.type==="dynamic-tool"||B.type.startsWith("tool-")),U=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),W=X&&!q,V=X&&!U,K=X&&U;return m.jsx(W_,{part:M,id:i,usageStats:P===a.length-1?b:void 0,isFollowedByToolCall:$,isFirstToolCallInSequence:W,isLastToolCallInSequence:V,hasNextToolCall:K},`${i}-${P}`)})]}):o?m.jsx(Y_,{}):null,e[11]=T,e[12]=d,e[13]=i,e[14]=o,e[15]=a,e[16]=E,e[17]=b,e[18]=R):R=e[18];let I;e[19]!==R?(I=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[15px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[19]=R,e[20]=I):I=e[20];let L;return e[21]!==w||e[22]!==I?(L=m.jsx("div",{className:w,children:I}),e[21]=w,e[22]=I,e[23]=L):L=e[23],L}function X_(t){return t.type==="reasoning"&&t.state==="streaming"}function Z_(t){return t.type==="reasoning"}const rd=j.createContext(null);function sd(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!j.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const i=t[n-1],a=j.isValidElement(i)&&i.props?.message?.role,u=i&&j.isValidElement(i)&&a==="user"?i:null;e.push({user:u,assistant:r})}}return e}function J_(t){const e=Q.c(27),{children:n,className:r,minHeightOffset:s}=t,i=j.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=j.useRef(a);let l,o,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==s){const A=j.Children.toArray(n),b=A[A.length-1];o=b&&j.isValidElement(b)&&b.type===sd?b:null;const w=o?A.slice(0,-1):A,R=K_(w);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=M=>{const P=u.current[M];if(P&&i.current){const S=i.current.offsetTop,B=P.offsetTop;i.current.scrollTo({top:B-S,behavior:"smooth"})}},e[11]=I):I=e[11];const L=I;l=rd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:L},e[12]=g):g=e[12],p=i,e[13]!==r?(h=re("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],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=R.map((M,P)=>{const S=P===R.length-1;return m.jsxs("div",{ref:B=>{u.current[P]=B},className:"flex flex-col pb-2",style:S&&s?{minHeight:`calc(100vh - ${s}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:M.user&&j.isValidElement(M.user)?j.cloneElement(M.user,{pairIndex:P}):M.user}),M.assistant]},P)}),e[1]=n,e[2]=r,e[3]=s,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else l=e[4],o=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==o||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,o]}),e[15]=o,e[16]=d,e[17]=f,e[18]=_):_=e[18];let T;e[19]!==p||e[20]!==h||e[21]!==_?(T=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=T):T=e[22];let E;return e[23]!==l||e[24]!==g||e[25]!==T?(E=m.jsx(l,{value:g,children:T}),e[23]=l,e[24]=g,e[25]=T,e[26]=E):E=e[26],E}function ey(t){const e=Q.c(5),{locator:n}=zt(),r=Yo(),s=$o();let i;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==s?(i=async(u,l,o)=>{const d=await jo(n,o),f=d.findIndex(T=>T.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${o}`);return}const p=d.slice(0,f).filter(ty),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await s.insert.mutateAsync(_),p.length>0){const T=p.map(E=>({...E,id:crypto.randomUUID(),metadata:{...E.metadata,thread_id:h,created_at:E.metadata?.created_at||g}}));await r.insertMany.mutateAsync(T)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=s,e[4]=i):i=e[4],i}function ty(t){return t.role!=="system"}function ny(t){const e=Q.c(18),{messageId:n,parts:r}=t,[s,i]=j.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:l,activeThreadId:o}=An(),d=ey(l);let f;e[0]!==r?(f=r.filter(sy).map(ry).join(`
107
107
  `),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=I=>{I.stopPropagation(),i(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==o||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==a||e[8]!==u?(_=async()=>{await d(n,p,o),a(p),u({originalThreadId:o,originalMessageId:n,originalMessageText:p}),i(!1)},e[3]=o,e[4]=d,e[5]=n,e[6]=p,e[7]=a,e[8]=u,e[9]=_):_=e[9];const T=_;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsx(Me,{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:m.jsx(so,{size:16,className:"p-0.5"})})}),m.jsx(xn,{side:"bottom",children:"Edit message"})]})}),e[10]=E):E=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsxs(uf,{children:[m.jsx(of,{children:"Edit message?"}),m.jsx(lf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=A):A=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(cf,{children:"Cancel"}),e[12]=b):b=e[12];let w;e[13]!==T?(w=m.jsxs(df,{children:[A,m.jsxs(ff,{children:[b,m.jsx(hf,{onClick:T,children:"Confirm"})]})]}),e[13]=T,e[14]=w):w=e[14];let R;return e[15]!==s||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[E,m.jsx(pf,{open:s,onOpenChange:i,children:w})]}),e[15]=s,e[16]=w,e[17]=R):R=e[17],R}function ry(t){return t.text}function sy(t){return t.type==="text"}function iy(t){const e=Q.c(29),{message:n,className:r,pairIndex:s}=t,{id:i,parts:a}=n,u=j.useContext(rd),[l,o]=j.useState(!1);if(!a||a.length===0)return null;let d;e[0]!==u||e[1]!==s?(d=()=>{o(!0),s!==void 0&&u?.scrollToPair(s)},e[0]=u,e[1]=s,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=re("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]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),g=()=>o(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=l?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let T;e[7]!==_?(T=re("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=T):T=e[8];let E;if(e[9]!==i||e[10]!==a){let L;e[12]!==i?(L=(M,P)=>M.type==="text"?m.jsx(ed,{id:i,part:M},`${i}-${P}`):null,e[12]=i,e[13]=L):L=e[13],E=a.map(L),e[9]=i,e[10]=a,e[11]=E}else E=e[11];let A;e[14]!==E?(A=m.jsx("div",{children:E}),e[14]=E,e[15]=A):A=e[15];let b;e[16]!==T||e[17]!==A?(b=m.jsx("div",{className:T,children:A}),e[16]=T,e[17]=A,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==a?(w=m.jsx(ny,{messageId:i,parts:a}),e[19]=i,e[20]=a,e[21]=w):w=e[21];let R;e[22]!==f||e[23]!==w||e[24]!==b?(R=m.jsxs("div",{tabIndex:0,onClick:f,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:[b,w]}),e[22]=f,e[23]=w,e[24]=b,e[25]=R):R=e[25];let I;return e[26]!==R||e[27]!==p?(I=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:R})}),e[26]=R,e[27]=p,e[28]=I):I=e[28],I}function ay({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",org:n}){const[r,s]=j.useState(!1),i=Ud(),a=Vu(),{data:u}=qu.useSession(),l=Wu(),o=u?.user?.id??"",d=()=>{a({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},f=async()=>{if(!n.id||!o){Kn.error("Not authenticated");return}s(!0);try{const p=l?.find(_=>_.connection_url===gf);if(p){a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:p.id}});return}const h=bf({id:Ef("conn")}),g=await i.create.mutateAsync(h);a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:g.id}})}catch(p){Kn.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{s(!1)}};return m.jsx(Sd,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(Me,{variant:"outline",onClick:f,disabled:r,children:[m.jsx("img",{src:mf,alt:"OpenRouter",className:"size-4"}),r?"Installing...":"Install OpenRouter"]}),m.jsx(Me,{variant:"outline",onClick:d,children:"Install Connection"})]})})}function uy(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4),i=Math.floor(r/36e5);return s<1?"now":s<60?`${s}m`:`${i}h`}function oy(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),s=new Date(n.getTime()-7*864e5),i=new Date(n.getTime()-30*864e5),a=[],u=[],l=[],o=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?a.push(p):h>=r?u.push(p):h>=s?l.push(p):h>=i?o.push(p):d.push(p)}const f=[];return a.length>0&&f.push({label:"Today",threads:a,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),l.length>0&&f.push({label:"7 days ago",threads:l,showRelativeTime:!1}),o.length>0&&f.push({label:"30 days ago",threads:o,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function ly(t){const e=Q.c(49),{variant:n}=t,r=n===void 0?"icon":n,{threads:s,refetch:i}=zo(),{activeThreadId:a,setActiveThreadId:u,hideThread:l}=An(),[o,d]=j.useState("");let f,p,h,g,_,T,E,A,b,w,R,I;if(e[0]!==a||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==r){const $=o.trim()?s.filter(K=>(K.title||"New chat").toLowerCase().includes(o.toLowerCase())):s,X=oy($);let q;e[19]!==i?(q=K=>{K?i():d("")},e[19]=i,e[20]=q):q=e[20];const U=q;g=hi,h=yn,p=lr,w=U,e[21]!==r?(R=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:r==="outline"?m.jsx(Me,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(na,{size:16})}):m.jsx(Me,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(na,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=r,e[22]=R):R=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx(xn,{children:"Chat history"}),e[23]=I):I=e[23],f=or,E="end",A="w-80 p-0";let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=W):W=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=K=>d(K.target.value),e[25]=V):V=e[25],e[26]!==o?(b=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[W,m.jsx("input",{type:"text",placeholder:"Search chats...",value:o,onChange:V,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=o,e[27]=b):b=e[27],_="max-h-[300px] overflow-y-auto",T=$.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:o.trim()?"No chats found":"No chats yet"}):X.map((K,J)=>m.jsxs("div",{children:[J>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const se=k.id===a;return m.jsxs("div",{className:re("flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group",se&&"bg-accent/50"),onClick:()=>u(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:se?"current":K.showRelativeTime?uy(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),l(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(Tf,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=a,e[1]=l,e[2]=i,e[3]=o,e[4]=u,e[5]=s,e[6]=r,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=T,e[13]=E,e[14]=A,e[15]=b,e[16]=w,e[17]=R,e[18]=I}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],T=e[12],E=e[13],A=e[14],b=e[15],w=e[16],R=e[17],I=e[18];let L;e[28]!==_||e[29]!==T?(L=m.jsx("div",{className:_,children:T}),e[28]=_,e[29]=T,e[30]=L):L=e[30];let M;e[31]!==f||e[32]!==L||e[33]!==E||e[34]!==A||e[35]!==b?(M=m.jsxs(f,{align:E,className:A,children:[b,L]}),e[31]=f,e[32]=L,e[33]=E,e[34]=A,e[35]=b,e[36]=M):M=e[36];let P;e[37]!==p||e[38]!==M||e[39]!==w||e[40]!==R||e[41]!==I?(P=m.jsxs(p,{onOpenChange:w,children:[R,I,M]}),e[37]=p,e[38]=M,e[39]=w,e[40]=R,e[41]=I,e[42]=P):P=e[42];let S;e[43]!==h||e[44]!==P?(S=m.jsx(h,{children:P}),e[43]=h,e[44]=P,e[45]=S):S=e[45];let B;return e[46]!==g||e[47]!==S?(B=m.jsx(g,{children:S}),e[46]=g,e[47]=S,e[48]=B):B=e[48],B}function cy(){const t=Q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Cr,{align:"right",width:"w-3/4"}),m.jsx(Cr,{align:"left",width:"w-full",lines:3}),m.jsx(Cr,{align:"right",width:"w-2/3"}),m.jsx(Cr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,s,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[i,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Cr(t){const e=Q.c(22),{align:n,width:r,lines:s}=t,i=r===void 0?"w-full":r,a=s===void 0?1:s,u=n==="right"?"flex-row-reverse":"flex-row";let l;e[0]!==u?(l=re("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=l):l=e[1];const o=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==o?(d=re("flex min-w-0 flex-col gap-2",o),e[2]=o,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==i?(h=re("min-w-0 rounded-2xl p-4",p,i),e[5]=p,e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let _;e[10]!==a||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((b,w)=>m.jsx("div",{className:re("h-3 rounded bg-muted-foreground/20 animate-pulse",w===a-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=a,e[11]=g,e[12]=_):_=e[12];let T;e[13]!==_||e[14]!==h?(T=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=T):T=e[15];let E;e[16]!==T||e[17]!==d?(E=m.jsxs("div",{className:d,children:[f,T]}),e[16]=T,e[17]=d,e[18]=E):E=e[18];let A;return e[19]!==E||e[20]!==l?(A=m.jsx("div",{className:l,children:E}),e[19]=E,e[20]=l,e[21]=A):A=e[21],A}function dy({messageCount:t,sentinelRef:e}){const n=j.useRef(t),r=j.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function zu(t,e){const n=j.Children.toArray(t);for(const r of n)if(j.isValidElement(r)&&r.type===e)return r;return null}function fy(t){const e=Q.c(5),{className:n,children:r}=t;let s;e[0]!==n?(s=re("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==r||e[3]!==s?(i=m.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function hy(t){const e=Q.c(7),{children:n}=t;let r;e[0]!==n?(r=zu(n,id),e[0]=n,e[1]=r):r=e[1];const s=r;let i;e[2]!==n?(i=zu(n,ad),e[2]=n,e[3]=i):i=e[3];const a=i;let u;return e[4]!==s||e[5]!==a?(u=m.jsxs("div",{className:"flex h-12 items-center justify-between gap-4 border-b border-border px-4 flex-none",children:[s,a]}),e[4]=s,e[5]=a,e[6]=u):u=e[6],u}function id(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ad(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex flex-none items-center gap-1",children:n}),e[0]=n,e[1]=r):r=e[1],r}function py(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=re("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function my(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.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 gy(t){const e=Q.c(12),{minHeightOffset:n}=t,r=n===void 0?240:n,{messages:s,chatStatus:i}=An(),a=j.useRef(null);let u;e[0]!==s.length?(u={messageCount:s.length,sentinelRef:a},e[0]=s.length,e[1]=u):u=e[1],dy(u);let l;if(e[2]!==s||e[3]!==i){let f;e[5]!==s.length||e[6]!==i?(f=(p,h)=>p.role==="user"?m.jsx(iy,{message:p},p.id):p.role==="assistant"?m.jsx(Q_,{message:p,status:h===s.length-1?i:void 0},p.id):null,e[5]=s.length,e[6]=i,e[7]=f):f=e[7],l=s.map(f),e[2]=s,e[3]=i,e[4]=l}else l=e[4];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(sd,{children:m.jsx("div",{ref:a,className:"h-0"})}),e[8]=o):o=e[8];let d;return e[9]!==r||e[10]!==l?(d=m.jsxs(J_,{minHeightOffset:r,children:[l,o]}),e[9]=r,e[10]=l,e[11]=d):d=e[11],d}function by(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=re("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function Ls(t){const e=Q.c(24),{title:n,description:r,icon:s,variant:i,onDismiss:a,children:u}=t,l=i===void 0?"default":i;let o,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==l){const b={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"}}[l];p=re("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",b.container),h=s&&m.jsx("div",{className:re("mt-0.5 shrink-0",b.icon),children:s}),o="flex-1 min-w-0",d=n&&m.jsx("div",{className:re("text-xs mb-1",b.title),children:n}),f=r&&m.jsx("div",{className:re("text-xs line-clamp-2",b.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=s,e[3]=n,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else o=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==o||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:o,children:[d,f,g]}),e[12]=o,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let T;e[17]!==a?(T=a&&m.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Nd,{size:14})}),e[17]=a,e[18]=T):T=e[18];let E;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==T?(E=m.jsxs("div",{className:p,children:[h,_,T]}),e[19]=p,e[20]=h,e[21]=_,e[22]=T,e[23]=E):E=e[23],E}const aA=Object.assign(fy,{Header:Object.assign(hy,{Left:id,Right:ad}),Main:py,Messages:gy,EmptyState:my,Footer:by,Input:V0,Provider:M0,Skeleton:cy,IceBreakers:ap,NoLlmBindingEmptyState:ay,ThreadHistoryPopover:ly});export{aA as C,g0 as G,L0 as M,B_ as R,$e as S,sA as T,qo as a,uo as b,rA as c,iA as d,eo as i,An as u};
@@ -1 +1 @@
1
- import{X as Ie,r as u,as as K,aW as F,R as Re,P as Ce,O as $e,C as Me,aX as z}from"./index-DZBCLPmz.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case o:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=o,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===o},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===o||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,o,c,d){if(c===l.length)return o===t.length?ve:Ke;var v=`${o},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,o),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===o?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(o,i-1).match(Oe),x&&o>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(o,i-1).match(be),$&&o>0&&(b*=Math.pow(ee,$.length))):(b*=je,o>0&&(b*=Math.pow(ee,i-o))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),o=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),W=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,ae)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var a,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")G(),H(),w(1,N);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(W);I?I.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,ae),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),X=u.useMemo(()=>({value:(e,s,m)=>{var a;s!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,oe(s,m)),w(2,()=>{H(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(o.current.has(s)?o.current.get(s).add(e):o.current.set(s,new Set([e]))),w(3,()=>{G(),H(),r.current.value||N(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{G(),m?.getAttribute("id")===e&&N(),R.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{c.current.delete(e),o.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:W,labelId:ue,listInnerRef:P}),[]);function oe(e,s){var m,a;let g=(a=(m=v.current)==null?void 0:m.filter)!=null?a:Te;return e?g(e,r.current.search,s):0}function H(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(a=>{let g=o.current.get(a),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([a,S])});let m=P.current;V().sort((a,g)=>{var S,C;let I=a.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(a=>{let g=a.closest(te);g?g.appendChild(a.parentElement===g?a:a.closest(`${te} > *`)):m.appendChild(a.parentElement===m?a:a.closest(`${te} > *`))}),s.sort((a,g)=>g[1]-a[1]).forEach(a=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(a[0])}"]`);S?.parentElement.appendChild(S)})}function N(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function G(){var e,s,m,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(a=(m=c.current.get(S))==null?void 0:m.keywords)!=null?a:[],_=oe(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of o.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function ae(){var e,s,m;let a=q();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((m=(s=a.closest(O))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function J(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=q(),a=V(),g=a.findIndex(C=>C===m),S=a[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?a[a.length-1]:g+e===a.length?a[0]:a[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),a;for(;m&&!a;)m=e>0?Qe(m,O):Ze(m,O),a=m?.querySelector(he);a?R.setState("value",a.getAttribute(j)):Y(e)}let ce=()=>J(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let a=q();if(a){let g=new Event(ne);a.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:X},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let o=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(o,d?.id)},[i]);let p=ke(o,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(o)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:W,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),We=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:o,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:o}),[o]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Xe=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,o=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(o,l),...f,"cmdk-separator":"",role:"separator"})}),He=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,o=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:o?t.value:d,onChange:i=>{o||c.setState("search",i.target.value),r?.(i.target.value)}})}),Ne=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...o}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Ge=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:o,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:o}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Je=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:o="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Ne,Item:Ue,Input:He,Group:We,Separator:Xe,Dialog:Ge,Empty:Je,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let o=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():o.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),o.current=v}),o}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,o)=>{r.current.set(f,o),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};
1
+ import{X as Ie,r as u,as as K,aW as F,R as Re,P as Ce,O as $e,C as Me,aX as z}from"./index-Diww4UW3.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case o:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=o,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===o},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===o||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,o,c,d){if(c===l.length)return o===t.length?ve:Ke;var v=`${o},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,o),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===o?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(o,i-1).match(Oe),x&&o>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(o,i-1).match(be),$&&o>0&&(b*=Math.pow(ee,$.length))):(b*=je,o>0&&(b*=Math.pow(ee,i-o))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),o=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),W=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,ae)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var a,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")G(),H(),w(1,N);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(W);I?I.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,ae),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),X=u.useMemo(()=>({value:(e,s,m)=>{var a;s!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,oe(s,m)),w(2,()=>{H(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(o.current.has(s)?o.current.get(s).add(e):o.current.set(s,new Set([e]))),w(3,()=>{G(),H(),r.current.value||N(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{G(),m?.getAttribute("id")===e&&N(),R.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{c.current.delete(e),o.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:W,labelId:ue,listInnerRef:P}),[]);function oe(e,s){var m,a;let g=(a=(m=v.current)==null?void 0:m.filter)!=null?a:Te;return e?g(e,r.current.search,s):0}function H(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(a=>{let g=o.current.get(a),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([a,S])});let m=P.current;V().sort((a,g)=>{var S,C;let I=a.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(a=>{let g=a.closest(te);g?g.appendChild(a.parentElement===g?a:a.closest(`${te} > *`)):m.appendChild(a.parentElement===m?a:a.closest(`${te} > *`))}),s.sort((a,g)=>g[1]-a[1]).forEach(a=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(a[0])}"]`);S?.parentElement.appendChild(S)})}function N(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function G(){var e,s,m,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(a=(m=c.current.get(S))==null?void 0:m.keywords)!=null?a:[],_=oe(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of o.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function ae(){var e,s,m;let a=q();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((m=(s=a.closest(O))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function J(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=q(),a=V(),g=a.findIndex(C=>C===m),S=a[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?a[a.length-1]:g+e===a.length?a[0]:a[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),a;for(;m&&!a;)m=e>0?Qe(m,O):Ze(m,O),a=m?.querySelector(he);a?R.setState("value",a.getAttribute(j)):Y(e)}let ce=()=>J(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let a=q();if(a){let g=new Event(ne);a.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:X},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let o=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(o,d?.id)},[i]);let p=ke(o,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(o)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:W,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),We=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:o,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:o}),[o]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Xe=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,o=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(o,l),...f,"cmdk-separator":"",role:"separator"})}),He=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,o=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:o?t.value:d,onChange:i=>{o||c.setState("search",i.target.value),r?.(i.target.value)}})}),Ne=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...o}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Ge=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:o,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:o}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Je=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:o="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Ne,Item:Ue,Input:He,Group:We,Separator:Xe,Dialog:Ge,Empty:Je,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let o=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():o.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),o.current=v}),o}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,o)=>{r.current.set(f,o),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};