decocms 2.282.1 → 2.282.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 (162) hide show
  1. package/dist/client/assets/{AlertCircle-CJ_7BsPP.js → AlertCircle-i753hIUr.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DtS9FYAN.js → ArrowNarrowLeft-DyneV8jh.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-smRbUGaN.js → CheckCircle-BDNIuV_g.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-xWqM1qJV.js → ChevronDown-vRDN8zoj.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-BCgvkwtC.js → ChevronRight-P2x5wJJp.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-CrL9TH1K.js → ChevronUp-Dg737K7F.js} +1 -1
  7. package/dist/client/assets/{Container-B7M87Wz6.js → Container-DsC3rtEa.js} +1 -1
  8. package/dist/client/assets/{LinkExternal01-DLKyZWWz.js → LinkExternal01-Cw9xV77y.js} +1 -1
  9. package/dist/client/assets/{Lock01-bZF1KUvq.js → Lock01-B4C5ICSW.js} +1 -1
  10. package/dist/client/assets/{Palette-Dl7lzquw.js → Palette-CxbsG8jb.js} +1 -1
  11. package/dist/client/assets/{Play-DtJ0cxBf.js → Play-F_qMNNeX.js} +1 -1
  12. package/dist/client/assets/{Plus-IUiAby9e.js → Plus-BM77-3yZ.js} +1 -1
  13. package/dist/client/assets/{SearchMd-A2WzjBhy.js → SearchMd-BQ703EvX.js} +1 -1
  14. package/dist/client/assets/{Settings02-uCCFk89X.js → Settings02-CZ-RzoRL.js} +1 -1
  15. package/dist/client/assets/{Star01-07LmVEi1.js → Star01-D8uixfU7.js} +1 -1
  16. package/dist/client/assets/{Sun-NZLaiUcL.js → Sun-Dzvpwc78.js} +1 -1
  17. package/dist/client/assets/{Tool01-1Tm6sx2D.js → Tool01-DV6LLMyv.js} +1 -1
  18. package/dist/client/assets/{Trash01-2of3D7QX.js → Trash01-DeQUJecj.js} +1 -1
  19. package/dist/client/assets/{Upload01-BPC1olzj.js → Upload01-C7vhn2fS.js} +1 -1
  20. package/dist/client/assets/{User01-Dj2-no-V.js → User01-CFTuPOYw.js} +1 -1
  21. package/dist/client/assets/{Users03-B_ZFhEj7.js → Users03-AWMGi4Xo.js} +1 -1
  22. package/dist/client/assets/{X-BXQFKahF.js → X-B19qdsWt.js} +1 -1
  23. package/dist/client/assets/{XCircle-ByksmUze.js → XCircle-Cu_m9KsD.js} +1 -1
  24. package/dist/client/assets/{Zap-Ct-Bt-7a.js → Zap-kmaaq3eG.js} +1 -1
  25. package/dist/client/assets/{ZapSquare-CLlEU1BK.js → ZapSquare-Bzu6OwXc.js} +1 -1
  26. package/dist/client/assets/{accordion-CBx4kF0A.js → accordion-Bcqp7xWC.js} +1 -1
  27. package/dist/client/assets/{agent-icon-uOxmWZzX.js → agent-icon-FJlZxNBT.js} +1 -1
  28. package/dist/client/assets/{agents-list-c4HvLnHM.js → agents-list-BzpReqDX.js} +1 -1
  29. package/dist/client/assets/ai-providers-BxK1xIaH.js +1 -0
  30. package/dist/client/assets/{alert-dialog-P8pjafE2.js → alert-dialog-BJ0hwa2l.js} +1 -1
  31. package/dist/client/assets/{auth-catchall-8f9iLpUP.js → auth-catchall-CGjZNqai.js} +1 -1
  32. package/dist/client/assets/{automation-list-row-BDBawYyn.js → automation-list-row-GPd6_cjS.js} +1 -1
  33. package/dist/client/assets/{automations-C_zdEQX8.js → automations-CXyF6Wr3.js} +1 -1
  34. package/dist/client/assets/{avatar-F9o71OJ0.js → avatar-BeRTzZHX.js} +1 -1
  35. package/dist/client/assets/{badge-D2Q0fk8p.js → badge-OuHAk68F.js} +1 -1
  36. package/dist/client/assets/{brand-context-CW58R34a.js → brand-context-CAuLcp_u.js} +1 -1
  37. package/dist/client/assets/{card-fcmwdw-g.js → card-64W2yOQo.js} +1 -1
  38. package/dist/client/assets/{chat-context-CXS-qe2G.js → chat-context-BQqGEJhg.js} +1 -1
  39. package/dist/client/assets/{checkbox-CqcJoypg.js → checkbox-Cx3RPx8a.js} +1 -1
  40. package/dist/client/assets/{collection-detail-DhZtELgd.js → collection-detail-ztCad3qg.js} +1 -1
  41. package/dist/client/assets/{collection-display-button-CgNICB5x.js → collection-display-button-CLTxoM3d.js} +1 -1
  42. package/dist/client/assets/{collection-search-BhW0WppR.js → collection-search-CcNzJi6D.js} +1 -1
  43. package/dist/client/assets/{collection-table-wrapper-rCxyye9m.js → collection-table-wrapper-BzqYYOAP.js} +1 -1
  44. package/dist/client/assets/{collection-tabs-CCiykiFm.js → collection-tabs-DD0Qt8TU.js} +1 -1
  45. package/dist/client/assets/{collections-C5k4gitm.js → collections-BpO3SJDN.js} +1 -1
  46. package/dist/client/assets/{command-Bap7RtnO.js → command-rQqgIdbd.js} +1 -1
  47. package/dist/client/assets/{connection-card-CAIl5zuH.js → connection-card-DKlghzN6.js} +1 -1
  48. package/dist/client/assets/{connection-detail-C-murm81.js → connection-detail-nptsFfMw.js} +1 -1
  49. package/dist/client/assets/{connection-form-helpers-Kb2X2zWy.js → connection-form-helpers-ByqGzB7q.js} +1 -1
  50. package/dist/client/assets/{connections-BUYyasfH.js → connections-CAWxy7P8.js} +1 -1
  51. package/dist/client/assets/{constants-Cz3vSCG9.js → constants-CN6Il9QM.js} +1 -1
  52. package/dist/client/assets/{constants-BYqEB04Y.js → constants-DBlKftLg.js} +1 -1
  53. package/dist/client/assets/{dialog-BEtDzaNY.js → dialog-BG20y4ti.js} +1 -1
  54. package/dist/client/assets/{drawer-BXhHhfPv.js → drawer-Gt9dvwHd.js} +1 -1
  55. package/dist/client/assets/{dropdown-menu-CPrJeiSb.js → dropdown-menu-D_gbsFgj.js} +1 -1
  56. package/dist/client/assets/{dynamic-plugin-layout-B3frXkTC.js → dynamic-plugin-layout-DUhVE3zr.js} +1 -1
  57. package/dist/client/assets/{empty-state-D17b8ueP.js → empty-state-B4p5HAyS.js} +1 -1
  58. package/dist/client/assets/{empty-state-QyaCdfZt.js → empty-state-YlXuIlyl.js} +1 -1
  59. package/dist/client/assets/{extract-connection-data-Df_ti4Xy.js → extract-connection-data-BkUkPjk1.js} +1 -1
  60. package/dist/client/assets/{features-DpwKJvfV.js → features-ZB9YPD6T.js} +1 -1
  61. package/dist/client/assets/{form-CyOS6D3q.js → form-DVLM8o8l.js} +1 -1
  62. package/dist/client/assets/{general-BXFZtoDZ.js → general-BSRTvN4z.js} +1 -1
  63. package/dist/client/assets/{index-C6iu8syV.js → index-B3NgIo6R.js} +1 -1
  64. package/dist/client/assets/{index-CpMJ05u5.js → index-B9tg__2J.js} +1 -1
  65. package/dist/client/assets/{index-C27Pbex0.js → index-BR4Tv9I4.js} +2 -2
  66. package/dist/client/assets/{index-DYJpZ_hI.js → index-BZ-_pOxX.js} +1 -1
  67. package/dist/client/assets/{index-FD-g03rr.js → index-B_9MykSP.js} +1 -1
  68. package/dist/client/assets/{index-B6nAXVWE.js → index-BejE17RG.js} +1 -1
  69. package/dist/client/assets/{index-D2u00J0R.js → index-Bpfr1gkL.js} +5 -5
  70. package/dist/client/assets/{index-DsXJm4s8.js → index-BxuUqWWJ.js} +1 -1
  71. package/dist/client/assets/{index-tiUiHjMI.js → index-CvjwIR23.js} +1 -1
  72. package/dist/client/assets/{index-CjRdG1Vp.js → index-DWgdGM2y.js} +1 -1
  73. package/dist/client/assets/{infiniteQueryObserver-Bm_4nXxh.js → infiniteQueryObserver-DjdUCzEf.js} +1 -1
  74. package/dist/client/assets/{input-BMDCCsVs.js → input-C6wlfqbz.js} +1 -1
  75. package/dist/client/assets/{integration-icon-gIhUX9GC.js → integration-icon-EHHTVGeJ.js} +1 -1
  76. package/dist/client/assets/{label-2vBVhIzi.js → label-CMuBjs0l.js} +1 -1
  77. package/dist/client/assets/{layout-BU5OyVXS.js → layout-BvulCiLM.js} +1 -1
  78. package/dist/client/assets/{lean-canvas-recruit-modal-BpJpmMV7.js → lean-canvas-recruit-modal-D54L-ueX.js} +1 -1
  79. package/dist/client/assets/{login-mUATXvn9.js → login-VLvQus3r.js} +1 -1
  80. package/dist/client/assets/{members-CEd1LJk0.js → members-Tmd-6nti.js} +1 -1
  81. package/dist/client/assets/{monaco-editor-BnguFt9B.js → monaco-editor-BIIx6Osu.js} +1 -1
  82. package/dist/client/assets/{monitoring-stats-row-DRhzCagY.js → monitoring-stats-row-DfQoN4dU.js} +1 -1
  83. package/dist/client/assets/{oauth-callback-BeAxhA0O.js → oauth-callback-COaviXzZ.js} +1 -1
  84. package/dist/client/assets/{oauth-callback-ai-provider-BNMpbB2T.js → oauth-callback-ai-provider-CeDoTmGO.js} +1 -1
  85. package/dist/client/assets/{onboarding-DXyWyIV-.js → onboarding-DMIifXKD.js} +1 -1
  86. package/dist/client/assets/{org-layout-DJZ7Z_p1.js → org-layout-CkCSATkV.js} +1 -1
  87. package/dist/client/assets/{org-plugin-layout-nQpaPqCP.js → org-plugin-layout-lYj2r1Ln.js} +1 -1
  88. package/dist/client/assets/{plugin-empty-state-D4pz75Eg.js → plugin-empty-state-BCI2akiJ.js} +1 -1
  89. package/dist/client/assets/{plugin-header-D_Oa6gN8.js → plugin-header--LbVNTsl.js} +1 -1
  90. package/dist/client/assets/{plugin-layout-csD4Blom.js → plugin-layout-Dhbi8qfO.js} +1 -1
  91. package/dist/client/assets/{popover-C6ihUqMx.js → popover-DL7_3A88.js} +1 -1
  92. package/dist/client/assets/{profile-725q4zwE.js → profile-CYehHV8y.js} +1 -1
  93. package/dist/client/assets/{project-app-view-BgI1ObN0.js → project-app-view-B680Vk1Z.js} +1 -1
  94. package/dist/client/assets/registry-D5sX2gio.js +2 -0
  95. package/dist/client/assets/{registry-layout-CZiwWJ4l.js → registry-layout-CEoOd_Wq.js} +1 -1
  96. package/dist/client/assets/{required-auth-layout-DYZPY8fJ.js → required-auth-layout-9J8EILU3.js} +1 -1
  97. package/dist/client/assets/{reset-password-D92BxTuZ.js → reset-password-CzSWUiKA.js} +1 -1
  98. package/dist/client/assets/{scroll-area-BjkPDLjB.js → scroll-area-CrjX3IME.js} +1 -1
  99. package/dist/client/assets/{search-input-BsH-Fhn1.js → search-input-DmblMA4A.js} +1 -1
  100. package/dist/client/assets/{select-ByGBjkSM.js → select-BQ3zutkO.js} +1 -1
  101. package/dist/client/assets/{select-model-ipn8mtVw.js → select-model-Cbrp8hD-.js} +1 -1
  102. package/dist/client/assets/{settings-layout-DaVsMStD.js → settings-layout-BxZT4ePy.js} +1 -1
  103. package/dist/client/assets/{shell-layout-CBHcQlP6.js → shell-layout-DrONQ6vr.js} +1 -1
  104. package/dist/client/assets/{skeleton-CKW2-ArL.js → skeleton-CmnvTWJg.js} +1 -1
  105. package/dist/client/assets/{sso-GNLrvSnU.js → sso-Csn8t5YG.js} +1 -1
  106. package/dist/client/assets/{store-Bv7PRV1N.js → store-B5WMfqFO.js} +1 -1
  107. package/dist/client/assets/store-registry-MW9ZrAsP.js +2 -0
  108. package/dist/client/assets/{switch-D_oyEj-7.js → switch-CM_vPUzz.js} +1 -1
  109. package/dist/client/assets/{table-DmvqYMYA.js → table-S8IBqobR.js} +1 -1
  110. package/dist/client/assets/{tabs-CHeB-_P1.js → tabs-B14EKG0Q.js} +1 -1
  111. package/dist/client/assets/{task-status-CGy28UD5.js → task-status-CoVKDaYE.js} +1 -1
  112. package/dist/client/assets/{textarea-Bo2Nbyc2.js → textarea-Bxm5HSBV.js} +1 -1
  113. package/dist/client/assets/{toggle-group-hicYHCaj.js → toggle-group-xjN2RMip.js} +1 -1
  114. package/dist/client/assets/{tools-list-Bc5L72jI.js → tools-list-DqbhkVqY.js} +1 -1
  115. package/dist/client/assets/{types-Qy_lXSZi.js → types-DA2UHbyR.js} +1 -1
  116. package/dist/client/assets/{use-ai-providers-D5svCGwH.js → use-ai-providers-LqR26vuo.js} +1 -1
  117. package/dist/client/assets/{use-collections-C9mDhhDp.js → use-collections-Bo1B5pfj.js} +1 -1
  118. package/dist/client/assets/{use-connection-labJovV0.js → use-connection-NZXO3HH3.js} +1 -1
  119. package/dist/client/assets/{use-copy-C--xeydh.js → use-copy-BRihc-l2.js} +1 -1
  120. package/dist/client/assets/{use-create-virtual-mcp-Dmy-tzU3.js → use-create-virtual-mcp-DgwS04N8.js} +1 -1
  121. package/dist/client/assets/{use-decopilot-events-BQ6lKiUz.js → use-decopilot-events-cbOJk-u-.js} +1 -1
  122. package/dist/client/assets/{use-delete-connection-Bj5gBc4Q.js → use-delete-connection-_oGK4bpj.js} +1 -1
  123. package/dist/client/assets/{use-infinite-scroll-CSBdO1Tg.js → use-infinite-scroll-BE8Qm8G-.js} +1 -1
  124. package/dist/client/assets/{use-list-state-BjQoZx3U.js → use-list-state-CeUQEO5I.js} +1 -1
  125. package/dist/client/assets/{use-mcp-tools-C0TDyIdf.js → use-mcp-tools-DqNbK4tC.js} +1 -1
  126. package/dist/client/assets/{use-members-BJMZeTol.js → use-members-DH_gyd2k.js} +1 -1
  127. package/dist/client/assets/{use-mobile-49sQdb0b.js → use-mobile-UG3f-VUD.js} +1 -1
  128. package/dist/client/assets/{use-navigate-to-agent-DHv3qU4y.js → use-navigate-to-agent-CDgOtsNz.js} +1 -1
  129. package/dist/client/assets/{use-org-sso-DZn2rTnY.js → use-org-sso-eSfysoE_.js} +1 -1
  130. package/dist/client/assets/{use-organization-settings-BhA6YmfT.js → use-organization-settings-bbuIudaf.js} +1 -1
  131. package/dist/client/assets/{use-registry-connections-Bvn4-1Jy.js → use-registry-connections-DN_uk-6v.js} +1 -1
  132. package/dist/client/assets/{use-status-sounds-hwHn7ByT.js → use-status-sounds-e0qVVZe8.js} +1 -1
  133. package/dist/client/assets/{use-tasks-CEfchIrz.js → use-tasks-DkVJbPPF.js} +1 -1
  134. package/dist/client/assets/{use-view-mode-BZEJDQ3u.js → use-view-mode-BvSJEzBA.js} +1 -1
  135. package/dist/client/assets/{use-virtual-mcp-kjgk684A.js → use-virtual-mcp-Doro-WnT.js} +1 -1
  136. package/dist/client/assets/useInfiniteQuery-C5UYrvtb.js +1 -0
  137. package/dist/client/assets/{user-DxIuCi_O.js → user-DMxAeRCM.js} +1 -1
  138. package/dist/client/assets/{view-mode-toggle-KKeD1zNQ.js → view-mode-toggle-B0na2o09.js} +1 -1
  139. package/dist/client/assets/{workflow-3PvqRa7g.js → workflow-BOEOo5nq.js} +1 -1
  140. package/dist/client/assets/workflow-detail-IfcsUNZf.js +1 -0
  141. package/dist/client/index.html +1 -1
  142. package/dist/server/cli.js +1 -1
  143. package/package.json +1 -1
  144. package/dist/client/assets/ai-providers-DNv3Q1EX.js +0 -1
  145. package/dist/client/assets/registry-DiyPXzzy.js +0 -2
  146. package/dist/client/assets/store-registry-IxsRTF9k.js +0 -2
  147. package/dist/client/assets/useInfiniteQuery-Bices_FL.js +0 -1
  148. package/dist/client/assets/workflow-detail-BLyd9EdB.js +0 -1
  149. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  150. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  151. package/dist/server/node_modules/ansi-styles/license +0 -9
  152. package/dist/server/node_modules/ansi-styles/package.json +0 -54
  153. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
  154. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  155. package/dist/server/node_modules/postgres-array/index.js +0 -97
  156. package/dist/server/node_modules/postgres-array/license +0 -21
  157. package/dist/server/node_modules/postgres-array/package.json +0 -35
  158. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  159. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  160. package/dist/server/node_modules/postgres-bytea/license +0 -21
  161. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  162. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
@@ -1,4 +1,4 @@
1
- import{r as O,J as xt,v as se,y as z,aL as Le,aJ as be,a$ as ve,aK as we,e as $,j as l,E as De,s as ne,o as fe,a as le,K as X,n as Ke,c as ie,x as je,w as ye,z as Y,aC as pe,t as Z,B as te,aE as $e,u as pt,f as gt,D as bt}from"./index-C27Pbex0.js";import{C as vt}from"./checkbox-CqcJoypg.js";import{I as oe}from"./input-BMDCCsVs.js";import{d as Ue,c as Be,a as jt,D as Ve,e as yt,b as We,h as St}from"./dialog-BEtDzaNY.js";import{g as Nt,a as wt,b as _t,c as Ct}from"./drawer-BXhHhfPv.js";import{u as It}from"./use-mobile-49sQdb0b.js";import{a as kt,c as Et,d as Mt,S as At,b as Ot}from"./select-ByGBjkSM.js";import{S as W}from"./skeleton-CKW2-ArL.js";import{i as Tt,t as Rt,b as Pt,a as zt,c as Ft}from"./Tool01-1Tm6sx2D.js";import{b as qe,d as He,s as Qe,a as Ge,e as Lt,c as Dt,i as Kt}from"./SearchMd-A2WzjBhy.js";import{t as _e}from"./ChevronDown-xWqM1qJV.js";import{a as $t}from"./Settings02-uCCFk89X.js";import{u as ae,b as Ye,a as ue}from"./use-ai-providers-D5svCGwH.js";import{p as Ce,u as Xe}from"./chat-context-CXS-qe2G.js";import{g as Se}from"./ai-providers-logos-CS4PCiqI.js";import{i as Ut}from"./Zap-Ct-Bt-7a.js";import{i as Bt}from"./AlertCircle-CJ_7BsPP.js";import{i as Vt}from"./CheckCircle-smRbUGaN.js";import{s as Wt}from"./Trash01-2of3D7QX.js";import{P as he}from"./index-DsXJm4s8.js";import{C as Je,b as qt,c as Ht,a as Qt}from"./card-fcmwdw-g.js";import{S as Gt}from"./switch-D_oyEj-7.js";import{a as Ie,T as Yt}from"./toggle-group-hicYHCaj.js";import{A as Xt}from"./avatar-F9o71OJ0.js";import{c as Ze,b as et,d as tt,A as st,e as lt,g as it,a as nt,f as ot}from"./alert-dialog-P8pjafE2.js";import{S as ce,u as de}from"./constants-Cz3vSCG9.js";import{c as Jt,d as Zt}from"./use-organization-settings-BhA6YmfT.js";import{f as es}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ts}from"./unwrap-tool-result-BYXdCQMg.js";function re(t,e,s){let n=s.initialDeps??[],i,o=!0;function r(){var a,d,m;let c;s.key&&((a=s.debug)!=null&&a.call(s))&&(c=Date.now());const u=t();if(!(u.length!==n.length||u.some((v,b)=>n[b]!==v)))return i;n=u;let f;if(s.key&&((d=s.debug)!=null&&d.call(s))&&(f=Date.now()),i=e(...u),s.key&&((m=s.debug)!=null&&m.call(s))){const v=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-f)*100)/100,w=b/16,j=(x,y)=>{for(x=String(x);x.length<y;)x=" "+x;return x};console.info(`%c⏱ ${j(b,5)} /${j(v,5)} ms`,`
1
+ import{r as O,J as xt,v as se,y as z,aL as Le,aJ as be,a$ as ve,aK as we,e as $,j as l,E as De,s as ne,o as fe,a as le,K as X,n as Ke,c as ie,x as je,w as ye,z as Y,aC as pe,t as Z,B as te,aE as $e,u as pt,f as gt,D as bt}from"./index-BR4Tv9I4.js";import{C as vt}from"./checkbox-Cx3RPx8a.js";import{I as oe}from"./input-C6wlfqbz.js";import{d as Ue,c as Be,a as jt,D as Ve,e as yt,b as We,h as St}from"./dialog-BG20y4ti.js";import{g as Nt,a as wt,b as _t,c as Ct}from"./drawer-Gt9dvwHd.js";import{u as It}from"./use-mobile-UG3f-VUD.js";import{a as kt,c as Et,d as Mt,S as At,b as Ot}from"./select-BQ3zutkO.js";import{S as W}from"./skeleton-CmnvTWJg.js";import{i as Tt,t as Rt,b as Pt,a as zt,c as Ft}from"./Tool01-DV6LLMyv.js";import{b as qe,d as He,s as Qe,a as Ge,e as Lt,c as Dt,i as Kt}from"./SearchMd-BQ703EvX.js";import{t as _e}from"./ChevronDown-vRDN8zoj.js";import{a as $t}from"./Settings02-CZ-RzoRL.js";import{u as ae,b as Ye,a as ue}from"./use-ai-providers-LqR26vuo.js";import{p as Ce,u as Xe}from"./chat-context-BQqGEJhg.js";import{g as Se}from"./ai-providers-logos-CS4PCiqI.js";import{i as Ut}from"./Zap-kmaaq3eG.js";import{i as Bt}from"./AlertCircle-i753hIUr.js";import{i as Vt}from"./CheckCircle-BDNIuV_g.js";import{s as Wt}from"./Trash01-DeQUJecj.js";import{P as he}from"./index-BxuUqWWJ.js";import{C as Je,b as qt,c as Ht,a as Qt}from"./card-64W2yOQo.js";import{S as Gt}from"./switch-CM_vPUzz.js";import{a as Ie,T as Yt}from"./toggle-group-xjN2RMip.js";import{A as Xt}from"./avatar-BeRTzZHX.js";import{c as Ze,b as et,d as tt,A as st,e as lt,g as it,a as nt,f as ot}from"./alert-dialog-BJ0hwa2l.js";import{S as ce,u as de}from"./constants-CN6Il9QM.js";import{c as Jt,d as Zt}from"./use-organization-settings-bbuIudaf.js";import{f as es}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ts}from"./unwrap-tool-result-BYXdCQMg.js";function re(t,e,s){let n=s.initialDeps??[],i,o=!0;function r(){var a,d,m;let c;s.key&&((a=s.debug)!=null&&a.call(s))&&(c=Date.now());const u=t();if(!(u.length!==n.length||u.some((v,b)=>n[b]!==v)))return i;n=u;let f;if(s.key&&((d=s.debug)!=null&&d.call(s))&&(f=Date.now()),i=e(...u),s.key&&((m=s.debug)!=null&&m.call(s))){const v=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-f)*100)/100,w=b/16,j=(x,y)=>{for(x=String(x);x.length<y;)x=" "+x;return x};console.info(`%c⏱ ${j(b,5)} /${j(v,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,s?.key)}return s?.onChange&&!(o&&s.skipInitialOnChange)&&s.onChange(i),o=!1,i}return r.updateDeps=a=>{n=a},r}function ke(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const ss=(t,e)=>Math.abs(t-e)<1.01,ls=(t,e,s)=>{let n;return function(...i){t.clearTimeout(n),n=t.setTimeout(()=>e.apply(this,i),s)}},Ee=t=>{const{offsetWidth:e,offsetHeight:s}=t;return{width:e,height:s}},is=t=>t,ns=t=>{const e=Math.max(t.startIndex-t.overscan,0),s=Math.min(t.endIndex+t.overscan,t.count-1),n=[];for(let i=e;i<=s;i++)n.push(i);return n},os=(t,e)=>{const s=t.scrollElement;if(!s)return;const n=t.targetWindow;if(!n)return;const i=r=>{const{width:a,height:d}=r;e({width:Math.round(a),height:Math.round(d)})};if(i(Ee(s)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const d=r[0];if(d?.borderBoxSize){const m=d.borderBoxSize[0];if(m){i({width:m.inlineSize,height:m.blockSize});return}}i(Ee(s))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(s,{box:"border-box"}),()=>{o.unobserve(s)}},Me={passive:!0},Ae=typeof window>"u"?!0:"onscrollend"in window,rs=(t,e)=>{const s=t.scrollElement;if(!s)return;const n=t.targetWindow;if(!n)return;let i=0;const o=t.options.useScrollendEvent&&Ae?()=>{}:ls(n,()=>{e(i,!1)},t.options.isScrollingResetDelay),r=c=>()=>{const{horizontal:u,isRtl:h}=t.options;i=u?s.scrollLeft*(h&&-1||1):s.scrollTop,o(),e(i,c)},a=r(!0),d=r(!1);s.addEventListener("scroll",a,Me);const m=t.options.useScrollendEvent&&Ae;return m&&s.addEventListener("scrollend",d,Me),()=>{s.removeEventListener("scroll",a),m&&s.removeEventListener("scrollend",d)}},as=(t,e,s)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[s.options.horizontal?"inlineSize":"blockSize"])}return t[s.options.horizontal?"offsetWidth":"offsetHeight"]},cs=(t,{adjustments:e=0,behavior:s},n)=>{var i,o;const r=t+e;(o=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[n.options.horizontal?"left":"top"]:r,behavior:s})};class ds{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var s,n,i;return((i=(n=(s=this.targetWindow)==null?void 0:s.performance)==null?void 0:n.now)==null?void 0:i.call(n))??Date.now()},this.observer=(()=>{let s=null;const n=()=>s||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:s=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const r=()=>{const a=o.target,d=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var i;(i=n())==null||i.disconnect(),s=null},observe:i=>{var o;return(o=n())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=n())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=s=>{Object.entries(s).forEach(([n,i])=>{typeof i>"u"&&delete s[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:is,rangeExtractor:ns,onChange:()=>{},measureElement:as,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...s}},this.notify=s=>{var n,i;(i=(n=this.options).onChange)==null||i.call(n,this,s)},this.maybeNotify=re(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),s=>{this.notify(s)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(s=>s()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var s;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((s=this.scrollElement)==null?void 0:s.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(s,n)=>{const i=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=s[r];if(i.has(a.lane))continue;const d=o.get(a.lane);if(d==null||a.end>d.end?o.set(a.lane,a):a.end<d.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=re(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(s,n,i,o,r,a,d)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:s,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:d}),{key:!1}),this.getMeasurements=re(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:s,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:d},m)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>s)for(const f of this.laneAssignments.keys())f>=s&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===s&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),h=new Array(a).fill(void 0);for(let f=0;f<c;f++){const v=u[f];v&&(h[v.lane]=f)}for(let f=c;f<s;f++){const v=o(f),b=this.laneAssignments.get(f);let w,j;const x=d==="estimate"||m.has(v);if(b!==void 0&&this.options.lanes>1){w=b;const g=h[w],N=g!==void 0?u[g]:void 0;j=N?N.end+this.options.gap:n+i}else{const g=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f);j=g?g.end+this.options.gap:n+i,w=g?g.lane:f%this.options.lanes,this.options.lanes>1&&x&&this.laneAssignments.set(f,w)}const y=m.get(v),S=typeof y=="number"?y:this.options.estimateSize(f),_=j+S;u[f]={index:f,start:j,size:S,end:_,key:v,lane:w},h[w]=f}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=re(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(s,n,i,o)=>this.range=s.length>0&&n>0?ms({measurements:s,outerSize:n,scrollOffset:i,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=re(()=>{let s=null,n=null;const i=this.calculateRange();return i&&(s=i.startIndex,n=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,s,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,s,n]},(s,n,i,o,r)=>o===null||r===null?[]:s({startIndex:o,endIndex:r,overscan:n,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=s=>{const n=this.options.indexAttribute,i=s.getAttribute(n);return i?parseInt(i,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=s=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(i!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,i-o),a=Math.min(this.options.count-1,i+o);return s>=r&&s<=a}return!0},this.measureElement=s=>{if(!s){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(s),i=this.options.getItemKey(n),o=this.elementsCache.get(i);o!==s&&(o&&this.observer.unobserve(o),this.observer.observe(s),this.elementsCache.set(i,s)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(s,void 0,this))},this.resizeItem=(s,n)=>{var i;const o=this.measurementsCache[s];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=re(()=>[this.getVirtualIndexes(),this.getMeasurements()],(s,n)=>{const i=[];for(let o=0,r=s.length;o<r;o++){const a=s[o],d=n[a];i.push(d)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=s=>{const n=this.getMeasurements();if(n.length!==0)return ke(n[rt(0,n.length-1,i=>ke(n[i]).start,s)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const s=this.scrollElement.document.documentElement;return this.options.horizontal?s.scrollWidth-this.scrollElement.innerWidth:s.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(s,n,i=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=s>=r+o?"end":"start"),n==="center"?s+=(i-o)/2:n==="end"&&(s-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,s),0)},this.getOffsetForIndex=(s,n="auto")=>{s=Math.max(0,Math.min(s,this.options.count-1));const i=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[s];if(!r)return;if(n==="auto")if(r.end>=o+i-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&s===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(s,{align:n="start",behavior:i="auto"}={})=>{const o=this.getOffsetForAlignment(s,n),r=this.now();this.scrollState={index:null,align:n,behavior:i,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(s,{align:n="auto",behavior:i="auto"}={})=>{s=Math.max(0,Math.min(s,this.options.count-1));const o=this.getOffsetForIndex(s,n);if(!o)return;const[r,a]=o,d=this.now();this.scrollState={index:s,align:a,behavior:i,startedAt:d,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(s,{behavior:n="auto"}={})=>{const i=this.getScrollOffset()+s,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var s;const n=this.getMeasurements();let i;if(n.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((s=n[n.length-1])==null?void 0:s.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}i=Math.max(...o.filter(a=>a!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(s,{adjustments:n,behavior:i})=>{this.options.scrollToFn(s,{behavior:i,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=i!==this.scrollState.lastTargetOffset;if(!r&&ss(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=i,this.scrollState.behavior="auto",this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const rt=(t,e,s,n)=>{for(;t<=e;){const i=(t+e)/2|0,o=s(i);if(o<n)t=i+1;else if(o>n)e=i-1;else return i}return t>0?t-1:0};function ms({measurements:t,outerSize:e,scrollOffset:s,lanes:n}){const i=t.length-1,o=d=>t[d].start;if(t.length<=n)return{startIndex:0,endIndex:i};let r=rt(0,i,o,s),a=r;if(n===1)for(;a<i&&t[a].end<s+e;)a++;else if(n>1){const d=Array(n).fill(0);for(;a<i&&d.some(c=>c<s+e);){const c=t[a];d[c.lane]=c.end,a++}const m=Array(n).fill(s+e);for(;r>=0&&m.some(c=>c>=s);){const c=t[r];m[c.lane]=c.start,r--}r=Math.max(0,r-r%n),a=Math.min(i,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const Oe=typeof document<"u"?O.useLayoutEffect:O.useEffect;function us({useFlushSync:t=!0,...e}){const s=O.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;t&&r?xt.flushSync(s):s(),(a=e.onChange)==null||a.call(e,o,r)}},[i]=O.useState(()=>new ds(n));return i.setOptions(n),Oe(()=>i._didMount(),[]),Oe(()=>i._willUpdate()),i}function hs(t){return us({observeElementRect:os,observeElementOffset:rs,scrollToFn:cs,...t})}se({title:z(),url:z(),icon:z()});se({registries:be(z(),se({enabled:ve()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Le(z()).describe("List of MCP app_name or app_id values to hide from the store.")});const me=se({keyId:z(),modelId:z(),title:z().optional()}).nullable(),fs=se({enabled:ve(),chat:se({fast:me,smart:me,thinking:me}),image:me,webResearch:me});se({id:z().describe("Brand context ID"),name:z().describe("Company name"),domain:z().describe("Company domain (e.g. example.com)"),overview:z().describe("Company overview / description"),logo:z().nullable().optional().describe("Logo URL"),favicon:z().nullable().optional().describe("Favicon URL"),ogImage:z().nullable().optional().describe("OG image URL"),fonts:se({heading:z().optional().describe("Font family for headings"),body:z().optional().describe("Font family for body text"),code:z().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:se({primary:z().optional().describe("Primary brand color (hex)"),secondary:z().optional().describe("Secondary brand color (hex)"),accent:z().optional().describe("Accent / highlight color (hex)"),background:z().optional().describe("Background color (hex)"),foreground:z().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Le(be(z(),we())).nullable().optional().describe("Brand images"),metadata:be(z(),we()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:z().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ve().optional().describe("Whether this is the default brand for the organization")});function xs(t){const e=$.c(3),{error:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Bt,{size:16}),e[0]=n):n=e[0];let i;return e[1]!==s.message?(i=l.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,l.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",s.message]})]}),e[1]=s.message,e[2]=i):i=e[2],i}function Te(t){const e=$.c(27),{keys:s,onDelete:n,isDeleting:i}=t,[o,r]=O.useState(null);let a;if(e[0]!==o||e[1]!==s){let S;e[3]!==o?(S=_=>_.id===o,e[3]=o,e[4]=S):S=e[4],a=s.find(S),e[0]=o,e[1]=s,e[2]=a}else a=e[2];const d=a;let m;if(e[5]!==i||e[6]!==s){let S;e[8]!==i?(S=_=>l.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted/50 text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[l.jsx(qe,{size:14,className:"text-muted-foreground shrink-0"}),l.jsx("span",{className:"font-medium truncate",children:_.label}),l.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["added ",es(new Date(_.createdAt))," ago"]})]}),l.jsx("div",{onClick:gs,children:l.jsx(te,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",disabled:i,onClick:()=>r(_.id),children:l.jsx(Wt,{size:14})})})]},_.id),e[8]=i,e[9]=S):S=e[9],m=s.map(S),e[5]=i,e[6]=s,e[7]=m}else m=e[7];const c=!!o;let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=S=>!S&&r(null),e[10]=u):u=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(Ze,{children:"Delete API Key"}),e[11]=h):h=e[11];const f=d?.label;let v;e[12]!==f?(v=l.jsxs(et,{children:[h,l.jsxs(tt,{children:["This action cannot be undone. This will permanently delete"," ",l.jsx("span",{className:"font-medium text-foreground",children:f}),"."]})]}),e[12]=f,e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(st,{children:"Cancel"}),e[14]=b):b=e[14];let w;e[15]!==o||e[16]!==n?(w=l.jsxs(lt,{children:[b,l.jsx(it,{onClick:()=>{o&&(n(o),r(null))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[15]=o,e[16]=n,e[17]=w):w=e[17];let j;e[18]!==v||e[19]!==w?(j=l.jsxs(nt,{onClick:ps,children:[v,w]}),e[18]=v,e[19]=w,e[20]=j):j=e[20];let x;e[21]!==j||e[22]!==c?(x=l.jsx(ot,{open:c,onOpenChange:u,children:j}),e[21]=j,e[22]=c,e[23]=x):x=e[23];let y;return e[24]!==x||e[25]!==m?(y=l.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[m,x]}),e[24]=x,e[25]=m,e[26]=y):y=e[26],y}function ps(t){return t.stopPropagation()}function gs(t){return t.stopPropagation()}const bs=se({label:z().optional(),apiKey:z().min(1,"API key is required")});function vs(t){const e=$.c(61),{providerId:s,onCancel:n,onSuccess:i}=t,{org:o}=ne();let r;e[0]!==o.id?(r={connectionId:ce,orgId:o.id},e[0]=o.id,e[1]=r):r=e[1];const a=de(r),d=fe(),[m,c]=O.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={resolver:ye(bs),defaultValues:{label:"",apiKey:""}},e[2]=u):u=e[2];const{register:h,handleSubmit:f,formState:v}=je(u),{errors:b}=v;let w;e[3]!==a||e[4]!==s?(w=async q=>{await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:s,label:q.label||"Personal key",apiKey:q.apiKey}})},e[3]=a,e[4]=s,e[5]=w):w=e[5];let j;e[6]!==i||e[7]!==o.id||e[8]!==d?(j=()=>{d.invalidateQueries({queryKey:X.aiProviderKeys(o.id)}),d.invalidateQueries({queryKey:X.aiProviders(o.id)}),Y.success("Key saved successfully"),i()},e[6]=i,e[7]=o.id,e[8]=d,e[9]=j):j=e[9];let x;e[10]!==w||e[11]!==j?(x={mutationFn:w,onSuccess:j,onError:js},e[10]=w,e[11]=j,e[12]=x):x=e[12];const{mutate:y,isPending:S,error:_}=le(x);let g;e[13]!==y?(g=q=>y(q),e[13]=y,e[14]=g):g=e[14];let N;e[15]!==f||e[16]!==g?(N=f(g),e[15]=f,e[16]=g,e[17]=N):N=e[17];let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=I):I=e[18];let p;e[19]!==h?(p=h("label"),e[19]=h,e[20]=p):p=e[20];let C;e[21]!==p?(C=l.jsxs("div",{className:"space-y-1",children:[I,l.jsx(oe,{placeholder:"e.g. Personal key",...p,className:"h-8 text-sm"})]}),e[21]=p,e[22]=C):C=e[22];let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[23]=E):E=e[23];const k=m?"text":"password";let A;e[24]!==h?(A=h("apiKey"),e[24]=h,e[25]=A):A=e[25];let M;e[26]!==k||e[27]!==A?(M=l.jsx(oe,{type:k,placeholder:"sk-...",...A,className:"ph-no-capture h-8 text-sm pr-8"}),e[26]=k,e[27]=A,e[28]=M):M=e[28];let T;e[29]!==m?(T=()=>c(!m),e[29]=m,e[30]=T):T=e[30];let F;e[31]!==m?(F=m?l.jsx(He,{size:14}):l.jsx(Qe,{size:14}),e[31]=m,e[32]=F):F=e[32];let R;e[33]!==T||e[34]!==F?(R=l.jsx("button",{type:"button",onClick:T,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[33]=T,e[34]=F,e[35]=R):R=e[35];let L;e[36]!==M||e[37]!==R?(L=l.jsxs("div",{className:"relative",children:[M,R]}),e[36]=M,e[37]=R,e[38]=L):L=e[38];let U;e[39]!==b.apiKey?(U=b.apiKey&&l.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[39]=b.apiKey,e[40]=U):U=e[40];let Q;e[41]!==L||e[42]!==U?(Q=l.jsxs("div",{className:"space-y-1",children:[E,L,U]}),e[41]=L,e[42]=U,e[43]=Q):Q=e[43];let B;e[44]!==_?(B=_&&l.jsx("p",{className:"text-xs text-destructive",children:_.message}),e[44]=_,e[45]=B):B=e[45];let D;e[46]!==S||e[47]!==n?(D=l.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:S,children:"Cancel"}),e[46]=S,e[47]=n,e[48]=D):D=e[48];const V=S?"Saving...":"Save Key";let K;e[49]!==S||e[50]!==V?(K=l.jsx(te,{type:"submit",size:"sm",disabled:S,children:V}),e[49]=S,e[50]=V,e[51]=K):K=e[51];let H;e[52]!==D||e[53]!==K?(H=l.jsxs(We,{children:[D,K]}),e[52]=D,e[53]=K,e[54]=H):H=e[54];let G;return e[55]!==C||e[56]!==Q||e[57]!==B||e[58]!==H||e[59]!==N?(G=l.jsxs("form",{onSubmit:N,className:"space-y-3",children:[C,Q,B,H]}),e[55]=C,e[56]=Q,e[57]=B,e[58]=H,e[59]=N,e[60]=G):G=e[60],G}function js(t){Y.error(`Failed to save key: ${t.message}`)}const ys=se({label:z().optional(),baseUrl:z().min(1,"Base URL is required"),apiKey:z().optional()});function Ss(t){const e=$.c(66),{onCancel:s,onSuccess:n}=t,{org:i}=ne();let o;e[0]!==i.id?(o={connectionId:ce,orgId:i.id},e[0]=i.id,e[1]=o):o=e[1];const r=de(o),a=fe(),[d,m]=O.useState(!1);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={resolver:ye(ys),defaultValues:{label:"",baseUrl:"",apiKey:""}},e[2]=c):c=e[2];const{register:u,handleSubmit:h,formState:f}=je(c),{errors:v}=f;let b;e[3]!==r?(b=async P=>{const J=JSON.stringify({baseUrl:P.baseUrl,apiKey:P.apiKey||""});await r.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:P.label||P.baseUrl,apiKey:J}})},e[3]=r,e[4]=b):b=e[4];let w;e[5]!==n||e[6]!==i.id||e[7]!==a?(w=()=>{a.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:X.aiProviders(i.id)}),Y.success("Connection saved successfully"),n()},e[5]=n,e[6]=i.id,e[7]=a,e[8]=w):w=e[8];let j;e[9]!==b||e[10]!==w?(j={mutationFn:b,onSuccess:w,onError:Ns},e[9]=b,e[10]=w,e[11]=j):j=e[11];const{mutate:x,isPending:y,error:S}=le(j);let _;e[12]!==x?(_=P=>x(P),e[12]=x,e[13]=_):_=e[13];let g;e[14]!==h||e[15]!==_?(g=h(_),e[14]=h,e[15]=_,e[16]=g):g=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[17]=N):N=e[17];let I;e[18]!==u?(I=u("label"),e[18]=u,e[19]=I):I=e[19];let p;e[20]!==I?(p=l.jsxs("div",{className:"space-y-1",children:[N,l.jsx(oe,{placeholder:"e.g. LiteLLM, Ollama",...I,className:"h-8 text-sm"})]}),e[20]=I,e[21]=p):p=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),e[22]=C):C=e[22];let E;e[23]!==u?(E=u("baseUrl"),e[23]=u,e[24]=E):E=e[24];let k;e[25]!==E?(k=l.jsx(oe,{type:"url",placeholder:"http://localhost:4000/v1",...E,className:"h-8 text-sm"}),e[25]=E,e[26]=k):k=e[26];let A;e[27]!==v.baseUrl?(A=v.baseUrl&&l.jsx("p",{className:"text-xs text-destructive",children:v.baseUrl.message}),e[27]=v.baseUrl,e[28]=A):A=e[28];let M;e[29]!==k||e[30]!==A?(M=l.jsxs("div",{className:"space-y-1",children:[C,k,A]}),e[29]=k,e[30]=A,e[31]=M):M=e[31];let T;e[32]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key ",l.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),e[32]=T):T=e[32];const F=d?"text":"password";let R;e[33]!==u?(R=u("apiKey"),e[33]=u,e[34]=R):R=e[34];let L;e[35]!==F||e[36]!==R?(L=l.jsx(oe,{type:F,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[35]=F,e[36]=R,e[37]=L):L=e[37];let U;e[38]!==d?(U=()=>m(!d),e[38]=d,e[39]=U):U=e[39];let Q;e[40]!==d?(Q=d?l.jsx(He,{size:14}):l.jsx(Qe,{size:14}),e[40]=d,e[41]=Q):Q=e[41];let B;e[42]!==U||e[43]!==Q?(B=l.jsx("button",{type:"button",onClick:U,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Q}),e[42]=U,e[43]=Q,e[44]=B):B=e[44];let D;e[45]!==L||e[46]!==B?(D=l.jsxs("div",{className:"space-y-1",children:[T,l.jsxs("div",{className:"relative",children:[L,B]})]}),e[45]=L,e[46]=B,e[47]=D):D=e[47];let V;e[48]!==S?(V=S&&l.jsx("p",{className:"text-xs text-destructive",children:S.message}),e[48]=S,e[49]=V):V=e[49];let K;e[50]!==y||e[51]!==s?(K=l.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:y,children:"Cancel"}),e[50]=y,e[51]=s,e[52]=K):K=e[52];const H=y?"Saving...":"Save Connection";let G;e[53]!==y||e[54]!==H?(G=l.jsx(te,{type:"submit",size:"sm",disabled:y,children:H}),e[53]=y,e[54]=H,e[55]=G):G=e[55];let q;e[56]!==K||e[57]!==G?(q=l.jsxs(We,{children:[K,G]}),e[56]=K,e[57]=G,e[58]=q):q=e[58];let ee;return e[59]!==p||e[60]!==M||e[61]!==D||e[62]!==V||e[63]!==q||e[64]!==g?(ee=l.jsxs("form",{onSubmit:g,className:"space-y-3",children:[p,M,D,V,q]}),e[59]=p,e[60]=M,e[61]=D,e[62]=V,e[63]=q,e[64]=g,e[65]=ee):ee=e[65],ee}function Ns(t){Y.error(`Failed to save connection: ${t.message}`)}function Re({provider:t,keys:e}){const{org:s}=ne(),n=de({connectionId:ce,orgId:s.id}),i=fe(),[o,r]=O.useState(!1),[a,d]=O.useState(!1),[m,c]=O.useState(null),u=t.supportedMethods.includes("cli-activate"),h=e.length>0,{mutate:f,isPending:v}=le({mutationFn:async p=>(await n.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:p}}),p),onSuccess:p=>{i.invalidateQueries({queryKey:X.aiProviderKeys(s.id)}),i.invalidateQueries({queryKey:X.aiProviders(s.id)}),i.invalidateQueries({queryKey:X.aiProviderModels(s.id,p)}),Y.success("Key deleted")},onError:p=>{Y.error(`Failed to delete key: ${p.message}`)}}),{mutate:b}=le({mutationFn:async({code:p,stateToken:C})=>{const E=await n.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:t.id,code:p,stateToken:C,label:"Connected via OAuth"}});if(E?.isError){const k=E.content?.[0]?.text??"OAuth exchange failed";throw new Error(k)}},onSuccess:()=>{Z("ai_provider_oauth_succeeded",{provider_id:t.id}),i.invalidateQueries({queryKey:X.aiProviderKeys(s.id)}),i.invalidateQueries({queryKey:X.aiProviders(s.id)}),Y.success(`${t.name} connected successfully`),d(!1),c(null)},onError:p=>{Z("ai_provider_oauth_failed",{provider_id:t.id,error:p.message}),Y.error(`OAuth connection failed: ${p.message}`),d(!1),c(null)}}),{mutate:w,isPending:j}=le({mutationFn:async()=>{const p=await n.callTool({name:"AI_PROVIDER_CLI_ACTIVATE",arguments:{providerId:t.id}});if(p?.isError)throw new Error(p.content?.[0]?.text??"CLI activation failed");return p.structuredContent},onSuccess:p=>{if(!p?.activated){Z("ai_provider_cli_activate_failed",{provider_id:t.id,error:p?.error??"unknown"}),Y.error(p?.error??"CLI activation failed");return}Z("ai_provider_cli_activated",{provider_id:t.id}),i.invalidateQueries({queryKey:X.aiProviderKeys(s.id)}),i.invalidateQueries({queryKey:X.aiProviders(s.id)}),Y.success(`${t.name} activated`)},onError:p=>{Z("ai_provider_cli_activate_failed",{provider_id:t.id,error:p.message}),Y.error(p.message)}}),{mutate:x,isPending:y}=le({mutationFn:async()=>{const p=await n.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:t.id}});if(p?.isError){const C=p.content?.[0]?.text??"Key provisioning failed";throw new Error(C)}},onSuccess:()=>{Z("ai_provider_provision_succeeded",{provider_id:t.id}),i.invalidateQueries({queryKey:X.aiProviderKeys(s.id)}),i.invalidateQueries({queryKey:X.aiProviders(s.id)}),Y.success(`${t.name} connected successfully`)},onError:p=>{Z("ai_provider_provision_failed",{provider_id:t.id,error:p.message}),Y.error(`Failed to connect ${t.name}: ${p.message}`)}});O.useEffect(()=>{if(!a||!m)return;let p=!1;const C=k=>{if(k.origin===window.location.origin&&k.data?.type==="AI_PROVIDER_OAUTH_CALLBACK"){const{code:A,stateToken:M}=k.data;M===m?(p=!0,b({code:A,stateToken:M})):(console.error("State token mismatch"),Y.error("Security check failed: State token mismatch"),d(!1),c(null))}};window.addEventListener("message",C);const E=setTimeout(()=>{p||(Z("ai_provider_oauth_timeout",{provider_id:t.id}),d(!1),c(null),Y.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",C),clearTimeout(E)}},[a,m,b,t.id]);const S=!!t.supportsProvision,_=t.supportedMethods.includes("oauth-pkce"),g=t.supportedMethods.includes("api-key"),N=()=>{if(!(o||a||j||y)){if(u){h||(Z("ai_provider_connect_clicked",{provider_id:t.id,method:"cli-activate"}),w());return}S?(Z("ai_provider_connect_clicked",{provider_id:t.id,method:"provision"}),x()):_?(Z("ai_provider_connect_clicked",{provider_id:t.id,method:"oauth-pkce"}),I()):g&&(Z("ai_provider_connect_clicked",{provider_id:t.id,method:"api-key"}),r(!0))}},I=async()=>{try{d(!0);const p=await n.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:t.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(p.structuredContent)c(p.structuredContent.stateToken),window.open(p.structuredContent.url,"AiProviderOAuth","width=600,height=700");else throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL")}catch(p){d(!1),Y.error(`Failed to start OAuth: ${p instanceof Error?p.message:String(p)}`)}};return l.jsxs(l.Fragment,{children:[l.jsxs(Je,{className:ie("p-4 flex flex-col gap-3 transition-colors relative",h&&"border-primary/20",!a&&!j&&!y&&"cursor-pointer hover:bg-muted/30",(a||j||y)&&"cursor-wait"),onClick:N,children:[h&&l.jsx("div",{className:"absolute top-4 right-4 w-2 h-2 rounded-full bg-green-500"}),l.jsx("div",{className:"flex items-start justify-between",children:l.jsxs("div",{className:"flex items-center gap-3",children:[t.logo?l.jsx("img",{src:t.logo,alt:t.name,className:"size-8 rounded-md object-contain dark:bg-white dark:rounded-md dark:p-0.5"}):l.jsx(Xt,{fallback:t.name.charAt(0),className:"size-8 bg-primary/10 text-primary"}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-base",children:t.name}),l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1",children:j?"Checking CLI...":y?"Connecting...":a?"Authorizing...":t.description})]})]})}),h&&l.jsx("div",{className:"mt-1",children:u?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Authenticated via ",t.name," CLI"]}),l.jsx(Te,{keys:e,onDelete:f,isDeleting:v})]}):l.jsxs(l.Fragment,{children:[!t.supportsCredits&&l.jsx("div",{className:"flex items-center justify-between",children:l.jsxs("p",{className:"text-xs font-medium text-muted-foreground",children:[e.length," key",e.length!==1?"s":""," configured"]})}),t.supportsCredits&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.length," key",e.length!==1?"s":""," configured · Managed above"]}),l.jsx(Te,{keys:e,onDelete:f,isDeleting:v})]})})]}),l.jsx(Ue,{open:o,onOpenChange:p=>{p||r(!1)},children:l.jsxs(Be,{children:[l.jsxs(jt,{children:[l.jsxs(Ve,{children:["Connect ",t.name]}),l.jsx(yt,{children:t.id==="openai-compatible"?"Enter the base URL and optional API key for your OpenAI-compatible endpoint.":`Add an API key to connect your ${t.name} account.`})]}),t.id==="openai-compatible"?l.jsx(Ss,{onCancel:()=>r(!1),onSuccess:()=>r(!1)}):l.jsx(vs,{providerId:t.id,onCancel:()=>r(!1),onSuccess:()=>r(!1)})]})})]})}function at(t){const e=$.c(20);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{hideProviderId:n}=s,i=Ye(),o=ae();let r,a,d,m;if(e[2]!==i?.providers||e[3]!==o||e[4]!==n){let h;e[9]!==n?(h=j=>j.id!==n,e[9]=n,e[10]=h):h=e[10];const f=(i?.providers??[]).filter(h),v=f.filter(_s),b=f.filter(ws);d="flex flex-col gap-5 w-full",m=v.length>0&&l.jsxs("div",{className:"relative rounded-xl border border-lime-400/30 bg-gradient-to-br from-lime-50/50 via-transparent to-yellow-50/30 dark:from-lime-950/20 dark:to-yellow-950/10 p-4",children:[l.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-lime-400/5 to-yellow-400/5 pointer-events-none"}),l.jsx("p",{className:"text-xs font-medium text-lime-700 dark:text-lime-400 mb-3 relative",children:"Local models — use your existing AI provider"}),l.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 relative",children:v.map(j=>l.jsx(Re,{provider:j,keys:o.filter(x=>x.providerId===j.id)},j.id))})]}),r="grid grid-cols-1 lg:grid-cols-2 gap-4";let w;e[11]!==o?(w=j=>l.jsx(Re,{provider:j,keys:o.filter(x=>x.providerId===j.id)},j.id),e[11]=o,e[12]=w):w=e[12],a=b.map(w),e[2]=i?.providers,e[3]=o,e[4]=n,e[5]=r,e[6]=a,e[7]=d,e[8]=m}else r=e[5],a=e[6],d=e[7],m=e[8];let c;e[13]!==r||e[14]!==a?(c=l.jsx("div",{className:r,children:a}),e[13]=r,e[14]=a,e[15]=c):c=e[15];let u;return e[16]!==d||e[17]!==m||e[18]!==c?(u=l.jsxs("div",{className:d,children:[m,c]}),e[16]=d,e[17]=m,e[18]=c,e[19]=u):u=e[19],u}function ws(t){return!t.supportedMethods.includes("cli-activate")}function _s(t){return t.supportedMethods.includes("cli-activate")}const Cs={usd:[10,20,100],brl:[50,100,500]};function Is(){const t=$.c(28),{org:e}=ne();let s;t[0]!==e.id?(s={connectionId:ce,orgId:e.id},t[0]=e.id,t[1]=s):s=t[1];const n=de(s),[i,o]=O.useState(!1),{mutate:r,isPending:a}=le({mutationFn:async N=>{const I=await n.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:N,currency:h}});if(I?.isError)throw new Error(I.content?.[0]?.text??"Failed to get top-up URL");return I.structuredContent?.url},onSuccess:Es,onError:ks}),[d,m]=O.useState(""),[c,u]=O.useState("usd"),h=c,f=parseFloat(d),v=!isNaN(f)&&f>=1,b=h==="brl"?"R$":"$";let w;t[2]!==u?(w=N=>{N&&u(N)},t[2]=u,t[3]=w):w=t[3];let j,x;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(Ie,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),x=l.jsx(Ie,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),t[4]=j,t[5]=x):(j=t[4],x=t[5]);let y;t[6]!==h||t[7]!==w?(y=l.jsxs(Yt,{type:"single",variant:"outline",size:"default",value:h,onValueChange:w,children:[j,x]}),t[6]=h,t[7]=w,t[8]=y):y=t[8];let S;t[9]!==h||t[10]!==b||t[11]!==i||t[12]!==a||t[13]!==r?(S=!i&&l.jsxs(l.Fragment,{children:[Cs[h].map(N=>l.jsxs(te,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:a,onClick:()=>r(N*100),children:[b,N]},N)),l.jsx(te,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>o(!0),disabled:a,children:"Custom"})]}),t[9]=h,t[10]=b,t[11]=i,t[12]=a,t[13]=r,t[14]=S):S=t[14];let _;t[15]!==b||t[16]!==d||t[17]!==f||t[18]!==i||t[19]!==v||t[20]!==a||t[21]!==m||t[22]!==r?(_=i&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative max-w-[140px]",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:b}),l.jsx(oe,{type:"number",min:"1",step:"1",placeholder:"50",value:d,onChange:N=>m(N.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),l.jsx(te,{className:"h-10",disabled:!v||a,onClick:()=>r(Math.round(f*100)),children:a?"...":"Add"}),l.jsx(te,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{o(!1),m("")},children:"Cancel"})]}),t[15]=b,t[16]=d,t[17]=f,t[18]=i,t[19]=v,t[20]=a,t[21]=m,t[22]=r,t[23]=_):_=t[23];let g;return t[24]!==y||t[25]!==S||t[26]!==_?(g=l.jsx("div",{className:"flex flex-col gap-2.5",children:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y,S,_]})}),t[24]=y,t[25]=S,t[26]=_,t[27]=g):g=t[27],g}function ks(t){Y.error(`Top-up failed: ${t.message}`)}function Es(t){t&&window.open(t,"_blank","noopener,noreferrer")}function Ms(t){return t<=0?"text-destructive":t<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function As(){const t=$.c(59),{org:e}=ne();let s;t[0]!==e.id?(s={connectionId:ce,orgId:e.id},t[0]=e.id,t[1]=s):s=t[1];const n=de(s),i=fe(),o=ae();let r;t[2]!==o?(r=o.find(Ts),t[2]=o,t[3]=r):r=t[3];const a=r,[d,m]=O.useState(!1);let c;t[4]!==n||t[5]!==a?(c=async()=>{a&&await n.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:a.id}})},t[4]=n,t[5]=a,t[6]=c):c=t[6];let u;t[7]!==e.id||t[8]!==i?(u=()=>{i.invalidateQueries({queryKey:X.aiProviderKeys(e.id)}),i.invalidateQueries({queryKey:X.aiProviders(e.id)}),Y.success("Deco AI Gateway disconnected"),m(!1)},t[7]=e.id,t[8]=i,t[9]=u):u=t[9];let h;t[10]!==c||t[11]!==u?(h={mutationFn:c,onSuccess:u,onError:Os},t[10]=c,t[11]=u,t[12]=h):h=t[12];const{mutate:f,isPending:v}=le(h);let b;t[13]!==e.id?(b=X.aiProviderCredits(e.id,"deco"),t[13]=e.id,t[14]=b):b=t[14];const w=!!a;let j;t[15]!==n?(j=async()=>{const ee=await n.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return ee?.isError?null:ee.structuredContent??null},t[15]=n,t[16]=j):j=t[16];let x;t[17]!==b||t[18]!==w||t[19]!==j?(x={queryKey:b,enabled:w,staleTime:6e4,queryFn:j},t[17]=b,t[18]=w,t[19]=j,t[20]=x):x=t[20];const{data:y,isLoading:S,refetch:_,isFetching:g}=Ke(x);if(!a)return null;const N=y?.balanceCents!=null?y.balanceCents/100:null;let I;t[21]!==N?(I=N!=null?`$${N.toFixed(2)}`:"—",t[21]=N,t[22]=I):I=t[22];const p=I;let C;t[23]===Symbol.for("react.memo_cache_sentinel")?(C=ie("relative rounded-xl overflow-hidden","border border-border","bg-gradient-to-br from-background via-muted/30 to-background"),t[23]=C):C=t[23];let E;t[24]===Symbol.for("react.memo_cache_sentinel")?(E=l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Deco AI Gateway"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})]})]}),t[24]=E):E=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(!0),t[25]=k):k=t[25];let A;t[26]!==v?(A=l.jsxs("div",{className:"flex items-center justify-between mb-5",children:[E,l.jsx(te,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:k,disabled:v,children:"Disconnect"})]}),t[26]=v,t[27]=A):A=t[27];let M;t[28]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsxs(et,{children:[l.jsx(Ze,{children:"Disconnect Deco AI Gateway"}),l.jsx(tt,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),t[28]=M):M=t[28];let T;t[29]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx(st,{children:"Cancel"}),t[29]=T):T=t[29];let F;t[30]!==f?(F=l.jsxs(nt,{children:[M,l.jsxs(lt,{children:[T,l.jsx(it,{onClick:()=>f(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),t[30]=f,t[31]=F):F=t[31];let R;t[32]!==d||t[33]!==F?(R=l.jsx(ot,{open:d,onOpenChange:m,children:F}),t[32]=d,t[33]=F,t[34]=R):R=t[34];let L;t[35]!==N||t[36]!==p||t[37]!==g||t[38]!==S?(L=S||g?l.jsx(W,{className:"h-9 w-24"}):l.jsx("span",{className:ie("text-3xl font-semibold tabular-nums tracking-tight",N!=null&&Ms(N)),children:p}),t[35]=N,t[36]=p,t[37]=g,t[38]=S,t[39]=L):L=t[39];let U;t[40]!==_?(U=()=>_(),t[40]=_,t[41]=U):U=t[41];const Q=g&&"animate-spin";let B;t[42]!==Q?(B=ie(Q),t[42]=Q,t[43]=B):B=t[43];let D;t[44]!==B?(D=l.jsx($e,{size:14,className:B}),t[44]=B,t[45]=D):D=t[45];let V;t[46]!==g||t[47]!==U||t[48]!==D?(V=l.jsx("button",{type:"button",onClick:U,disabled:g,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:D}),t[46]=g,t[47]=U,t[48]=D,t[49]=V):V=t[49];let K;t[50]!==L||t[51]!==V?(K=l.jsxs("div",{className:"flex items-baseline gap-2",children:[L,V]}),t[50]=L,t[51]=V,t[52]=K):K=t[52];let H;t[53]===Symbol.for("react.memo_cache_sentinel")?(H=l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Available credit balance"}),t[53]=H):H=t[53];let G;t[54]===Symbol.for("react.memo_cache_sentinel")?(G=l.jsxs("div",{className:"mt-5 pt-4 border-t border-border/60",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),l.jsx(Is,{})]}),t[54]=G):G=t[54];let q;return t[55]!==A||t[56]!==R||t[57]!==K?(q=l.jsx("div",{className:C,children:l.jsxs("div",{className:"relative p-6",children:[A,R,K,H,G]})}),t[55]=A,t[56]=R,t[57]=K,t[58]=q):q=t[58],q}function Os(t){Y.error(`Failed to disconnect: ${t.message}`)}function Ts(t){return t.providerId==="deco"}const Rs=t=>t.capabilities?.includes("image")===!0,Ps=t=>{const e=t.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return e.includes("sonar")||e.includes("deepresearch")},zs={fast:"Fast",smart:"Smart",thinking:"Thinking"},Fs={fast:"Fastest responses, best for quick tasks",smart:"Balanced speed and capability",thinking:"Most capable, best for complex tasks"};function ge(t){const e=$.c(30),{label:s,description:n,slot:i,onSlotChange:o,filterModels:r,defaultKeyId:a}=t,d=ae(),[m,c]=O.useState(i?.keyId??a);let u;e[0]!==i?(u=()=>{i?.keyId&&c(i.keyId)},e[0]=i,e[1]=u):u=e[1];const h=i?.keyId;let f;e[2]!==h?(f=[h],e[2]=h,e[3]=f):f=e[3],O.useEffect(u,f);const v=m??a;let b;e[4]!==v||e[5]!==d?(b=v?d.find(k=>k.id===v):null,e[4]=v,e[5]=d,e[6]=b):b=e[6];const w=b,{models:j,isLoading:x}=ue(r?v??void 0:void 0);let y;e[7]!==j||e[8]!==r||e[9]!==x?(y=r?x||j.some(r):!0,e[7]=j,e[8]=r,e[9]=x,e[10]=y):y=e[10];const S=y;let _;e[11]!==i||e[12]!==w?.providerId?(_=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:w?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[11]=i,e[12]=w?.providerId,e[13]=_):_=e[13];const g=_;let N;e[14]!==s?(N=l.jsx("p",{className:"text-sm font-medium text-foreground",children:s}),e[14]=s,e[15]=N):N=e[15];let I;e[16]!==n?(I=n&&l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n}),e[16]=n,e[17]=I):I=e[17];let p;e[18]!==N||e[19]!==I?(p=l.jsxs("div",{className:"min-w-0 flex-1",children:[N,I]}),e[18]=N,e[19]=I,e[20]=p):p=e[20];let C;e[21]!==v||e[22]!==r||e[23]!==S||e[24]!==o||e[25]!==g?(C=l.jsx("div",{className:"shrink-0",children:r&&!S?l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}):l.jsx(_l,{variant:"bordered",placeholder:"Pick model",model:g,credentialId:v,filterModels:r,onCredentialChange:k=>c(k),onModelChange:k=>{const A=k.keyId??v??"";c(A),o({keyId:A,modelId:k.modelId,title:k.title})}})}),e[21]=v,e[22]=r,e[23]=S,e[24]=o,e[25]=g,e[26]=C):C=e[26];let E;return e[27]!==C||e[28]!==p?(E=l.jsxs("div",{className:"flex items-center justify-between gap-4 py-2",children:[p,C]}),e[27]=C,e[28]=p,e[29]=E):E=e[29],E}function Ls(t){const e=$.c(2),{isPending:s,showSaved:n}=t;if(s){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx($e,{size:12,className:"animate-spin"}),"Saving…"]}),e[0]=i):i=e[0],i}if(n){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx(Vt,{size:12}),"Saved"]}),e[1]=i):i=e[1],i}return null}function Ds(){const t=ae(),e=Jt(),s=t.length>0,n=je({resolver:ye(fs),values:e,mode:"onChange"}),{mutate:i,isPending:o,isSuccess:r}=Zt(),a=n.watch(),d=n.formState.isDirty;O.useEffect(()=>{if(!d)return;const x=setTimeout(()=>{i(a,{onSuccess:()=>n.reset(a,{keepValues:!0}),onError:y=>{n.reset(e),Y.error(`Failed to save: ${y.message}`)}})},250);return()=>clearTimeout(x)},[a,d,i,n,e]);const m=t[0],c=t[1],u=t[2],{models:h}=ue(m?.id),{models:f}=ue(c?.id),{models:v}=ue(u?.id),b=x=>{const y=n.getValues("chat");if(x&&!y.fast&&!y.smart&&!y.thinking){const S={};m?.id&&(S[m.id]=h),c?.id&&(S[c.id]=f),u?.id&&(S[u.id]=v);const _=Ce(t,S);n.reset({enabled:!0,chat:_.chat,image:_.image,webResearch:_.webResearch},{keepDirty:!0})}else n.setValue("enabled",x,{shouldDirty:!0})};O.useEffect(()=>{s||n.reset({enabled:!1,chat:{fast:null,smart:null,thinking:null},image:null,webResearch:null})},[s,n]),O.useEffect(()=>{const x=n.getValues();if(!x.enabled)return;const y=new Set(t.map(k=>k.id)),S={};m?.id&&(S[m.id]=h),c?.id&&(S[c.id]=f),u?.id&&(S[u.id]=v);const _=k=>k!=null&&!y.has(k.keyId),g={fast:_(x.chat.fast)?null:x.chat.fast,smart:_(x.chat.smart)?null:x.chat.smart,thinking:_(x.chat.thinking)?null:x.chat.thinking},N=_(x.image)?null:x.image,I=_(x.webResearch)?null:x.webResearch,p=!g.fast||!g.smart||!g.thinking||!N||!I,C=g.fast===x.chat.fast&&g.smart===x.chat.smart&&g.thinking===x.chat.thinking;if(!p&&C)return;const E=Ce(t,S);n.reset({...x,chat:{fast:g.fast??E.chat.fast,smart:g.smart??E.chat.smart,thinking:g.thinking??E.chat.thinking},image:N??E.image,webResearch:I??E.webResearch},{keepDirty:!0})},[n,t,h,f,v,m?.id,c?.id,u?.id]);const j=n.watch("enabled")&&s;return l.jsxs(Je,{className:"p-6",children:[l.jsx(qt,{className:"p-0",children:l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ht,{className:"text-sm",children:"Simple model mode"}),l.jsx(Ls,{isPending:o,showSaved:r&&!d})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s?"Replace the model picker with a Fast / Smart / Thinking toggle for all members of this org.":"Connect an AI provider above to enable this feature."})]}),l.jsx(Gt,{checked:j,onCheckedChange:b,disabled:o||!s})]})}),j&&l.jsxs(Qt,{className:"flex flex-col p-0 mt-6",children:[l.jsxs("div",{className:"flex flex-col gap-1 pb-6",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Chat models"}),["fast","smart","thinking"].map(x=>l.jsx(pe,{control:n.control,name:`chat.${x}`,render:({field:y})=>l.jsx(ge,{label:zs[x],description:Fs[x],slot:y.value,defaultKeyId:t[0]?.id??null,onSlotChange:S=>y.onChange(S)})},x))]}),l.jsxs("div",{className:"flex flex-col gap-1 pt-6 border-t border-border/50",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Other models"}),l.jsx(pe,{control:n.control,name:"image",render:({field:x})=>l.jsx(ge,{label:"Image",slot:x.value,defaultKeyId:t[0]?.id??null,filterModels:Rs,onSlotChange:y=>x.onChange(y)})}),l.jsx(pe,{control:n.control,name:"webResearch",render:({field:x})=>l.jsx(ge,{label:"Web research",slot:x.value,defaultKeyId:t[0]?.id??null,filterModels:Ps,onSlotChange:y=>x.onChange(y)})})]})]})]})}function Ks(){const t=$.c(6),s=ae().some($s);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(As,{}),t[0]=n):n=t[0];const i=s?"deco":void 0;let o;t[1]!==i?(o=l.jsx(at,{hideProviderId:i}),t[1]=i,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx(O.Suspense,{fallback:l.jsx(W,{className:"h-16 w-full"}),children:l.jsx(Ds,{})}),t[3]=r):r=t[3];let a;return t[4]!==o?(a=l.jsxs("div",{className:"flex flex-col gap-6",children:[n,o,r]}),t[4]=o,t[5]=a):a=t[5],a}function $s(t){return t.providerId==="deco"}function li(){const t=$.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(he.Title,{children:"AI Providers"}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(he,{children:l.jsx(he.Content,{children:l.jsx(he.Body,{children:l.jsxs("div",{className:"flex flex-col gap-6",children:[e,l.jsx(De,{fallback:Us,children:l.jsx(O.Suspense,{fallback:l.jsx(W,{className:"h-64 w-full"}),children:l.jsx(Ks,{})})})]})})})}),t[1]=s):s=t[1],s}function Us(t){const{error:e}=t;return l.jsx(xs,{error:e??new Error("Failed to load AI providers")})}function Bs(){const t=$.c(9),{org:e}=ne();let s;t[0]!==e.id?(s={connectionId:ce,orgId:e.id},t[0]=e.id,t[1]=s):s=t[1];const n=de(s);let i;t[2]!==e.id?(i=X.defaultBrand(e.id),t[2]=e.id,t[3]=i):i=t[3];let o;t[4]!==n?(o=async()=>{const d=await n.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),m=ts(d);return(Array.isArray(m?.items)?m.items:[]).find(Vs)??null},t[4]=n,t[5]=o):o=t[5];let r;t[6]!==i||t[7]!==o?(r={queryKey:i,queryFn:o},t[6]=i,t[7]=o,t[8]=r):r=t[8];const{data:a}=Ke(r);return a??null}function Vs(t){return t.isDefault&&!t.archivedAt}function Ws(t){const e=t.colors;if(!e)return null;if(Array.isArray(e)){const s=e.find(i=>typeof i=="object"&&i!==null&&"label"in i&&/primary|brand|main/i.test(i.label)),n=s?s.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const s=e;return s.primary??Object.values(s)[0]??null}return null}function qs(t){const e=$.c(31);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{title:n,description:i}=s,{org:o}=ne(),{localMode:r}=pt(),a=Bs(),d=o.name;let m;e[2]!==a?(m=a?Ws(a):null,e[2]=a,e[3]=m):m=e[3];const c=m,u=a?.favicon??a?.logo??null,h=n??(d?`${d} is ready for agents`:"Your agents are almost ready"),f=i??"Choose how to power your AI team.",v=!!(u||c);let b;e[4]!==c?(b=c?{backgroundColor:`${c}18`,borderColor:`${c}30`}:void 0,e[4]=c,e[5]=b):b=e[5];const w=b,j=v?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-gradient-to-br from-lime-100 to-yellow-50 dark:from-lime-900/30 dark:to-yellow-900/20 border border-lime-300/40 dark:border-lime-700/30";let x;e[6]!==u||e[7]!==c?(x=u?l.jsx("img",{src:u,alt:"",className:"size-7 rounded object-contain"}):l.jsx(Ut,{size:24,style:c?{color:c}:void 0,className:ie(!c&&"text-lime-600 dark:text-lime-400")}),e[6]=u,e[7]=c,e[8]=x):x=e[8];let y;e[9]!==j||e[10]!==w||e[11]!==x?(y=l.jsx("div",{className:j,style:w,children:x}),e[9]=j,e[10]=w,e[11]=x,e[12]=y):y=e[12];let S;e[13]!==h?(S=l.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:h}),e[13]=h,e[14]=S):S=e[14];let _;e[15]!==f?(_=l.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:f}),e[15]=f,e[16]=_):_=e[16];let g;e[17]!==S||e[18]!==_?(g=l.jsxs("div",{className:"space-y-2",children:[S,_]}),e[17]=S,e[18]=_,e[19]=g):g=e[19];let N;e[20]!==y||e[21]!==g?(N=l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[y,g]}),e[20]=y,e[21]=g,e[22]=N):N=e[22];let I;e[23]!==r?(I=r&&l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Local models + use your existing AI provider"}),e[23]=r,e[24]=I):I=e[24];let p;e[25]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(O.Suspense,{fallback:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 w-full",children:[l.jsx(W,{className:"h-32 w-full rounded-lg"}),l.jsx(W,{className:"h-32 w-full rounded-lg"})]}),children:l.jsx(at,{})}),e[25]=p):p=e[25];let C;e[26]!==I?(C=l.jsxs("div",{className:"w-full space-y-3",children:[I,p]}),e[26]=I,e[27]=C):C=e[27];let E;return e[28]!==C||e[29]!==N?(E=l.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-2xl px-4",children:[N,C]}),e[28]=C,e[29]=N,e[30]=E):E=e[30],E}function Ne(t){const e=t.title.includes(": ");return{provider:e?t.title.split(": ")[0]??"":t.modelId.split("/")[0]??"",displayName:e?t.title.split(": ").slice(1).join(": "):t.title}}const ct=["smarter","faster","cheaper"],dt={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Hs=[{tier:"smarter",prefixes:["claude-code:opus","anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","codex:gpt-5.4","codex:gpt-5.4-mini","codex:gpt-5.3-codex","codex:gpt-5.2-codex","codex:gpt-5.1-codex-max","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["claude-code:sonnet","anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","codex:gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["claude-code:haiku","google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Qs=Hs.flatMap(({tier:t,prefixes:e})=>e.map(s=>({tier:t,prefix:s}))).sort((t,e)=>e.prefix.length-t.prefix.length),Gs=new Set(["google/gemini-2.5-pro"]),Pe=new Map;function Ys(t){const e=Pe.get(t);if(e!==void 0)return e;let s=null;if(t.endsWith(":free"))s="cheaper";else e:for(const{tier:n,prefix:i}of Qs)if(t.startsWith(i)){if(Gs.has(i)&&t.length>i.length&&t[i.length]==="-"){const r=t[i.length+1];if(!r||!/\d/.test(r))continue e}s=n;break}return Pe.set(t,s),s}function ze(t){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const s of t){const n=Ys(s.modelId);e[n??"other"].push(s)}for(const s of Object.keys(e))e[s].sort((n,i)=>n.title.localeCompare(i.title));return e}const mt="mesh:model-shortlist:",Xs=new Set(["anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Js(t){try{const e=localStorage.getItem(mt+t);return e?new Set(JSON.parse(e)):null}catch{return null}}function Zs(t,e){localStorage.setItem(mt+t,JSON.stringify([...e]))}function el(t){return t<32e3?{level:1,label:"Small",description:"Short conversations"}:t<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:t<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const tl=["bg-destructive","bg-warning","bg-success","bg-success"],sl=["text-success","text-warning","text-warning","text-destructive"];function ll(t){const e=Math.round(t*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(t*.75)} words`}function il(t){return t<1?{level:1,label:"Cheap"}:t<5?{level:2,label:"Moderate"}:t<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const nl={text:{icon:l.jsx(Ft,{className:"size-3.5"}),label:"Text"},vision:{icon:l.jsx(zt,{className:"size-3.5"}),label:"Vision"},image:{icon:l.jsx(Lt,{className:"size-3.5"}),label:"Image"},tools:{icon:l.jsx(Pt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:l.jsx(Rt,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:l.jsx(Ge,{className:"size-3.5"}),label:"Web search"}};function ol(t){const e=$.c(5),{capability:s}=t;let n;e[0]!==s?(n=nl[s]??{icon:null,label:s.charAt(0).toUpperCase()+s.slice(1)},e[0]=s,e[1]=n):n=e[1];const i=n;let o;return e[2]!==i.icon||e[3]!==i.label?(o=l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[i.icon,i.label]}),e[2]=i.icon,e[3]=i.label,e[4]=o):o=e[4],o}function rl(t){const e=$.c(49),{model:s,compact:n}=t,i=n===void 0?!1:n;if(!s){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=g):g=e[0],g}const o=s.costs?.input!=null?s.costs.input*1e6:null,r=s.costs?.output!=null?s.costs.output*1e6:null;let a;e[1]!==s?(a=Ne(s),e[1]=s,e[2]=a):a=e[2];const{provider:d,displayName:m}=a;if(i){let g;e[3]!==s.limits?(g=s.limits?.contextWindow&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Context"}),l.jsxs("span",{className:"text-foreground font-medium",children:[s.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=s.limits,e[4]=g):g=e[4];let N;e[5]!==o?(N=o!=null&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Input"}),l.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let I;e[7]!==r?(I=r!=null&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Output"}),l.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=I):I=e[8];let p;e[9]!==s.limits?(p=s.limits?.maxOutputTokens&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),l.jsxs("span",{className:"text-foreground font-medium",children:[s.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=s.limits,e[10]=p):p=e[10];let C;return e[11]!==g||e[12]!==N||e[13]!==I||e[14]!==p?(C=l.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[g,N,I,p]}),e[11]=g,e[12]=N,e[13]=I,e[14]=p,e[15]=C):C=e[15],C}let c;e[16]!==d?(c=l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[16]=d,e[17]=c):c=e[17];let u;e[18]!==s.logo||e[19]!==s.title?(u=s.logo&&l.jsx("img",{src:s.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[18]=s.logo,e[19]=s.title,e[20]=u):u=e[20];let h;e[21]!==m?(h=l.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:m}),e[21]=m,e[22]=h):h=e[22];let f;e[23]!==u||e[24]!==h?(f=l.jsxs("div",{className:"flex items-center gap-2.5",children:[u,h]}),e[23]=u,e[24]=h,e[25]=f):f=e[25];let v;e[26]!==s.modelId?(v=l.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:s.modelId}),e[26]=s.modelId,e[27]=v):v=e[27];let b;e[28]!==c||e[29]!==f||e[30]!==v?(b=l.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[c,f,v]}),e[28]=c,e[29]=f,e[30]=v,e[31]=b):b=e[31];let w;e[32]!==s.capabilities?(w=s.capabilities&&s.capabilities.length>0&&l.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(s.capabilities)].map(al)}),e[32]=s.capabilities,e[33]=w):w=e[33];let j;e[34]!==s.limits?(j=s.limits?.contextWindow&&(()=>{const{level:g,label:N,description:I}=el(s.limits.contextWindow);return l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(p=>l.jsx("div",{className:ie("w-2 h-2 rounded-full",p<=g?tl[g-1]:"bg-muted")},p))}),l.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",I]})]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=s.limits,e[35]=j):j=e[35];let x;e[36]!==s.limits?(x=s.limits?.maxOutputTokens&&l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsxs("span",{className:"text-sm text-foreground",children:[s.limits.maxOutputTokens.toLocaleString()," tokens"]}),l.jsx("span",{className:"text-sm text-muted-foreground",children:ll(s.limits.maxOutputTokens)})]})]}),e[36]=s.limits,e[37]=x):x=e[37];let y;e[38]!==o||e[39]!==r?(y=(o!=null||r!=null)&&(()=>{const{level:g,label:N}=o!=null?il(o):{level:0,label:""};return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(I=>l.jsx("span",{className:ie("text-sm font-bold leading-none",I<=g?sl[g-1]:"text-muted-foreground/20"),children:"$"},I))}),l.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),l.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),l.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),l.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=y):y=e[40];let S;e[41]!==j||e[42]!==x||e[43]!==y?(S=l.jsxs("div",{className:"flex flex-col gap-6",children:[j,x,y]}),e[41]=j,e[42]=x,e[43]=y,e[44]=S):S=e[44];let _;return e[45]!==S||e[46]!==b||e[47]!==w?(_=l.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[b,w,S]}),e[45]=S,e[46]=b,e[47]=w,e[48]=_):_=e[48],_}function al(t){return l.jsx(ol,{capability:t},t)}function cl(t){const e=$.c(21),{model:s,onHover:n}=t;let i;e[0]!==s?(i=Ne(s),e[0]=s,e[1]=i):i=e[1];const{displayName:o,provider:r}=i;let a;e[2]!==s?(a=Se(s),e[2]=s,e[3]=a):a=e[3];const d=a;let m;e[4]!==s||e[5]!==n?(m=()=>n(s),e[4]=s,e[5]=n,e[6]=m):m=e[6];let c;e[7]!==s.title||e[8]!==d?(c=l.jsx("img",{src:d,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[7]=s.title,e[8]=d,e[9]=c):c=e[9];let u;e[10]!==o?(u=l.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=u):u=e[11];let h;e[12]!==r?(h=l.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=h):h=e[13];let f;e[14]!==u||e[15]!==h?(f=l.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[u,h]}),e[14]=u,e[15]=h,e[16]=f):f=e[16];let v;return e[17]!==m||e[18]!==c||e[19]!==f?(v=l.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:m,children:[c,f]}),e[17]=m,e[18]=c,e[19]=f,e[20]=v):v=e[20],v}function dl(t){const e=$.c(10),{error:s,onRetry:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:l.jsx(bt,{className:"size-5 text-destructive"})}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=s?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=l.jsxs("div",{className:"flex flex-col gap-1",children:[o,l.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(Dt,{className:"size-3.5"}),e[4]=d):d=e[4];let m;e[5]!==n?(m=l.jsx("div",{className:"flex items-center gap-2",children:l.jsxs(te,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[d,"Retry"]})}),e[5]=n,e[6]=m):m=e[6];let c;return e[7]!==a||e[8]!==m?(c=l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[i,a,m]}),e[7]=a,e[8]=m,e[9]=c):c=e[9],c}function ml(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(ul)}),t[0]=e):e=t[0],e}function ul(t,e){return l.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[l.jsx(W,{className:"size-5 shrink-0 rounded-sm"}),l.jsx(W,{className:"flex-1 h-4"}),l.jsx(W,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Fe(t){const e=$.c(12),{label:s,models:n,onSelect:i,onHover:o}=t;if(n.length===0)return null;let r;e[0]!==s?(r=l.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:s}),e[0]=s,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==i){let m;e[6]!==o||e[7]!==i?(m=c=>l.jsx("div",{onClick:()=>i(c),className:"cursor-pointer",children:l.jsx(cl,{model:c,onHover:o})},c.modelId),e[6]=o,e[7]=i,e[8]=m):m=e[8],a=n.map(m),e[2]=n,e[3]=o,e[4]=i,e[5]=a}else a=e[5];let d;return e[9]!==r||e[10]!==a?(d=l.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=d):d=e[11],d}function hl(t){const e=$.c(21),{model:s,isChecked:n,onToggle:i,onHover:o}=t,[r,a]=O.useState(n);r!==n&&a(n);let d;e[0]!==s?(d=Se(s),e[0]=s,e[1]=d):d=e[1];const m=d;let c;e[2]!==s||e[3]!==o?(c=()=>o(s),e[2]=s,e[3]=o,e[4]=c):c=e[4];let u;e[5]!==s.modelId||e[6]!==i?(u=()=>{a(fl),i(s.modelId)},e[5]=s.modelId,e[6]=i,e[7]=u):u=e[7];let h;e[8]!==r||e[9]!==u?(h=l.jsx(vt,{checked:r,onCheckedChange:u}),e[8]=r,e[9]=u,e[10]=h):h=e[10];let f;e[11]!==m||e[12]!==s.title?(f=l.jsx("img",{src:m,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[11]=m,e[12]=s.title,e[13]=f):f=e[13];let v;e[14]!==s.title?(v=l.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:s.title}),e[14]=s.title,e[15]=v):v=e[15];let b;return e[16]!==c||e[17]!==h||e[18]!==f||e[19]!==v?(b=l.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:c,children:[h,f,v]}),e[16]=c,e[17]=h,e[18]=f,e[19]=v,e[20]=b):b=e[20],b}function fl(t){return!t}function xl(t){const e=[];for(const s of ct)if(t[s].length>0){e.push({type:"header",label:dt[s]});for(const n of t[s])e.push({type:"model",model:n})}if(t.other.length>0){e.push({type:"header",label:"Other"});for(const s of t.other)e.push({type:"model",model:s})}return e}function pl({items:t,shortlistSet:e,onToggle:s,onHover:n}){const i=O.useRef(null),o=hs({count:t.length,getScrollElement:()=>i.current,estimateSize:r=>t[r]?.type==="header"?36:44,overscan:6});return l.jsx("div",{ref:i,className:"flex-1 overflow-y-auto",children:l.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=t[r.index];return a?l.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?l.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):l.jsx(hl,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:s,onHover:n})},r.key):null})})})}function gl(t){const e=$.c(23),{keyId:s,searchTerm:n,onHover:i,onModelSelect:o,managing:r,onToggleManage:a,filterModels:d}=t,{models:m}=ue(s),c=d?m.filter(d):m;let u;e[0]!==s?(u=()=>(s?Js(s):null)??Xs,e[0]=s,e[1]=u):u=e[1];const[h,f]=O.useState(u),[,v]=O.useTransition();let b;e[2]!==s||e[3]!==v?(b=C=>{s&&v(()=>{f(E=>{const k=new Set(E);return k.has(C)?k.delete(C):k.add(C),Zs(s,k),k})})},e[2]=s,e[3]=v,e[4]=b):b=e[4];const w=b,j=n.toLowerCase().trim(),x=C=>j?C.filter(E=>E.title.toLowerCase().includes(j)||E.modelId.toLowerCase().includes(j)):C;if(r){const C=ze(x(c)),E=xl(C);let k;e[5]!==h?(k=F=>h.has(F.modelId),e[5]=h,e[6]=k):k=e[6];const A=c.filter(k).length;let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsx(Kt,{size:14}),e[7]=M):M=e[7];let T;return e[8]!==a?(T=l.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[M,"Back"]}),e[8]=a,e[9]=T):T=e[9],l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[T,l.jsxs("span",{className:"text-xs text-muted-foreground",children:[A," selected"]})]}),l.jsx(pl,{items:E,shortlistSet:h,onToggle:w,onHover:i})]})}let y;e[10]!==h?(y=C=>h.has(C.modelId),e[10]=h,e[11]=y):y=e[11];const S=c.filter(y),_=S.length>0?S:c,g=ze(x(_));let N;e[12]!==g||e[13]!==i||e[14]!==o?(N=ct.map(C=>l.jsx(Fe,{label:dt[C],models:g[C],onSelect:o,onHover:i},C)),e[12]=g,e[13]=i,e[14]=o,e[15]=N):N=e[15];let I;e[16]!==g.other||e[17]!==i||e[18]!==o?(I=l.jsx(Fe,{label:"Other",models:g.other,onSelect:o,onHover:i}),e[16]=g.other,e[17]=i,e[18]=o,e[19]=I):I=e[19];let p;return e[20]!==N||e[21]!==I?(p=l.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,I]}),e[20]=N,e[21]=I,e[22]=p):p=e[22],p}function ut(t){const e=$.c(19),{model:s,placeholder:n,isLoading:i}=t,o=n===void 0?"Select model":n;if(i===void 0?!1:i){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(W,{className:"w-5 h-5 rounded-sm shrink-0"}),l.jsx(W,{className:"w-16 h-3 hidden md:block"})]}),e[0]=b):b=e[0],b}if(!s){let b;e[1]!==o?(b=l.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=b):b=e[2];let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx(_e,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=w):w=e[3];let j;return e[4]!==b?(j=l.jsxs("div",{className:"flex items-center gap-1.5",children:[b,w]}),e[4]=b,e[5]=j):j=e[5],j}let a;e[6]!==s?(a=Ne(s),e[6]=s,e[7]=a):a=e[7];const{displayName:d}=a;let m;e[8]!==s?(m=Se(s),e[8]=s,e[9]=m):m=e[9];const c=m;let u;e[10]!==s.title||e[11]!==c?(u=l.jsx("img",{src:c,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[10]=s.title,e[11]=c,e[12]=u):u=e[12];let h;e[13]!==d?(h=l.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:d}),e[13]=d,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(_e,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let v;return e[16]!==u||e[17]!==h?(v=l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[u,h,f]}),e[16]=u,e[17]=h,e[18]=v):v=e[18],v}const bl=["vision","image","file","audio","video"],ht=["image/png","image/jpeg","image/gif","image/webp"];function ii(t){const e=t?.capabilities;return e?bl.some(s=>e.includes(s)):!1}function ni(t,e){if(!t)return!1;if(t.startsWith("text/"))return!0;const s=e?.capabilities??[],n=s.includes("vision")||s.includes("image"),i=s.includes("file"),o=s.includes("audio"),r=s.includes("video");return!!(n&&ht.includes(t)||i&&t==="application/pdf"||o&&t.startsWith("audio/")||r&&t.startsWith("video/"))}function oi(t){const e=t?.capabilities??[],s=["text/*"];return(e.includes("vision")||e.includes("image"))&&s.push(...ht),e.includes("file")&&s.push("application/pdf"),e.includes("audio")&&s.push("audio/*"),e.includes("video")&&s.push("video/*"),s.join(",")}function ri(t){const e=t?.capabilities??[],s=[];return(e.includes("vision")||e.includes("image"))&&s.push("images"),e.includes("file")&&s.push("PDFs"),e.includes("audio")&&s.push("audio"),e.includes("video")&&s.push("video"),s.length===0?"text only":s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s.at(-1)}`}function vl(){const t=$.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:l.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[l.jsx(W,{className:"size-4 shrink-0"}),l.jsx(W,{className:"flex-1 h-6"}),l.jsx(W,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,l.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(jl)})]}),t[1]=s):s=t[1];let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx(W,{className:"size-6 shrink-0"}),l.jsx(W,{className:"h-6 w-32"})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(W,{className:"h-6 w-20 rounded-md"}),l.jsx(W,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=i):i=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(W,{className:"h-4 w-24"}),l.jsx(W,{className:"h-4 w-32"})]}),t[4]=o):o=t[4];let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[s,l.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:l.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[i,l.jsxs("div",{className:"flex flex-col gap-4",children:[o,l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(W,{className:"h-4 w-16"}),l.jsx(W,{className:"h-4 w-40"})]})]})]})})]}),t[5]=r):r=t[5],r}function jl(t,e){return l.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[l.jsx(W,{className:"size-5 shrink-0 rounded-sm"}),l.jsx(W,{className:"flex-1 h-4"}),l.jsx(W,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ft(t){const e=$.c(43),{onClose:s,credentialId:n,onCredentialChange:i,selectedModel:o,onModelChange:r,filterModels:a}=t,[d,m]=O.useState(null),[c,u]=O.useState(""),[h,f]=O.useState(!1),v=O.useRef(null),b=Ye(),w=ae(),j=Object.fromEntries((b?.providers??[]).map(Nl)),x=gt(),{org:y}=ne();let S;e[0]!==i?(S=P=>{i(P),m(null)},e[0]=i,e[1]=S):S=e[1];const _=S;let g;e[2]!==n||e[3]!==s||e[4]!==r?(g=P=>{n&&(r(P),u(""),s())},e[2]=n,e[3]=s,e[4]=r,e[5]=g):g=e[5];const N=g;if(w.length===0){let P;return e[6]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:l.jsx(qs,{})}),e[6]=P):P=e[6],P}const I="flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",p="flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",C="border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",E="flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text";let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(Ge,{size:16,className:"text-muted-foreground shrink-0"}),e[7]=k):k=e[7];const A=h?"Search all models...":"Search for a model...";let M;e[8]===Symbol.for("react.memo_cache_sentinel")?(M=P=>u(P.target.value),e[8]=M):M=e[8];let T;e[9]!==c||e[10]!==A?(T=l.jsx(oe,{ref:v,type:"text",placeholder:A,value:c,onChange:M,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[9]=c,e[10]=A,e[11]=T):T=e[11];const F=w.length>0&&l.jsxs(kt,{value:n??"",onValueChange:_,children:[l.jsxs(Et,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Sl,children:[l.jsx(Mt,{placeholder:"Key",children:(()=>{const P=w.find(xe=>xe.id===n),J=P?j[P.providerId]:void 0;return l.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[J?.logo?l.jsx("img",{src:J.logo,alt:J.name,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):l.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:(J?.name??P?.providerId??"?").slice(0,1).toUpperCase()}),l.jsx("span",{className:"text-xs truncate",children:J?.name??P?.providerId??"Key"})]})})()}),l.jsx(Tt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),l.jsx(At,{children:w.map(P=>{const J=j[P.providerId];return l.jsx(Ot,{value:P.id,children:l.jsxs("div",{className:"flex items-center gap-2",children:[J?.logo?l.jsx("img",{src:J.logo,alt:J.name,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):l.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:(J?.name??P.providerId).slice(0,1).toUpperCase()}),l.jsxs("span",{children:[J?.name??P.providerId," — ",P.label]})]})},P.id)})})]});let R;e[12]!==T||e[13]!==F||e[14]!==k?(R=l.jsx("div",{className:C,children:l.jsxs("label",{className:E,children:[k,T,F]})}),e[12]=T,e[13]=F,e[14]=k,e[15]=R):R=e[15];let L;e[16]!==n?(L=P=>{const{error:J,resetError:xe}=P;return l.jsx(dl,{error:J,onRetry:xe,credentialId:n??void 0})},e[16]=n,e[17]=L):L=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U=l.jsx(ml,{}),e[18]=U):U=e[18];const Q=n??void 0;let B;e[19]===Symbol.for("react.memo_cache_sentinel")?(B=()=>f(yl),e[19]=B):B=e[19];let D;e[20]!==a||e[21]!==N||e[22]!==h||e[23]!==c||e[24]!==Q?(D=l.jsx(O.Suspense,{fallback:U,children:l.jsx(gl,{keyId:Q,searchTerm:c,onHover:m,onModelSelect:N,managing:h,onToggleManage:B,filterModels:a})}),e[20]=a,e[21]=N,e[22]=h,e[23]=c,e[24]=Q,e[25]=D):D=e[25];let V;e[26]!==n||e[27]!==L||e[28]!==D?(V=l.jsx(De,{fallback:L,children:D},n),e[26]=n,e[27]=L,e[28]=D,e[29]=V):V=e[29];let K;e[30]!==h||e[31]!==x||e[32]!==y?(K=!h&&l.jsxs("div",{className:"border-t border-border flex",children:[l.jsxs("button",{type:"button",onClick:()=>O.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[l.jsx($t,{className:"size-3.5 shrink-0"}),"Manage models"]}),l.jsx("div",{className:"w-px bg-border shrink-0"}),l.jsxs("button",{type:"button",onClick:()=>x({to:"/$org/settings/ai-providers",params:{org:y.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[l.jsx(qe,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[30]=h,e[31]=x,e[32]=y,e[33]=K):K=e[33];let H;e[34]!==R||e[35]!==V||e[36]!==K?(H=l.jsxs("div",{className:p,children:[R,V,K]}),e[34]=R,e[35]=V,e[36]=K,e[37]=H):H=e[37];const G=d??o??null;let q;e[38]!==G?(q=l.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:l.jsx(rl,{model:G})}),e[38]=G,e[39]=q):q=e[39];let ee;return e[40]!==H||e[41]!==q?(ee=l.jsxs("div",{className:I,children:[H,q]}),e[40]=H,e[41]=q,e[42]=ee):ee=e[42],ee}function yl(t){return!t}function Sl(t){return t.stopPropagation()}function Nl(t){return[t.id,t]}function wl(t){const e=$.c(12),{onClose:s}=t,{credentialId:n,setCredentialId:i,selectedModel:o,setModel:r}=Xe();let a;e[0]!==i?(a=c=>{Z("chat_credential_changed",{credential_id:c}),i(c)},e[0]=i,e[1]=a):a=e[1];let d;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(d=c=>{n&&(Z("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:c.modelId,to_model_provider:c.providerId??null,credential_id:n}),r({...c,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=d):d=e[5];let m;return e[6]!==n||e[7]!==s||e[8]!==o||e[9]!==a||e[10]!==d?(m=l.jsx(ft,{onClose:s,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:d}),e[6]=n,e[7]=s,e[8]=o,e[9]=a,e[10]=d,e[11]=m):m=e[11],m}function _l(t){const e=$.c(38),{variant:s,className:n,placeholder:i,model:o,isLoading:r,credentialId:a,onCredentialChange:d,onModelChange:m,filterModels:c}=t,u=s===void 0?"borderless":s,h=i===void 0?"Select model":i,[f,v]=O.useState(!1),b=m!==void 0,w=It(),j=u==="borderless"?"ghost":"outline",x=u==="borderless"&&"md:border-none";let y;e[0]!==n||e[1]!==x?(y=ie("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",x,n),e[0]=n,e[1]=x,e[2]=y):y=e[2];let S;e[3]!==r||e[4]!==o||e[5]!==h||e[6]!==b?(S=b?l.jsx(ut,{model:o??null,placeholder:h,isLoading:r}):l.jsx(Il,{placeholder:h}),e[3]=r,e[4]=o,e[5]=h,e[6]=b,e[7]=S):S=e[7];let _;e[8]!==j||e[9]!==y||e[10]!==S?(_=l.jsx(te,{variant:j,size:"sm",className:y,children:S}),e[8]=j,e[9]=y,e[10]=S,e[11]=_):_=e[11];const g=_;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(vl,{}),e[12]=N):N=e[12];let I;e[13]!==a||e[14]!==c||e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==b?(I=l.jsx(O.Suspense,{fallback:N,children:b?l.jsx(ft,{onClose:()=>v(!1),credentialId:a??null,onCredentialChange:d??Cl,selectedModel:o??null,onModelChange:m,filterModels:c}):l.jsx(wl,{onClose:()=>v(!1)})}),e[13]=a,e[14]=c,e[15]=o,e[16]=d,e[17]=m,e[18]=b,e[19]=I):I=e[19];const p=I;if(w){let M;e[20]!==g?(M=l.jsx(Nt,{asChild:!0,children:g}),e[20]=g,e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx(wt,{className:"sr-only",children:"Select model"}),e[22]=T):T=e[22];let F;e[23]!==p?(F=l.jsxs(_t,{className:"p-0 flex flex-col max-h-[95vh]",children:[T,l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:p})]}),e[23]=p,e[24]=F):F=e[24];let R;return e[25]!==f||e[26]!==M||e[27]!==F?(R=l.jsxs(Ct,{open:f,onOpenChange:v,children:[M,F]}),e[25]=f,e[26]=M,e[27]=F,e[28]=R):R=e[28],R}let C;e[29]!==g?(C=l.jsx(St,{asChild:!0,children:g}),e[29]=g,e[30]=C):C=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=l.jsx(Ve,{className:"sr-only",children:"Select model"}),e[31]=E):E=e[31];let k;e[32]!==p?(k=l.jsxs(Be,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[E,p]}),e[32]=p,e[33]=k):k=e[33];let A;return e[34]!==f||e[35]!==C||e[36]!==k?(A=l.jsxs(Ue,{open:f,onOpenChange:v,children:[C,k]}),e[34]=f,e[35]=C,e[36]=k,e[37]=A):A=e[37],A}function Cl(){}function Il(t){const e=$.c(4),{placeholder:s}=t,{selectedModel:n,isModelsLoading:i}=Xe();let o;return e[0]!==i||e[1]!==n||e[2]!==s?(o=l.jsx(ut,{model:n,placeholder:s,isLoading:i}),e[0]=i,e[1]=n,e[2]=s,e[3]=o):o=e[3],o}export{_l as M,qs as N,li as O,ri as a,oi as g,ni as i,ii as m};
@@ -1 +1 @@
1
- import{e as v,g as T,a4 as B,j as s,s as E,aH as D,c as L,az as k,t as R,b as W,O as M,l as J,r as K}from"./index-C27Pbex0.js";import{k as Q,l as U,m as V,u as X,S as $,a as w,b as z,d as C,c as O,f as Y,g as Z,q as I,n as ee,o as se,p as te}from"./index-DsXJm4s8.js";import{i as q}from"./ArrowNarrowLeft-DtS9FYAN.js";import{b as le,d as ne,n as re,e as ie,f as oe,i as F,a as ae,c as ce}from"./ZapSquare-CLlEU1BK.js";import{t as me,a as A}from"./Users03-B_ZFhEj7.js";import{i as de}from"./ChevronRight-BCgvkwtC.js";import{i as fe}from"./Lock01-bZF1KUvq.js";import{s as xe}from"./User01-Dj2-no-V.js";import{i as G}from"./Zap-Ct-Bt-7a.js";import{u as be}from"./use-mobile-49sQdb0b.js";import{u as he}from"./use-status-sounds-hwHn7ByT.js";import"./X-BXQFKahF.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-BQ6lKiUz.js";import"./create-sse-subscription-CxkOgzKf.js";function H(){const e=v.c(24),t=E().project;let n;e[0]!==t.enabledPlugins?(n=t.enabledPlugins??[],e[0]=t.enabledPlugins,e[1]=n):n=e[1];const l=n;let r,i,a;if(e[2]!==l){const o=D.filter(S=>l.includes(S.pluginId)).map(ue);let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x={key:"general",label:"General",icon:s.jsx(me,{size:14}),to:"/$org/settings/general"},e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b={key:"connections",label:"Connections",icon:s.jsx(le,{size:14}),to:"/$org/settings/connections"},e[7]=b):b=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c={key:"agents",label:"Agents",icon:s.jsx(A,{size:14}),to:"/$org/settings/agents"},e[8]=c):c=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m={key:"automations",label:"Automations",icon:s.jsx(G,{size:14}),to:"/$org/settings/automations"},e[9]=m):m=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h={key:"store",label:"Store",icon:s.jsx(ne,{size:14}),to:"/$org/settings/store"},e[10]=h):h=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p={key:"brand-context",label:"Brand Context",icon:s.jsx(re,{size:14}),to:"/$org/settings/brand-context"},e[11]=p):p=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_={key:"ai-providers",label:"AI Providers",icon:s.jsx(ie,{size:14}),to:"/$org/settings/ai-providers"},e[12]=_):_=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g={key:"monitor",label:"Monitor",icon:s.jsx(oe,{size:14}),to:"/$org/settings/monitor"},e[13]=g):g=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j={key:"members",label:"Members",icon:s.jsx(A,{size:14}),to:"/$org/settings/members"},e[14]=j):j=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(a={label:"",items:[x,b,c,m,h,p,_,g,j,{key:"sso",label:"SSO",icon:s.jsx(fe,{size:14}),to:"/$org/settings/sso"}]},e[15]=a):a=e[15],r="";let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u={key:"features",label:"Plugins",icon:s.jsx(G,{size:14}),to:"/$org/settings/features"},e[16]=u):u=e[16],i=[u,...o],e[2]=l,e[3]=r,e[4]=i,e[5]=a}else r=e[3],i=e[4],a=e[5];let f;e[17]!==r||e[18]!==i?(f={label:r,items:i},e[17]=r,e[18]=i,e[19]=f):f=e[19];let d;if(e[20]!==a||e[21]!==f){d=[a,f];let o;e[23]===Symbol.for("react.memo_cache_sentinel")?(o={label:"",items:[{key:"profile",label:"Profile & Preferences",icon:s.jsx(xe,{size:14}),to:"/$org/settings/profile"}]},e[23]=o):o=e[23],d.push(o),e[20]=a,e[21]=f,e[22]=d}else d=e[22];return d}function ue(e){const{key:t,label:n,icon:l,to:r}=e;return{key:t,label:n,icon:l,to:r}}function pe(){const e=v.c(26),t=H();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:l}=T(n);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={select:je},e[1]=r):r=e[1];const i=B(r);let a;e[2]!==l||e[3]!==i?(a=j=>{const u=j.replace("$org",l);return i.startsWith(u)},e[2]=l,e[3]=i,e[4]=a):a=e[4];const f=a;let d;e[5]!==l?(d={org:l},e[5]=l,e[6]=d):d=e[6];let o,x;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(q,{size:14}),x=s.jsx("span",{children:"Settings"}),e[7]=o,e[8]=x):(o=e[7],x=e[8]);let b;e[9]!==d?(b=s.jsx($,{className:"pt-0 pr-0 pb-3 md:pb-3 pl-0",children:s.jsx(w,{children:s.jsx(z,{className:"gap-1.5",children:s.jsx(C,{children:s.jsx(O,{asChild:!0,children:s.jsxs(k,{to:"/$org",params:d,className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o,x]})})})})})}),e[9]=d,e[10]=b):b=e[10];let c;if(e[11]!==t||e[12]!==f||e[13]!==l){let j;e[15]!==f||e[16]!==l?(j=(u,S)=>s.jsxs($,{className:"pt-0 pr-0 pb-0 pl-0",children:[S>0&&s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),u.label&&s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:u.label}),s.jsx(w,{children:s.jsx(z,{className:"gap-0.5",children:u.items.map(y=>s.jsx(C,{children:s.jsx(O,{asChild:!0,isActive:f(y.to),children:s.jsxs(k,{to:y.to,params:{org:l},onClick:()=>R("settings_nav_clicked",{section_key:y.key,section_label:y.label,group_label:u.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:y.icon}),s.jsx("span",{className:"truncate",children:y.label})]})})},y.key))})})]},`${u.label}-${S}`),e[15]=f,e[16]=l,e[17]=j):j=e[17],c=t.map(j),e[11]=t,e[12]=f,e[13]=l,e[14]=c}else c=e[14];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[18]=m):m=e[18];let h;e[19]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs($,{className:"pt-0 pr-0 pb-0 pl-0",children:[m,s.jsx(w,{children:s.jsx(z,{className:"gap-0.5",children:s.jsx(C,{children:s.jsxs(O,{onClick:ge,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[19]=h):h=e[19];let p;e[20]!==b||e[21]!==c?(p=s.jsxs(Y,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0",children:[b,c,h]}),e[20]=b,e[21]=c,e[22]=p):p=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.282.1"]})}),e[23]=_):_=e[23];let g;return e[24]!==p?(g=s.jsxs(Z,{variant:"sidebar",children:[p,_]}),e[24]=p,e[25]=g):g=e[25],g}function ge(){R("signed_out",{source:"settings_sidebar"}),W.signOut()}function je(e){return e.location.pathname}function _e(e){const t=v.c(29),{onClose:n}=e,l=H();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org"},t[0]=r):r=t[0];const{org:i}=T(r);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:Se},t[1]=a):a=t[1];const f=B(a);let d;t[2]!==i||t[3]!==f?(d=S=>{const y=S.replace("$org",i);return f.startsWith(y)},t[2]=i,t[3]=f,t[4]=d):d=t[4];const o=d;let x;t[5]!==i?(x={org:i},t[5]=i,t[6]=x):x=t[6];let b,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(q,{size:16,className:"shrink-0"}),c=s.jsx("span",{children:"Settings"}),t[7]=b,t[8]=c):(b=t[7],c=t[8]);let m;t[9]!==n||t[10]!==x?(m=s.jsx("div",{className:"flex items-center h-14 px-4 shrink-0 border-b border-border/50",children:s.jsxs(k,{to:"/$org",params:x,onClick:n,className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[b,c]})}),t[9]=n,t[10]=x,t[11]=m):m=t[11];let h;if(t[12]!==l||t[13]!==o||t[14]!==n||t[15]!==i){let S;t[17]!==o||t[18]!==n||t[19]!==i?(S=(y,P)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P>0&&s.jsx("div",{className:"h-px bg-border/50 my-2"}),y.items.map(N=>s.jsxs(k,{to:N.to,params:{org:i},onClick:n,className:L("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",o(N.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsx("span",{className:"shrink-0",children:N.icon}),s.jsx("span",{className:"truncate",children:N.label})]},N.key))]},`${y.label}-${P}`),t[17]=o,t[18]=n,t[19]=i,t[20]=S):S=t[20],h=l.map(S),t[12]=l,t[13]=o,t[14]=n,t[15]=i,t[16]=h}else h=t[16];let p;t[21]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[21]=p):p=t[21];let _;t[22]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[p,s.jsxs("button",{type:"button",onClick:ye,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[22]=_):_=t[22];let g;t[23]!==h?(g=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[h,_]}),t[23]=h,t[24]=g):g=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.282.1"]})}),t[25]=j):j=t[25];let u;return t[26]!==g||t[27]!==m?(u=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[m,g,j]}),t[26]=g,t[27]=m,t[28]=u):u=t[28],u}function ye(){return W.signOut()}function Se(e){return e.location.pathname}function ve(){const e=v.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("button",{type:"button",onClick:ke,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:s.jsx(ae,{size:16})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"shrink-0 flex items-center justify-between pl-1 pr-2 h-10",children:s.jsxs("div",{className:"flex items-center gap-0.5 min-w-0",children:[t,s.jsx("button",{type:"button",onClick:Ne,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:s.jsx(de,{size:16})})]})}),e[1]=n):n=e[1],n}function Ne(){return window.history.forward()}function ke(){return window.history.back()}function $e(e){const t=v.c(3),{onOpenSidebar:n}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ce,{size:20}),t[0]=l):l=t[0];let r;return t[1]!==n?(r=s.jsx("div",{className:"shrink-0 flex items-center justify-between px-3 h-12 bg-background border-b border-border",children:s.jsx("button",{type:"button",onClick:n,className:"flex size-8 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:l})}),t[1]=n,t[2]=r):r=t[2],r}function we(){const e=v.c(17),t=be(),{org:n}=E();he(n.id);const{setOpenMobile:l,openMobile:r}=X();if(t){let o;e[0]!==l?(o=s.jsx($e,{onOpenSidebar:()=>l(!0)}),e[0]=l,e[1]=o):o=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(I,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(M,{})})})}),e[2]=x):x=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ee,{className:"sr-only",children:"Navigation"}),e[3]=b):b=e[3];let c;e[4]!==l?(c=s.jsxs(se,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[b,s.jsx(_e,{onClose:()=>l(!1)})]}),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==r||e[7]!==l||e[8]!==c?(m=s.jsx(te,{open:r,onOpenChange:l,children:c}),e[6]=r,e[7]=l,e[8]=c,e[9]=m):m=e[9];let h;return e[10]!==o||e[11]!==m?(h=s.jsxs("div",{className:"flex flex-col flex-1 bg-background min-h-0",children:[o,x,m]}),e[10]=o,e[11]=m,e[12]=h):h=e[12],h}let i;e[13]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ve,{}),e[13]=i):i=e[13];let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),e[14]=a):a=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(J,{size:20,className:"animate-spin text-muted-foreground"})}),e[15]=f):f=e[15];let d;return e[16]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(s.Fragment,{children:[i,s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:a,children:s.jsx(K.Suspense,{fallback:f,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(I,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(M,{})})})})})})})]}),e[16]=d):d=e[16],d}function Fe(){const e=v.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={"--sidebar-width-icon":"3.5rem"},e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pe,{}),e[1]=n):n=e[1];let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Q,{defaultOpen:!0,children:s.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:s.jsxs(U,{className:"flex-1 bg-sidebar",style:t,children:[n,s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(we,{})})]})})}),e[2]=l):l=e[2],l}export{pe as SettingsSidebar,_e as SettingsSidebarMobile,Fe as default};
1
+ import{e as v,g as T,a4 as B,j as s,s as E,aH as D,c as L,az as k,t as R,b as W,O as M,l as J,r as K}from"./index-BR4Tv9I4.js";import{k as Q,l as U,m as V,u as X,S as $,a as w,b as z,d as C,c as O,f as Y,g as Z,q as I,n as ee,o as se,p as te}from"./index-BxuUqWWJ.js";import{i as q}from"./ArrowNarrowLeft-DyneV8jh.js";import{b as le,d as ne,n as re,e as ie,f as oe,i as F,a as ae,c as ce}from"./ZapSquare-Bzu6OwXc.js";import{t as me,a as A}from"./Users03-AWMGi4Xo.js";import{i as de}from"./ChevronRight-P2x5wJJp.js";import{i as fe}from"./Lock01-B4C5ICSW.js";import{s as xe}from"./User01-CFTuPOYw.js";import{i as G}from"./Zap-kmaaq3eG.js";import{u as be}from"./use-mobile-UG3f-VUD.js";import{u as he}from"./use-status-sounds-e0qVVZe8.js";import"./X-B19qdsWt.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-cbOJk-u-.js";import"./create-sse-subscription-CxkOgzKf.js";function H(){const e=v.c(24),t=E().project;let n;e[0]!==t.enabledPlugins?(n=t.enabledPlugins??[],e[0]=t.enabledPlugins,e[1]=n):n=e[1];const l=n;let r,i,a;if(e[2]!==l){const o=D.filter(S=>l.includes(S.pluginId)).map(ue);let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x={key:"general",label:"General",icon:s.jsx(me,{size:14}),to:"/$org/settings/general"},e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b={key:"connections",label:"Connections",icon:s.jsx(le,{size:14}),to:"/$org/settings/connections"},e[7]=b):b=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c={key:"agents",label:"Agents",icon:s.jsx(A,{size:14}),to:"/$org/settings/agents"},e[8]=c):c=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m={key:"automations",label:"Automations",icon:s.jsx(G,{size:14}),to:"/$org/settings/automations"},e[9]=m):m=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h={key:"store",label:"Store",icon:s.jsx(ne,{size:14}),to:"/$org/settings/store"},e[10]=h):h=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p={key:"brand-context",label:"Brand Context",icon:s.jsx(re,{size:14}),to:"/$org/settings/brand-context"},e[11]=p):p=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_={key:"ai-providers",label:"AI Providers",icon:s.jsx(ie,{size:14}),to:"/$org/settings/ai-providers"},e[12]=_):_=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g={key:"monitor",label:"Monitor",icon:s.jsx(oe,{size:14}),to:"/$org/settings/monitor"},e[13]=g):g=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j={key:"members",label:"Members",icon:s.jsx(A,{size:14}),to:"/$org/settings/members"},e[14]=j):j=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(a={label:"",items:[x,b,c,m,h,p,_,g,j,{key:"sso",label:"SSO",icon:s.jsx(fe,{size:14}),to:"/$org/settings/sso"}]},e[15]=a):a=e[15],r="";let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u={key:"features",label:"Plugins",icon:s.jsx(G,{size:14}),to:"/$org/settings/features"},e[16]=u):u=e[16],i=[u,...o],e[2]=l,e[3]=r,e[4]=i,e[5]=a}else r=e[3],i=e[4],a=e[5];let f;e[17]!==r||e[18]!==i?(f={label:r,items:i},e[17]=r,e[18]=i,e[19]=f):f=e[19];let d;if(e[20]!==a||e[21]!==f){d=[a,f];let o;e[23]===Symbol.for("react.memo_cache_sentinel")?(o={label:"",items:[{key:"profile",label:"Profile & Preferences",icon:s.jsx(xe,{size:14}),to:"/$org/settings/profile"}]},e[23]=o):o=e[23],d.push(o),e[20]=a,e[21]=f,e[22]=d}else d=e[22];return d}function ue(e){const{key:t,label:n,icon:l,to:r}=e;return{key:t,label:n,icon:l,to:r}}function pe(){const e=v.c(26),t=H();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:l}=T(n);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={select:je},e[1]=r):r=e[1];const i=B(r);let a;e[2]!==l||e[3]!==i?(a=j=>{const u=j.replace("$org",l);return i.startsWith(u)},e[2]=l,e[3]=i,e[4]=a):a=e[4];const f=a;let d;e[5]!==l?(d={org:l},e[5]=l,e[6]=d):d=e[6];let o,x;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(q,{size:14}),x=s.jsx("span",{children:"Settings"}),e[7]=o,e[8]=x):(o=e[7],x=e[8]);let b;e[9]!==d?(b=s.jsx($,{className:"pt-0 pr-0 pb-3 md:pb-3 pl-0",children:s.jsx(w,{children:s.jsx(z,{className:"gap-1.5",children:s.jsx(C,{children:s.jsx(O,{asChild:!0,children:s.jsxs(k,{to:"/$org",params:d,className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o,x]})})})})})}),e[9]=d,e[10]=b):b=e[10];let c;if(e[11]!==t||e[12]!==f||e[13]!==l){let j;e[15]!==f||e[16]!==l?(j=(u,S)=>s.jsxs($,{className:"pt-0 pr-0 pb-0 pl-0",children:[S>0&&s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),u.label&&s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:u.label}),s.jsx(w,{children:s.jsx(z,{className:"gap-0.5",children:u.items.map(y=>s.jsx(C,{children:s.jsx(O,{asChild:!0,isActive:f(y.to),children:s.jsxs(k,{to:y.to,params:{org:l},onClick:()=>R("settings_nav_clicked",{section_key:y.key,section_label:y.label,group_label:u.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:y.icon}),s.jsx("span",{className:"truncate",children:y.label})]})})},y.key))})})]},`${u.label}-${S}`),e[15]=f,e[16]=l,e[17]=j):j=e[17],c=t.map(j),e[11]=t,e[12]=f,e[13]=l,e[14]=c}else c=e[14];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[18]=m):m=e[18];let h;e[19]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs($,{className:"pt-0 pr-0 pb-0 pl-0",children:[m,s.jsx(w,{children:s.jsx(z,{className:"gap-0.5",children:s.jsx(C,{children:s.jsxs(O,{onClick:ge,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[19]=h):h=e[19];let p;e[20]!==b||e[21]!==c?(p=s.jsxs(Y,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0",children:[b,c,h]}),e[20]=b,e[21]=c,e[22]=p):p=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.282.2"]})}),e[23]=_):_=e[23];let g;return e[24]!==p?(g=s.jsxs(Z,{variant:"sidebar",children:[p,_]}),e[24]=p,e[25]=g):g=e[25],g}function ge(){R("signed_out",{source:"settings_sidebar"}),W.signOut()}function je(e){return e.location.pathname}function _e(e){const t=v.c(29),{onClose:n}=e,l=H();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org"},t[0]=r):r=t[0];const{org:i}=T(r);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:Se},t[1]=a):a=t[1];const f=B(a);let d;t[2]!==i||t[3]!==f?(d=S=>{const y=S.replace("$org",i);return f.startsWith(y)},t[2]=i,t[3]=f,t[4]=d):d=t[4];const o=d;let x;t[5]!==i?(x={org:i},t[5]=i,t[6]=x):x=t[6];let b,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(q,{size:16,className:"shrink-0"}),c=s.jsx("span",{children:"Settings"}),t[7]=b,t[8]=c):(b=t[7],c=t[8]);let m;t[9]!==n||t[10]!==x?(m=s.jsx("div",{className:"flex items-center h-14 px-4 shrink-0 border-b border-border/50",children:s.jsxs(k,{to:"/$org",params:x,onClick:n,className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[b,c]})}),t[9]=n,t[10]=x,t[11]=m):m=t[11];let h;if(t[12]!==l||t[13]!==o||t[14]!==n||t[15]!==i){let S;t[17]!==o||t[18]!==n||t[19]!==i?(S=(y,P)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P>0&&s.jsx("div",{className:"h-px bg-border/50 my-2"}),y.items.map(N=>s.jsxs(k,{to:N.to,params:{org:i},onClick:n,className:L("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",o(N.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsx("span",{className:"shrink-0",children:N.icon}),s.jsx("span",{className:"truncate",children:N.label})]},N.key))]},`${y.label}-${P}`),t[17]=o,t[18]=n,t[19]=i,t[20]=S):S=t[20],h=l.map(S),t[12]=l,t[13]=o,t[14]=n,t[15]=i,t[16]=h}else h=t[16];let p;t[21]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[21]=p):p=t[21];let _;t[22]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[p,s.jsxs("button",{type:"button",onClick:ye,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[22]=_):_=t[22];let g;t[23]!==h?(g=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[h,_]}),t[23]=h,t[24]=g):g=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.282.2"]})}),t[25]=j):j=t[25];let u;return t[26]!==g||t[27]!==m?(u=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[m,g,j]}),t[26]=g,t[27]=m,t[28]=u):u=t[28],u}function ye(){return W.signOut()}function Se(e){return e.location.pathname}function ve(){const e=v.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("button",{type:"button",onClick:ke,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:s.jsx(ae,{size:16})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"shrink-0 flex items-center justify-between pl-1 pr-2 h-10",children:s.jsxs("div",{className:"flex items-center gap-0.5 min-w-0",children:[t,s.jsx("button",{type:"button",onClick:Ne,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:s.jsx(de,{size:16})})]})}),e[1]=n):n=e[1],n}function Ne(){return window.history.forward()}function ke(){return window.history.back()}function $e(e){const t=v.c(3),{onOpenSidebar:n}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ce,{size:20}),t[0]=l):l=t[0];let r;return t[1]!==n?(r=s.jsx("div",{className:"shrink-0 flex items-center justify-between px-3 h-12 bg-background border-b border-border",children:s.jsx("button",{type:"button",onClick:n,className:"flex size-8 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:l})}),t[1]=n,t[2]=r):r=t[2],r}function we(){const e=v.c(17),t=be(),{org:n}=E();he(n.id);const{setOpenMobile:l,openMobile:r}=X();if(t){let o;e[0]!==l?(o=s.jsx($e,{onOpenSidebar:()=>l(!0)}),e[0]=l,e[1]=o):o=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(I,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(M,{})})})}),e[2]=x):x=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ee,{className:"sr-only",children:"Navigation"}),e[3]=b):b=e[3];let c;e[4]!==l?(c=s.jsxs(se,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[b,s.jsx(_e,{onClose:()=>l(!1)})]}),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==r||e[7]!==l||e[8]!==c?(m=s.jsx(te,{open:r,onOpenChange:l,children:c}),e[6]=r,e[7]=l,e[8]=c,e[9]=m):m=e[9];let h;return e[10]!==o||e[11]!==m?(h=s.jsxs("div",{className:"flex flex-col flex-1 bg-background min-h-0",children:[o,x,m]}),e[10]=o,e[11]=m,e[12]=h):h=e[12],h}let i;e[13]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ve,{}),e[13]=i):i=e[13];let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),e[14]=a):a=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(J,{size:20,className:"animate-spin text-muted-foreground"})}),e[15]=f):f=e[15];let d;return e[16]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(s.Fragment,{children:[i,s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:a,children:s.jsx(K.Suspense,{fallback:f,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(I,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(M,{})})})})})})})]}),e[16]=d):d=e[16],d}function Fe(){const e=v.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={"--sidebar-width-icon":"3.5rem"},e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pe,{}),e[1]=n):n=e[1];let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Q,{defaultOpen:!0,children:s.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:s.jsxs(U,{className:"flex-1 bg-sidebar",style:t,children:[n,s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(we,{})})]})})}),e[2]=l):l=e[2],l}export{pe as SettingsSidebar,_e as SettingsSidebarMobile,Fe as default};
@@ -1 +1 @@
1
- import{e as O,j as s,K as N,B as _,f as C,o as D,s as I,g as K,d as P,ab as E,r as w,V as M,b as A,a3 as L,S as R,O as q,bj as $}from"./index-C27Pbex0.js";import{c as z,a as F,D as U,d as B}from"./dialog-BEtDzaNY.js";import{R as G}from"./required-auth-layout-DYZPY8fJ.js";import{u as Q}from"./use-tasks-CEfchIrz.js";import{a as H}from"./use-organization-settings-BhA6YmfT.js";import{u as Y}from"./use-org-sso-DZn2rTnY.js";import{i as V}from"./Lock01-bZF1KUvq.js";const T=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),k=T?"⌘":"Ctrl",j={keyboardShortcuts:{keys:[k,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[k,"L"],description:"Focus chat input"},saveAndFormat:{keys:[k,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[k,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[k,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",k,"S"],description:"New task"},toggleDaemon:{keys:[k,"D"],description:"Toggle daemon logs"}},W=[{label:"General",shortcuts:[j.keyboardShortcuts,j.newTask,j.toggleDaemon]},{label:"Editor",shortcuts:[j.saveAndFormat]},{label:"Chat",shortcuts:[j.focusChatInput,j.togglePlanMode,j.sendMessage,j.newLine]},{label:"Questions",shortcuts:[j.selectOption]},{label:"Monitoring",shortcuts:[j.applyFilter]}];function J(t){return T?t.metaKey:t.ctrlKey}function X(t){const e=O.c(5),{open:n,onOpenChange:o}=t;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(F,{children:s.jsx(U,{children:"Keyboard Shortcuts"})}),e[0]=u):u=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(z,{className:"sm:max-w-md",children:[u,s.jsx("div",{className:"flex flex-col gap-4",children:W.map(Z)})]}),e[1]=c):c=e[1];let r;return e[2]!==o||e[3]!==n?(r=s.jsx(B,{open:n,onOpenChange:o,children:c}),e[2]=o,e[3]=n,e[4]=r):r=e[4],r}function Z(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(ee)})]},t.label)}function ee(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(te)})]},t.description)}function te(t){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}function se(t,e,n){if(!n)return null;const o=t.getQueriesData({queryKey:N.tasksPrefix(e)});for(const[,u]of o){const c=u?.items?.find(r=>r.id===n);if(c?.branch)return c.branch}return null}function ne(t){const e=O.c(17),{orgId:n,orgName:o,domain:u}=t;let c;e[0]!==n?(c=()=>{window.location.href=`/api/org-sso/authorize?orgId=${encodeURIComponent(n)}`},e[0]=n,e[1]=c):c=e[1];const r=c,g=oe;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(V,{className:"h-6 w-6 text-primary"})}),e[2]=m):m=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=h):h=e[3];let p;e[4]!==u||e[5]!==o?(p=o?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:o})," requires SSO authentication",u?` via ${u}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=u,e[5]=o,e[6]=p):p=e[6];let l;e[7]!==p?(l=s.jsxs("div",{className:"space-y-2",children:[h,s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]}),e[7]=p,e[8]=l):l=e[8];let y;e[9]!==r?(y=s.jsx(_,{onClick:r,children:"Sign in with SSO"}),e[9]=r,e[10]=y):y=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(_,{variant:"ghost",onClick:g,children:"Go back"}),e[11]=S):S=e[11];let b;e[12]!==y?(b=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[y,S]}),e[12]=y,e[13]=b):b=e[13];let x;return e[14]!==l||e[15]!==b?(x=s.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:s.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[m,l,b]})}),e[14]=l,e[15]=b,e[16]=x):x=e[16],x}function oe(){window.location.href="/"}function ae(t){const e=O.c(8),{org:n,children:o}=t,c=H(n.id)?.enabled_plugins??null;let r;e[0]!==n.id||e[1]!==n.name||e[2]!==c?(r={id:n.id,organizationId:n.id,slug:"_org",name:n.name,enabledPlugins:c,ui:null},e[0]=n.id,e[1]=n.name,e[2]=c,e[3]=r):r=e[3];const g=r;let m;return e[4]!==o||e[5]!==n||e[6]!==g?(m=s.jsx($,{org:n,project:g,children:o}),e[4]=o,e[5]=n,e[6]=g,e[7]=m):m=e[7],m}function ie(){const t=C(),e=D(),n=Q(),{locator:o}=I(),u=K({strict:!1}),c=P({strict:!1}),r=u.org??"",g=u.taskId??"",m=(a,i,f=!0)=>t({to:"/$org/$taskId",params:{org:r,taskId:a},search:i,replace:f}),h=(a,i=!0)=>m(g,a,i),p=a=>h(i=>({...i,chat:a?1:0})),l=a=>h(i=>({...i,tasks:a?1:0})),y=(a,i)=>m(a,f=>{const d={chat:1};return i?d.virtualmcpid=i:f.virtualmcpid&&(d.virtualmcpid=f.virtualmcpid),f.tasks&&(d.tasks=f.tasks),f.main&&(d.main=f.main),d},!1);return{setChatOpen:p,setTasksOpen:l,setTaskId:y,createNewTask:async()=>{const a=crypto.randomUUID(),i=se(e,o,g),f=c.virtualmcpid;try{await n.create.mutateAsync({id:a,...f?{virtual_mcp_id:f}:{},...i?{branch:i}:{}})}catch{}y(a)},openTab:a=>m(g||crypto.randomUUID(),i=>({...i,main:a})),toggleMain:()=>h(a=>{if(a.main!==void 0&&a.main!=="0")return{...a,main:"0"};const f={...a};return delete f.main,f})}}function re(){const t=O.c(24);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=E(e)?.params.org,[u,c]=w.useState(!1);let r,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const d=v=>{J(v)&&v.code==="KeyK"&&(v.preventDefault(),c(!0))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},g=[],t[1]=r,t[2]=g):(r=t[1],g=t[2]),w.useEffect(r,g);let m;t[3]!==o?(m=N.activeOrganization(o),t[3]=o,t[4]=m):m=t[4];let h;t[5]!==o?(h=async()=>{if(!o)return null;const{data:d}=await A.organization.setActive({organizationSlug:o});return d&&localStorage.setItem(L.lastOrgSlug(),o),d},t[5]=o,t[6]=h):h=t[6];let p;t[7]!==m||t[8]!==h?(p={queryKey:m,queryFn:h,gcTime:1/0,refetchOnWindowFocus:!1},t[7]=m,t[8]=h,t[9]=p):p=t[9];const{data:l}=M(p),y=l?.id,{data:S}=Y(y);if(!l){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(R,{}),t[10]=d):d=t[10],d}if(S?.ssoRequired&&!S.authenticated){let d;return t[11]!==l.id||t[12]!==l.name||t[13]!==S.domain?(d=s.jsx(ne,{orgId:l.id,orgName:l.name,domain:S.domain}),t[11]=l.id,t[12]=l.name,t[13]=S.domain,t[14]=d):d=t[14],d}const b=l.logo??null;let x;t[15]!==l||t[16]!==b?(x={...l,logo:b},t[15]=l,t[16]=b,t[17]=x):x=t[17];let a;t[18]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{}),t[18]=a):a=t[18];let i;t[19]!==u?(i=s.jsx(X,{open:u,onOpenChange:c}),t[19]=u,t[20]=i):i=t[20];let f;return t[21]!==x||t[22]!==i?(f=s.jsxs(ae,{org:x,children:[a,i]}),t[21]=x,t[22]=i,t[23]=f):f=t[23],f}function ce(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(G,{children:s.jsx(re,{})}),t[0]=e):e=t[0],e}const pe=Object.freeze(Object.defineProperty({__proto__:null,default:ce,usePanelActions:ie},Symbol.toStringTag,{value:"Module"}));export{J as i,se as r,pe as s,ie as u};
1
+ import{e as O,j as s,K as N,B as _,f as C,o as D,s as I,g as K,d as P,ab as E,r as w,V as M,b as A,a3 as L,S as R,O as q,bj as $}from"./index-BR4Tv9I4.js";import{c as z,a as F,D as U,d as B}from"./dialog-BG20y4ti.js";import{R as G}from"./required-auth-layout-9J8EILU3.js";import{u as Q}from"./use-tasks-DkVJbPPF.js";import{a as H}from"./use-organization-settings-bbuIudaf.js";import{u as Y}from"./use-org-sso-eSfysoE_.js";import{i as V}from"./Lock01-B4C5ICSW.js";const T=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),k=T?"⌘":"Ctrl",j={keyboardShortcuts:{keys:[k,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[k,"L"],description:"Focus chat input"},saveAndFormat:{keys:[k,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[k,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[k,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",k,"S"],description:"New task"},toggleDaemon:{keys:[k,"D"],description:"Toggle daemon logs"}},W=[{label:"General",shortcuts:[j.keyboardShortcuts,j.newTask,j.toggleDaemon]},{label:"Editor",shortcuts:[j.saveAndFormat]},{label:"Chat",shortcuts:[j.focusChatInput,j.togglePlanMode,j.sendMessage,j.newLine]},{label:"Questions",shortcuts:[j.selectOption]},{label:"Monitoring",shortcuts:[j.applyFilter]}];function J(t){return T?t.metaKey:t.ctrlKey}function X(t){const e=O.c(5),{open:n,onOpenChange:o}=t;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(F,{children:s.jsx(U,{children:"Keyboard Shortcuts"})}),e[0]=u):u=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(z,{className:"sm:max-w-md",children:[u,s.jsx("div",{className:"flex flex-col gap-4",children:W.map(Z)})]}),e[1]=c):c=e[1];let r;return e[2]!==o||e[3]!==n?(r=s.jsx(B,{open:n,onOpenChange:o,children:c}),e[2]=o,e[3]=n,e[4]=r):r=e[4],r}function Z(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(ee)})]},t.label)}function ee(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(te)})]},t.description)}function te(t){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}function se(t,e,n){if(!n)return null;const o=t.getQueriesData({queryKey:N.tasksPrefix(e)});for(const[,u]of o){const c=u?.items?.find(r=>r.id===n);if(c?.branch)return c.branch}return null}function ne(t){const e=O.c(17),{orgId:n,orgName:o,domain:u}=t;let c;e[0]!==n?(c=()=>{window.location.href=`/api/org-sso/authorize?orgId=${encodeURIComponent(n)}`},e[0]=n,e[1]=c):c=e[1];const r=c,g=oe;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(V,{className:"h-6 w-6 text-primary"})}),e[2]=m):m=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=h):h=e[3];let p;e[4]!==u||e[5]!==o?(p=o?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:o})," requires SSO authentication",u?` via ${u}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=u,e[5]=o,e[6]=p):p=e[6];let l;e[7]!==p?(l=s.jsxs("div",{className:"space-y-2",children:[h,s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]}),e[7]=p,e[8]=l):l=e[8];let y;e[9]!==r?(y=s.jsx(_,{onClick:r,children:"Sign in with SSO"}),e[9]=r,e[10]=y):y=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(_,{variant:"ghost",onClick:g,children:"Go back"}),e[11]=S):S=e[11];let b;e[12]!==y?(b=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[y,S]}),e[12]=y,e[13]=b):b=e[13];let x;return e[14]!==l||e[15]!==b?(x=s.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:s.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[m,l,b]})}),e[14]=l,e[15]=b,e[16]=x):x=e[16],x}function oe(){window.location.href="/"}function ae(t){const e=O.c(8),{org:n,children:o}=t,c=H(n.id)?.enabled_plugins??null;let r;e[0]!==n.id||e[1]!==n.name||e[2]!==c?(r={id:n.id,organizationId:n.id,slug:"_org",name:n.name,enabledPlugins:c,ui:null},e[0]=n.id,e[1]=n.name,e[2]=c,e[3]=r):r=e[3];const g=r;let m;return e[4]!==o||e[5]!==n||e[6]!==g?(m=s.jsx($,{org:n,project:g,children:o}),e[4]=o,e[5]=n,e[6]=g,e[7]=m):m=e[7],m}function ie(){const t=C(),e=D(),n=Q(),{locator:o}=I(),u=K({strict:!1}),c=P({strict:!1}),r=u.org??"",g=u.taskId??"",m=(a,i,f=!0)=>t({to:"/$org/$taskId",params:{org:r,taskId:a},search:i,replace:f}),h=(a,i=!0)=>m(g,a,i),p=a=>h(i=>({...i,chat:a?1:0})),l=a=>h(i=>({...i,tasks:a?1:0})),y=(a,i)=>m(a,f=>{const d={chat:1};return i?d.virtualmcpid=i:f.virtualmcpid&&(d.virtualmcpid=f.virtualmcpid),f.tasks&&(d.tasks=f.tasks),f.main&&(d.main=f.main),d},!1);return{setChatOpen:p,setTasksOpen:l,setTaskId:y,createNewTask:async()=>{const a=crypto.randomUUID(),i=se(e,o,g),f=c.virtualmcpid;try{await n.create.mutateAsync({id:a,...f?{virtual_mcp_id:f}:{},...i?{branch:i}:{}})}catch{}y(a)},openTab:a=>m(g||crypto.randomUUID(),i=>({...i,main:a})),toggleMain:()=>h(a=>{if(a.main!==void 0&&a.main!=="0")return{...a,main:"0"};const f={...a};return delete f.main,f})}}function re(){const t=O.c(24);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=E(e)?.params.org,[u,c]=w.useState(!1);let r,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const d=v=>{J(v)&&v.code==="KeyK"&&(v.preventDefault(),c(!0))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},g=[],t[1]=r,t[2]=g):(r=t[1],g=t[2]),w.useEffect(r,g);let m;t[3]!==o?(m=N.activeOrganization(o),t[3]=o,t[4]=m):m=t[4];let h;t[5]!==o?(h=async()=>{if(!o)return null;const{data:d}=await A.organization.setActive({organizationSlug:o});return d&&localStorage.setItem(L.lastOrgSlug(),o),d},t[5]=o,t[6]=h):h=t[6];let p;t[7]!==m||t[8]!==h?(p={queryKey:m,queryFn:h,gcTime:1/0,refetchOnWindowFocus:!1},t[7]=m,t[8]=h,t[9]=p):p=t[9];const{data:l}=M(p),y=l?.id,{data:S}=Y(y);if(!l){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(R,{}),t[10]=d):d=t[10],d}if(S?.ssoRequired&&!S.authenticated){let d;return t[11]!==l.id||t[12]!==l.name||t[13]!==S.domain?(d=s.jsx(ne,{orgId:l.id,orgName:l.name,domain:S.domain}),t[11]=l.id,t[12]=l.name,t[13]=S.domain,t[14]=d):d=t[14],d}const b=l.logo??null;let x;t[15]!==l||t[16]!==b?(x={...l,logo:b},t[15]=l,t[16]=b,t[17]=x):x=t[17];let a;t[18]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{}),t[18]=a):a=t[18];let i;t[19]!==u?(i=s.jsx(X,{open:u,onOpenChange:c}),t[19]=u,t[20]=i):i=t[20];let f;return t[21]!==x||t[22]!==i?(f=s.jsxs(ae,{org:x,children:[a,i]}),t[21]=x,t[22]=i,t[23]=f):f=t[23],f}function ce(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(G,{children:s.jsx(re,{})}),t[0]=e):e=t[0],e}const pe=Object.freeze(Object.defineProperty({__proto__:null,default:ce,usePanelActions:ie},Symbol.toStringTag,{value:"Module"}));export{J as i,se as r,pe as s,ie as u};
@@ -1 +1 @@
1
- import{e as n,c,j as i}from"./index-C27Pbex0.js";function m(o){const e=n.c(8);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=c("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=l):l=e[4];let a;return e[5]!==t||e[6]!==l?(a=i.jsx("div",{"data-slot":"skeleton",className:l,...t}),e[5]=t,e[6]=l,e[7]=a):a=e[7],a}export{m as S};
1
+ import{e as n,c,j as i}from"./index-BR4Tv9I4.js";function m(o){const e=n.c(8);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=c("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=l):l=e[4];let a;return e[5]!==t||e[6]!==l?(a=i.jsx("div",{"data-slot":"skeleton",className:l,...t}),e[5]=t,e[6]=l,e[7]=a):a=e[7],a}export{m as S};
@@ -1 +1 @@
1
- import{s as E,r as S,j as e,B as u,t as h,z as a,e as I}from"./index-C27Pbex0.js";import{P as g}from"./index-DsXJm4s8.js";import{I as d}from"./input-BMDCCsVs.js";import{L as m}from"./label-2vBVhIzi.js";import{S as _}from"./switch-D_oyEj-7.js";import{a as w,b as z,c as D,d as k}from"./use-org-sso-DZn2rTnY.js";import{i as F}from"./AlertCircle-CJ_7BsPP.js";import{i as P}from"./CheckCircle-smRbUGaN.js";import{s as R}from"./Trash01-2of3D7QX.js";import"./use-mobile-49sQdb0b.js";import"./X-BXQFKahF.js";function L(){const{org:n}=E(),{data:r,isLoading:N}=w(n.id),p=z(n.id),j=D(n.id),v=k(n.id),[i,c]=S.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[x,f]=S.useState(!1),l=r?.configured&&r.config,t=r?.config,y=()=>{t&&c({issuer:t.issuer,clientId:t.clientId,clientSecret:"",discoveryEndpoint:t.discoveryEndpoint??"",domain:t.domain,scopes:t.scopes.join(" ")}),f(!0)},C=async()=>{if(!i.issuer||!i.clientId||!i.domain){a.error("Issuer, Client ID, and Domain are required");return}if(!l&&!i.clientSecret){a.error("Client Secret is required for initial setup");return}try{await p.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:t?.enforced??!1}),h(l?"sso_config_updated":"sso_configured",{organization_id:n.id,email_domain:i.domain}),a.success("SSO configuration saved"),f(!1)}catch(s){a.error(s instanceof Error?s.message:"Failed to save SSO config")}},O=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await j.mutateAsync(),h("sso_config_removed",{organization_id:n.id}),a.success("SSO configuration removed"),f(!1)}catch{a.error("Failed to remove SSO config")}},b=async s=>{try{await v.mutateAsync(s),h("sso_enforcement_toggled",{organization_id:n.id,enforced:s}),a.success(s?"SSO enforcement enabled":"SSO enforcement disabled")}catch{a.error("Failed to toggle SSO enforcement")}};return e.jsx(g,{children:e.jsx(g.Content,{children:e.jsx(g.Body,{children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(g.Title,{children:"Single Sign-On"}),N?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs("div",{className:"flex flex-col gap-6",children:[l&&!x&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/50",children:[e.jsx(P,{size:16,className:"text-green-600"}),e.jsx("span",{className:"text-sm font-medium",children:"SSO Configured"}),e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:t.issuer})]}),e.jsxs("div",{className:"flex flex-col gap-3 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Provider"}),e.jsx("span",{className:"font-medium",children:t.issuer})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Client ID"}),e.jsx("span",{className:"font-mono text-xs",children:t.clientId})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Domain"}),e.jsx("span",{className:"font-medium",children:t.domain})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Scopes"}),e.jsx("span",{className:"font-mono text-xs",children:t.scopes.join(" ")})]})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Enforce SSO"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Require all members to authenticate via SSO"})]}),e.jsx(_,{checked:t.enforced,onCheckedChange:b,disabled:v.isPending})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u,{variant:"outline",size:"sm",onClick:y,children:"Edit configuration"}),e.jsx(u,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/org-sso/authorize?orgId=${n.id}`,"_blank")},children:"Test SSO"}),e.jsxs(u,{variant:"ghost",size:"sm",onClick:O,disabled:j.isPending,className:"text-destructive hover:text-destructive ml-auto",children:[e.jsx(R,{size:14}),"Remove"]})]})]}),(!l||x)&&e.jsxs("div",{className:"flex flex-col gap-4",children:[!l&&e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/50",children:[e.jsx(F,{size:16,className:"text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"SSO is not configured for this organization."})]}),e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-issuer",children:"Issuer URL"}),e.jsx(d,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:i.issuer,onChange:s=>c(o=>({...o,issuer:s.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The OIDC issuer URL of your identity provider."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-client-id",children:"Client ID"}),e.jsx(d,{id:"sso-client-id",placeholder:"your-client-id",value:i.clientId,onChange:s=>c(o=>({...o,clientId:s.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(m,{htmlFor:"sso-client-secret",children:["Client Secret",x&&l&&e.jsx("span",{className:"text-muted-foreground font-normal ml-1",children:"(leave empty to keep current)"})]}),e.jsx(d,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:i.clientSecret,onChange:s=>c(o=>({...o,clientSecret:s.target.value}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-domain",children:"Email Domain"}),e.jsx(d,{id:"sso-domain",placeholder:"company.com",value:i.domain,onChange:s=>c(o=>({...o,domain:s.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The email domain that this SSO provider covers."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-scopes",children:"Scopes"}),e.jsx(d,{id:"sso-scopes",placeholder:"openid email profile",value:i.scopes,onChange:s=>c(o=>({...o,scopes:s.target.value}))})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(m,{htmlFor:"sso-discovery",children:["Discovery Endpoint"," ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),e.jsx(d,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:i.discoveryEndpoint,onChange:s=>c(o=>({...o,discoveryEndpoint:s.target.value}))})]})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx(u,{onClick:C,disabled:p.isPending,children:p.isPending?"Saving...":x?"Update":"Configure SSO"}),x&&e.jsx(u,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"})]})]})]})]})})})})}function Q(){const n=I.c(1);let r;return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(L,{}),n[0]=r):r=n[0],r}export{Q as default};
1
+ import{s as E,r as S,j as e,B as u,t as h,z as a,e as I}from"./index-BR4Tv9I4.js";import{P as g}from"./index-BxuUqWWJ.js";import{I as d}from"./input-C6wlfqbz.js";import{L as m}from"./label-CMuBjs0l.js";import{S as _}from"./switch-CM_vPUzz.js";import{a as w,b as z,c as D,d as k}from"./use-org-sso-eSfysoE_.js";import{i as F}from"./AlertCircle-i753hIUr.js";import{i as P}from"./CheckCircle-BDNIuV_g.js";import{s as R}from"./Trash01-DeQUJecj.js";import"./use-mobile-UG3f-VUD.js";import"./X-B19qdsWt.js";function L(){const{org:n}=E(),{data:r,isLoading:N}=w(n.id),p=z(n.id),j=D(n.id),v=k(n.id),[i,c]=S.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[x,f]=S.useState(!1),l=r?.configured&&r.config,t=r?.config,y=()=>{t&&c({issuer:t.issuer,clientId:t.clientId,clientSecret:"",discoveryEndpoint:t.discoveryEndpoint??"",domain:t.domain,scopes:t.scopes.join(" ")}),f(!0)},C=async()=>{if(!i.issuer||!i.clientId||!i.domain){a.error("Issuer, Client ID, and Domain are required");return}if(!l&&!i.clientSecret){a.error("Client Secret is required for initial setup");return}try{await p.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:t?.enforced??!1}),h(l?"sso_config_updated":"sso_configured",{organization_id:n.id,email_domain:i.domain}),a.success("SSO configuration saved"),f(!1)}catch(s){a.error(s instanceof Error?s.message:"Failed to save SSO config")}},O=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await j.mutateAsync(),h("sso_config_removed",{organization_id:n.id}),a.success("SSO configuration removed"),f(!1)}catch{a.error("Failed to remove SSO config")}},b=async s=>{try{await v.mutateAsync(s),h("sso_enforcement_toggled",{organization_id:n.id,enforced:s}),a.success(s?"SSO enforcement enabled":"SSO enforcement disabled")}catch{a.error("Failed to toggle SSO enforcement")}};return e.jsx(g,{children:e.jsx(g.Content,{children:e.jsx(g.Body,{children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(g.Title,{children:"Single Sign-On"}),N?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs("div",{className:"flex flex-col gap-6",children:[l&&!x&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/50",children:[e.jsx(P,{size:16,className:"text-green-600"}),e.jsx("span",{className:"text-sm font-medium",children:"SSO Configured"}),e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:t.issuer})]}),e.jsxs("div",{className:"flex flex-col gap-3 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Provider"}),e.jsx("span",{className:"font-medium",children:t.issuer})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Client ID"}),e.jsx("span",{className:"font-mono text-xs",children:t.clientId})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Domain"}),e.jsx("span",{className:"font-medium",children:t.domain})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Scopes"}),e.jsx("span",{className:"font-mono text-xs",children:t.scopes.join(" ")})]})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Enforce SSO"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Require all members to authenticate via SSO"})]}),e.jsx(_,{checked:t.enforced,onCheckedChange:b,disabled:v.isPending})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u,{variant:"outline",size:"sm",onClick:y,children:"Edit configuration"}),e.jsx(u,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/org-sso/authorize?orgId=${n.id}`,"_blank")},children:"Test SSO"}),e.jsxs(u,{variant:"ghost",size:"sm",onClick:O,disabled:j.isPending,className:"text-destructive hover:text-destructive ml-auto",children:[e.jsx(R,{size:14}),"Remove"]})]})]}),(!l||x)&&e.jsxs("div",{className:"flex flex-col gap-4",children:[!l&&e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/50",children:[e.jsx(F,{size:16,className:"text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"SSO is not configured for this organization."})]}),e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-issuer",children:"Issuer URL"}),e.jsx(d,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:i.issuer,onChange:s=>c(o=>({...o,issuer:s.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The OIDC issuer URL of your identity provider."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-client-id",children:"Client ID"}),e.jsx(d,{id:"sso-client-id",placeholder:"your-client-id",value:i.clientId,onChange:s=>c(o=>({...o,clientId:s.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(m,{htmlFor:"sso-client-secret",children:["Client Secret",x&&l&&e.jsx("span",{className:"text-muted-foreground font-normal ml-1",children:"(leave empty to keep current)"})]}),e.jsx(d,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:i.clientSecret,onChange:s=>c(o=>({...o,clientSecret:s.target.value}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-domain",children:"Email Domain"}),e.jsx(d,{id:"sso-domain",placeholder:"company.com",value:i.domain,onChange:s=>c(o=>({...o,domain:s.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The email domain that this SSO provider covers."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(m,{htmlFor:"sso-scopes",children:"Scopes"}),e.jsx(d,{id:"sso-scopes",placeholder:"openid email profile",value:i.scopes,onChange:s=>c(o=>({...o,scopes:s.target.value}))})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(m,{htmlFor:"sso-discovery",children:["Discovery Endpoint"," ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),e.jsx(d,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:i.discoveryEndpoint,onChange:s=>c(o=>({...o,discoveryEndpoint:s.target.value}))})]})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx(u,{onClick:C,disabled:p.isPending,children:p.isPending?"Saving...":x?"Update":"Configure SSO"}),x&&e.jsx(u,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"})]})]})]})]})})})})}function Q(){const n=I.c(1);let r;return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(L,{}),n[0]=r):r=n[0],r}export{Q as default};
@@ -1 +1 @@
1
- import{e as B,j as s,E as ie,r as O,s as ne,o as re,f as oe,g as le,B as Y,t as V,K as ae,a as ce,z as Z}from"./index-C27Pbex0.js";import{i as me}from"./AlertCircle-CJ_7BsPP.js";import{i as de}from"./ChevronRight-BCgvkwtC.js";import{s as fe}from"./Plus-IUiAby9e.js";import{s as ue}from"./Trash01-2of3D7QX.js";import{C as ge}from"./card-fcmwdw-g.js";import{I as W}from"./input-BMDCCsVs.js";import{S as ee}from"./switch-D_oyEj-7.js";import{S as xe}from"./skeleton-CKW2-ArL.js";import{A as te}from"./avatar-F9o71OJ0.js";import{b as he,P as pe,a as ye}from"./popover-C6ihUqMx.js";import{a as se}from"./use-connection-labJovV0.js";import{d as J}from"./constants-Cz3vSCG9.js";import{P as G}from"./index-DsXJm4s8.js";import{u as je}from"./use-registry-connections-Bvn4-1Jy.js";import{e as ve,f as Ce}from"./use-organization-settings-BhA6YmfT.js";import"./User01-Dj2-no-V.js";import"./use-collections-C9mDhhDp.js";import"./use-mobile-49sQdb0b.js";import"./X-BXQFKahF.js";function _e(t){const e=B.c(3),{error:n}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(me,{size:16}),e[0]=m):m=e[0];let r;return e[1]!==n.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",n.message]})]}),e[1]=n.message,e[2]=r):r=e[2],r}function be(t){const e=B.c(39),{onCancel:n,onSuccess:m}=t,r=se(),[o,b]=O.useState(""),[d,P]=O.useState(""),[g,v]=O.useState("");let x;e[0]!==r||e[1]!==o||e[2]!==g||e[3]!==d?(x=async()=>(await r.create.mutateAsync({title:o||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:d,connection_token:g||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=r,e[1]=o,e[2]=g,e[3]=d,e[4]=x):x=e[4];let f;e[5]!==m?(f=k=>{V("store_private_registry_added",{connection_id:k}),Z.success("Private registry added"),m(k)},e[5]=m,e[6]=f):f=e[6];let c;e[7]!==x||e[8]!==f?(c={mutationFn:x,onSuccess:f,onError:Ne},e[7]=x,e[8]=f,e[9]=c):c=e[9];const{mutate:h,isPending:y}=ce(c);let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=j):j=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=k=>b(k.target.value),e[11]=u):u=e[11];let l;e[12]!==o?(l=s.jsxs("div",{className:"space-y-1",children:[j,s.jsx(W,{placeholder:"e.g. Acme Corp Registry",value:o,onChange:u,className:"h-8 text-sm"})]}),e[12]=o,e[13]=l):l=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Registry URL"}),e[14]=C):C=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=k=>P(k.target.value),e[15]=N):N=e[15];let p;e[16]!==d?(p=s.jsxs("div",{className:"space-y-1",children:[C,s.jsx(W,{placeholder:"https://registry.example.com/mcp",value:d,onChange:N,className:"h-8 text-sm"})]}),e[16]=d,e[17]=p):p=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Auth Token (optional)"}),e[18]=S):S=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=k=>v(k.target.value),e[19]=R):R=e[19];let _;e[20]!==g?(_=s.jsxs("div",{className:"space-y-1",children:[S,s.jsx(W,{type:"password",placeholder:"Bearer token...",value:g,onChange:R,className:"h-8 text-sm"})]}),e[20]=g,e[21]=_):_=e[21];let w;e[22]!==y||e[23]!==n?(w=s.jsx(Y,{variant:"ghost",size:"sm",onClick:n,disabled:y,children:"Cancel"}),e[22]=y,e[23]=n,e[24]=w):w=e[24];let a;e[25]!==h?(a=()=>h(),e[25]=h,e[26]=a):a=e[26];const A=!d||y,E=y?"Adding...":"Add Registry";let T;e[27]!==a||e[28]!==A||e[29]!==E?(T=s.jsx(Y,{size:"sm",onClick:a,disabled:A,children:E}),e[27]=a,e[28]=A,e[29]=E,e[30]=T):T=e[30];let M;e[31]!==w||e[32]!==T?(M=s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[w,T]}),e[31]=w,e[32]=T,e[33]=M):M=e[33];let $;return e[34]!==_||e[35]!==M||e[36]!==l||e[37]!==p?($=s.jsxs("div",{className:"space-y-3 p-4 border rounded-lg bg-muted/30",children:[l,p,_,M]}),e[34]=_,e[35]=M,e[36]=l,e[37]=p,e[38]=$):$=e[38],$}function Ne(t){Z.error(`Failed to add registry: ${t.message}`)}function L(t){const e=B.c(38),{name:n,description:m,icon:r,enabled:o,onToggle:b,onDelete:d,href:P}=t,g=oe();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:x}=le(v);let f;e[1]!==o||e[2]!==P||e[3]!==g||e[4]!==b||e[5]!==x?(f=()=>{P?g({to:P,params:{org:x}}):b(!o)},e[1]=o,e[2]=P,e[3]=g,e[4]=b,e[5]=x,e[6]=f):f=e[6];const c=f;let h;e[7]!==c?(h=a=>{a.currentTarget===a.target&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),c())},e[7]=c,e[8]=h):h=e[8];const y=h;let j;e[9]!==r||e[10]!==n?(j=r?s.jsx("img",{src:r,alt:n,className:"size-8 rounded-md object-contain shrink-0"}):s.jsx(te,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary shrink-0"}),e[9]=r,e[10]=n,e[11]=j):j=e[11];let u;e[12]!==n?(u=s.jsx("h3",{className:"font-medium text-sm truncate",children:n}),e[12]=n,e[13]=u):u=e[13];let l;e[14]!==m?(l=s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:m}),e[14]=m,e[15]=l):l=e[15];let C;e[16]!==u||e[17]!==l?(C=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,l]}),e[16]=u,e[17]=l,e[18]=C):C=e[18];let N;e[19]!==d?(N=d&&s.jsxs(he,{children:[s.jsx(pe,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:ke,children:s.jsx(ue,{size:14})})}),s.jsx(ye,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:a=>{a.stopPropagation(),d()},children:"Remove"})]})})]}),e[19]=d,e[20]=N):N=e[20];let p;e[21]!==b?(p=a=>b(a),e[21]=b,e[22]=p):p=e[22];let S;e[23]!==o||e[24]!==p?(S=s.jsx(ee,{checked:o,onClick:Se,onCheckedChange:p}),e[23]=o,e[24]=p,e[25]=S):S=e[25];let R;e[26]!==P?(R=P&&s.jsx(de,{size:14,className:"text-muted-foreground"}),e[26]=P,e[27]=R):R=e[27];let _;e[28]!==S||e[29]!==R||e[30]!==N?(_=s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[N,S,R]}),e[28]=S,e[29]=R,e[30]=N,e[31]=_):_=e[31];let w;return e[32]!==c||e[33]!==y||e[34]!==_||e[35]!==j||e[36]!==C?(w=s.jsxs("div",{role:"button",tabIndex:0,className:"flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-muted/30 transition-colors",onClick:c,onKeyDown:y,children:[j,C,_]}),e[32]=c,e[33]=y,e[34]=_,e[35]=j,e[36]=C,e[37]=w):w=e[37],w}function Se(t){return t.stopPropagation()}function ke(t){return t.stopPropagation()}function Pe(){const t=B.c(55),{org:e}=ne(),n=je(),m=se(),r=ve(),{mutateAsync:o}=Ce(),b=re(),[d,P]=O.useState(!1);let g,v,x,f,c,h;if(t[0]!==m||t[1]!==e.id||t[2]!==b||t[3]!==r||t[4]!==n||t[5]!==d||t[6]!==o){const u=J.REGISTRY(e.id),l=i=>{if(!r)return i===u;const z=r.registries[i];return z?z.enabled:i===u},C=J.COMMUNITY_REGISTRY(e.id),N=n.find(i=>i.id===u),p=n.find(i=>i.id===C||i.id==="community-registry"),S=p?.id??C,R=J.SELF(e.id),_=new Set([u,C,"community-registry",R]),w=n.filter(i=>!_.has(i.id));let a;t[13]!==r||t[14]!==o?(a=async(i,z)=>{V("store_registry_toggled",{connection_id:i,enabled:z});const X=r??{registries:{},blockedMcps:[]};await o({...X,registries:{...X.registries,[i]:{enabled:z}}})},t[13]=r,t[14]=o,t[15]=a):a=t[15];const A=a;let E;t[16]!==m||t[17]!==e.id||t[18]!==b?(E=async i=>{V("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),b.invalidateQueries({queryKey:ae.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=b,t[19]=E):E=t[19];const T=E;let M;t[20]!==r||t[21]!==o?(M=async i=>{P(!1);const z=r??{registries:{},blockedMcps:[]};await o({...z,registries:{...z.registries,[i]:{enabled:!0}}})},t[20]=r,t[21]=o,t[22]=M):M=t[22];const $=M;f="space-y-6";let k;t[23]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Deco Store"}),t[23]=k):k=t[23];const Q=N?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:N.icon,enabled:l(u),onToggle:i=>A(u,i)}):s.jsx(ge,{className:"p-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Deco Store connection not found. It will be created automatically."})});t[24]!==Q?(c=s.jsxs("div",{className:"space-y-3",children:[k,Q]}),t[24]=Q,t[25]=c):c=t[25];let U;t[26]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Private Registries"}),t[26]=U):U=t[26];let D;t[27]!==l?(D=l("self"),t[27]=l,t[28]=D):D=t[28];let F;t[29]!==A?(F=i=>A("self",i),t[29]=A,t[30]=F):F=t[30];let I;t[31]!==D||t[32]!==F?(I=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:D,onToggle:F,href:"/$org/settings/store/registry"}),t[31]=D,t[32]=F,t[33]=I):I=t[33];let q;t[34]!==T||t[35]!==A||t[36]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:z=>A(i.id,z),onDelete:()=>T(i.id)},i.id),t[34]=T,t[35]=A,t[36]=l,t[37]=q):q=t[37];const H=w.map(q);let K;t[38]!==$||t[39]!==d?(K=d?s.jsx(be,{onCancel:()=>P(!1),onSuccess:$}):s.jsxs(Y,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>P(!0),children:[s.jsx(fe,{size:14}),"Add Private Registry"]}),t[38]=$,t[39]=d,t[40]=K):K=t[40],t[41]!==I||t[42]!==H||t[43]!==K?(h=s.jsxs("div",{className:"space-y-3",children:[U,I,H,K]}),t[41]=I,t[42]=H,t[43]=K,t[44]=h):h=t[44],g="space-y-3",t[45]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Community"}),t[45]=v):v=t[45],x=p?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:p.icon,enabled:l(S),onToggle:i=>A(S,i)}):s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-md bg-muted/30",children:[s.jsx(te,{fallback:"M",className:"size-8 bg-primary/10 text-primary shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-medium",children:"MCP Registry"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Community MCP registry — not yet added"})]}),s.jsx(ee,{checked:!1,disabled:!0,onCheckedChange:Re})]}),t[0]=m,t[1]=e.id,t[2]=b,t[3]=r,t[4]=n,t[5]=d,t[6]=o,t[7]=g,t[8]=v,t[9]=x,t[10]=f,t[11]=c,t[12]=h}else g=t[7],v=t[8],x=t[9],f=t[10],c=t[11],h=t[12];let y;t[46]!==g||t[47]!==v||t[48]!==x?(y=s.jsxs("div",{className:g,children:[v,x]}),t[46]=g,t[47]=v,t[48]=x,t[49]=y):y=t[49];let j;return t[50]!==f||t[51]!==c||t[52]!==h||t[53]!==y?(j=s.jsxs("div",{className:f,children:[c,h,y]}),t[50]=f,t[51]=c,t[52]=h,t[53]=y,t[54]=j):j=t[54],j}function Re(){}function we(){const t=B.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xe,{className:"h-64 w-full"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ie,{fallback:Ae,children:s.jsx(O.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx(G.Title,{children:"Store"})}),s.jsx(Pe,{})]})})})})})}),t[1]=n):n=t[1],n}function Ae(t){const{error:e}=t;return s.jsx(_e,{error:e??new Error("Failed to load store settings")})}function Ve(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(we,{}),t[0]=e):e=t[0],e}export{Ve as default};
1
+ import{e as B,j as s,E as ie,r as O,s as ne,o as re,f as oe,g as le,B as Y,t as V,K as ae,a as ce,z as Z}from"./index-BR4Tv9I4.js";import{i as me}from"./AlertCircle-i753hIUr.js";import{i as de}from"./ChevronRight-P2x5wJJp.js";import{s as fe}from"./Plus-BM77-3yZ.js";import{s as ue}from"./Trash01-DeQUJecj.js";import{C as ge}from"./card-64W2yOQo.js";import{I as W}from"./input-C6wlfqbz.js";import{S as ee}from"./switch-CM_vPUzz.js";import{S as xe}from"./skeleton-CmnvTWJg.js";import{A as te}from"./avatar-BeRTzZHX.js";import{b as he,P as pe,a as ye}from"./popover-DL7_3A88.js";import{a as se}from"./use-connection-NZXO3HH3.js";import{d as J}from"./constants-CN6Il9QM.js";import{P as G}from"./index-BxuUqWWJ.js";import{u as je}from"./use-registry-connections-DN_uk-6v.js";import{e as ve,f as Ce}from"./use-organization-settings-bbuIudaf.js";import"./User01-CFTuPOYw.js";import"./use-collections-Bo1B5pfj.js";import"./use-mobile-UG3f-VUD.js";import"./X-B19qdsWt.js";function _e(t){const e=B.c(3),{error:n}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(me,{size:16}),e[0]=m):m=e[0];let r;return e[1]!==n.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",n.message]})]}),e[1]=n.message,e[2]=r):r=e[2],r}function be(t){const e=B.c(39),{onCancel:n,onSuccess:m}=t,r=se(),[o,b]=O.useState(""),[d,P]=O.useState(""),[g,v]=O.useState("");let x;e[0]!==r||e[1]!==o||e[2]!==g||e[3]!==d?(x=async()=>(await r.create.mutateAsync({title:o||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:d,connection_token:g||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=r,e[1]=o,e[2]=g,e[3]=d,e[4]=x):x=e[4];let f;e[5]!==m?(f=k=>{V("store_private_registry_added",{connection_id:k}),Z.success("Private registry added"),m(k)},e[5]=m,e[6]=f):f=e[6];let c;e[7]!==x||e[8]!==f?(c={mutationFn:x,onSuccess:f,onError:Ne},e[7]=x,e[8]=f,e[9]=c):c=e[9];const{mutate:h,isPending:y}=ce(c);let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=j):j=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=k=>b(k.target.value),e[11]=u):u=e[11];let l;e[12]!==o?(l=s.jsxs("div",{className:"space-y-1",children:[j,s.jsx(W,{placeholder:"e.g. Acme Corp Registry",value:o,onChange:u,className:"h-8 text-sm"})]}),e[12]=o,e[13]=l):l=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Registry URL"}),e[14]=C):C=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=k=>P(k.target.value),e[15]=N):N=e[15];let p;e[16]!==d?(p=s.jsxs("div",{className:"space-y-1",children:[C,s.jsx(W,{placeholder:"https://registry.example.com/mcp",value:d,onChange:N,className:"h-8 text-sm"})]}),e[16]=d,e[17]=p):p=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Auth Token (optional)"}),e[18]=S):S=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=k=>v(k.target.value),e[19]=R):R=e[19];let _;e[20]!==g?(_=s.jsxs("div",{className:"space-y-1",children:[S,s.jsx(W,{type:"password",placeholder:"Bearer token...",value:g,onChange:R,className:"h-8 text-sm"})]}),e[20]=g,e[21]=_):_=e[21];let w;e[22]!==y||e[23]!==n?(w=s.jsx(Y,{variant:"ghost",size:"sm",onClick:n,disabled:y,children:"Cancel"}),e[22]=y,e[23]=n,e[24]=w):w=e[24];let a;e[25]!==h?(a=()=>h(),e[25]=h,e[26]=a):a=e[26];const A=!d||y,E=y?"Adding...":"Add Registry";let T;e[27]!==a||e[28]!==A||e[29]!==E?(T=s.jsx(Y,{size:"sm",onClick:a,disabled:A,children:E}),e[27]=a,e[28]=A,e[29]=E,e[30]=T):T=e[30];let M;e[31]!==w||e[32]!==T?(M=s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[w,T]}),e[31]=w,e[32]=T,e[33]=M):M=e[33];let $;return e[34]!==_||e[35]!==M||e[36]!==l||e[37]!==p?($=s.jsxs("div",{className:"space-y-3 p-4 border rounded-lg bg-muted/30",children:[l,p,_,M]}),e[34]=_,e[35]=M,e[36]=l,e[37]=p,e[38]=$):$=e[38],$}function Ne(t){Z.error(`Failed to add registry: ${t.message}`)}function L(t){const e=B.c(38),{name:n,description:m,icon:r,enabled:o,onToggle:b,onDelete:d,href:P}=t,g=oe();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:x}=le(v);let f;e[1]!==o||e[2]!==P||e[3]!==g||e[4]!==b||e[5]!==x?(f=()=>{P?g({to:P,params:{org:x}}):b(!o)},e[1]=o,e[2]=P,e[3]=g,e[4]=b,e[5]=x,e[6]=f):f=e[6];const c=f;let h;e[7]!==c?(h=a=>{a.currentTarget===a.target&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),c())},e[7]=c,e[8]=h):h=e[8];const y=h;let j;e[9]!==r||e[10]!==n?(j=r?s.jsx("img",{src:r,alt:n,className:"size-8 rounded-md object-contain shrink-0"}):s.jsx(te,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary shrink-0"}),e[9]=r,e[10]=n,e[11]=j):j=e[11];let u;e[12]!==n?(u=s.jsx("h3",{className:"font-medium text-sm truncate",children:n}),e[12]=n,e[13]=u):u=e[13];let l;e[14]!==m?(l=s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:m}),e[14]=m,e[15]=l):l=e[15];let C;e[16]!==u||e[17]!==l?(C=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,l]}),e[16]=u,e[17]=l,e[18]=C):C=e[18];let N;e[19]!==d?(N=d&&s.jsxs(he,{children:[s.jsx(pe,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:ke,children:s.jsx(ue,{size:14})})}),s.jsx(ye,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:a=>{a.stopPropagation(),d()},children:"Remove"})]})})]}),e[19]=d,e[20]=N):N=e[20];let p;e[21]!==b?(p=a=>b(a),e[21]=b,e[22]=p):p=e[22];let S;e[23]!==o||e[24]!==p?(S=s.jsx(ee,{checked:o,onClick:Se,onCheckedChange:p}),e[23]=o,e[24]=p,e[25]=S):S=e[25];let R;e[26]!==P?(R=P&&s.jsx(de,{size:14,className:"text-muted-foreground"}),e[26]=P,e[27]=R):R=e[27];let _;e[28]!==S||e[29]!==R||e[30]!==N?(_=s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[N,S,R]}),e[28]=S,e[29]=R,e[30]=N,e[31]=_):_=e[31];let w;return e[32]!==c||e[33]!==y||e[34]!==_||e[35]!==j||e[36]!==C?(w=s.jsxs("div",{role:"button",tabIndex:0,className:"flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-muted/30 transition-colors",onClick:c,onKeyDown:y,children:[j,C,_]}),e[32]=c,e[33]=y,e[34]=_,e[35]=j,e[36]=C,e[37]=w):w=e[37],w}function Se(t){return t.stopPropagation()}function ke(t){return t.stopPropagation()}function Pe(){const t=B.c(55),{org:e}=ne(),n=je(),m=se(),r=ve(),{mutateAsync:o}=Ce(),b=re(),[d,P]=O.useState(!1);let g,v,x,f,c,h;if(t[0]!==m||t[1]!==e.id||t[2]!==b||t[3]!==r||t[4]!==n||t[5]!==d||t[6]!==o){const u=J.REGISTRY(e.id),l=i=>{if(!r)return i===u;const z=r.registries[i];return z?z.enabled:i===u},C=J.COMMUNITY_REGISTRY(e.id),N=n.find(i=>i.id===u),p=n.find(i=>i.id===C||i.id==="community-registry"),S=p?.id??C,R=J.SELF(e.id),_=new Set([u,C,"community-registry",R]),w=n.filter(i=>!_.has(i.id));let a;t[13]!==r||t[14]!==o?(a=async(i,z)=>{V("store_registry_toggled",{connection_id:i,enabled:z});const X=r??{registries:{},blockedMcps:[]};await o({...X,registries:{...X.registries,[i]:{enabled:z}}})},t[13]=r,t[14]=o,t[15]=a):a=t[15];const A=a;let E;t[16]!==m||t[17]!==e.id||t[18]!==b?(E=async i=>{V("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),b.invalidateQueries({queryKey:ae.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=b,t[19]=E):E=t[19];const T=E;let M;t[20]!==r||t[21]!==o?(M=async i=>{P(!1);const z=r??{registries:{},blockedMcps:[]};await o({...z,registries:{...z.registries,[i]:{enabled:!0}}})},t[20]=r,t[21]=o,t[22]=M):M=t[22];const $=M;f="space-y-6";let k;t[23]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Deco Store"}),t[23]=k):k=t[23];const Q=N?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:N.icon,enabled:l(u),onToggle:i=>A(u,i)}):s.jsx(ge,{className:"p-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Deco Store connection not found. It will be created automatically."})});t[24]!==Q?(c=s.jsxs("div",{className:"space-y-3",children:[k,Q]}),t[24]=Q,t[25]=c):c=t[25];let U;t[26]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Private Registries"}),t[26]=U):U=t[26];let D;t[27]!==l?(D=l("self"),t[27]=l,t[28]=D):D=t[28];let F;t[29]!==A?(F=i=>A("self",i),t[29]=A,t[30]=F):F=t[30];let I;t[31]!==D||t[32]!==F?(I=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:D,onToggle:F,href:"/$org/settings/store/registry"}),t[31]=D,t[32]=F,t[33]=I):I=t[33];let q;t[34]!==T||t[35]!==A||t[36]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:z=>A(i.id,z),onDelete:()=>T(i.id)},i.id),t[34]=T,t[35]=A,t[36]=l,t[37]=q):q=t[37];const H=w.map(q);let K;t[38]!==$||t[39]!==d?(K=d?s.jsx(be,{onCancel:()=>P(!1),onSuccess:$}):s.jsxs(Y,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>P(!0),children:[s.jsx(fe,{size:14}),"Add Private Registry"]}),t[38]=$,t[39]=d,t[40]=K):K=t[40],t[41]!==I||t[42]!==H||t[43]!==K?(h=s.jsxs("div",{className:"space-y-3",children:[U,I,H,K]}),t[41]=I,t[42]=H,t[43]=K,t[44]=h):h=t[44],g="space-y-3",t[45]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Community"}),t[45]=v):v=t[45],x=p?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:p.icon,enabled:l(S),onToggle:i=>A(S,i)}):s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-md bg-muted/30",children:[s.jsx(te,{fallback:"M",className:"size-8 bg-primary/10 text-primary shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-medium",children:"MCP Registry"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Community MCP registry — not yet added"})]}),s.jsx(ee,{checked:!1,disabled:!0,onCheckedChange:Re})]}),t[0]=m,t[1]=e.id,t[2]=b,t[3]=r,t[4]=n,t[5]=d,t[6]=o,t[7]=g,t[8]=v,t[9]=x,t[10]=f,t[11]=c,t[12]=h}else g=t[7],v=t[8],x=t[9],f=t[10],c=t[11],h=t[12];let y;t[46]!==g||t[47]!==v||t[48]!==x?(y=s.jsxs("div",{className:g,children:[v,x]}),t[46]=g,t[47]=v,t[48]=x,t[49]=y):y=t[49];let j;return t[50]!==f||t[51]!==c||t[52]!==h||t[53]!==y?(j=s.jsxs("div",{className:f,children:[c,h,y]}),t[50]=f,t[51]=c,t[52]=h,t[53]=y,t[54]=j):j=t[54],j}function Re(){}function we(){const t=B.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xe,{className:"h-64 w-full"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ie,{fallback:Ae,children:s.jsx(O.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx(G.Title,{children:"Store"})}),s.jsx(Pe,{})]})})})})})}),t[1]=n):n=t[1],n}function Ae(t){const{error:e}=t;return s.jsx(_e,{error:e??new Error("Failed to load store settings")})}function Ve(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(we,{}),t[0]=e):e=t[0],e}export{Ve as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-CEoOd_Wq.js","assets/index-BR4Tv9I4.js","assets/index-DHRo5LVc.css","assets/ArrowNarrowLeft-DyneV8jh.js","assets/CheckCircle-BDNIuV_g.js","assets/Container-DsC3rtEa.js","assets/Settings02-CZ-RzoRL.js","assets/XCircle-Cu_m9KsD.js","assets/constants-CN6Il9QM.js","assets/useInfiniteQuery-C5UYrvtb.js","assets/infiniteQueryObserver-DjdUCzEf.js","assets/badge-OuHAk68F.js","assets/input-C6wlfqbz.js","assets/dropdown-menu-D_gbsFgj.js","assets/ChevronDown-vRDN8zoj.js","assets/ChevronRight-P2x5wJJp.js","assets/table-S8IBqobR.js","assets/toggle-group-xjN2RMip.js","assets/use-view-mode-BvSJEzBA.js","assets/use-mobile-UG3f-VUD.js","assets/SearchMd-BQ703EvX.js","assets/dialog-BG20y4ti.js","assets/X-B19qdsWt.js","assets/AlertCircle-i753hIUr.js","assets/Upload01-C7vhn2fS.js","assets/alert-dialog-BJ0hwa2l.js","assets/card-64W2yOQo.js","assets/Trash01-DeQUJecj.js","assets/label-CMuBjs0l.js","assets/select-BQ3zutkO.js","assets/ChevronUp-Dg737K7F.js","assets/switch-CM_vPUzz.js","assets/textarea-Bxm5HSBV.js","assets/checkbox-Cx3RPx8a.js","assets/LinkExternal01-Cw9xV77y.js","assets/use-copy-BRihc-l2.js","assets/Plus-BM77-3yZ.js","assets/Play-F_qMNNeX.js"])))=>i.map(i=>d[i]);
2
+ import{e as n,f as c,g as m,j as r,l as f,r as l,aF as u}from"./index-BR4Tv9I4.js";const g=l.lazy(()=>u(()=>import("./registry-layout-CEoOd_Wq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])));function _(){const e=n.c(5),o=c();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org"},e[0]=t):t=e[0];const{org:i}=m(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==i?(a=r.jsx(l.Suspense,{fallback:s,children:r.jsx(g,{onBack:()=>o({to:"/$org/settings/store",params:{org:i}})})}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}export{_ as default};
@@ -1 +1 @@
1
- import{r as c,j as i,ai as C,b7 as y,aU as T,aj as I,b8 as M,b9 as H,ap as U,e as z,c as g}from"./index-C27Pbex0.js";var m="Switch",[A]=U(m),[q,L]=A(m),E=c.forwardRef((r,e)=>{const{__scopeSwitch:t,name:s,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=r,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=T({prop:a,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(r.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((r,e)=>{const{__scopeSwitch:t,...s}=r,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:s=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(v)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(r){return r?"checked":"unchecked"}var $=E,D=R;function W(r){const e=z.c(9);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...s,children:n}),e[6]=s,e[7]=a,e[8]=o):o=e[8],o}export{W as S};
1
+ import{r as c,j as i,ai as C,b7 as y,aU as T,aj as I,b8 as M,b9 as H,ap as U,e as z,c as g}from"./index-BR4Tv9I4.js";var m="Switch",[A]=U(m),[q,L]=A(m),E=c.forwardRef((r,e)=>{const{__scopeSwitch:t,name:s,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=r,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=T({prop:a,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(r.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((r,e)=>{const{__scopeSwitch:t,...s}=r,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:s=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(v)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(r){return r?"checked":"unchecked"}var $=E,D=R;function W(r){const e=z.c(9);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...s,children:n}),e[6]=s,e[7]=a,e[8]=o):o=e[8],o}export{W as S};
@@ -1 +1 @@
1
- import{e as c,c as n,j as r}from"./index-C27Pbex0.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-background dark:bg-input/30 rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("[&_tr]:border-b sticky top-0 z-10 bg-background",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function u(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{u as T,p as a,f as b,d as c,b as d,m as e};
1
+ import{e as c,c as n,j as r}from"./index-BR4Tv9I4.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-background dark:bg-input/30 rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("[&_tr]:border-b sticky top-0 z-10 bg-background",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function u(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=n("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{u as T,p as a,f as b,d as c,b as d,m as e};
@@ -1 +1 @@
1
- import{e as b,n as A,V as F,aP as V,aQ as k,r as f,j as d,aR as L,ai as m,aj as y,aS as h,ap as q,aT as D,aU as K,aV as G,aW as Q,aX as z,c as g}from"./index-C27Pbex0.js";import{K as w}from"./constants-Cz3vSCG9.js";async function C(s){if(!s.getServerCapabilities()?.prompts)return{prompts:[]};try{return await s.listPrompts()}catch(t){if(t instanceof V&&t.code===k.MethodNotFound)return{prompts:[]};throw t}}async function Z(s,e,t){if(!s.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await s.getPrompt({name:e,arguments:t??{}})}function ee(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],F(i)}function te(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],A(i)}var x="Tabs",[O]=q(x,[h]),P=h(),[B,T]=O(x),N=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,onValueChange:r,defaultValue:o,orientation:n="horizontal",dir:i,activationMode:l="automatic",...v}=s,u=D(i),[c,p]=K({prop:a,onChange:r,defaultProp:o??"",caller:x});return d.jsx(B,{scope:t,baseId:G(),value:c,onValueChange:p,orientation:n,dir:u,activationMode:l,children:d.jsx(m.div,{dir:u,"data-orientation":n,...v,ref:e})})});N.displayName=x;var j="TabsList",E=f.forwardRef((s,e)=>{const{__scopeTabs:t,loop:a=!0,...r}=s,o=T(j,t),n=P(t);return d.jsx(Q,{asChild:!0,...n,orientation:o.orientation,dir:o.dir,loop:a,children:d.jsx(m.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});E.displayName=j;var I="TabsTrigger",_=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,disabled:r=!1,...o}=s,n=T(I,t),i=P(t),l=M(n.baseId,a),v=$(n.baseId,a),u=a===n.value;return d.jsx(L,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":v,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:e,onMouseDown:y(s.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?n.onValueChange(a):c.preventDefault()}),onKeyDown:y(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&n.onValueChange(a)}),onFocus:y(s.onFocus,()=>{const c=n.activationMode!=="manual";!u&&!r&&c&&n.onValueChange(a)})})})});_.displayName=I;var R="TabsContent",S=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,forceMount:r,children:o,...n}=s,i=T(R,t),l=M(i.baseId,a),v=$(i.baseId,a),u=a===i.value,c=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(z,{present:r||u,children:({present:p})=>d.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:v,tabIndex:0,...n,ref:e,style:{...s.style,animationDuration:c.current?"0s":void 0},children:p&&o})})});S.displayName=R;function M(s,e){return`${s}-trigger-${e}`}function $(s,e){return`${s}-content-${e}`}var H=N,U=E,W=_,X=S;function ae(s){const e=b.c(10);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r===void 0?"pill":r;let n;e[4]!==t?(n=g("flex flex-col gap-2",t),e[4]=t,e[5]=n):n=e[5];let i;return e[6]!==a||e[7]!==n||e[8]!==o?(i=d.jsx(H,{"data-slot":"tabs","data-variant":o,className:n,...a}),e[6]=a,e[7]=n,e[8]=o,e[9]=i):i=e[9],i}function re(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex h-[52px] items-center border-b border-border":o==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(U,{"data-slot":"tabs-list","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function se(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":o==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(W,{"data-slot":"tabs-trigger","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function oe(s){const e=b.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=g("flex-1 outline-none h-full",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=d.jsx(X,{"data-slot":"tabs-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{ae as T,oe as a,se as b,re as c,te as d,Z as g,C as l,ee as u};
1
+ import{e as b,n as A,V as F,aP as V,aQ as k,r as f,j as d,aR as L,ai as m,aj as y,aS as h,ap as q,aT as D,aU as K,aV as G,aW as Q,aX as z,c as g}from"./index-BR4Tv9I4.js";import{K as w}from"./constants-CN6Il9QM.js";async function C(s){if(!s.getServerCapabilities()?.prompts)return{prompts:[]};try{return await s.listPrompts()}catch(t){if(t instanceof V&&t.code===k.MethodNotFound)return{prompts:[]};throw t}}async function Z(s,e,t){if(!s.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await s.getPrompt({name:e,arguments:t??{}})}function ee(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],F(i)}function te(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],A(i)}var x="Tabs",[O]=q(x,[h]),P=h(),[B,T]=O(x),N=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,onValueChange:r,defaultValue:o,orientation:n="horizontal",dir:i,activationMode:l="automatic",...v}=s,u=D(i),[c,p]=K({prop:a,onChange:r,defaultProp:o??"",caller:x});return d.jsx(B,{scope:t,baseId:G(),value:c,onValueChange:p,orientation:n,dir:u,activationMode:l,children:d.jsx(m.div,{dir:u,"data-orientation":n,...v,ref:e})})});N.displayName=x;var j="TabsList",E=f.forwardRef((s,e)=>{const{__scopeTabs:t,loop:a=!0,...r}=s,o=T(j,t),n=P(t);return d.jsx(Q,{asChild:!0,...n,orientation:o.orientation,dir:o.dir,loop:a,children:d.jsx(m.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});E.displayName=j;var I="TabsTrigger",_=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,disabled:r=!1,...o}=s,n=T(I,t),i=P(t),l=M(n.baseId,a),v=$(n.baseId,a),u=a===n.value;return d.jsx(L,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":v,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:e,onMouseDown:y(s.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?n.onValueChange(a):c.preventDefault()}),onKeyDown:y(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&n.onValueChange(a)}),onFocus:y(s.onFocus,()=>{const c=n.activationMode!=="manual";!u&&!r&&c&&n.onValueChange(a)})})})});_.displayName=I;var R="TabsContent",S=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,forceMount:r,children:o,...n}=s,i=T(R,t),l=M(i.baseId,a),v=$(i.baseId,a),u=a===i.value,c=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(z,{present:r||u,children:({present:p})=>d.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:v,tabIndex:0,...n,ref:e,style:{...s.style,animationDuration:c.current?"0s":void 0},children:p&&o})})});S.displayName=R;function M(s,e){return`${s}-trigger-${e}`}function $(s,e){return`${s}-content-${e}`}var H=N,U=E,W=_,X=S;function ae(s){const e=b.c(10);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r===void 0?"pill":r;let n;e[4]!==t?(n=g("flex flex-col gap-2",t),e[4]=t,e[5]=n):n=e[5];let i;return e[6]!==a||e[7]!==n||e[8]!==o?(i=d.jsx(H,{"data-slot":"tabs","data-variant":o,className:n,...a}),e[6]=a,e[7]=n,e[8]=o,e[9]=i):i=e[9],i}function re(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex h-[52px] items-center border-b border-border":o==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(U,{"data-slot":"tabs-list","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function se(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":o==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(W,{"data-slot":"tabs-trigger","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function oe(s){const e=b.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=g("flex-1 outline-none h-full",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=d.jsx(X,{"data-slot":"tabs-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{ae as T,oe as a,se as b,re as c,te as d,Z as g,C as l,ee as u};