decocms 4.321.3 → 4.321.5

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 (254) hide show
  1. package/dist/client/assets/{AlertCircle-DlZdUT4y.js → AlertCircle-CjhgF3vK.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CDaTYOly.js → AreaChart-B4JKGcdS.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-B_C58IhS.js → ArrowLeft-DjieScGW.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-0zKbGhZX.js → ArrowUp-DOewE1qv.js} +1 -1
  5. package/dist/client/assets/{Check-Bu3XsPtR.js → Check-D5XzCZva.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DKTcHnyM.js → CheckCircle-iUtdabgI.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DuX1hKVe.js → ChevronRight-BkCMOd4C.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-CUY38lF0.js → ChevronSelectorVertical-C7ueTKUo.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DDdMqJL1.js → ChevronUp-rYvSsRjP.js} +1 -1
  10. package/dist/client/assets/{Copy01-BbXi4FYi.js → Copy01-D5UYujbX.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-gu6q0yZd.js → CreditCard01-3vvlQGFk.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-PUVVFLTP.js → DotsVertical-D1_N6gFC.js} +1 -1
  13. package/dist/client/assets/{Download01-AtmH14NN.js → Download01-hGLAd0mm.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-qLO8ohog.js → ErrorBarContext-o-Fkq2Ln.js} +1 -1
  15. package/dist/client/assets/{Eye-Z_2DhwO_.js → Eye-msF77noH.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-BritbDKe.js → GitBranch01-CfKitZQX.js} +1 -1
  17. package/dist/client/assets/{Globe01-DIQAtDkP.js → Globe01-Cmz_gJoO.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DjrfIOu4.js → HardDrive-CdioWthT.js} +1 -1
  19. package/dist/client/assets/{Image01-CGO7yG2R.js → Image01-Db6iL1L-.js} +1 -1
  20. package/dist/client/assets/{Key01-m5a-9O7E.js → Key01-D2vuY6hS.js} +1 -1
  21. package/dist/client/assets/{Link01-_3xhMoAr.js → Link01-BkSSEygv.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DFZf17HG.js → LinkExternal01-C9li9a1P.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Cym0a0IH.js → Monitor01-BxqJ2lfk.js} +1 -1
  24. package/dist/client/assets/{Package-BA5DvHbm.js → Package-sAm7St0O.js} +1 -1
  25. package/dist/client/assets/{Palette-DVp1cbTL.js → Palette-D3vbkhAB.js} +1 -1
  26. package/dist/client/assets/{Play-CC767BNc.js → Play-4YhTSJF0.js} +1 -1
  27. package/dist/client/assets/{Plus-BsdY3vta.js → Plus-BKIxzM6s.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CQywkGC8.js → SearchMd-DjN-DKoK.js} +1 -1
  29. package/dist/client/assets/{Sector-6c8v6F9Y.js → Sector-BLtiNIir.js} +1 -1
  30. package/dist/client/assets/{Settings02-B3BHuFlc.js → Settings02-CniOGh2R.js} +1 -1
  31. package/dist/client/assets/{Share07-DQRfeucj.js → Share07-BJIuab_2.js} +1 -1
  32. package/dist/client/assets/{Shield01-CfLUCs7T.js → Shield01-Bi6Wt_Bu.js} +1 -1
  33. package/dist/client/assets/{Stars01-D7oX_8Wb.js → Stars01-DF4f96O4.js} +1 -1
  34. package/dist/client/assets/{Sun-DwFd1air.js → Sun-Ccd3Vvd3.js} +1 -1
  35. package/dist/client/assets/{Tool01-Dh-2dHg7.js → Tool01-BuNvOC1h.js} +1 -1
  36. package/dist/client/assets/{Tool02-C5-ESFs5.js → Tool02-DpNDBEil.js} +1 -1
  37. package/dist/client/assets/{Trash01-DgYh1NxX.js → Trash01-DXHCqEe6.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-0nrjwpEZ.js → TrendUp01-DaIUMzmz.js} +1 -1
  39. package/dist/client/assets/{Upload01-jkHCXrUI.js → Upload01-CPO6AwG4.js} +1 -1
  40. package/dist/client/assets/{User01-yXo0r48U.js → User01-mzLrMAfi.js} +1 -1
  41. package/dist/client/assets/{UserSquare-B19aw2mP.js → UserSquare-vGUnOUu5.js} +1 -1
  42. package/dist/client/assets/{Users01-BiFVZazG.js → Users01-Dtk1qxXT.js} +1 -1
  43. package/dist/client/assets/{Users03-C9WBhoi4.js → Users03-B7DS8i2Z.js} +1 -1
  44. package/dist/client/assets/{XCircle-DRYTYfoJ.js → XCircle-D0IscWfB.js} +1 -1
  45. package/dist/client/assets/{XClose-D_sSgqWY.js → XClose-Bw26wZe2.js} +1 -1
  46. package/dist/client/assets/{Zap-BwqaqJR6.js → Zap-BxV_wNn9.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DL9fn9Rn.js → ZoomOut-CXTlcyBa.js} +1 -1
  48. package/dist/client/assets/{access-gate-Cr4kGdoG.js → access-gate-VXc3n5Tl.js} +1 -1
  49. package/dist/client/assets/{agent-icon-RpsSZWOm.js → agent-icon-BQA3BxVU.js} +1 -1
  50. package/dist/client/assets/agents-list-DAAaYRTV.js +1 -0
  51. package/dist/client/assets/{ai-providers-dfmBmLi1.js → ai-providers-BK3I1K8S.js} +1 -1
  52. package/dist/client/assets/{alert-DDOSdHF1.js → alert-COnOFEuN.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BwkydmfJ.js → alert-dialog-C2u5xYM5.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-CfuMS2EL.js → analytics-tab-BF3qnd05.js} +1 -1
  55. package/dist/client/assets/api-keys-BSfQHEUl.js +1 -0
  56. package/dist/client/assets/{api-keys-DMRP4EpN.js → api-keys-k31q4uJT.js} +1 -1
  57. package/dist/client/assets/{app-editor-DqP-YnLu.js → app-editor-CBQYggH6.js} +1 -1
  58. package/dist/client/assets/{auth-catchall-DjUs0QfG.js → auth-catchall-CXsAwLpp.js} +1 -1
  59. package/dist/client/assets/{auth-1n-nSaCp.js → auth-cfubGdj3.js} +1 -1
  60. package/dist/client/assets/{auth-entry-l2FufJt_.js → auth-entry-Cp-9Vl-Z.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-BFjeh5RK.js → auth-split-layout-CVD6XG6e.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-CczjH39y.js → authenticate-and-persist-oauth-BwmApcxP.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DJmiHAcQ.js → automation-list-row-tSPFX-ed.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CPO7lLwq.js → automation-runs-DQXBuaQh.js} +1 -1
  65. package/dist/client/assets/{automations-nuUr74Pw.js → automations-DZtzLDko.js} +1 -1
  66. package/dist/client/assets/{avatar-D7BI9kIY.js → avatar-65M-tykE.js} +1 -1
  67. package/dist/client/assets/{badge-C7G_dwIu.js → badge-BlkJw9ZT.js} +1 -1
  68. package/dist/client/assets/{block-document-DoNf7H3D.js → block-document-D7S4AfrT.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-BAjbmNYL.js → breadcrumb-1tRgR6ke.js} +1 -1
  70. package/dist/client/assets/{buckets-BzOMvHnI.js → buckets-DQgYHPnt.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-CDcCaEVa.js → bulk-category-panel-BAYz2_C9.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DdUEYVnx.js → capability-load-error-DiWeeuLw.js} +1 -1
  73. package/dist/client/assets/{cards-evwCQ3BJ.js → cards-BQ5m1ZaL.js} +1 -1
  74. package/dist/client/assets/{category-editor-BUgoXsGS.js → category-editor-Dp4gJGUo.js} +1 -1
  75. package/dist/client/assets/{cdn-tab-C7HzaQJs.js → cdn-tab-DSB7ZS0h.js} +1 -1
  76. package/dist/client/assets/{chart-BbiPqYsI.js → chart-BSRtxUXr.js} +1 -1
  77. package/dist/client/assets/{chat-context-5h3SEksi.js → chat-context-DKWUJJQk.js} +1 -1
  78. package/dist/client/assets/{checkbox-DrLBm6Hu.js → checkbox-C6unHBB5.js} +1 -1
  79. package/dist/client/assets/{choose-editor-C_UqQB0X.js → choose-editor-MOqcOH7b.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-mbtPKAeO.js → cli-auth-success-CqFfKIh9.js} +1 -1
  81. package/dist/client/assets/{client-icons-Dx7ZT4qY.js → client-icons-DzX9Vbzz.js} +1 -1
  82. package/dist/client/assets/{collection-detail-3F2jLAIe.js → collection-detail-C31CzNrH.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-BuGIMFHI.js → collection-display-button-4eZzlNhD.js} +1 -1
  84. package/dist/client/assets/{collection-search-Byf9covb.js → collection-search-7lVLJWOB.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-C9hfGOql.js → collection-table-wrapper-BrisTU0i.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-4YD6nwky.js → collection-tabs-D9skai09.js} +1 -1
  87. package/dist/client/assets/{command-Bz-l73oK.js → command-CiqpOqS9.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-Dt2M_QAS.js → commerce-onboarding-DMDBByMY.js} +1 -1
  89. package/dist/client/assets/{connect-DaJLytlD.js → connect-BzlWBjZm.js} +1 -1
  90. package/dist/client/assets/{connect-layout-D7bRiFvQ.js → connect-layout-BjHZtb1k.js} +1 -1
  91. package/dist/client/assets/connection-LSXDLhvc.js +1 -0
  92. package/dist/client/assets/{connection-card-kBzgkq3q.js → connection-card-CExTxSsL.js} +1 -1
  93. package/dist/client/assets/connection-detail-DatPU092.js +1 -0
  94. package/dist/client/assets/{connection-form-helpers-CkY6wGpq.js → connection-form-helpers-CuPBBiAF.js} +1 -1
  95. package/dist/client/assets/{connections-NFtaWcpm.js → connections-Bg6qG3Ax.js} +1 -1
  96. package/dist/client/assets/{create-organization-dialog-CZnpESma.js → create-organization-dialog-Bn2HCOk4.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool-Ccw1vgMp.js → decopilot-sse-pool-CZGi6xG2.js} +1 -1
  98. package/dist/client/assets/{dialog-lVg2I_FW.js → dialog-B49rrPcE.js} +1 -1
  99. package/dist/client/assets/{domain-settings-2IuIzWRo.js → domain-settings-CVN9LhLH.js} +1 -1
  100. package/dist/client/assets/{drawer-F0hkjkWK.js → drawer-CXWN5aFX.js} +1 -1
  101. package/dist/client/assets/{dropdown-menu-QVhpTnbw.js → dropdown-menu-DIF5PQaU.js} +1 -1
  102. package/dist/client/assets/{e2e-tab-CIhvZ7jB.js → e2e-tab-ChQwMMQw.js} +1 -1
  103. package/dist/client/assets/{editor-DHSROqSc.js → editor-BCbV0AET.js} +1 -1
  104. package/dist/client/assets/{empty-state-BoTu9lkL.js → empty-state-BJDGKBD3.js} +1 -1
  105. package/dist/client/assets/{empty-state-B6_Ul4U9.js → empty-state-BW8HBeBv.js} +1 -1
  106. package/dist/client/assets/extract-connection-data-CkOzL4EZ.js +1 -0
  107. package/dist/client/assets/{file-explorer-FGaad9SC.js → file-explorer-DrjG_dkv.js} +1 -1
  108. package/dist/client/assets/{file-type-icon-iSdqxvCJ.js → file-type-icon-DOGxWp7T.js} +1 -1
  109. package/dist/client/assets/{folder-icon-DoL1wgM6.js → folder-icon-CrwX1TKL.js} +1 -1
  110. package/dist/client/assets/{form-BzptyBk4.js → form-DW1iRzK_.js} +1 -1
  111. package/dist/client/assets/{general-D6b_Y3aW.js → general-DO74QmpP.js} +1 -1
  112. package/dist/client/assets/{github-repo-picker-B1n6OBj4.js → github-repo-picker-DBMeVgPY.js} +1 -1
  113. package/dist/client/assets/{hooks-bhKP99Ax.js → hooks-BduZvxu6.js} +1 -1
  114. package/dist/client/assets/{hosting-tab-s8sW7wxN.js → hosting-tab-BwMW6-cj.js} +1 -1
  115. package/dist/client/assets/{index-CGetbWoq.js → index-BOvZXmG5.js} +1 -1
  116. package/dist/client/assets/{index-D7xeSGeI.js → index-BSFs19PU.js} +1 -1
  117. package/dist/client/assets/{index-nFRHQC-L.js → index-BWAN2gi-.js} +1 -1
  118. package/dist/client/assets/{index-BNJPAEna.js → index-CZ1vtr8q.js} +1 -1
  119. package/dist/client/assets/{index-DWxzACaY.js → index-CeMxrEOa.js} +7 -7
  120. package/dist/client/assets/{index-ruQQqW4p.js → index-CplzrnNp.js} +1 -1
  121. package/dist/client/assets/{index-Bw600I7i.js → index-Czq-ZgYT.js} +1 -1
  122. package/dist/client/assets/{index-MnhhExK7.js → index-Dq833TiR.js} +1 -1
  123. package/dist/client/assets/{index-CW6L2S49.js → index-Ds9_YQQm.js} +3 -3
  124. package/dist/client/assets/{index-fXvyzo6h.js → index-fhNPvwoK.js} +1 -1
  125. package/dist/client/assets/{index-redirect-CGJzac9E.js → index-redirect-CPrLxGcH.js} +1 -1
  126. package/dist/client/assets/{infra-billing-DzmhWVEh.js → infra-billing-kpC_vP6b.js} +1 -1
  127. package/dist/client/assets/{input-DPKIPveM.js → input-CBtN_PPx.js} +1 -1
  128. package/dist/client/assets/{integration-icon-D9FdHsn5.js → integration-icon-Dxw_FbSX.js} +1 -1
  129. package/dist/client/assets/{invite-member-dialog-CyxMgQZJ.js → invite-member-dialog-Cu3x-0JT.js} +1 -1
  130. package/dist/client/assets/{label-CqIRBXyv.js → label-B8I1KhDR.js} +1 -1
  131. package/dist/client/assets/{layout-C4M3_yhL.js → layout-BhRI7lH-.js} +1 -1
  132. package/dist/client/assets/{login-qzbpt226.js → login-CwG5hnUr.js} +1 -1
  133. package/dist/client/assets/{markdown-BiJIqYGv.js → markdown-Bj8bPaFr.js} +1 -1
  134. package/dist/client/assets/mcp-oauth-CL6Q-kht.js +1 -0
  135. package/dist/client/assets/{members-D2It71TM.js → members-CERkIR2N.js} +1 -1
  136. package/dist/client/assets/{monaco-editor-DkHBERIE.js → monaco-editor-B806dXX7.js} +1 -1
  137. package/dist/client/assets/{monitoring-stats-row-B68839YD.js → monitoring-stats-row-C2A8X1H1.js} +1 -1
  138. package/dist/client/assets/{multi-select-jl7Hbzaz.js → multi-select-BP8V6T_m.js} +1 -1
  139. package/dist/client/assets/{oauth-callback--dbFGP9K.js → oauth-callback-B3e62S4Z.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-BRBN5fiB.js → oauth-callback-ai-provider-BeU5aWSG.js} +1 -1
  141. package/dist/client/assets/{onboarding-HFAUcTGc.js → onboarding-Ct4A_Jz9.js} +1 -1
  142. package/dist/client/assets/org-layout-DKVs--x0.js +1 -0
  143. package/dist/client/assets/{organization-choice-G8mAnjMS.js → organization-choice-CLLN-ACi.js} +1 -1
  144. package/dist/client/assets/{orgs-CgeiXFFD.js → orgs-CQQFJ08X.js} +1 -1
  145. package/dist/client/assets/{page-seo-form-DTFWlSs6.js → page-seo-form-71yQnW9g.js} +1 -1
  146. package/dist/client/assets/{popover-Cfo1Nvgv.js → popover-BKkJ1_Xg.js} +1 -1
  147. package/dist/client/assets/{post-calendar-D0PKhtb8.js → post-calendar-ClavelB2.js} +1 -1
  148. package/dist/client/assets/{post-editor-BsMV7w5K.js → post-editor-Ds6d5h9N.js} +1 -1
  149. package/dist/client/assets/{primitives-Dshx-6vZ.js → primitives-CtpDwLvA.js} +1 -1
  150. package/dist/client/assets/{profile-6Ncb3Njd.js → profile-DO4qkKsK.js} +1 -1
  151. package/dist/client/assets/{project-app-view-DJ4h95de.js → project-app-view-Cpin65jK.js} +1 -1
  152. package/dist/client/assets/{prompts-6dW4jofl.js → prompts-nePHaw8G.js} +1 -1
  153. package/dist/client/assets/record-editor-B8zpMto0.js +1 -0
  154. package/dist/client/assets/redirect-editor-Q_hMRPu2.js +1 -0
  155. package/dist/client/assets/registry-Bid5M6jp.js +2 -0
  156. package/dist/client/assets/{registry-layout-CEF3gBC_.js → registry-layout-lsA6ndEN.js} +1 -1
  157. package/dist/client/assets/{reports-hh8ZI3ZJ.js → reports-z8c0XEWP.js} +1 -1
  158. package/dist/client/assets/{require-capability-B7CJKsKK.js → require-capability-CXqHSbCc.js} +1 -1
  159. package/dist/client/assets/{required-auth-layout-BASPIPDt.js → required-auth-layout-BIgCtLKM.js} +1 -1
  160. package/dist/client/assets/{reset-password-B5OEAnS-.js → reset-password-DpPr5niQ.js} +1 -1
  161. package/dist/client/assets/{review-settings-DJxQp0XZ.js → review-settings-Cp01VqYx.js} +1 -1
  162. package/dist/client/assets/{roles-Bx1AV-1M.js → roles-BApIuR8C.js} +1 -1
  163. package/dist/client/assets/{schema-CmTu1Qcv.js → schema-CSzKWh-e.js} +1 -1
  164. package/dist/client/assets/{scroll-area-gq3Q2AeD.js → scroll-area-BSFqWPow.js} +1 -1
  165. package/dist/client/assets/{search-input-B-_TRDC7.js → search-input-CfcUKbcR.js} +1 -1
  166. package/dist/client/assets/{secrets-C8NxHpd-.js → secrets-BtAWzVgG.js} +1 -1
  167. package/dist/client/assets/{sections-editor-Bh7OpK8E.js → sections-editor-CkyqVakM.js} +1 -1
  168. package/dist/client/assets/{select-DamLPfhf.js → select-YGToc2er.js} +1 -1
  169. package/dist/client/assets/{select-model-QU5hzlSe.js → select-model-Gm2aIKeG.js} +1 -1
  170. package/dist/client/assets/{self-tool-result-Lz_-Z0nG.js → self-tool-result-D1fWp3qG.js} +1 -1
  171. package/dist/client/assets/{seo-editor-DwIreVEK.js → seo-editor-BbrItmvh.js} +1 -1
  172. package/dist/client/assets/settings-layout-C1fOKdd9.js +1 -0
  173. package/dist/client/assets/{settings-sidebar-BfPvugP6.js → settings-sidebar-CEa69wW9.js} +1 -1
  174. package/dist/client/assets/{shell-controls-CeHXl7mZ.js → shell-controls-Cpk05Xlw.js} +1 -1
  175. package/dist/client/assets/{shell-layout-CBZfZSo4.js → shell-layout-BStzIFKM.js} +1 -1
  176. package/dist/client/assets/{skill-preview-Cq3_PFMf.js → skill-preview-BgXO28GZ.js} +1 -1
  177. package/dist/client/assets/{skills-BHXTZ7NQ.js → skills-Bnft56YJ.js} +1 -1
  178. package/dist/client/assets/{sso-DU8cw1b0.js → sso-Cfv5bRYB.js} +1 -1
  179. package/dist/client/assets/{store-BVdwdwPL.js → store-6e8Le4X5.js} +1 -1
  180. package/dist/client/assets/store-registry-T8JvcFLm.js +2 -0
  181. package/dist/client/assets/{switch-Mdu4u0WR.js → switch-DXic8Uh_.js} +1 -1
  182. package/dist/client/assets/{synced-repos-DaH0mQuQ.js → synced-repos-BX3OCOkU.js} +1 -1
  183. package/dist/client/assets/{table-D3m7ArKR.js → table-BCojuEdb.js} +1 -1
  184. package/dist/client/assets/{tabs-C6SXoslH.js → tabs-CgB53moJ.js} +1 -1
  185. package/dist/client/assets/{task-board-BR_hukMd.js → task-board-BILXt1or.js} +1 -1
  186. package/dist/client/assets/task-route-DDbV2QN2.js +1 -0
  187. package/dist/client/assets/{tasks-BRPJVj0A.js → tasks-CsYew1RZ.js} +1 -1
  188. package/dist/client/assets/{textarea-DoEBjnc4.js → textarea-BZQ-H9le.js} +1 -1
  189. package/dist/client/assets/{thread-intent-1OmKxTfG.js → thread-intent-VOG1y4W9.js} +1 -1
  190. package/dist/client/assets/{thread-route-xvjmSQIh.js → thread-route-CYj4FJe7.js} +1 -1
  191. package/dist/client/assets/{toggle-group-CNANG2fZ.js → toggle-group-B4zTvBSA.js} +1 -1
  192. package/dist/client/assets/{toolbar-B341Epq4.js → toolbar-CG1eQp71.js} +1 -1
  193. package/dist/client/assets/{toolbar-icon-button-BO82E-n0.js → toolbar-icon-button-BI33A1DT.js} +1 -1
  194. package/dist/client/assets/{track-Bj2VKdRl.js → track-B9IGnryN.js} +1 -1
  195. package/dist/client/assets/{types-DLFi4V7L.js → types-D8EuE9Mj.js} +1 -1
  196. package/dist/client/assets/{use-ai-providers-tSdCWAm9.js → use-ai-providers-BtViIKA8.js} +1 -1
  197. package/dist/client/assets/{use-automations-DjM5YwJ5.js → use-automations-Dd66jMcH.js} +1 -1
  198. package/dist/client/assets/{use-autosave-DdDTzW-p.js → use-autosave-BnjvVAx3.js} +1 -1
  199. package/dist/client/assets/{use-connection--sEuYWk0.js → use-connection-D-P-oJeL.js} +1 -1
  200. package/dist/client/assets/{use-copy-IMBiDrGI.js → use-copy-D7YVH85a.js} +1 -1
  201. package/dist/client/assets/{use-create-virtual-mcp-DsfSBfvB.js → use-create-virtual-mcp-BqJwGUXr.js} +1 -1
  202. package/dist/client/assets/{use-debounced-autosave-DyX30vD8.js → use-debounced-autosave-dNIsOT-E.js} +1 -1
  203. package/dist/client/assets/{use-debounced-value-DS9pfZWp.js → use-debounced-value-CQvHGF7W.js} +1 -1
  204. package/dist/client/assets/{use-decopilot-events-DNS0SnLr.js → use-decopilot-events-DDJx3VDP.js} +1 -1
  205. package/dist/client/assets/{use-delete-connection-DIc-Qfav.js → use-delete-connection-DyDPErD6.js} +1 -1
  206. package/dist/client/assets/{use-deployment-admin-CH4neEKc.js → use-deployment-admin-DTead3D9.js} +1 -1
  207. package/dist/client/assets/{use-destination-route-7JP5O6OJ.js → use-destination-route-DzHgzZDH.js} +1 -1
  208. package/dist/client/assets/{use-file-configs-CUpgfUZo.js → use-file-configs-Etx2upQ_.js} +1 -1
  209. package/dist/client/assets/{use-infinite-scroll-BYZDUtLT.js → use-infinite-scroll-CpGR8CTM.js} +1 -1
  210. package/dist/client/assets/{use-join-requests-DLCB2F3F.js → use-join-requests-B74l_G0c.js} +1 -1
  211. package/dist/client/assets/{use-mcp-auth-status-DS3icTNp.js → use-mcp-auth-status-B1LLuxQZ.js} +1 -1
  212. package/dist/client/assets/{use-mcp-client-BkpxeCP2.js → use-mcp-client-BzmGxRuq.js} +1 -1
  213. package/dist/client/assets/{use-mcp-prompts-DCcZ3Vir.js → use-mcp-prompts-B9ZjCxIV.js} +1 -1
  214. package/dist/client/assets/{use-mcp-tools-zprouZ07.js → use-mcp-tools-BElJHPUX.js} +1 -1
  215. package/dist/client/assets/{use-members-CI2nYVE7.js → use-members-DZQLsJGr.js} +1 -1
  216. package/dist/client/assets/use-navigate-to-agent-LzLdBs0e.js +1 -0
  217. package/dist/client/assets/{use-org-auth-client-S97f03iK.js → use-org-auth-client-Cp3G9WC1.js} +1 -1
  218. package/dist/client/assets/{use-org-sso-BjH4Z9oA.js → use-org-sso-CWXniPVe.js} +1 -1
  219. package/dist/client/assets/{use-organization-roles-CPwpLNzf.js → use-organization-roles-D-A39N_h.js} +1 -1
  220. package/dist/client/assets/{use-organization-settings-BPN8rXNO.js → use-organization-settings-CpiPY2sA.js} +1 -1
  221. package/dist/client/assets/{use-panel-navigate-fLU7dGE0.js → use-panel-navigate-Dev670TY.js} +1 -1
  222. package/dist/client/assets/{use-project-scope-BgyywlH_.js → use-project-scope-BAnUVA3r.js} +1 -1
  223. package/dist/client/assets/{use-registry-connections-Dzb0fhHm.js → use-registry-connections-RuRoPZjO.js} +1 -1
  224. package/dist/client/assets/{use-secrets-Dts0cF77.js → use-secrets-BZQygYLJ.js} +1 -1
  225. package/dist/client/assets/{use-section-preview-base-D94KMpp4.js → use-section-preview-base-Dbp7FR8A.js} +1 -1
  226. package/dist/client/assets/{use-status-sounds-DHbTO7IH.js → use-status-sounds-a-r3lT4g.js} +1 -1
  227. package/dist/client/assets/{use-tags-C7VYYpbH.js → use-tags-CziB3qDr.js} +1 -1
  228. package/dist/client/assets/{use-view-mode-DsDWXQJ2.js → use-view-mode-B2sjpoVQ.js} +1 -1
  229. package/dist/client/assets/{use-virtual-mcp-BhEuXWFl.js → use-virtual-mcp-C2SUHuV8.js} +1 -1
  230. package/dist/client/assets/useInfiniteQuery-n7OKFVHh.js +1 -0
  231. package/dist/client/assets/useSuspenseInfiniteQuery-BpKA0laV.js +1 -0
  232. package/dist/client/assets/{users-CuirzC-v.js → users-BtGMynxT.js} +1 -1
  233. package/dist/client/assets/{variant-calendar-Bhuv7S39.js → variant-calendar-B5DPyQ2J.js} +1 -1
  234. package/dist/client/assets/{view-mode-toggle-CvuuImgL.js → view-mode-toggle-D5oruA9V.js} +1 -1
  235. package/dist/client/index.html +1 -1
  236. package/dist/server/cli.js +509 -509
  237. package/dist/server/server.js +355 -355
  238. package/package.json +1 -1
  239. package/dist/client/assets/agents-list-D2gG4rxl.js +0 -1
  240. package/dist/client/assets/api-keys-aPYST39a.js +0 -1
  241. package/dist/client/assets/connection-Corqb4nW.js +0 -1
  242. package/dist/client/assets/connection-detail-BixLRE2Y.js +0 -1
  243. package/dist/client/assets/extract-connection-data-DcfPnaRL.js +0 -1
  244. package/dist/client/assets/mcp-oauth-HjvSjKSb.js +0 -1
  245. package/dist/client/assets/org-layout-H_iF2Jpr.js +0 -1
  246. package/dist/client/assets/record-editor-C1_htYBv.js +0 -1
  247. package/dist/client/assets/redirect-editor-Cj58js0D.js +0 -1
  248. package/dist/client/assets/registry-Blrslzvj.js +0 -2
  249. package/dist/client/assets/settings-layout-C-8zm3_h.js +0 -1
  250. package/dist/client/assets/store-registry-DUIUtqr7.js +0 -2
  251. package/dist/client/assets/task-route-Dm9sxint.js +0 -1
  252. package/dist/client/assets/use-navigate-to-agent-ChEjWy4D.js +0 -1
  253. package/dist/client/assets/useInfiniteQuery-BNd4lP3z.js +0 -1
  254. package/dist/client/assets/useSuspenseInfiniteQuery-DOhopmGX.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as m,W as x,K as y,m as I,n as R,e as P,r as A,j as g}from"./index-CW6L2S49.js";import{s as D}from"./Eye-Z_2DhwO_.js";function nt(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function S(s,t,e,n){const r=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(t)}/${e}${r?`?${r}`:""}`}async function F(s,t,e){const n=await fetch(s,t);if(n.ok||e?.allow404&&n.status===404)return n;let r="";try{r=(await n.json()).error??""}catch{}throw new Error(r||`HTTP ${n.status}`)}function rt(s,t){const e=m.c(15),{org:n}=x();let r;e[0]!==n.id||e[1]!==t||e[2]!==s?(r=y.orgFsList(n.id,s,t),e[0]=n.id,e[1]=t,e[2]=s,e[3]=r):r=e[3];let i;e[4]!==n.id||e[5]!==s?(i=(c,l)=>l?.queryKey[1]===n.id&&l.queryKey[2]===s?c:void 0,e[4]=n.id,e[5]=s,e[6]=i):i=e[6];let a;e[7]!==n.slug||e[8]!==t||e[9]!==s?(a=async()=>(await(await F(S(n.slug,s,"list",{path:t}))).json()).entries.toSorted(M),e[7]=n.slug,e[8]=t,e[9]=s,e[10]=a):a=e[10];let o;return e[11]!==r||e[12]!==i||e[13]!==a?(o={queryKey:r,placeholderData:i,queryFn:a},e[11]=r,e[12]=i,e[13]=a,e[14]=o):o=e[14],I(o)}function M(s,t){return s.kind!==t.kind?s.kind==="dir"?-1:1:s.path.localeCompare(t.path)}async function B(s,t,e){const n=await F(S(s,t,"stat",{path:e}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function it(s,t,e){const n=m.c(15),{org:r}=x();let i;n[0]!==r.id||n[1]!==t||n[2]!==s?(i=y.orgFsStat(r.id,s??"",t),n[0]=r.id,n[1]=t,n[2]=s,n[3]=i):i=n[3];const a=s!==null;let o;n[4]!==e?(o=e?.refetchIntervalWhenAbsent?d=>d.state.data?!1:e.refetchIntervalWhenAbsent??!1:void 0,n[4]=e,n[5]=o):o=n[5];let c;n[6]!==r.slug||n[7]!==t||n[8]!==s?(c=()=>B(r.slug,s??"",t),n[6]=r.slug,n[7]=t,n[8]=s,n[9]=c):c=n[9];let l;return n[10]!==i||n[11]!==a||n[12]!==o||n[13]!==c?(l={queryKey:i,enabled:a,refetchInterval:o,queryFn:c},n[10]=i,n[11]=a,n[12]=o,n[13]=c,n[14]=l):l=n[14],I(l)}function ot(s){const t=m.c(9),{org:e}=x();let n;t[0]!==e.id||t[1]!==s?(n=y.orgFsUsage(e.id,s),t[0]=e.id,t[1]=s,t[2]=n):n=t[2];let r;t[3]!==e.slug||t[4]!==s?(r=async()=>await(await F(S(e.slug,s,"usage"))).json(),t[3]=e.slug,t[4]=s,t[5]=r):r=t[5];let i;return t[6]!==n||t[7]!==r?(i={queryKey:n,queryFn:r},t[6]=n,t[7]=r,t[8]=i):i=t[8],I(i)}function at(s,t){const e=m.c(9),n=s===void 0?60:s,{org:r}=x();let i;e[0]!==r.id?(i=y.orgFsRecent(r.id),e[0]=r.id,e[1]=i):i=e[1];const a=t?.enabled;let o;e[2]!==n||e[3]!==r.slug?(o=async()=>(await(await F(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${n}`)).json()).entries,e[2]=n,e[3]=r.slug,e[4]=o):o=e[4];let c;return e[5]!==i||e[6]!==a||e[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},e[5]=i,e[6]=a,e[7]=o,e[8]=c):c=e[8],I(c)}const Q=50;function lt(s,t){const e=m.c(16),{org:n}=x();let r;e[0]!==n.id||e[1]!==s||e[2]!==t?.prefix||e[3]!==t?.volume?(r=y.orgFsSearch(n.id,s,t?.volume??"",t?.prefix??""),e[0]=n.id,e[1]=s,e[2]=t?.prefix,e[3]=t?.volume,e[4]=r):r=e[4];const i=s.length>0;let a;e[5]!==n.id?(a=(l,d)=>d?.queryKey[1]===n.id?l:void 0,e[5]=n.id,e[6]=a):a=e[6];let o;e[7]!==n.slug||e[8]!==s||e[9]!==t?(o=async()=>{const l=new URLSearchParams({q:s,limit:String(Q)});return t&&(l.set("volume",t.volume),t.prefix&&l.set("prefix",t.prefix)),(await(await F(`/api/${encodeURIComponent(n.slug)}/fs/search?${l}`)).json()).entries},e[7]=n.slug,e[8]=s,e[9]=t,e[10]=o):o=e[10];let c;return e[11]!==r||e[12]!==i||e[13]!==a||e[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},e[11]=r,e[12]=i,e[13]=a,e[14]=o,e[15]=c):c=e[15],I(c)}function ct(s){const t=m.c(8),{org:e}=x();let n;t[0]!==e.id?(n=y.orgFsSkills(e.id),t[0]=e.id,t[1]=n):n=t[1];const r=s?.enabled;let i;t[2]!==e.slug?(i=async()=>{const o=await F(`/api/${encodeURIComponent(e.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(N)},t[2]=e.slug,t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a={queryKey:n,enabled:r,queryFn:i},t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],I(a)}function N(s){return{volume:s.volume,path:s.path}}async function W(s){const t=await F(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:e}=await t.json();return e}function ft(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.slashSkills(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=()=>W(t.slug),s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,queryFn:n,staleTime:6e4},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}async function H(s,t,e){return(await F(S(s,t,"read",{path:e}))).text()}function dt(s,t){const e=m.c(8);let n;e[0]!==s?(n=y.fileText(s),e[0]=s,e[1]=n):n=e[1];const r=t?.enabled!==!1&&s!=="";let i;e[2]!==s?(i=async()=>{const o=await fetch(s,{credentials:"include"});return o.ok?await o.text():null},e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a={queryKey:n,enabled:r,staleTime:6e4,retry:!1,queryFn:i},e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],I(a)}const X=new Set(["md","mdx","markdown","txt","text"]),V=25,z=64*1024,G=256*1024,Y=4;function J(s){const t=s.lastIndexOf(".");return t===-1?!1:X.has(s.slice(t+1).toLowerCase())}async function ut(s,t,e){const n=e?`${e}/`:"",r=f=>f.startsWith(n)?f.slice(n.length):f,i=[],a=[],o=[{path:e,depth:0}];for(;o.length>0;){const f=o.shift();if(!f)break;let h;try{h=(await(await F(S(s,t,"list",{path:f.path}))).json()).entries}catch{continue}for(const u of[...h].sort((b,w)=>b.path.localeCompare(w.path))){if(u.kind==="dir"){f.depth<Y&&o.push({path:u.path,depth:f.depth+1});continue}J(u.path)&&u.size<=z&&i.length<V?i.push(u.path):a.push(r(u.path))}}const c=await Promise.all(i.map(f=>H(s,t,f).catch(()=>null))),l=[];let d=0;return i.forEach((f,h)=>{const u=c[h];if(u==null||d+u.length>G){a.push(r(f));return}d+=u.length,l.push({relPath:r(f),content:u})}),l.sort((f,h)=>f.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:f.relPath.localeCompare(h.relPath)),a.sort(),{files:l,omittedPaths:a}}function ht(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.orgFsPublicSets(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=async()=>(await(await F(`/api/${encodeURIComponent(t.slug)}/fs/public-sets`)).json()).sets,s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,staleTime:3e5,queryFn:n},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}function gt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e.slug||t[1]!==s?(n=r=>S(e.slug,s,"read",{path:r}),t[0]=e.slug,t[1]=s,t[2]=n):n=t[2],n}function yt(){const s=m.c(2),{org:t}=x();let e;return s[0]!==t.slug?(e=(n,r)=>S(t.slug,n,"read",{path:r}),s[0]=t.slug,s[1]=e):e=s[1],e}function pt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e||t[1]!==s?(n={mutationFn:async r=>(await(await F(S(e.slug,s,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},t[0]=e,t[1]=s,t[2]=n):n=t[2],P(n)}function Ft(s){const t=m.c(18),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==s?(r=async l=>(await(await F(S(e.slug,s,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,t[0]=e,t[1]=s,t[2]=r):r=t[2];let i;t[3]!==e||t[4]!==n||t[5]!==s?(i=async l=>{const d=y.orgFsStat(e.id,s,l.path);await n.cancelQueries({queryKey:d});const f=n.getQueryData(d),h=l.mode!=="private";return n.setQueryData(d,u=>u&&{...u,readPublic:h,effectivePublic:h,shareMode:l.mode}),{key:d,previous:f}},t[3]=e,t[4]=n,t[5]=s,t[6]=i):i=t[6];let a;t[7]!==n?(a=(l,d,f)=>{f&&n.setQueryData(f.key,f.previous)},t[7]=n,t[8]=a):a=t[8];let o;t[9]!==e||t[10]!==n||t[11]!==s?(o=(l,d,f)=>{n.invalidateQueries({queryKey:y.orgFsStat(e.id,s,f.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[9]=e,t[10]=n,t[11]=s,t[12]=o):o=t[12];let c;return t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},t[13]=r,t[14]=i,t[15]=a,t[16]=o,t[17]=c):c=t[17],P(c)}function mt(s){const t=m.c(33),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==n||t[2]!==s?(r=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[0]=e,t[1]=n,t[2]=s,t[3]=r):r=t[3];const i=r;let a;t[4]!==e||t[5]!==s?(a=async p=>{const C=(await Promise.allSettled(p.files.map(j=>{const q=p.dir?`${p.dir}/${j.name}`:j.name;return F(S(e.slug,s,"file",{path:q}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Z);if(C)throw C.reason},t[4]=e,t[5]=s,t[6]=a):a=t[6];let o;t[7]!==i||t[8]!==a?(o={mutationFn:a,onSettled:i},t[7]=i,t[8]=a,t[9]=o):o=t[9];const c=P(o);let l;t[10]!==e||t[11]!==s?(l=async p=>{await F(S(e.slug,s,"dir",{path:p}),{method:"POST"})},t[10]=e,t[11]=s,t[12]=l):l=t[12];let d;t[13]!==i||t[14]!==l?(d={mutationFn:l,onSuccess:i},t[13]=i,t[14]=l,t[15]=d):d=t[15];const f=P(d);let h;t[16]!==e||t[17]!==s?(h=async p=>{await F(S(e.slug,s,"file",{path:p}),{method:"DELETE"})},t[16]=e,t[17]=s,t[18]=h):h=t[18];let u;t[19]!==i||t[20]!==h?(u={mutationFn:h,onSuccess:i},t[19]=i,t[20]=h,t[21]=u):u=t[21];const b=P(u);let w;t[22]!==e||t[23]!==s?(w=async p=>{await F(S(e.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(p)})},t[22]=e,t[23]=s,t[24]=w):w=t[24];let k;t[25]!==i||t[26]!==w?(k={mutationFn:w,onSuccess:i},t[25]=i,t[26]=w,t[27]=k):k=t[27];const T=P(k);let $;return t[28]!==f||t[29]!==T||t[30]!==b||t[31]!==c?($={upload:c,mkdir:f,remove:b,move:T},t[28]=f,t[29]=T,t[30]=b,t[31]=c,t[32]=$):$=t[32],$}function Z(s){return s.status==="rejected"}function v(s){const t={};for(const e of s.split(`
1
+ import{c as m,W as x,K as y,m as I,n as R,e as P,r as A,j as g}from"./index-Ds9_YQQm.js";import{s as D}from"./Eye-msF77noH.js";function nt(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function S(s,t,e,n){const r=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(t)}/${e}${r?`?${r}`:""}`}async function F(s,t,e){const n=await fetch(s,t);if(n.ok||e?.allow404&&n.status===404)return n;let r="";try{r=(await n.json()).error??""}catch{}throw new Error(r||`HTTP ${n.status}`)}function rt(s,t){const e=m.c(15),{org:n}=x();let r;e[0]!==n.id||e[1]!==t||e[2]!==s?(r=y.orgFsList(n.id,s,t),e[0]=n.id,e[1]=t,e[2]=s,e[3]=r):r=e[3];let i;e[4]!==n.id||e[5]!==s?(i=(c,l)=>l?.queryKey[1]===n.id&&l.queryKey[2]===s?c:void 0,e[4]=n.id,e[5]=s,e[6]=i):i=e[6];let a;e[7]!==n.slug||e[8]!==t||e[9]!==s?(a=async()=>(await(await F(S(n.slug,s,"list",{path:t}))).json()).entries.toSorted(M),e[7]=n.slug,e[8]=t,e[9]=s,e[10]=a):a=e[10];let o;return e[11]!==r||e[12]!==i||e[13]!==a?(o={queryKey:r,placeholderData:i,queryFn:a},e[11]=r,e[12]=i,e[13]=a,e[14]=o):o=e[14],I(o)}function M(s,t){return s.kind!==t.kind?s.kind==="dir"?-1:1:s.path.localeCompare(t.path)}async function B(s,t,e){const n=await F(S(s,t,"stat",{path:e}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function it(s,t,e){const n=m.c(15),{org:r}=x();let i;n[0]!==r.id||n[1]!==t||n[2]!==s?(i=y.orgFsStat(r.id,s??"",t),n[0]=r.id,n[1]=t,n[2]=s,n[3]=i):i=n[3];const a=s!==null;let o;n[4]!==e?(o=e?.refetchIntervalWhenAbsent?d=>d.state.data?!1:e.refetchIntervalWhenAbsent??!1:void 0,n[4]=e,n[5]=o):o=n[5];let c;n[6]!==r.slug||n[7]!==t||n[8]!==s?(c=()=>B(r.slug,s??"",t),n[6]=r.slug,n[7]=t,n[8]=s,n[9]=c):c=n[9];let l;return n[10]!==i||n[11]!==a||n[12]!==o||n[13]!==c?(l={queryKey:i,enabled:a,refetchInterval:o,queryFn:c},n[10]=i,n[11]=a,n[12]=o,n[13]=c,n[14]=l):l=n[14],I(l)}function ot(s){const t=m.c(9),{org:e}=x();let n;t[0]!==e.id||t[1]!==s?(n=y.orgFsUsage(e.id,s),t[0]=e.id,t[1]=s,t[2]=n):n=t[2];let r;t[3]!==e.slug||t[4]!==s?(r=async()=>await(await F(S(e.slug,s,"usage"))).json(),t[3]=e.slug,t[4]=s,t[5]=r):r=t[5];let i;return t[6]!==n||t[7]!==r?(i={queryKey:n,queryFn:r},t[6]=n,t[7]=r,t[8]=i):i=t[8],I(i)}function at(s,t){const e=m.c(9),n=s===void 0?60:s,{org:r}=x();let i;e[0]!==r.id?(i=y.orgFsRecent(r.id),e[0]=r.id,e[1]=i):i=e[1];const a=t?.enabled;let o;e[2]!==n||e[3]!==r.slug?(o=async()=>(await(await F(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${n}`)).json()).entries,e[2]=n,e[3]=r.slug,e[4]=o):o=e[4];let c;return e[5]!==i||e[6]!==a||e[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},e[5]=i,e[6]=a,e[7]=o,e[8]=c):c=e[8],I(c)}const Q=50;function lt(s,t){const e=m.c(16),{org:n}=x();let r;e[0]!==n.id||e[1]!==s||e[2]!==t?.prefix||e[3]!==t?.volume?(r=y.orgFsSearch(n.id,s,t?.volume??"",t?.prefix??""),e[0]=n.id,e[1]=s,e[2]=t?.prefix,e[3]=t?.volume,e[4]=r):r=e[4];const i=s.length>0;let a;e[5]!==n.id?(a=(l,d)=>d?.queryKey[1]===n.id?l:void 0,e[5]=n.id,e[6]=a):a=e[6];let o;e[7]!==n.slug||e[8]!==s||e[9]!==t?(o=async()=>{const l=new URLSearchParams({q:s,limit:String(Q)});return t&&(l.set("volume",t.volume),t.prefix&&l.set("prefix",t.prefix)),(await(await F(`/api/${encodeURIComponent(n.slug)}/fs/search?${l}`)).json()).entries},e[7]=n.slug,e[8]=s,e[9]=t,e[10]=o):o=e[10];let c;return e[11]!==r||e[12]!==i||e[13]!==a||e[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},e[11]=r,e[12]=i,e[13]=a,e[14]=o,e[15]=c):c=e[15],I(c)}function ct(s){const t=m.c(8),{org:e}=x();let n;t[0]!==e.id?(n=y.orgFsSkills(e.id),t[0]=e.id,t[1]=n):n=t[1];const r=s?.enabled;let i;t[2]!==e.slug?(i=async()=>{const o=await F(`/api/${encodeURIComponent(e.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(N)},t[2]=e.slug,t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a={queryKey:n,enabled:r,queryFn:i},t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],I(a)}function N(s){return{volume:s.volume,path:s.path}}async function W(s){const t=await F(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:e}=await t.json();return e}function ft(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.slashSkills(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=()=>W(t.slug),s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,queryFn:n,staleTime:6e4},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}async function H(s,t,e){return(await F(S(s,t,"read",{path:e}))).text()}function dt(s,t){const e=m.c(8);let n;e[0]!==s?(n=y.fileText(s),e[0]=s,e[1]=n):n=e[1];const r=t?.enabled!==!1&&s!=="";let i;e[2]!==s?(i=async()=>{const o=await fetch(s,{credentials:"include"});return o.ok?await o.text():null},e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a={queryKey:n,enabled:r,staleTime:6e4,retry:!1,queryFn:i},e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],I(a)}const X=new Set(["md","mdx","markdown","txt","text"]),V=25,z=64*1024,G=256*1024,Y=4;function J(s){const t=s.lastIndexOf(".");return t===-1?!1:X.has(s.slice(t+1).toLowerCase())}async function ut(s,t,e){const n=e?`${e}/`:"",r=f=>f.startsWith(n)?f.slice(n.length):f,i=[],a=[],o=[{path:e,depth:0}];for(;o.length>0;){const f=o.shift();if(!f)break;let h;try{h=(await(await F(S(s,t,"list",{path:f.path}))).json()).entries}catch{continue}for(const u of[...h].sort((b,w)=>b.path.localeCompare(w.path))){if(u.kind==="dir"){f.depth<Y&&o.push({path:u.path,depth:f.depth+1});continue}J(u.path)&&u.size<=z&&i.length<V?i.push(u.path):a.push(r(u.path))}}const c=await Promise.all(i.map(f=>H(s,t,f).catch(()=>null))),l=[];let d=0;return i.forEach((f,h)=>{const u=c[h];if(u==null||d+u.length>G){a.push(r(f));return}d+=u.length,l.push({relPath:r(f),content:u})}),l.sort((f,h)=>f.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:f.relPath.localeCompare(h.relPath)),a.sort(),{files:l,omittedPaths:a}}function ht(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.orgFsPublicSets(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=async()=>(await(await F(`/api/${encodeURIComponent(t.slug)}/fs/public-sets`)).json()).sets,s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,staleTime:3e5,queryFn:n},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}function gt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e.slug||t[1]!==s?(n=r=>S(e.slug,s,"read",{path:r}),t[0]=e.slug,t[1]=s,t[2]=n):n=t[2],n}function yt(){const s=m.c(2),{org:t}=x();let e;return s[0]!==t.slug?(e=(n,r)=>S(t.slug,n,"read",{path:r}),s[0]=t.slug,s[1]=e):e=s[1],e}function pt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e||t[1]!==s?(n={mutationFn:async r=>(await(await F(S(e.slug,s,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},t[0]=e,t[1]=s,t[2]=n):n=t[2],P(n)}function Ft(s){const t=m.c(18),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==s?(r=async l=>(await(await F(S(e.slug,s,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,t[0]=e,t[1]=s,t[2]=r):r=t[2];let i;t[3]!==e||t[4]!==n||t[5]!==s?(i=async l=>{const d=y.orgFsStat(e.id,s,l.path);await n.cancelQueries({queryKey:d});const f=n.getQueryData(d),h=l.mode!=="private";return n.setQueryData(d,u=>u&&{...u,readPublic:h,effectivePublic:h,shareMode:l.mode}),{key:d,previous:f}},t[3]=e,t[4]=n,t[5]=s,t[6]=i):i=t[6];let a;t[7]!==n?(a=(l,d,f)=>{f&&n.setQueryData(f.key,f.previous)},t[7]=n,t[8]=a):a=t[8];let o;t[9]!==e||t[10]!==n||t[11]!==s?(o=(l,d,f)=>{n.invalidateQueries({queryKey:y.orgFsStat(e.id,s,f.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[9]=e,t[10]=n,t[11]=s,t[12]=o):o=t[12];let c;return t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},t[13]=r,t[14]=i,t[15]=a,t[16]=o,t[17]=c):c=t[17],P(c)}function mt(s){const t=m.c(33),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==n||t[2]!==s?(r=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[0]=e,t[1]=n,t[2]=s,t[3]=r):r=t[3];const i=r;let a;t[4]!==e||t[5]!==s?(a=async p=>{const C=(await Promise.allSettled(p.files.map(j=>{const q=p.dir?`${p.dir}/${j.name}`:j.name;return F(S(e.slug,s,"file",{path:q}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Z);if(C)throw C.reason},t[4]=e,t[5]=s,t[6]=a):a=t[6];let o;t[7]!==i||t[8]!==a?(o={mutationFn:a,onSettled:i},t[7]=i,t[8]=a,t[9]=o):o=t[9];const c=P(o);let l;t[10]!==e||t[11]!==s?(l=async p=>{await F(S(e.slug,s,"dir",{path:p}),{method:"POST"})},t[10]=e,t[11]=s,t[12]=l):l=t[12];let d;t[13]!==i||t[14]!==l?(d={mutationFn:l,onSuccess:i},t[13]=i,t[14]=l,t[15]=d):d=t[15];const f=P(d);let h;t[16]!==e||t[17]!==s?(h=async p=>{await F(S(e.slug,s,"file",{path:p}),{method:"DELETE"})},t[16]=e,t[17]=s,t[18]=h):h=t[18];let u;t[19]!==i||t[20]!==h?(u={mutationFn:h,onSuccess:i},t[19]=i,t[20]=h,t[21]=u):u=t[21];const b=P(u);let w;t[22]!==e||t[23]!==s?(w=async p=>{await F(S(e.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(p)})},t[22]=e,t[23]=s,t[24]=w):w=t[24];let k;t[25]!==i||t[26]!==w?(k={mutationFn:w,onSuccess:i},t[25]=i,t[26]=w,t[27]=k):k=t[27];const T=P(k);let $;return t[28]!==f||t[29]!==T||t[30]!==b||t[31]!==c?($={upload:c,mkdir:f,remove:b,move:T},t[28]=f,t[29]=T,t[30]=b,t[31]=c,t[32]=$):$=t[32],$}function Z(s){return s.status==="rejected"}function v(s){const t={};for(const e of s.split(`
2
2
  `)){const n=e.match(/^([A-Za-z][\w-]*):\s*(.*)$/);n?.[1]&&n[2]!==void 0&&(t[n[1].toLowerCase()]=n[2].trim())}return t}function U(s){for(const t of s.split(/\n\s*\n/)){const e=t.trim();if(!(!e||e.startsWith("#")))return e.replace(/\n/g," ")}return null}function wt(s){const t=s.match(/^---\n([\s\S]*?)\n---\n?/);if(!t||t[1]===void 0)return{name:null,description:U(s),body:s};const e=v(t[1]),n=s.slice(t[0].length);return{name:e.name||null,description:e.description||U(n),body:n}}const tt={default:{backFrom:"#4D87DF",backTo:"#296FE8",frontFrom:"#72B6FA",frontTo:"#5BB1EF",stripe:"#84CDFB",glyph:"#014AC9"},system:{backFrom:"#8A94A6",backTo:"#6B7687",frontFrom:"#B6BEC9",frontTo:"#A3ADBA",stripe:"#D5DBE3",glyph:"#3D4757"}};function St(s){const t=m.c(46);let e,n,r,i;t[0]!==s?({glyph:e,readOnly:r,tone:i,...n}=s,t[0]=s,t[1]=e,t[2]=n,t[3]=r,t[4]=i):(e=t[1],n=t[2],r=t[3],i=t[4]);const o=tt[i===void 0?"default":i],c=A.useId(),l=`${c}-back`,d=`${c}-front`,f=`url(#${l})`;let h;t[5]!==f?(h=g.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:f}),t[5]=f,t[6]=h):h=t[6];const u=`url(#${d})`;let b;t[7]!==u?(b=g.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),t[7]=u,t[8]=b):b=t[8];let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),t[9]=w):w=t[9];let k,T;t[10]!==o.stripe?(k=g.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:o.stripe}),T=g.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:o.stripe}),t[10]=o.stripe,t[11]=k,t[12]=T):(k=t[11],T=t[12]);let $;t[13]!==e||t[14]!==o.glyph?($=e&&g.jsx(e,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:o.glyph,opacity:.55}}),t[13]=e,t[14]=o.glyph,t[15]=$):$=t[15];let p;t[16]!==r?(p=r&&g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),g.jsx(D,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),t[16]=r,t[17]=p):p=t[17];let K;t[18]!==o.backFrom?(K=g.jsx("stop",{offset:"0.3",stopColor:o.backFrom}),t[18]=o.backFrom,t[19]=K):K=t[19];let C;t[20]!==o.backTo?(C=g.jsx("stop",{offset:"1",stopColor:o.backTo}),t[20]=o.backTo,t[21]=C):C=t[21];let j;t[22]!==l||t[23]!==K||t[24]!==C?(j=g.jsxs("linearGradient",{id:l,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[K,C]}),t[22]=l,t[23]=K,t[24]=C,t[25]=j):j=t[25];let q;t[26]!==o.frontFrom?(q=g.jsx("stop",{stopColor:o.frontFrom}),t[26]=o.frontFrom,t[27]=q):q=t[27];let O;t[28]!==o.frontTo?(O=g.jsx("stop",{offset:"1",stopColor:o.frontTo}),t[28]=o.frontTo,t[29]=O):O=t[29];let L;t[30]!==d||t[31]!==q||t[32]!==O?(L=g.jsxs("radialGradient",{id:d,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[q,O]}),t[30]=d,t[31]=q,t[32]=O,t[33]=L):L=t[33];let E;t[34]!==j||t[35]!==L?(E=g.jsxs("defs",{children:[j,L]}),t[34]=j,t[35]=L,t[36]=E):E=t[36];let _;return t[37]!==n||t[38]!==p||t[39]!==E||t[40]!==h||t[41]!==b||t[42]!==k||t[43]!==T||t[44]!==$?(_=g.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[h,b,w,k,T,$,p,E]}),t[37]=n,t[38]=p,t[39]=E,t[40]=h,t[41]=b,t[42]=k,t[43]=T,t[44]=$,t[45]=_):_=t[45],_}export{St as F,W as a,yt as b,at as c,ct as d,gt as e,ut as f,pt as g,nt as h,Ft as i,it as j,dt as k,rt as l,lt as m,ht as n,ot as o,wt as p,ft as q,B as r,mt as u};
@@ -1 +1 @@
1
- import{fa as C,c as f,j as c,at as b,r as d,l as p,cb as j,fb as v,fc as h}from"./index-CW6L2S49.js";import{L as N}from"./label-CqIRBXyv.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(b,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{E as F,w as a,P as b,R as c,M as d,L as e,y as f};
1
+ import{fa as C,c as f,j as c,at as b,r as d,l as p,cb as j,fb as v,fc as h}from"./index-Ds9_YQQm.js";import{L as N}from"./label-B8I1KhDR.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(b,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{E as F,w as a,P as b,R as c,M as d,L as e,y as f};
@@ -1 +1 @@
1
- import{ae as re,ag as X,b as M,W as ie,n as le,ar as ce,as as ge,e as ne,o as H,t as G,K as ee,j as i,dq as se,dr as oe,ds as U,at as de,c as W,r as J,a7 as me,J as te,cQ as ue,cR as fe,w as pe,B as he,P as $,dt as xe}from"./index-CW6L2S49.js";import{u as je}from"./use-org-auth-client-S97f03iK.js";import{u as ze}from"./use-debounced-autosave-DyX30vD8.js";import{A as Se}from"./avatar-D7BI9kIY.js";import{I as ae}from"./input-DPKIPveM.js";import{C as ve}from"./review-settings-DJxQp0XZ.js";import{D as Oe}from"./domain-settings-2IuIzWRo.js";import{c as be,d as ye,b as Ce,f as _e,g as Ae,e as De,a as Fe,A as we}from"./alert-dialog-BwkydmfJ.js";import{R as Ne}from"./require-capability-B7CJKsKK.js";import"./User01-yXo0r48U.js";import"./switch-Mdu4u0WR.js";import"./UserSquare-B19aw2mP.js";import"./GitBranch01-BritbDKe.js";import"./use-organization-settings-BPN8rXNO.js";import"./constants-DNuUCxmW.js";import"./schema-CmTu1Qcv.js";import"./task-board-BR_hukMd.js";import"./badge-C7G_dwIu.js";import"./select-DamLPfhf.js";import"./Check-Bu3XsPtR.js";import"./ChevronUp-DDdMqJL1.js";import"./access-gate-Cr4kGdoG.js";import"./capability-load-error-DdUEYVnx.js";const Te=re({name:X().min(1,"Name is required").max(255,"Name is too long"),logo:X().optional()});function Ee(e){const t=W.c(17),{value:n,onChange:g,name:r,disabled:l}=e,d=M(),m=J.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const h=a;let s;t[1]!==g||t[2]!==d?(s=Y=>{const z=Y.target.files?.[0];if(!z)return;if(z.size>2097152){G.error(d("settings.organizationForm.imageTooLarge"));return}const p=new FileReader;p.onerror=()=>G.error(d("settings.organizationForm.failedToReadImage")),p.onloadend=()=>{p.result&&g(p.result),m.current&&(m.current.value="")},p.readAsDataURL(z)},t[1]=g,t[2]=d,t[3]=s):s=t[3];const c=s;let o;t[4]!==d?(o=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=o):o=t[5];let u;t[6]!==l||t[7]!==c?(u=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:c,className:"hidden",disabled:l}),t[6]=l,t[7]=c,t[8]=u):u=t[8];const x=n||void 0,j=r??"?";let f;t[9]!==x||t[10]!==j?(f=i.jsx(Se,{url:x,fallback:j,shape:"square",size:"base"}),t[9]=x,t[10]=j,t[11]=f):f=t[11];let S;return t[12]!==l||t[13]!==o||t[14]!==u||t[15]!==f?(S=i.jsxs("button",{type:"button",onClick:h,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":o,children:[u,f]}),t[12]=l,t[13]=o,t[14]=u,t[15]=f,t[16]=S):S=t[16],S}function Pe(){const e=M(),{org:t}=ie(),n=je(),g=le(),r=ce({resolver:ge(Te),values:{name:t.name??"",logo:t.logo??""}}),l=ne({mutationFn:async s=>{const c={name:s.name};s.logo&&(c.logo=s.logo);const o=await n.organization.update({data:c});if(o?.error)throw new Error(o.error.message||e("settings.organizationForm.failedToUpdateOrg"));return o},onSuccess:(s,c)=>{H("organization_settings_updated",{organization_id:t.id,fields:Object.keys(c)}),g.invalidateQueries({queryKey:ee.organizations()}),g.invalidateQueries({queryKey:ee.activeOrganization(t.slug)}),G.success(e("settings.organizationForm.updateSuccess"))},onError:(s,c)=>{H("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(c),error:s instanceof Error?s.message:String(s)}),G.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:m}=ze({save:async()=>{const s=r.control._formState.dirtyFields;if(Object.keys(s).length===0||!await r.trigger())return;const o=r.getValues(),u=r.control._defaultValues;r.reset(o,{keepValues:!0});try{await l.mutateAsync(o)}catch{r.reset(u,{keepValues:!0})}}}),a=r.formState.errors,h=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(oe,{children:[i.jsx(U,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Ee,{value:r.watch("logo"),onChange:s=>{r.setValue("logo",s??"",{shouldDirty:!0}),m()},name:r.watch("name")})}),i.jsx(U,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(de,{control:r.control,name:"name",render:({field:s})=>i.jsx(ae,{id:"org-name",...s,onChange:c=>{s.onChange(c),d()},onBlur:()=>{s.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(U,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[h&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:h}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(a.name||a.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[a.name&&i.jsx("p",{className:"text-xs text-destructive",children:a.name.message}),a.logo&&i.jsx("p",{className:"text-xs text-destructive",children:a.logo.message})]})]})})}function Le(){const e=W.c(86),t=M(),{org:n}=ie(),[g,r]=J.useState(!1),[l,d]=J.useState(""),m=me();let a;e[0]!==n.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=m,e[2]=a):a=e[2];let h;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(h=()=>{H("organization_deleted",{organization_id:n.id}),localStorage.getItem(te.lastOrgSlug())===n.slug&&localStorage.removeItem(te.lastOrgSlug()),ue()?.org===n.slug&&fe(),pe(),G.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=h):h=e[6];let s;e[7]!==t?(s=v=>{G.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=s):s=e[8];let c;e[9]!==a||e[10]!==h||e[11]!==s?(c={mutationFn:a,onSuccess:h,onError:s},e[9]=a,e[10]=h,e[11]=s,e[12]=c):c=e[12];const o=ne(c);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let x;e[15]!==t?(x=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=x):x=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let f;e[19]!==t?(f=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=f):f=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=()=>r(!0),e[21]=S):S=e[21];const Y=o.isPending;let z;e[22]!==t?(z=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=z):z=e[23];let p;e[24]!==o.isPending||e[25]!==z?(p=i.jsx(he,{variant:"destructive",size:"sm",onClick:S,disabled:Y,children:z}),e[24]=o.isPending,e[25]=z,e[26]=p):p=e[26];let O;e[27]!==p||e[28]!==j||e[29]!==f?(O=i.jsx(oe,{className:"border-destructive/40",children:i.jsx(U,{title:j,description:f,action:p})}),e[27]=p,e[28]=j,e[29]=f,e[30]=O):O=e[30];let b;e[31]!==O||e[32]!==u||e[33]!==x?(b=i.jsx(se,{title:u,description:x,children:O}),e[31]=O,e[32]=u,e[33]=x,e[34]=b):b=e[34];let K;e[35]===Symbol.for("react.memo_cache_sentinel")?(K=v=>{r(v),v||d("")},e[35]=K):K=e[35];let y;e[36]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=y):y=e[37];let C;e[38]!==y?(C=i.jsx(be,{children:y}),e[38]=y,e[39]=C):C=e[39];let _;e[40]!==n.name||e[41]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=_):_=e[42];let A;e[43]!==_?(A=i.jsx("p",{children:_}),e[43]=_,e[44]=A):A=e[44];let D;e[45]!==n.name||e[46]!==t?(D=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=D):D=e[47];let F;e[48]!==D?(F=i.jsx("p",{className:"mt-3 mb-1.5",children:D}),e[48]=D,e[49]=F):F=e[49];let Q;e[50]===Symbol.for("react.memo_cache_sentinel")?(Q=v=>d(v.target.value),e[50]=Q):Q=e[50];let w;e[51]!==l||e[52]!==n.name?(w=i.jsx(ae,{value:l,onChange:Q,placeholder:n.name,autoFocus:!0}),e[51]=l,e[52]=n.name,e[53]=w):w=e[53];let N;e[54]!==A||e[55]!==F||e[56]!==w?(N=i.jsx(ye,{asChild:!0,children:i.jsxs("div",{children:[A,F,w]})}),e[54]=A,e[55]=F,e[56]=w,e[57]=N):N=e[57];let T;e[58]!==C||e[59]!==N?(T=i.jsxs(Ce,{children:[C,N]}),e[58]=C,e[59]=N,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let P;e[63]!==E?(P=i.jsx(_e,{children:E}),e[63]=E,e[64]=P):P=e[64];let L;e[65]!==o?(L=()=>o.mutate(),e[65]=o,e[66]=L):L=e[66];const Z=l!==n.name||o.isPending;let R;e[67]!==o.isPending||e[68]!==t?(R=o.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=o.isPending,e[68]=t,e[69]=R):R=e[69];let k;e[70]!==L||e[71]!==Z||e[72]!==R?(k=i.jsx(Ae,{onClick:L,disabled:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R}),e[70]=L,e[71]=Z,e[72]=R,e[73]=k):k=e[73];let I;e[74]!==P||e[75]!==k?(I=i.jsxs(De,{children:[P,k]}),e[74]=P,e[75]=k,e[76]=I):I=e[76];let q;e[77]!==T||e[78]!==I?(q=i.jsxs(Fe,{children:[T,I]}),e[77]=T,e[78]=I,e[79]=q):q=e[79];let B;e[80]!==g||e[81]!==q?(B=i.jsx(we,{open:g,onOpenChange:K,children:q}),e[80]=g,e[81]=q,e[82]=B):B=e[82];let V;return e[83]!==b||e[84]!==B?(V=i.jsxs(i.Fragment,{children:[b,B]}),e[83]=b,e[84]=B,e[85]=V):V=e[85],V}function Re(){const e=W.c(10),t=M();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let g;e[2]!==n?(g=i.jsx($.Title,{children:n}),e[2]=n,e[3]=g):g=e[3];let r,l,d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Pe,{}),l=i.jsx(ve,{}),d=i.jsx(Oe,{}),m=i.jsx(Le,{}),e[4]=r,e[5]=l,e[6]=d,e[7]=m):(r=e[4],l=e[5],d=e[6],m=e[7]);let a;return e[8]!==g?(a=i.jsx($,{children:i.jsx($.Content,{children:i.jsx($.Body,{children:i.jsxs(xe,{children:[g,r,l,d,m]})})})}),e[8]=g,e[9]=a):a=e[9],a}function at(){const e=W.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Ne,{capability:"org:manage",area:"general settings",children:i.jsx(Re,{})}),e[0]=t):t=e[0],t}export{at as default};
1
+ import{ae as re,ag as X,b as M,W as ie,n as le,ar as ce,as as ge,e as ne,o as H,t as G,K as ee,j as i,dq as se,dr as oe,ds as U,at as de,c as W,r as J,a7 as me,J as te,cQ as ue,cR as fe,w as pe,B as he,P as $,dt as xe}from"./index-Ds9_YQQm.js";import{u as je}from"./use-org-auth-client-Cp3G9WC1.js";import{u as ze}from"./use-debounced-autosave-dNIsOT-E.js";import{A as Se}from"./avatar-65M-tykE.js";import{I as ae}from"./input-CBtN_PPx.js";import{C as ve}from"./review-settings-Cp01VqYx.js";import{D as Oe}from"./domain-settings-CVN9LhLH.js";import{c as be,d as ye,b as Ce,f as _e,g as Ae,e as De,a as Fe,A as we}from"./alert-dialog-C2u5xYM5.js";import{R as Ne}from"./require-capability-CXqHSbCc.js";import"./User01-mzLrMAfi.js";import"./switch-DXic8Uh_.js";import"./UserSquare-vGUnOUu5.js";import"./GitBranch01-CfKitZQX.js";import"./use-organization-settings-CpiPY2sA.js";import"./constants-DNuUCxmW.js";import"./schema-CSzKWh-e.js";import"./task-board-BILXt1or.js";import"./badge-BlkJw9ZT.js";import"./select-YGToc2er.js";import"./Check-D5XzCZva.js";import"./ChevronUp-rYvSsRjP.js";import"./access-gate-VXc3n5Tl.js";import"./capability-load-error-DiWeeuLw.js";const Te=re({name:X().min(1,"Name is required").max(255,"Name is too long"),logo:X().optional()});function Ee(e){const t=W.c(17),{value:n,onChange:g,name:r,disabled:l}=e,d=M(),m=J.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const h=a;let s;t[1]!==g||t[2]!==d?(s=Y=>{const z=Y.target.files?.[0];if(!z)return;if(z.size>2097152){G.error(d("settings.organizationForm.imageTooLarge"));return}const p=new FileReader;p.onerror=()=>G.error(d("settings.organizationForm.failedToReadImage")),p.onloadend=()=>{p.result&&g(p.result),m.current&&(m.current.value="")},p.readAsDataURL(z)},t[1]=g,t[2]=d,t[3]=s):s=t[3];const c=s;let o;t[4]!==d?(o=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=o):o=t[5];let u;t[6]!==l||t[7]!==c?(u=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:c,className:"hidden",disabled:l}),t[6]=l,t[7]=c,t[8]=u):u=t[8];const x=n||void 0,j=r??"?";let f;t[9]!==x||t[10]!==j?(f=i.jsx(Se,{url:x,fallback:j,shape:"square",size:"base"}),t[9]=x,t[10]=j,t[11]=f):f=t[11];let S;return t[12]!==l||t[13]!==o||t[14]!==u||t[15]!==f?(S=i.jsxs("button",{type:"button",onClick:h,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":o,children:[u,f]}),t[12]=l,t[13]=o,t[14]=u,t[15]=f,t[16]=S):S=t[16],S}function Pe(){const e=M(),{org:t}=ie(),n=je(),g=le(),r=ce({resolver:ge(Te),values:{name:t.name??"",logo:t.logo??""}}),l=ne({mutationFn:async s=>{const c={name:s.name};s.logo&&(c.logo=s.logo);const o=await n.organization.update({data:c});if(o?.error)throw new Error(o.error.message||e("settings.organizationForm.failedToUpdateOrg"));return o},onSuccess:(s,c)=>{H("organization_settings_updated",{organization_id:t.id,fields:Object.keys(c)}),g.invalidateQueries({queryKey:ee.organizations()}),g.invalidateQueries({queryKey:ee.activeOrganization(t.slug)}),G.success(e("settings.organizationForm.updateSuccess"))},onError:(s,c)=>{H("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(c),error:s instanceof Error?s.message:String(s)}),G.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:m}=ze({save:async()=>{const s=r.control._formState.dirtyFields;if(Object.keys(s).length===0||!await r.trigger())return;const o=r.getValues(),u=r.control._defaultValues;r.reset(o,{keepValues:!0});try{await l.mutateAsync(o)}catch{r.reset(u,{keepValues:!0})}}}),a=r.formState.errors,h=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(oe,{children:[i.jsx(U,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Ee,{value:r.watch("logo"),onChange:s=>{r.setValue("logo",s??"",{shouldDirty:!0}),m()},name:r.watch("name")})}),i.jsx(U,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(de,{control:r.control,name:"name",render:({field:s})=>i.jsx(ae,{id:"org-name",...s,onChange:c=>{s.onChange(c),d()},onBlur:()=>{s.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(U,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[h&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:h}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(a.name||a.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[a.name&&i.jsx("p",{className:"text-xs text-destructive",children:a.name.message}),a.logo&&i.jsx("p",{className:"text-xs text-destructive",children:a.logo.message})]})]})})}function Le(){const e=W.c(86),t=M(),{org:n}=ie(),[g,r]=J.useState(!1),[l,d]=J.useState(""),m=me();let a;e[0]!==n.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=m,e[2]=a):a=e[2];let h;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(h=()=>{H("organization_deleted",{organization_id:n.id}),localStorage.getItem(te.lastOrgSlug())===n.slug&&localStorage.removeItem(te.lastOrgSlug()),ue()?.org===n.slug&&fe(),pe(),G.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=h):h=e[6];let s;e[7]!==t?(s=v=>{G.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=s):s=e[8];let c;e[9]!==a||e[10]!==h||e[11]!==s?(c={mutationFn:a,onSuccess:h,onError:s},e[9]=a,e[10]=h,e[11]=s,e[12]=c):c=e[12];const o=ne(c);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let x;e[15]!==t?(x=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=x):x=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let f;e[19]!==t?(f=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=f):f=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=()=>r(!0),e[21]=S):S=e[21];const Y=o.isPending;let z;e[22]!==t?(z=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=z):z=e[23];let p;e[24]!==o.isPending||e[25]!==z?(p=i.jsx(he,{variant:"destructive",size:"sm",onClick:S,disabled:Y,children:z}),e[24]=o.isPending,e[25]=z,e[26]=p):p=e[26];let O;e[27]!==p||e[28]!==j||e[29]!==f?(O=i.jsx(oe,{className:"border-destructive/40",children:i.jsx(U,{title:j,description:f,action:p})}),e[27]=p,e[28]=j,e[29]=f,e[30]=O):O=e[30];let b;e[31]!==O||e[32]!==u||e[33]!==x?(b=i.jsx(se,{title:u,description:x,children:O}),e[31]=O,e[32]=u,e[33]=x,e[34]=b):b=e[34];let K;e[35]===Symbol.for("react.memo_cache_sentinel")?(K=v=>{r(v),v||d("")},e[35]=K):K=e[35];let y;e[36]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=y):y=e[37];let C;e[38]!==y?(C=i.jsx(be,{children:y}),e[38]=y,e[39]=C):C=e[39];let _;e[40]!==n.name||e[41]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=_):_=e[42];let A;e[43]!==_?(A=i.jsx("p",{children:_}),e[43]=_,e[44]=A):A=e[44];let D;e[45]!==n.name||e[46]!==t?(D=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=D):D=e[47];let F;e[48]!==D?(F=i.jsx("p",{className:"mt-3 mb-1.5",children:D}),e[48]=D,e[49]=F):F=e[49];let Q;e[50]===Symbol.for("react.memo_cache_sentinel")?(Q=v=>d(v.target.value),e[50]=Q):Q=e[50];let w;e[51]!==l||e[52]!==n.name?(w=i.jsx(ae,{value:l,onChange:Q,placeholder:n.name,autoFocus:!0}),e[51]=l,e[52]=n.name,e[53]=w):w=e[53];let N;e[54]!==A||e[55]!==F||e[56]!==w?(N=i.jsx(ye,{asChild:!0,children:i.jsxs("div",{children:[A,F,w]})}),e[54]=A,e[55]=F,e[56]=w,e[57]=N):N=e[57];let T;e[58]!==C||e[59]!==N?(T=i.jsxs(Ce,{children:[C,N]}),e[58]=C,e[59]=N,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let P;e[63]!==E?(P=i.jsx(_e,{children:E}),e[63]=E,e[64]=P):P=e[64];let L;e[65]!==o?(L=()=>o.mutate(),e[65]=o,e[66]=L):L=e[66];const Z=l!==n.name||o.isPending;let R;e[67]!==o.isPending||e[68]!==t?(R=o.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=o.isPending,e[68]=t,e[69]=R):R=e[69];let k;e[70]!==L||e[71]!==Z||e[72]!==R?(k=i.jsx(Ae,{onClick:L,disabled:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R}),e[70]=L,e[71]=Z,e[72]=R,e[73]=k):k=e[73];let I;e[74]!==P||e[75]!==k?(I=i.jsxs(De,{children:[P,k]}),e[74]=P,e[75]=k,e[76]=I):I=e[76];let q;e[77]!==T||e[78]!==I?(q=i.jsxs(Fe,{children:[T,I]}),e[77]=T,e[78]=I,e[79]=q):q=e[79];let B;e[80]!==g||e[81]!==q?(B=i.jsx(we,{open:g,onOpenChange:K,children:q}),e[80]=g,e[81]=q,e[82]=B):B=e[82];let V;return e[83]!==b||e[84]!==B?(V=i.jsxs(i.Fragment,{children:[b,B]}),e[83]=b,e[84]=B,e[85]=V):V=e[85],V}function Re(){const e=W.c(10),t=M();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let g;e[2]!==n?(g=i.jsx($.Title,{children:n}),e[2]=n,e[3]=g):g=e[3];let r,l,d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Pe,{}),l=i.jsx(ve,{}),d=i.jsx(Oe,{}),m=i.jsx(Le,{}),e[4]=r,e[5]=l,e[6]=d,e[7]=m):(r=e[4],l=e[5],d=e[6],m=e[7]);let a;return e[8]!==g?(a=i.jsx($,{children:i.jsx($.Content,{children:i.jsx($.Body,{children:i.jsxs(xe,{children:[g,r,l,d,m]})})})}),e[8]=g,e[9]=a):a=e[9],a}function at(){const e=W.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Ne,{capability:"org:manage",area:"general settings",children:i.jsx(Re,{})}),e[0]=t):t=e[0],t}export{at as default};
@@ -1 +1 @@
1
- import{c as $,j as t,W as de,a as ye,n as me,r as D,aS as le,b as ee,h as Z,e as ge,t as te,fd as Ne,K as se,m as ke,l as ae,B as re,x as ve,z as Ce}from"./index-CW6L2S49.js";import{c as Re,d as we,b as Pe,D as Se}from"./dialog-lVg2I_FW.js";import{C as Ie}from"./collection-search-Byf9covb.js";import{u as Te}from"./use-debounced-value-DS9pfZWp.js";import{b as he,u as _e}from"./use-connection--sEuYWk0.js";import{u as ne}from"./use-mcp-client-BkpxeCP2.js";import{W as Ee,S as pe}from"./constants-DNuUCxmW.js";import{a as be}from"./authenticate-and-persist-oauth-CczjH39y.js";import{i as ue}from"./ArrowLeft-B_C58IhS.js";import{n as Ae}from"./LinkExternal01-DFZf17HG.js";import{n as ze}from"./Share07-DQRfeucj.js";import{u as Le}from"./use-mcp-tools-zprouZ07.js";import{e as Ge}from"./extract-connection-data-DcfPnaRL.js";import{u as Fe}from"./use-navigate-to-agent-ChEjWy4D.js";import{b as Oe,p as fe,f as Ue,G as xe}from"./provision-repo-scoped-github-connection-WQFARyHG.js";function M(C){const e=$.c(4),{size:n,className:l}=C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=x):x=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:x}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function De(C,e){const n=$.c(12),{org:l}=de();let x;n[0]!==l.id?(x=Ee.REGISTRY(l.id),n[0]=l.id,n[1]=x):x=n[1];const o=x;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==C?(s={name:C},n[6]=C,n[7]=s):s=n[7];const u=e?.enabled??!0;let k;return n[8]!==r||n[9]!==s||n[10]!==u?(k={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:He},n[8]=r,n[9]=s,n[10]=u,n[11]=k):k=n[11],Le(k)}function He(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function $e(C){const{org:e}=de(),{data:n}=ye.useSession(),l=he(),x=me(),[o,a]=D.useState("idle"),[r,s]=D.useState(null),[u,k]=D.useState(null),{data:v,isLoading:P}=De(Me,{enabled:C.enabled}),f=D.useRef(!1);C.enabled&&v&&!P&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!n?.user?.id||!e))try{a("installing"),s(null);const c=Ge(v,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:h}=await l.create.mutateAsync(c);a("authenticating");const y=await be({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:g=>l.update.mutateAsync({id:h,data:{connection_token:g}}).then(()=>{})});if(y.ran&&!y.ok){try{await l.delete.mutateAsync(h)}catch{}throw new Error(y.error&&y.error!=="no token received"?y.error:"No token received from GitHub")}le(x,e.id),k(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function dt(C){const e=$.c(27),{open:n,onOpenChange:l,title:x,onImportComplete:o,mode:a}=C,r=a===void 0?"agent":a,s=ee();let u;e[0]!==r||e[1]!==s||e[2]!==x?(u=x??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=x,e[3]=u):u=e[3];const k=u,[v,P]=D.useState(null);let f;e[4]!==k?(f=t.jsx(Re,{className:"sr-only",children:t.jsx(we,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{className:"size-4.5 text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let b;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==v||e[17]!==c?(b=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(D.Suspense,{fallback:m,children:t.jsx(Be,{open:n,onComplete:c,selectedInstallation:v,onSelectInstallation:P,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=v,e[17]=c,e[18]=b):b=e[18];let h;e[19]!==f||e[20]!==d||e[21]!==b?(h=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,b]}),e[19]=f,e[20]=d,e[21]=b,e[22]=h):h=e[22];let y;return e[23]!==l||e[24]!==n||e[25]!==h?(y=t.jsx(Se,{open:n,onOpenChange:l,children:h}),e[23]=l,e[24]=n,e[25]=h,e[26]=y):y=e[26],y}function Be({open:C,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:x,mode:o="agent"}){const a=ee(),{org:r}=de(),s=me(),u=Fe(),[k,v]=D.useState(null),P=_e({slug:"mcp-github"}),f=Oe(P),d=$e({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),b=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),h=async(i,j)=>{try{const I=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:j}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},y=(i,j)=>{Promise.all([h(j,"AGENTS.md"),h(j,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await b.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:T}}}}),le(s,r.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},g=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const j=n.installationId;if(o==="connection"){const{childConnectionId:R}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>b.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>b.callTool(R)});let T=null;try{const R=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:j,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:i,connectionId:N,item:w.item}}catch(R){throw T&&await b.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await b.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:j,connectionId:N,item:I})=>{if(o==="connection"||!i||!I){if(le(s,r.id),Ne(s,r.id),x){x({virtualMcpId:null,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.addedRepo",{name:j.name})),e();return}if(s.setQueryData(se.collectionItem(b,r.id,"","VIRTUAL_MCP",i),{item:I}),le(s,r.id),y(i,j),x){x({virtualMcpId:i,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.importedRepo",{name:j.name})),e(),u(i)},onError:(i,j)=>{console.error("GitHub import failed:",i);const N=i instanceof Error?i.message:a("common.githubRepoPicker.unknownError");if(j.fork&&N.toLowerCase().includes("mint")){te.error(a("common.githubRepoPicker.failedImportFork",{name:j.name}));return}te.error(a("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>v(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ve,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>g.mutate(i),isSaving:g.isPending}):t.jsx(qe,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>v(null)}):null}function qe(C){const e=$.c(124),{connectionId:n,orgId:l,orgSlug:x,onSelect:o,showBackButton:a,onBack:r}=C,s=ee();let u;e[0]!==l||e[1]!==x?(u={connectionId:pe,orgId:l,orgSlug:x},e[0]=l,e[1]=x,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==k?(d=()=>Ue(p=>k.callTool(p),n),e[6]=n,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ke(m);let b;e[12]!==P||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==x||e[17]!==v?(b=async()=>{const p=await be({connectionId:n,orgId:l,orgSlug:x,persistFallback:E=>P.update.mutateAsync({id:n,data:{connection_token:E}}).then(Qe)});if(p.ran&&!p.ok)throw new Error(p.error??"no token received");const S=new URL(`/api/${x}/mcp/${n}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=P,e[13]=n,e[14]=c,e[15]=l,e[16]=x,e[17]=v,e[18]=b):b=e[18];let h;e[19]!==s?(h=p=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:p instanceof Error?p.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=h):h=e[20];let y;e[21]!==b||e[22]!==h?(y={mutationFn:b,onError:h},e[21]=b,e[22]=h,e[23]=y):y=e[23];const g=ge(y);if(c.isLoading){let p;return e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{className:"size-4.5 text-muted-foreground"})}),e[24]=p):p=e[24],p}if(c.isError){let p;e[25]!==s?(p=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=p):p=e[26];let S;e[27]!==p?(S=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[27]=p,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==g?(z=()=>g.mutate(),e[33]=g,e[34]=z):z=e[34];const H=g.isPending;let L;e[35]!==g.isPending?(L=g.isPending?t.jsx(Z,{className:"size-3.5"}):t.jsx(M,{className:"size-3.5"}),e[35]=g.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let F;e[39]!==g.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(F=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:H,children:[L,G]}),e[39]=g.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=F):F=e[43];let U;return e[44]!==A||e[45]!==F||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,F]}),e[44]=A,e[45]=F,e[46]=S,e[47]=U):U=e[47],U}const i=c.data;if(!i)return null;if(i.installations.length===0){let p;e[48]!==r||e[49]!==a||e[50]!==s?(p=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=p):p=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let L;e[60]!==H?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let F;e[64]!==G?(F=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=F):F=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Ae,{size:14}),e[68]=ie):ie=e[68];let B;e[69]!==U?(B=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=B):B=e[70];let q;e[71]!==c?(q=()=>{c.refetch()},e[71]=c,e[72]=q):q=e[72];const je=c.isFetching;let Q;e[73]!==c.isFetching?(Q=c.isFetching&&t.jsx(Z,{className:"size-3.5"}),e[73]=c.isFetching,e[74]=Q):Q=e[74];let V;e[75]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=V):V=e[76];let K;e[77]!==c.isFetching||e[78]!==q||e[79]!==Q||e[80]!==V?(K=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[Q,V]}),e[77]=c.isFetching,e[78]=q,e[79]=Q,e[80]=V,e[81]=K):K=e[81];let W;e[82]!==B||e[83]!==K?(W=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[B,K]}),e[82]=B,e[83]=K,e[84]=W):W=e[84];let J;e[85]!==s?(J=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=J):J=e[86];let Y;e[87]!==J?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:J}),e[87]=J,e[88]=Y):Y=e[88];let X;e[89]!==z||e[90]!==L||e[91]!==F||e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,F,W,Y]}),e[89]=z,e[90]=L,e[91]=F,e[92]=W,e[93]=Y,e[94]=X):X=e[94];let oe;return e[95]!==X||e[96]!==p?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,X]}),e[95]=X,e[96]=p,e[97]=oe):oe=e[97],oe}let j;e[98]!==r||e[99]!==a||e[100]!==s?(j=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=r,e[99]=a,e[100]=s,e[101]=j):j=e[101];let N;if(e[102]!==i.installations||e[103]!==o||e[104]!==s){let p;e[106]!==o||e[107]!==s?(p=S=>t.jsxs("button",{type:"button",onClick:()=>o(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=o,e[107]=s,e[108]=p):p=e[108],N=i.installations.map(p),e[102]=i.installations,e[103]=o,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let O;return e[120]!==I||e[121]!==_||e[122]!==j?(O=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,I,_]}),e[120]=I,e[121]=_,e[122]=j,e[123]=O):O=e[123],O}function Qe(){}function Ve(C){const e=$.c(23),{connectionId:n,orgId:l,orgSlug:x,installation:o,onSelectRepo:a,isSaving:r}=C,s=ee(),[u,k]=D.useState(""),v=Te(u,300),P=D.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Ie,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let b;e[6]!==c?(b=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=b):b=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{className:"size-4.5 text-muted-foreground"})}),e[8]=h):h=e[8];let y;e[9]!==n||e[10]!==P||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==x?(y=t.jsx(D.Suspense,{fallback:h,children:t.jsx(Ke,{connectionId:n,orgId:l,orgSlug:x,installation:o,query:P,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=P,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=x,e[16]=y):y=e[16];let g;e[17]!==b||e[18]!==y?(g=t.jsx("div",{className:b,children:y}),e[17]=b,e[18]=y,e[19]=g):g=e[19];let i;return e[20]!==m||e[21]!==g?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,g]}),e[20]=m,e[21]=g,e[22]=i):i=e[22],i}function Ke(C){const e=$.c(36),{connectionId:n,orgId:l,orgSlug:x,installation:o,query:a,onSelectRepo:r,isSaving:s}=C,u=ee();let k;e[0]!==n||e[1]!==l||e[2]!==x?(k={connectionId:n,orgId:l,orgSlug:x},e[0]=n,e[1]=l,e[2]=x,e[3]=k):k=e[3];const v=ne(k),P=o.type==="User"?"user":"org",f=a?`${P}:${o.login} ${a} in:name fork:true`:`${P}:${o.login} fork:true`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async g=>{const{signal:i}=g,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:b}=ve(c);if(b.length===0){let g;e[15]!==u?(g=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=g):g=e[16];let i;e[17]!==g?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[17]=g,e[18]=i):i=e[18];let j;e[19]!==a||e[20]!==u?(j=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==i||e[23]!==j?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,j]}),e[22]=i,e[23]=j,e[24]=N):N=e[24],N}let h;if(e[25]!==s||e[26]!==r||e[27]!==b||e[28]!==u){let g;e[30]!==s||e[31]!==r||e[32]!==u?(g=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(M,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),i.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Ce,{size:10}):t.jsx(ze,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=g):g=e[33],h=b.map(g),e[25]=s,e[26]=r,e[27]=b,e[28]=u,e[29]=h}else h=e[29];let y;return e[34]!==h?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:h}),e[34]=h,e[35]=y):y=e[35],y}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=$.c(51),{status:n,error:l,retry:x}=C,o=ee();if(n==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==o?(I=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==l||e[6]!==o?(R=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let O;e[13]!==o?(O=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=O):O=e[14];let p;e[15]!==x||e[16]!==O?(p=t.jsx("button",{type:"button",onClick:x,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:O}),e[15]=x,e[16]=O,e[17]=p):p=e[17];let S;return e[18]!==_||e[19]!==p?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,p]}),e[18]=_,e[19]=p,e[20]=S):S=e[20],S}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{className:"size-3 text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==a||e[29]!==o?(v=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let h;e[40]!==b?(h=ae("size-1.5 rounded-full",b),e[40]=b,e[41]=h):h=e[41];let y;e[42]!==h?(y=t.jsx("span",{className:h}),e[42]=h,e[43]=y):y=e[43];let g;e[44]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=g):g=e[44];let i;e[45]!==c||e[46]!==y?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,g]}),e[45]=c,e[46]=y,e[47]=i):i=e[47];let j;return e[48]!==i||e[49]!==f?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=j):j=e[50],j}export{M as G,dt as a,$e as b,De as u};
1
+ import{c as $,j as t,W as de,a as ye,n as me,r as D,aS as le,b as ee,h as Z,e as ge,t as te,fd as Ne,K as se,m as ke,l as ae,B as re,x as ve,z as Ce}from"./index-Ds9_YQQm.js";import{c as Re,d as we,b as Pe,D as Se}from"./dialog-B49rrPcE.js";import{C as Ie}from"./collection-search-7lVLJWOB.js";import{u as Te}from"./use-debounced-value-CQvHGF7W.js";import{b as he,u as _e}from"./use-connection-D-P-oJeL.js";import{u as ne}from"./use-mcp-client-BzmGxRuq.js";import{W as Ee,S as pe}from"./constants-DNuUCxmW.js";import{a as be}from"./authenticate-and-persist-oauth-BwmApcxP.js";import{i as ue}from"./ArrowLeft-DjieScGW.js";import{n as Ae}from"./LinkExternal01-C9li9a1P.js";import{n as ze}from"./Share07-BJIuab_2.js";import{u as Le}from"./use-mcp-tools-BElJHPUX.js";import{e as Ge}from"./extract-connection-data-CkOzL4EZ.js";import{u as Fe}from"./use-navigate-to-agent-LzLdBs0e.js";import{b as Oe,p as fe,f as Ue,G as xe}from"./provision-repo-scoped-github-connection-WQFARyHG.js";function M(C){const e=$.c(4),{size:n,className:l}=C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=x):x=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:x}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function De(C,e){const n=$.c(12),{org:l}=de();let x;n[0]!==l.id?(x=Ee.REGISTRY(l.id),n[0]=l.id,n[1]=x):x=n[1];const o=x;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==C?(s={name:C},n[6]=C,n[7]=s):s=n[7];const u=e?.enabled??!0;let k;return n[8]!==r||n[9]!==s||n[10]!==u?(k={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:He},n[8]=r,n[9]=s,n[10]=u,n[11]=k):k=n[11],Le(k)}function He(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function $e(C){const{org:e}=de(),{data:n}=ye.useSession(),l=he(),x=me(),[o,a]=D.useState("idle"),[r,s]=D.useState(null),[u,k]=D.useState(null),{data:v,isLoading:P}=De(Me,{enabled:C.enabled}),f=D.useRef(!1);C.enabled&&v&&!P&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!n?.user?.id||!e))try{a("installing"),s(null);const c=Ge(v,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:h}=await l.create.mutateAsync(c);a("authenticating");const y=await be({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:g=>l.update.mutateAsync({id:h,data:{connection_token:g}}).then(()=>{})});if(y.ran&&!y.ok){try{await l.delete.mutateAsync(h)}catch{}throw new Error(y.error&&y.error!=="no token received"?y.error:"No token received from GitHub")}le(x,e.id),k(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function dt(C){const e=$.c(27),{open:n,onOpenChange:l,title:x,onImportComplete:o,mode:a}=C,r=a===void 0?"agent":a,s=ee();let u;e[0]!==r||e[1]!==s||e[2]!==x?(u=x??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=x,e[3]=u):u=e[3];const k=u,[v,P]=D.useState(null);let f;e[4]!==k?(f=t.jsx(Re,{className:"sr-only",children:t.jsx(we,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{className:"size-4.5 text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let b;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==v||e[17]!==c?(b=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(D.Suspense,{fallback:m,children:t.jsx(Be,{open:n,onComplete:c,selectedInstallation:v,onSelectInstallation:P,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=v,e[17]=c,e[18]=b):b=e[18];let h;e[19]!==f||e[20]!==d||e[21]!==b?(h=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,b]}),e[19]=f,e[20]=d,e[21]=b,e[22]=h):h=e[22];let y;return e[23]!==l||e[24]!==n||e[25]!==h?(y=t.jsx(Se,{open:n,onOpenChange:l,children:h}),e[23]=l,e[24]=n,e[25]=h,e[26]=y):y=e[26],y}function Be({open:C,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:x,mode:o="agent"}){const a=ee(),{org:r}=de(),s=me(),u=Fe(),[k,v]=D.useState(null),P=_e({slug:"mcp-github"}),f=Oe(P),d=$e({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),b=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),h=async(i,j)=>{try{const I=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:j}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},y=(i,j)=>{Promise.all([h(j,"AGENTS.md"),h(j,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await b.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:T}}}}),le(s,r.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},g=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const j=n.installationId;if(o==="connection"){const{childConnectionId:R}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>b.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>b.callTool(R)});let T=null;try{const R=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:j,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:i,connectionId:N,item:w.item}}catch(R){throw T&&await b.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await b.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:j,connectionId:N,item:I})=>{if(o==="connection"||!i||!I){if(le(s,r.id),Ne(s,r.id),x){x({virtualMcpId:null,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.addedRepo",{name:j.name})),e();return}if(s.setQueryData(se.collectionItem(b,r.id,"","VIRTUAL_MCP",i),{item:I}),le(s,r.id),y(i,j),x){x({virtualMcpId:i,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.importedRepo",{name:j.name})),e(),u(i)},onError:(i,j)=>{console.error("GitHub import failed:",i);const N=i instanceof Error?i.message:a("common.githubRepoPicker.unknownError");if(j.fork&&N.toLowerCase().includes("mint")){te.error(a("common.githubRepoPicker.failedImportFork",{name:j.name}));return}te.error(a("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>v(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ve,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>g.mutate(i),isSaving:g.isPending}):t.jsx(qe,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>v(null)}):null}function qe(C){const e=$.c(124),{connectionId:n,orgId:l,orgSlug:x,onSelect:o,showBackButton:a,onBack:r}=C,s=ee();let u;e[0]!==l||e[1]!==x?(u={connectionId:pe,orgId:l,orgSlug:x},e[0]=l,e[1]=x,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==k?(d=()=>Ue(p=>k.callTool(p),n),e[6]=n,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ke(m);let b;e[12]!==P||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==x||e[17]!==v?(b=async()=>{const p=await be({connectionId:n,orgId:l,orgSlug:x,persistFallback:E=>P.update.mutateAsync({id:n,data:{connection_token:E}}).then(Qe)});if(p.ran&&!p.ok)throw new Error(p.error??"no token received");const S=new URL(`/api/${x}/mcp/${n}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=P,e[13]=n,e[14]=c,e[15]=l,e[16]=x,e[17]=v,e[18]=b):b=e[18];let h;e[19]!==s?(h=p=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:p instanceof Error?p.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=h):h=e[20];let y;e[21]!==b||e[22]!==h?(y={mutationFn:b,onError:h},e[21]=b,e[22]=h,e[23]=y):y=e[23];const g=ge(y);if(c.isLoading){let p;return e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{className:"size-4.5 text-muted-foreground"})}),e[24]=p):p=e[24],p}if(c.isError){let p;e[25]!==s?(p=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=p):p=e[26];let S;e[27]!==p?(S=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[27]=p,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==g?(z=()=>g.mutate(),e[33]=g,e[34]=z):z=e[34];const H=g.isPending;let L;e[35]!==g.isPending?(L=g.isPending?t.jsx(Z,{className:"size-3.5"}):t.jsx(M,{className:"size-3.5"}),e[35]=g.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let F;e[39]!==g.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(F=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:H,children:[L,G]}),e[39]=g.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=F):F=e[43];let U;return e[44]!==A||e[45]!==F||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,F]}),e[44]=A,e[45]=F,e[46]=S,e[47]=U):U=e[47],U}const i=c.data;if(!i)return null;if(i.installations.length===0){let p;e[48]!==r||e[49]!==a||e[50]!==s?(p=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=p):p=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let L;e[60]!==H?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let F;e[64]!==G?(F=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=F):F=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Ae,{size:14}),e[68]=ie):ie=e[68];let B;e[69]!==U?(B=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=B):B=e[70];let q;e[71]!==c?(q=()=>{c.refetch()},e[71]=c,e[72]=q):q=e[72];const je=c.isFetching;let Q;e[73]!==c.isFetching?(Q=c.isFetching&&t.jsx(Z,{className:"size-3.5"}),e[73]=c.isFetching,e[74]=Q):Q=e[74];let V;e[75]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=V):V=e[76];let K;e[77]!==c.isFetching||e[78]!==q||e[79]!==Q||e[80]!==V?(K=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[Q,V]}),e[77]=c.isFetching,e[78]=q,e[79]=Q,e[80]=V,e[81]=K):K=e[81];let W;e[82]!==B||e[83]!==K?(W=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[B,K]}),e[82]=B,e[83]=K,e[84]=W):W=e[84];let J;e[85]!==s?(J=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=J):J=e[86];let Y;e[87]!==J?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:J}),e[87]=J,e[88]=Y):Y=e[88];let X;e[89]!==z||e[90]!==L||e[91]!==F||e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,F,W,Y]}),e[89]=z,e[90]=L,e[91]=F,e[92]=W,e[93]=Y,e[94]=X):X=e[94];let oe;return e[95]!==X||e[96]!==p?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,X]}),e[95]=X,e[96]=p,e[97]=oe):oe=e[97],oe}let j;e[98]!==r||e[99]!==a||e[100]!==s?(j=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=r,e[99]=a,e[100]=s,e[101]=j):j=e[101];let N;if(e[102]!==i.installations||e[103]!==o||e[104]!==s){let p;e[106]!==o||e[107]!==s?(p=S=>t.jsxs("button",{type:"button",onClick:()=>o(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=o,e[107]=s,e[108]=p):p=e[108],N=i.installations.map(p),e[102]=i.installations,e[103]=o,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let O;return e[120]!==I||e[121]!==_||e[122]!==j?(O=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,I,_]}),e[120]=I,e[121]=_,e[122]=j,e[123]=O):O=e[123],O}function Qe(){}function Ve(C){const e=$.c(23),{connectionId:n,orgId:l,orgSlug:x,installation:o,onSelectRepo:a,isSaving:r}=C,s=ee(),[u,k]=D.useState(""),v=Te(u,300),P=D.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Ie,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let b;e[6]!==c?(b=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=b):b=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{className:"size-4.5 text-muted-foreground"})}),e[8]=h):h=e[8];let y;e[9]!==n||e[10]!==P||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==x?(y=t.jsx(D.Suspense,{fallback:h,children:t.jsx(Ke,{connectionId:n,orgId:l,orgSlug:x,installation:o,query:P,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=P,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=x,e[16]=y):y=e[16];let g;e[17]!==b||e[18]!==y?(g=t.jsx("div",{className:b,children:y}),e[17]=b,e[18]=y,e[19]=g):g=e[19];let i;return e[20]!==m||e[21]!==g?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,g]}),e[20]=m,e[21]=g,e[22]=i):i=e[22],i}function Ke(C){const e=$.c(36),{connectionId:n,orgId:l,orgSlug:x,installation:o,query:a,onSelectRepo:r,isSaving:s}=C,u=ee();let k;e[0]!==n||e[1]!==l||e[2]!==x?(k={connectionId:n,orgId:l,orgSlug:x},e[0]=n,e[1]=l,e[2]=x,e[3]=k):k=e[3];const v=ne(k),P=o.type==="User"?"user":"org",f=a?`${P}:${o.login} ${a} in:name fork:true`:`${P}:${o.login} fork:true`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async g=>{const{signal:i}=g,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:b}=ve(c);if(b.length===0){let g;e[15]!==u?(g=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=g):g=e[16];let i;e[17]!==g?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[17]=g,e[18]=i):i=e[18];let j;e[19]!==a||e[20]!==u?(j=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==i||e[23]!==j?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,j]}),e[22]=i,e[23]=j,e[24]=N):N=e[24],N}let h;if(e[25]!==s||e[26]!==r||e[27]!==b||e[28]!==u){let g;e[30]!==s||e[31]!==r||e[32]!==u?(g=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(M,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),i.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Ce,{size:10}):t.jsx(ze,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=g):g=e[33],h=b.map(g),e[25]=s,e[26]=r,e[27]=b,e[28]=u,e[29]=h}else h=e[29];let y;return e[34]!==h?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:h}),e[34]=h,e[35]=y):y=e[35],y}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=$.c(51),{status:n,error:l,retry:x}=C,o=ee();if(n==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==o?(I=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==l||e[6]!==o?(R=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let O;e[13]!==o?(O=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=O):O=e[14];let p;e[15]!==x||e[16]!==O?(p=t.jsx("button",{type:"button",onClick:x,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:O}),e[15]=x,e[16]=O,e[17]=p):p=e[17];let S;return e[18]!==_||e[19]!==p?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,p]}),e[18]=_,e[19]=p,e[20]=S):S=e[20],S}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{className:"size-3 text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==a||e[29]!==o?(v=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let h;e[40]!==b?(h=ae("size-1.5 rounded-full",b),e[40]=b,e[41]=h):h=e[41];let y;e[42]!==h?(y=t.jsx("span",{className:h}),e[42]=h,e[43]=y):y=e[43];let g;e[44]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=g):g=e[44];let i;e[45]!==c||e[46]!==y?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,g]}),e[45]=c,e[46]=y,e[47]=i):i=e[47];let j;return e[48]!==i||e[49]!==f?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=j):j=e[50],j}export{M as G,dt as a,$e as b,De as u};
@@ -1,4 +1,4 @@
1
- import{eI as It,eJ as Et,cf as R,ag as c,eK as de,ck as Je,eL as Tt,ce as wt,al as Mt,ah as O,aj as G,af as oe,ae as S,an as m,ao as F,am as At,eM as I,ai as Ot,t as ge,r as W,c as Ee,W as Ct,j as Rt}from"./index-CW6L2S49.js";import{u as Nt}from"./use-mcp-client-BkpxeCP2.js";import{S as xt}from"./constants-DNuUCxmW.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";import{d as Lt,D as kt}from"./decopilot-sse-pool-Ccw1vgMp.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},t.getValidEnumValues=s=>{const n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},t.find=(s,n)=>{for(const i of s)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(a(i))):o[u]=o[u]||{_errors:[]},o=o[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));class L{constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var We="vercel.ai.error",jt=Symbol.for(We),Ce,Re,Z=class Ge extends(Re=Error,Ce=jt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return Ge.hasMarker(e,We)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var He="AI_InvalidArgumentError",qe=`vercel.ai.error.${He}`,Zt=Symbol.for(qe),Ne,xe,$t=class extends(xe=Z,Ne=Zt,xe){constructor({message:t,cause:e,argument:a}){super({name:He,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},Xe="AI_JSONParseError",Qe=`vercel.ai.error.${Xe}`,Ut=Symbol.for(Qe),Pe,De,Le=class extends(De=Z,Pe=Ut,De){constructor({text:t,cause:e}){super({name:Xe,message:`JSON parsing failed: Text: ${t}.
1
+ import{eI as It,eJ as Et,cf as R,ag as c,eK as de,ck as Je,eL as Tt,ce as wt,al as Mt,ah as O,aj as G,af as oe,ae as S,an as m,ao as F,am as At,eM as I,ai as Ot,t as ge,r as W,c as Ee,W as Ct,j as Rt}from"./index-Ds9_YQQm.js";import{u as Nt}from"./use-mcp-client-BzmGxRuq.js";import{S as xt}from"./constants-DNuUCxmW.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";import{d as Lt,D as kt}from"./decopilot-sse-pool-CZGi6xG2.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},t.getValidEnumValues=s=>{const n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},t.find=(s,n)=>{for(const i of s)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(a(i))):o[u]=o[u]||{_errors:[]},o=o[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));class L{constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var We="vercel.ai.error",jt=Symbol.for(We),Ce,Re,Z=class Ge extends(Re=Error,Ce=jt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return Ge.hasMarker(e,We)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var He="AI_InvalidArgumentError",qe=`vercel.ai.error.${He}`,Zt=Symbol.for(qe),Ne,xe,$t=class extends(xe=Z,Ne=Zt,xe){constructor({message:t,cause:e,argument:a}){super({name:He,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},Xe="AI_JSONParseError",Qe=`vercel.ai.error.${Xe}`,Ut=Symbol.for(Qe),Pe,De,Le=class extends(De=Z,Pe=Ut,De){constructor({text:t,cause:e}){super({name:Xe,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ye(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Qe)}},Ke="AI_TypeValidationError",et=`vercel.ai.error.${Ke}`,Ft=Symbol.for(et),ke,je,q=class ve extends(je=Z,ke=Ft,je){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const n=[];r.entityName&&n.push(r.entityName),r.entityId&&n.push(`id: "${r.entityId}"`),s+=n.join(", "),s+=")"}super({name:Ke,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ye(a)}`,cause:a}),this[ke]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,et)}static wrap({value:e,cause:a,context:r}){var s,n,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((n=a.context)==null?void 0:n.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const n=a.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=a[Math.random()*n|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new $t({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Bt=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Vt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Bt.test(t)===!1&&Vt.test(t)===!1?e:zt(e)}function zt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const n=r[s];n&&typeof n=="object"&&e.push(n)}}}return t}function Jt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Te(t)}var Wt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Gt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function N(){return{}}function Yt(t,e){var a,r,s;const n={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(n.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function Ht(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function qt(){return{type:"boolean"}}function tt(t,e){return b(t.type._def,e)}var Xt=(t,e)=>b(t.innerType._def,e);function at(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,n)=>at(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Qt(t)}}var Qt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Kt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function ea(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function ta(t){return{type:"string",enum:Array.from(t.values)}}var aa=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function ra(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(aa(s))r.push(...s.allOf);else{let n=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...o}=s;n=o}r.push(n)}}),r.length?{allOf:r}:void 0}function sa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function rt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?oa(t):t}var na=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function oa(t){let e="";for(let a=0;a<t.length;a++)na.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,p=!1;for(let u=0;u<s.length;u++){if(i){n+=s[u],i=!1;continue}if(r.i){if(o){if(s[u].match(/[a-z]/)){p?(n+=s[u],n+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(n+=s[u],p=!0):n+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){n+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){n+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){n+=`($|(?=[\r