decocms 3.97.2 → 3.97.3

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 (213) hide show
  1. package/dist/client/assets/{AlertCircle-Btg3Kl1X.js → AlertCircle-CiYXjBCp.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BVel7TVT.js → ArrowUpRight-D62C8hBG.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-CLxX0sp0.js → CheckCircle-B0cHPrPi.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-jaVETr_P.js → ChevronDown-Ep-T2bbc.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-Cz8IZPHh.js → ChevronLeft-Cn3JRl7K.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BIxpFMHu.js → ChevronRight-BB8PtdU_.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CWfuGOeB.js → ChevronUp-BCrNzv-A.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CD2_SPET.js → DotsVertical-21OsfYko.js} +1 -1
  9. package/dist/client/assets/{Eye-DEx5XrP2.js → Eye-vPozEeRC.js} +1 -1
  10. package/dist/client/assets/{FilterLines-DhgVTgBD.js → FilterLines-BcHnc4HO.js} +1 -1
  11. package/dist/client/assets/{Globe01-D585s3-L.js → Globe01-eAXhqoKJ.js} +1 -1
  12. package/dist/client/assets/{Globe04-DUM4y8yY.js → Globe04-8G7DaJlX.js} +1 -1
  13. package/dist/client/assets/{HardDrive-jkJ-SO2a.js → HardDrive-BJ-lnZmp.js} +1 -1
  14. package/dist/client/assets/{Key01-BUffBtXO.js → Key01-qC4LCntt.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DGLWhARC.js → LayoutLeft-DiBhmi5f.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-DlKfvrtk.js → LinkExternal01-k2q6wU7l.js} +1 -1
  17. package/dist/client/assets/{Monitor01-DpTbdt9c.js → Monitor01-DvPP6kPt.js} +1 -1
  18. package/dist/client/assets/{Palette-JUrymlge.js → Palette-BaoaCY0h.js} +1 -1
  19. package/dist/client/assets/{Play-AhJc89r7.js → Play-CMo8plFz.js} +1 -1
  20. package/dist/client/assets/{Plus-BMZPk-z1.js → Plus-CexM6aI0.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BqzQBy2h.js → SearchMd-BT6OYA0s.js} +1 -1
  22. package/dist/client/assets/{Settings02-BFwzM13E.js → Settings02-CtG2aS1_.js} +1 -1
  23. package/dist/client/assets/{Shield01-Cy2UxQ_z.js → Shield01-Dwjpxvd-.js} +1 -1
  24. package/dist/client/assets/{Star01-Dq61L69S.js → Star01-Ccb8Hi5b.js} +1 -1
  25. package/dist/client/assets/{Stars01-DNL1g9Iv.js → Stars01-Dsl5vjAD.js} +1 -1
  26. package/dist/client/assets/{Stars02-CzZ5fHXf.js → Stars02-kHQQc3aX.js} +1 -1
  27. package/dist/client/assets/{Sun-BPu5UC0A.js → Sun-BjBDYy_F.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-C20gqSxc.js → SwitchHorizontal01-YTEahx81.js} +1 -1
  29. package/dist/client/assets/{Tool01-DQFc9MhY.js → Tool01-DaG15Hqa.js} +1 -1
  30. package/dist/client/assets/{Trash01-BonmNT1r.js → Trash01-B5-ciNMB.js} +1 -1
  31. package/dist/client/assets/{Upload01-CCkVYg7o.js → Upload01-DWdtOJ5u.js} +1 -1
  32. package/dist/client/assets/{User01-Dzxgobw-.js → User01-4kOfLZMN.js} +1 -1
  33. package/dist/client/assets/{Users01-B4E_Pu1F.js → Users01-dV9sT0dy.js} +1 -1
  34. package/dist/client/assets/{Users03-U1LVx73K.js → Users03-D9C5BM7D.js} +1 -1
  35. package/dist/client/assets/{X-BnhQ9YZ6.js → X-BKm6Fw1t.js} +1 -1
  36. package/dist/client/assets/{XCircle-BeS_rdZa.js → XCircle-CAZvEkjb.js} +1 -1
  37. package/dist/client/assets/{XClose-DDDs6Mbr.js → XClose-ssDuFEQg.js} +1 -1
  38. package/dist/client/assets/{Zap-BqREagVI.js → Zap-C-erO5Sh.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-aFDn3I17.js → ZapSquare-DbVR4h30.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-CmgeNViZ.js → ZoomOut-BNzpzje_.js} +1 -1
  41. package/dist/client/assets/{access-gate-Bvgfz-li.js → access-gate-BkA2GKhf.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-CXIUotXj.js → add-section-modal-DxQ_2Wd2.js} +1 -1
  43. package/dist/client/assets/{agent-icon-DxayptCQ.js → agent-icon-DC15QH5N.js} +1 -1
  44. package/dist/client/assets/{agents-list-1oZReADZ.js → agents-list-DcKbuDjZ.js} +1 -1
  45. package/dist/client/assets/{ai-providers-Cw2C4Eal.js → ai-providers-Je5PimJe.js} +1 -1
  46. package/dist/client/assets/{alert-CMhk6btp.js → alert-Dl9mLaEt.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-tMxAwGBu.js → alert-dialog-DgcsfpwV.js} +1 -1
  48. package/dist/client/assets/{app-editor-BHqiYDYO.js → app-editor-9i48Z1mN.js} +1 -1
  49. package/dist/client/assets/{auth-catchall-B4MZ625t.js → auth-catchall-C-nIq0-D.js} +1 -1
  50. package/dist/client/assets/{auth-entry-lCRxMtrR.js → auth-entry-BRIrNXJW.js} +1 -1
  51. package/dist/client/assets/{auth-CvftsTU7.js → auth-fUaquGnI.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-UPGIe-CZ.js → auth-split-layout-MeF5ymWQ.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-D2VXP3oz.js → authenticate-and-persist-oauth-DJxmh0FS.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-BgycuzMn.js → automation-list-row-BE7UAA7m.js} +1 -1
  55. package/dist/client/assets/{automation-runs-B1K-1oMZ.js → automation-runs-KROcbEKJ.js} +1 -1
  56. package/dist/client/assets/{automations-BSUPl6X8.js → automations-M_nP8Dw1.js} +1 -1
  57. package/dist/client/assets/{avatar-DyemZXDO.js → avatar-VLg8_8qy.js} +1 -1
  58. package/dist/client/assets/{badge-DYzttO0q.js → badge-CXqt8LsO.js} +1 -1
  59. package/dist/client/assets/{block-document-D6HcJpaK.js → block-document-gRQauTZI.js} +1 -1
  60. package/dist/client/assets/{brand-context-C4H6mJBs.js → brand-context-BBxDnkt1.js} +1 -1
  61. package/dist/client/assets/{buckets-C0yxaZeM.js → buckets-BMjr1jEe.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-gDA_XWS8.js → capability-load-error-BssWdjEJ.js} +1 -1
  63. package/dist/client/assets/{card-Bxht1Pz7.js → card-c1tDYTHP.js} +1 -1
  64. package/dist/client/assets/{category-editor-BXnx8Oys.js → category-editor-DsdVSDFi.js} +1 -1
  65. package/dist/client/assets/{chat-context-CMdxOOBP.js → chat-context-DAyh5sec.js} +1 -1
  66. package/dist/client/assets/{checkbox-zBVxVTpV.js → checkbox-BZ4Cev3m.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-U2SAqU9R.js → cli-auth-success-DIR-u7k3.js} +1 -1
  68. package/dist/client/assets/{collection-detail-BnmMg4O2.js → collection-detail-xnmDLTC2.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-DGiHGZ5q.js → collection-display-button-5E1VxEVW.js} +1 -1
  70. package/dist/client/assets/{collection-search-CAQmDEAU.js → collection-search-BHxcuieJ.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-Cupf9UDQ.js → collection-tabs-BMqIu2hn.js} +1 -1
  72. package/dist/client/assets/{command-DvtOmBox.js → command-hmVb9nzj.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-4uPq9OUy.js → commerce-onboarding-BPECsSVR.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-C2pM6ITw.js → connect-desktop-dialog-M8mQpyYi.js} +1 -1
  75. package/dist/client/assets/{connection-card-W2XZUNP_.js → connection-card-DwO2q63k.js} +1 -1
  76. package/dist/client/assets/{connection-detail-D_40d5w9.js → connection-detail-DlzvyCLX.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-Bhix3Tpy.js → connection-form-helpers-_UdmyYSC.js} +1 -1
  78. package/dist/client/assets/{connections-Cc6ES9cM.js → connections-BzsSZkKz.js} +1 -1
  79. package/dist/client/assets/{context-menu-DE4OvYZ2.js → context-menu-ClXPOkdV.js} +1 -1
  80. package/dist/client/assets/{decopilot-BT37ltFz.js → decopilot-BZ76gfhX.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-DUnY4wlT.js → decopilot-sse-pool-DF7I7n1i.js} +1 -1
  82. package/dist/client/assets/{dialog-BD0YSELz.js → dialog-CaTEiJVO.js} +1 -1
  83. package/dist/client/assets/{domain-settings-AXt4tIbV.js → domain-settings-Dy-h970m.js} +1 -1
  84. package/dist/client/assets/{drawer-B6EjelmV.js → drawer-BAJPoLOE.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-BYxo50Eo.js → dropdown-menu-oCs7Iiv2.js} +1 -1
  86. package/dist/client/assets/{empty-state-wn-fH-_c.js → empty-state-wZACnL2J.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-B-bQ6qcJ.js → extract-connection-data-Bmmw_I_H.js} +1 -1
  88. package/dist/client/assets/{file-explorer-BI2KGl5m.js → file-explorer-DYFMt1oY.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-BkqVFUn0.js → file-type-icon-DHG3dnn1.js} +1 -1
  90. package/dist/client/assets/{files-HzDszk5R.js → files-BjRJXW0l.js} +1 -1
  91. package/dist/client/assets/{form-ky5gQWvG.js → form-BWIorvmY.js} +1 -1
  92. package/dist/client/assets/{general-DoAalAMH.js → general-CFBr5HF3.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-CUmOt3I_.js → github-repo-picker-Bqmm5RYY.js} +1 -1
  94. package/dist/client/assets/{hooks-gVmahO9e.js → hooks-DGQm848Q.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-BxwPxHo-.js → import-from-deco-dialog-z9TrSbfs.js} +1 -1
  96. package/dist/client/assets/{index-CqtNqT9C.js → index-17QLTZMM.js} +5 -5
  97. package/dist/client/assets/{index-D26xsVrw.js → index-6BQORbvL.js} +1 -1
  98. package/dist/client/assets/{index-FyMv705f.js → index-AltTReR4.js} +1 -1
  99. package/dist/client/assets/{index-D74Vpeva.js → index-B83rPo9I.js} +1 -1
  100. package/dist/client/assets/{index-DSwt5xfh.js → index-C4Z0gT1h.js} +1 -1
  101. package/dist/client/assets/{index-D4uKwn5c.js → index-CVhJkkBU.js} +1 -1
  102. package/dist/client/assets/{index-DPWuddBR.js → index-CqwvSop6.js} +1 -1
  103. package/dist/client/assets/{index--T8_B07u.js → index-DFanLV1X.js} +1 -1
  104. package/dist/client/assets/{index-Doax1Rh9.js → index-DHFxvk5e.js} +1 -1
  105. package/dist/client/assets/{index-D3EIYiGy.js → index-DIk1O_Dr.js} +1 -1
  106. package/dist/client/assets/{index-BhM87K40.js → index-DLQ4JwZN.js} +3 -3
  107. package/dist/client/assets/{index-BoZzI320.js → index-DY2Xseue.js} +1 -1
  108. package/dist/client/assets/{index-DBw9KlV8.css → index-NVhaWgyE.css} +1 -1
  109. package/dist/client/assets/{index-Dr49UYrF.js → index-ZWBhZDHA.js} +1 -1
  110. package/dist/client/assets/{index-DtX2gqsN.js → index-qjVbGUv9.js} +2 -2
  111. package/dist/client/assets/{index-redirect-BVyRPD0g.js → index-redirect-2HTXFJkp.js} +1 -1
  112. package/dist/client/assets/{input-B3fwGRLy.js → input-BFLS6IB9.js} +1 -1
  113. package/dist/client/assets/{integration-icon-CXYCj2JQ.js → integration-icon-DD9LcA1t.js} +1 -1
  114. package/dist/client/assets/{label-DHjkgYPE.js → label-TS_o46fE.js} +1 -1
  115. package/dist/client/assets/{login-BoIbxWMS.js → login-jqUZykUn.js} +1 -1
  116. package/dist/client/assets/{mcp-oauth-Beq2gudf.js → mcp-oauth-DyPHEZc0.js} +1 -1
  117. package/dist/client/assets/{members-CIjIXofA.js → members-Oku2ILxU.js} +1 -1
  118. package/dist/client/assets/{monaco-editor-BvU2YE9H.js → monaco-editor-D0BeTcV-.js} +1 -1
  119. package/dist/client/assets/{monitoring-stats-row-E8lTg99w.js → monitoring-stats-row-BkORDVIl.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-CfBT8W75.js → oauth-callback-BgIbnfWn.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-B3z-XKj1.js → oauth-callback-ai-provider-DnNDJyNh.js} +1 -1
  122. package/dist/client/assets/{onboarding--n3sjPEB.js → onboarding-Df5Y7dbu.js} +1 -1
  123. package/dist/client/assets/{org-install-CI5M4OGn.js → org-install-C9pyMts_.js} +1 -1
  124. package/dist/client/assets/{org-layout-Sm0IgEMA.js → org-layout-Bl_9Td80.js} +1 -1
  125. package/dist/client/assets/{organization-choice-B_EiPCVl.js → organization-choice-vRlqbiOV.js} +1 -1
  126. package/dist/client/assets/{page-seo-form-BGjB96yL.js → page-seo-form-BlSVNC9f.js} +1 -1
  127. package/dist/client/assets/page-seo-sheet-B4lXhQN9.js +1 -0
  128. package/dist/client/assets/{popover-CNCsQG7k.js → popover-BSP7ejLc.js} +1 -1
  129. package/dist/client/assets/{post-editor-CXg532VA.js → post-editor-CXXGCGJD.js} +1 -1
  130. package/dist/client/assets/{preview-dialog-QmVWBELF.js → preview-dialog-CSsWWs5M.js} +1 -1
  131. package/dist/client/assets/{primitives-CEo62JLM.js → primitives-DhSbPHiR.js} +1 -1
  132. package/dist/client/assets/{profile-DIi3q8gD.js → profile-BZTAS1CN.js} +1 -1
  133. package/dist/client/assets/project-app-view-zNAcdk0L.js +1 -0
  134. package/dist/client/assets/record-editor-CTIyv7ob.js +1 -0
  135. package/dist/client/assets/registry-eX771F2z.js +2 -0
  136. package/dist/client/assets/{registry-layout-DVD8yn1p.js → registry-layout-BRvslRVV.js} +1 -1
  137. package/dist/client/assets/{require-capability-CMniQrvy.js → require-capability-CikSO1sK.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-DexhwMQR.js → required-auth-layout-1Q0s2bde.js} +1 -1
  139. package/dist/client/assets/{reset-password-C9Pvgm51.js → reset-password-e6G_i6Vq.js} +1 -1
  140. package/dist/client/assets/{roles-BmLxsJ3R.js → roles-BKbJv76K.js} +1 -1
  141. package/dist/client/assets/{save-status-Cw-Sb1au.js → save-status-DJMZw4Ff.js} +1 -1
  142. package/dist/client/assets/{scroll-area-O6cg2-ar.js → scroll-area-bUXD_r58.js} +1 -1
  143. package/dist/client/assets/{search-input-B_2r2KRh.js → search-input-Cw_P0J35.js} +1 -1
  144. package/dist/client/assets/{secrets-C1Qy2bcs.js → secrets-DH2hlPoO.js} +1 -1
  145. package/dist/client/assets/{sections-editor-CJ6rxxdG.js → sections-editor-D2ALK4En.js} +1 -1
  146. package/dist/client/assets/{select-DCp4xmLi.js → select-C0lOOEoK.js} +1 -1
  147. package/dist/client/assets/{select-model-AWOkH62O.js → select-model-vYCpp3x3.js} +1 -1
  148. package/dist/client/assets/{seo-editor-L3Q6UeNL.js → seo-editor-CkygDS8T.js} +1 -1
  149. package/dist/client/assets/{settings-layout-2JS2qlHo.js → settings-layout-BXYPwJV4.js} +1 -1
  150. package/dist/client/assets/{settings-section-k4LsHL-b.js → settings-section-Bk_k5SKB.js} +1 -1
  151. package/dist/client/assets/{sheet-CSveQQ63.js → sheet-DAwn9AHA.js} +1 -1
  152. package/dist/client/assets/{shell-controls-CP-l57Bp.js → shell-controls-HZ3369Yf.js} +1 -1
  153. package/dist/client/assets/{shell-layout-DyGMe2eH.js → shell-layout-DOpUjfn5.js} +1 -1
  154. package/dist/client/assets/{shell-route-loading-DFl9EK_F.js → shell-route-loading-xptU08tM.js} +1 -1
  155. package/dist/client/assets/{sidebar-B99ZGhiW.js → sidebar-g2qAal9U.js} +1 -1
  156. package/dist/client/assets/{skeleton-BHmlVMNC.js → skeleton-D4R3a4o-.js} +1 -1
  157. package/dist/client/assets/{sortable.esm-CfA1vsLE.js → sortable.esm-BnJIYE_Z.js} +1 -1
  158. package/dist/client/assets/{sso-LmNfLC54.js → sso-qEodk6g6.js} +1 -1
  159. package/dist/client/assets/{store-DSs1tM4O.js → store-C4B_G2oW.js} +1 -1
  160. package/dist/client/assets/store-registry-BYI63lgN.js +2 -0
  161. package/dist/client/assets/{studio-tools-flBlg18v.js → studio-tools-COOhA4uQ.js} +1 -1
  162. package/dist/client/assets/{switch-8d47o93z.js → switch-B56_YQh-.js} +1 -1
  163. package/dist/client/assets/{table-2irqwFYt.js → table-C_RjqUn4.js} +1 -1
  164. package/dist/client/assets/{tabs-K5RGTpnB.js → tabs-DWit868K.js} +1 -1
  165. package/dist/client/assets/{task-status-D-XaFnT6.js → task-status-ANvwNzqA.js} +1 -1
  166. package/dist/client/assets/{textarea-DM4qEV5B.js → textarea-DUeOU9F3.js} +1 -1
  167. package/dist/client/assets/{toggle-group-DUSqhvB3.js → toggle-group-BJd6ihxO.js} +1 -1
  168. package/dist/client/assets/{toolbar-DCIj0wR_.js → toolbar-CqV98Xz1.js} +1 -1
  169. package/dist/client/assets/{tooltip-BUxV_D6P.js → tooltip-BBVKuVWA.js} +1 -1
  170. package/dist/client/assets/{types-XTMRscgC.js → types-CFybozjb.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-Co4lS64D.js → use-ai-providers-BI7Dx3UD.js} +1 -1
  172. package/dist/client/assets/{use-automations-CEf62emA.js → use-automations-BlPG5Nag.js} +1 -1
  173. package/dist/client/assets/{use-capability-CGQ_ecnh.js → use-capability-GDRaaPxs.js} +1 -1
  174. package/dist/client/assets/{use-clock-tick-CKmhsKgV.js → use-clock-tick-10nS2wAD.js} +1 -1
  175. package/dist/client/assets/{use-collections-BM_62WFY.js → use-collections-olSa4--l.js} +1 -1
  176. package/dist/client/assets/{use-connection-Dnm0WcaI.js → use-connection-n2su9fBK.js} +1 -1
  177. package/dist/client/assets/{use-copy-DzCk3D8f.js → use-copy-CV2s0Bln.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-DM_PHl57.js → use-create-virtual-mcp-G5bEKswL.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-gosv4n02.js → use-debounced-autosave-3i25sE_n.js} +1 -1
  180. package/dist/client/assets/{use-delete-connection-BlKKBule.js → use-delete-connection-C1BvcpjL.js} +1 -1
  181. package/dist/client/assets/{use-file-configs-Coh70RCY.js → use-file-configs-fW8ExhxC.js} +1 -1
  182. package/dist/client/assets/{use-infinite-scroll-jqZM0sS1.js → use-infinite-scroll-DEtplhmh.js} +1 -1
  183. package/dist/client/assets/{use-join-requests-Lex6BTHJ.js → use-join-requests-CPgAASRp.js} +1 -1
  184. package/dist/client/assets/{use-mcp-client-YTTTCF1I.js → use-mcp-client-CNXUneAa.js} +1 -1
  185. package/dist/client/assets/{use-mcp-prompts-CATyOAeB.js → use-mcp-prompts-Dp1bbbjz.js} +1 -1
  186. package/dist/client/assets/{use-mcp-tools-eK4rSwtV.js → use-mcp-tools-Dp1oFDkR.js} +1 -1
  187. package/dist/client/assets/{use-members-lrTKUCiI.js → use-members-CbHGf6Jg.js} +1 -1
  188. package/dist/client/assets/{use-mobile-C07VmsnQ.js → use-mobile-D49EcQdA.js} +1 -1
  189. package/dist/client/assets/{use-navigate-to-agent-eeJmD1SD.js → use-navigate-to-agent-m-7qnjdO.js} +1 -1
  190. package/dist/client/assets/{use-org-auth-client-D2ysoG3X.js → use-org-auth-client-FC6WdH_x.js} +1 -1
  191. package/dist/client/assets/{use-org-sso-ha4y3BbE.js → use-org-sso-BFPLcR8G.js} +1 -1
  192. package/dist/client/assets/{use-organization-roles-DthsGMZM.js → use-organization-roles-CEdyJBDf.js} +1 -1
  193. package/dist/client/assets/{use-organization-settings-BtJCQVIt.js → use-organization-settings-I56W3q4b.js} +1 -1
  194. package/dist/client/assets/{use-registry-connections-Dc_2D03B.js → use-registry-connections-DeVqfCCu.js} +1 -1
  195. package/dist/client/assets/{use-secrets-DP6R3o57.js → use-secrets-DfdiWPHB.js} +1 -1
  196. package/dist/client/assets/{use-status-sounds-DEDoa54q.js → use-status-sounds-DBMDawLF.js} +1 -1
  197. package/dist/client/assets/{use-view-mode-kYf2GeMl.js → use-view-mode-CVarJF55.js} +1 -1
  198. package/dist/client/assets/{use-virtual-mcp-C59EnYRY.js → use-virtual-mcp-37EwEzlF.js} +1 -1
  199. package/dist/client/assets/useInfiniteQuery-Do3-OeIV.js +1 -0
  200. package/dist/client/assets/useSuspenseInfiniteQuery-7BcKLQOb.js +1 -0
  201. package/dist/client/assets/{useSuspenseQueries-bKn-P81g.js → useSuspenseQueries-DlzLq1Lb.js} +1 -1
  202. package/dist/client/assets/{variant-calendar-DvWXsa9o.js → variant-calendar-D1ngj2k8.js} +1 -1
  203. package/dist/client/assets/{view-mode-toggle-C8nDVI0J.js → view-mode-toggle-CoFBmpiz.js} +1 -1
  204. package/dist/client/index.html +2 -2
  205. package/dist/server/cli.js +1 -1
  206. package/package.json +1 -1
  207. package/dist/client/assets/page-seo-sheet-_TrM5CwR.js +0 -1
  208. package/dist/client/assets/project-app-view-da1C74xQ.js +0 -1
  209. package/dist/client/assets/record-editor-BqGJRt4z.js +0 -1
  210. package/dist/client/assets/registry-UP7cRNp1.js +0 -2
  211. package/dist/client/assets/store-registry-Bso_3IAj.js +0 -2
  212. package/dist/client/assets/useInfiniteQuery-BqHcBSf6.js +0 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-WmZU5ca0.js +0 -1
@@ -1 +1 @@
1
- import{r as h}from"./index-BhM87K40.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
1
+ import{r as h}from"./index-DLQ4JwZN.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
@@ -1,4 +1,4 @@
1
- import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,b as et,u as tt,E as Te,ae as Tt}from"./index-BhM87K40.js";import{i as zt}from"./ChevronRight-BIxpFMHu.js";import{s as st}from"./Eye-DEx5XrP2.js";import{n as Pt,i as nt}from"./Globe01-D585s3-L.js";import{b as lt,e as Ft,f as Ot,a as Et}from"./ZoomOut-CmgeNViZ.js";import{a as pe}from"./Palette-JUrymlge.js";import{s as At}from"./Plus-BMZPk-z1.js";import{t as Mt}from"./Stars01-DNL1g9Iv.js";import{i as xe}from"./Upload01-CCkVYg7o.js";import{i as Oe}from"./Zap-BqREagVI.js";import{u as it}from"./use-mobile-C07VmsnQ.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-tMxAwGBu.js";import{b as Ee,a as Ae,d as Me,f as rt,c as Ht,e as Vt,D as Gt}from"./dialog-BD0YSELz.js";import{I as Ue}from"./input-B3fwGRLy.js";import{S as K}from"./skeleton-BHmlVMNC.js";import{F as ie,d as at,M as ot}from"./file-type-icon-BkqVFUn0.js";import{a as Qt}from"./toolbar-DCIj0wR_.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-QmVWBELF.js";import{a as ve}from"./DotsVertical-CD2_SPET.js";import{i as is}from"./Key01-BUffBtXO.js";import{s as je}from"./Trash01-BonmNT1r.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-BYxo50Eo.js";import{T as rs}from"./textarea-DM4qEV5B.js";import{t as as}from"./ChevronDown-jaVETr_P.js";import{n as os}from"./ChevronUp-CWfuGOeB.js";import{i as ge}from"./X-BnhQ9YZ6.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-Cz8IZPHh.js";import"./tooltip-BUxV_D6P.js";import"./LinkExternal01-DlKfvrtk.js";import"./XClose-DDDs6Mbr.js";import"./index-D26xsVrw.js";import"./LayoutLeft-DGLWhARC.js";import"./popover-CNCsQG7k.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.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:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
1
+ import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,b as et,u as tt,E as Te,ae as Tt}from"./index-DLQ4JwZN.js";import{i as zt}from"./ChevronRight-BB8PtdU_.js";import{s as st}from"./Eye-vPozEeRC.js";import{n as Pt,i as nt}from"./Globe01-eAXhqoKJ.js";import{b as lt,e as Ft,f as Ot,a as Et}from"./ZoomOut-BNzpzje_.js";import{a as pe}from"./Palette-BaoaCY0h.js";import{s as At}from"./Plus-CexM6aI0.js";import{t as Mt}from"./Stars01-Dsl5vjAD.js";import{i as xe}from"./Upload01-DWdtOJ5u.js";import{i as Oe}from"./Zap-C-erO5Sh.js";import{u as it}from"./use-mobile-D49EcQdA.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-DgcsfpwV.js";import{b as Ee,a as Ae,d as Me,f as rt,c as Ht,e as Vt,D as Gt}from"./dialog-CaTEiJVO.js";import{I as Ue}from"./input-BFLS6IB9.js";import{S as K}from"./skeleton-D4R3a4o-.js";import{F as ie,d as at,M as ot}from"./file-type-icon-DHG3dnn1.js";import{a as Qt}from"./toolbar-CqV98Xz1.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-CSsWWs5M.js";import{a as ve}from"./DotsVertical-21OsfYko.js";import{i as is}from"./Key01-qC4LCntt.js";import{s as je}from"./Trash01-B5-ciNMB.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-oCs7Iiv2.js";import{T as rs}from"./textarea-DUeOU9F3.js";import{t as as}from"./ChevronDown-Ep-T2bbc.js";import{n as os}from"./ChevronUp-BCrNzv-A.js";import{i as ge}from"./X-BKm6Fw1t.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-Cn3JRl7K.js";import"./tooltip-BBVKuVWA.js";import"./LinkExternal01-k2q6wU7l.js";import"./XClose-ssDuFEQg.js";import"./index-6BQORbvL.js";import"./LayoutLeft-DiBhmi5f.js";import"./popover-BSP7ejLc.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.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:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
2
2
  ${e}: ${n};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
3
3
  `)?`
4
4
  `:"";return`${s}${r}:root {
@@ -166,4 +166,4 @@ import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,
166
166
  <p class="cta">slides-create --theme &hellip;</p>
167
167
  </section>`].join(`
168
168
 
169
- `);async function We(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function rn(s,e){const n=e?`<style>${e}</style>`:"";return s.replaceAll("{{{slides}}}",ln).replaceAll("{{title}}",nn).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${n}</head>`)}function an(s){const e=S.c(23),{readUrl:n,title:i,tokensUrl:l}=s;let r;e[0]!==n?(r=B.fileText(n),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==n?(a=()=>We(n),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==a?(c={queryKey:r,queryFn:a,staleTime:6e4,retry:!1},e[4]=r,e[5]=a,e[6]=c):c=e[6];const o=Y(c);let d;e[7]!==l?(d=B.fileText(l??""),e[7]=l,e[8]=d):d=e[8];const u=!!l;let f;e[9]!==l?(f=()=>We(l??""),e[9]=l,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==u||e[13]!==f?(m={queryKey:d,enabled:u,queryFn:f,staleTime:6e4,retry:!1},e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14];const h=Y(m);if(o.isPending||l&&h.isPending){let y;return e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(K,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[15]=y):y=e[15],y}if(o.isError||!o.data){let y;return e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[16]=y):y=e[16],y}const x=h.data??null;let v;e[17]!==x||e[18]!==o.data?(v=rn(o.data,x),e[17]=x,e[18]=o.data,e[19]=v):v=e[19];let j;return e[20]!==v||e[21]!==i?(j=t.jsx("iframe",{title:i,srcDoc:v,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=v,e[21]=i,e[22]=j):j=e[22],j}async function Ye(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function ae(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function on(s){const e=S.c(16),{family:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;let c;e[0]!==n?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>{const h=r(m),x=`${m.name.replace(/^--brand-/,"")}: ${h}`;return l&&/^#/.test(h)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:js(h),onChange:v=>a(m.name,v.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:h}},m.name)},e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function cn(s){const e=S.c(9),{token:n,value:i}=s;if(n.kind==="space"){let r;return e[0]!==i?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:i,maxWidth:"100%"}})}),e[0]=i,e[1]=r):r=e[1],r}if(n.kind==="radius"){let r;return e[2]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:i}}),e[2]=i,e[3]=r):r=e[3],r}if(n.kind==="shadow"){let r;return e[4]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:i}}),e[4]=i,e[5]=r):r=e[5],r}if(n.kind==="type"&&/^--brand-text-/.test(n.name)){const r=`min(${i}, 22px)`;let a;return e[6]!==r?(a=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=a):a=e[7],a}let l;return e[8]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=l):l=e[8],l}function ht(s){const e=S.c(17),{token:n,value:i,editing:l,onEdit:r}=s;let a;e[0]!==n||e[1]!==i?(a=t.jsx(cn,{token:n,value:i}),e[0]=n,e[1]=i,e[2]=a):a=e[2];let c;if(e[3]!==n.name){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/^--brand-/,e[5]=f):f=e[5],c=n.name.replace(f,""),e[3]=n.name,e[4]=c}else c=e[4];let o;e[6]!==c?(o=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==n.name||e[11]!==i?(d=l?t.jsx(Ue,{value:i,onChange:f=>r(n.name,f.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:i}),e[8]=l,e[9]=r,e[10]=n.name,e[11]=i,e[12]=d):d=e[12];let u;return e[13]!==a||e[14]!==o||e[15]!==d?(u=t.jsxs("div",{className:"flex items-center gap-3",children:[a,o,d]}),e[13]=a,e[14]=o,e[15]=d,e[16]=u):u=e[16],u}function re(s){const e=S.c(16),{label:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;if(i.length===0)return null;let c;e[0]!==n?(c=t.jsx(ae,{children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>t.jsx(ht,{token:m,value:r(m),editing:l,onEdit:a},m.name),e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-3",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function pt({brandPath:s,onClose:e,variant:n}){const{org:i}=Fe(),l=Be(s),r=l.volume??"",a=l.dirPath,c=A(a),o=l.readOnly,d=Je(),u=be(),f=Wt(r),{upload:m,remove:h}=Pe(r),x=U.useRef(null),v=Le(r,a),j=v.data??[],y=b=>j.some(M=>M.kind==="file"&&A(M.path)===b),k=y("tokens.css"),N=y("brand.md"),g=y("slides-theme.html"),C=Ns(j),D=u(r,`${a}/tokens.css`),P=u(r,`${a}/brand.md`),$=u(r,`${a}/slides-theme.html`),F=Y({queryKey:B.fileText(D),enabled:k,queryFn:()=>Ye(D),staleTime:6e4,retry:!1}),z=Y({queryKey:B.fileText(P),enabled:N,queryFn:()=>Ye(P),staleTime:6e4,retry:!1}),[p,T]=U.useState(!1),[E,L]=U.useState({}),[q,R]=U.useState(null),[Q,O]=U.useState(!1),[G,se]=U.useState(!1),[Se,ue]=U.useState("deck"),H=F.data?dt(F.data):[],$e=b=>H.find(M=>M.name===b)?.value,V=b=>E[b.name]??b.value,w=ws(H),I=H.filter(b=>b.kind==="font"),ne=H.filter(b=>b.kind==="type"),vt=H.filter(b=>b.kind==="space"),jt=H.filter(b=>b.kind==="radius"),yt=H.filter(b=>b.kind==="shadow"),wt=H.filter(b=>b.kind==="motion"),kt=H.filter(b=>b.kind==="other"),Z=(b,M)=>L(he=>({...he,[b]:M})),me=g&&Se==="deck",Ce=q??z.data??"",De=Object.entries(E).filter(([b,M])=>$e(b)!==M),Ie=q!==null&&q!==(z.data??""),Nt=De.length>0||Ie;function St(){L({}),R(null),T(!1)}async function $t(){O(!0);try{if(De.length>0){let b=F.data??"";for(const[M,he]of De)b=ks(b,M,he);await f.mutateAsync({path:`${a}/tokens.css`,body:b,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(D)})}Ie&&q!==null&&(await f.mutateAsync({path:`${a}/brand.md`,body:q,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(P)})),d.invalidateQueries({queryKey:B.orgFsVolume(i.id,r)}),d.invalidateQueries({queryKey:B.orgFsRecent(i.id)}),L({}),R(null),T(!1),W.success("Brand saved")}catch(b){W.error(b instanceof Error?b.message:"Failed to save brand")}finally{O(!1)}}async function Ct(b){const M=b?.[0];if(!M)return;const Ke=`logo.${(M.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:a,files:[new File([M],Ke,{type:M.type})]}),C&&A(C)!==Ke&&await h.mutateAsync(C),W.success("Logo updated")}catch(He){W.error(He instanceof Error?He.message:"Logo upload failed")}finally{x.current&&(x.current.value="")}}const Dt=!v.isPending&&!k&&!N&&!C;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(pe,{size:18})}),n==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!o&&(p?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"ghost",size:"sm",onClick:St,disabled:Q,children:"Cancel"}),t.jsx(_,{size:"sm",disabled:!Nt||Q,onClick:()=>{$t()},children:Q?"Saving…":"Save"})]}):t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[t.jsx(Ot,{size:14}),"Edit"]})),n==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(ge,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:v.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(K,{className:"h-40 w-full rounded-xl"}),t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-4 w-2/3"})]}):Dt?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):t.jsxs(t.Fragment,{children:[(g||k)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":G?"Show preview":"Hide preview",onClick:()=>se(b=>!b),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),se(M=>!M))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:b=>b.stopPropagation(),children:[g&&t.jsx("button",{type:"button",onClick:()=>{ue("deck"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),t.jsx("button",{type:"button",onClick:()=>{ue("components"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),G?t.jsx(as,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(os,{size:16,className:"shrink-0 text-muted-foreground"})]}),!G&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:ee("w-full overflow-hidden rounded-xl border border-border bg-muted/30",me?"aspect-[16/9]":"h-96"),children:me?t.jsx(an,{readUrl:$,title:`${c} deck theme`,tokensUrl:D}):t.jsx(sn,{tokensUrl:D})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Logo"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:C?t.jsx("img",{src:u(r,C),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(pe,{size:28,className:"text-muted-foreground/50"})}),p&&t.jsxs("div",{children:[t.jsxs(_,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(xe,{size:14}),C?"Replace logo":"Add logo"]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:b=>{Ct(b.target.files)}})]})]})]}),w.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Colors"}),w.map(b=>t.jsx(on,{family:b.family,tokens:b.tokens,editing:p,valueOf:V,onEdit:Z},b.family))]}),(I.length>0||ne.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Typography"}),I.map(b=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:b.name.replace(/^--brand-font-?/,"")||"font"}),p?t.jsx(Ue,{value:V(b),onChange:M=>Z(b.name,M.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:V(b)},children:V(b)})]},b.name)),ne.map(b=>t.jsx(ht,{token:b,value:V(b),editing:p,onEdit:Z},b.name))]}),t.jsx(re,{label:"Spacing",tokens:vt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Radius",tokens:jt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Shadows",tokens:yt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Motion",tokens:wt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Tokens",tokens:kt,editing:p,valueOf:V,onEdit:Z}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Voice & guidelines"}),p?t.jsx(rs,{value:Ce,onChange:b=>R(b.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):z.isPending&&N?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"})]}):Ce.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(ot,{id:`brand-preview-${s}`,text:Ce})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function dn(s){const e=S.c(8),{brandPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==i?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"dialog"})}),e[2]=n,e[3]=i,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function fn(s){const e=S.c(3),{brandPath:n,onClose:i}=s;let l;return e[0]!==n||e[1]!==i?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"panel"})}),e[0]=n,e[1]=i,e[2]=l):l=e[2],l}function xt(s){const e=S.c(23),{skillPath:n,onClose:i,variant:l}=s,r=Be(n),{volume:a,dirPath:c}=r,o=be(),d=o(a??"",`${c}/SKILL.md`),u=B.fileText(d);let f;e[0]!==d?(f=async()=>{const O=await fetch(d,{credentials:"include"});if(!O.ok)throw new Error(`fetch failed: ${O.status}`);return O.text()},e[0]=d,e[1]=f):f=e[1];let m;e[2]!==u||e[3]!==f?(m={queryKey:u,queryFn:f,staleTime:6e4,retry:!1},e[2]=u,e[3]=f,e[4]=m):m=e[4];const h=Y(m),x=Le(a??"",c);let v;e[5]!==c?(v=A(c),e[5]=c,e[6]=v):v=e[6];const j=v;let y;e[7]!==h.data?(y=h.data?ft(h.data):null,e[7]=h.data,e[8]=y):y=e[8];const k=y,N=mn;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=(O,G)=>N(O.path)?-1:N(G.path)?1:A(O.path).localeCompare(A(G.path)),e[9]=g):g=e[9];const C=(x.data??[]).filter(un).sort(g),[D,P]=U.useState(null),$=D===null?null:C.find(O=>O.path===D)??null,F=k?.name??j;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Oe,{size:18})}),e[10]=z):z=e[10];let p;e[11]!==F||e[12]!==l?(p=l==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:F}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:F}),e[11]=F,e[12]=l,e[13]=p):p=e[13];let T;e[14]!==i||e[15]!==l?(T=l==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:i,children:t.jsx(ge,{size:16})}),e[14]=i,e[15]=l,e[16]=T):T=e[16];let E;e[17]!==p||e[18]!==T?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,p,T]}),e[17]=p,e[18]=T,e[19]=E):E=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=L):L=e[20];const q="relative flex min-w-0 flex-1 flex-col overflow-y-auto",R=$?t.jsx(Yt,{file:{key:$.path,filename:A($.path),size:$.size,downloadUrl:o(a??"",$.path)}}):h.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"}),t.jsx(K,{className:"h-3 w-2/3"})]}):h.isError||!k?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:k.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ot,{id:`skill-preview-${n}`,text:k.body})})]});let Q;return e[21]!==R?(Q=t.jsx("div",{className:q,children:R}),e[21]=R,e[22]=Q):Q=e[22],t.jsxs(t.Fragment,{children:[E,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[L,x.isPending?t.jsx(K,{className:"mx-2 h-4 w-24"}):C.map(O=>{const G=N(O.path)?$===null:D===O.path;return t.jsxs("button",{type:"button",onClick:()=>P(N(O.path)?null:O.path),className:ee("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(ie,{filename:A(O.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:ee("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:A(O.path)})]},O.path)})]}),Q]})]})}function un(s){return s.kind==="file"}function mn(s){return A(s)==="SKILL.md"}function hn(s){const e=S.c(8),{skillPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"dialog"})}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function pn(s){const e=S.c(3),{skillPath:n,onClose:i}=s;let l;return e[0]!==i||e[1]!==n?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"panel"})}),e[0]=i,e[1]=n,e[2]=l):l=e[2],l}function gt(s){return`${window.location.origin}${s}`}function oe(s){if(s.shareMode==="password")return"password";if(s.shareMode==="public"||s.readPublic)return"public";if(s.effectivePublic)return"inherited"}const bt=[{id:"home",description:"Your organization's home folder",glyph:Et},{id:"uploads",description:"Files your team uploads",glyph:xe},{id:"outputs",description:"Agent run outputs",glyph:Mt}],Xe=3;function J(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function X(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Re(s){const e=S.c(2),{rows:n}=s,i=n===void 0?1:n;let l;return e[0]!==i?(l=t.jsx(X,{children:Array.from({length:i*3},xn)}),e[0]=i,e[1]=l):l=e[1],l}function xn(s,e){return t.jsx(K,{className:"h-16 rounded-2xl"},e)}function qe(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function gn(s){const e=S.c(6),{volume:n,displayName:i,description:l,glyph:r,onOpen:a}=s,c=ls(n),o=i??n,d=c.data?`${c.data.files} files`:void 0;let u;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==o||e[4]!==d?(u=t.jsx(Ne,{name:o,meta:d,subtitle:l,glyph:r,onOpen:a}),e[0]=l,e[1]=r,e[2]=a,e[3]=o,e[4]=d,e[5]=u):u=e[5],u}function bn(s){const e=S.c(8),{segments:n,onNavigate:i}=s;let l;e[0]!==i?(l=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=n.map((c,o)=>{const d=n.slice(0,o+1).join("/"),u=o===n.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(zt,{size:12,className:"shrink-0 text-muted-foreground"}),u?t.jsx("span",{className:"truncate font-medium text-foreground",children:c}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:c})]},d)}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[l,r]}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function vn(s){const e=S.c(23),{onOpenDir:n,onOpenFile:i,onShare:l,onDelete:r}=s,{org:a}=Fe(),c=ns(),o=ct(),d=be();let u;e[0]!==d||e[1]!==l?(u=h=>l({volume:h.volume,path:h.path,kind:"file",shareMode:h.shareMode??"private",effectivePublic:h.effectivePublic??!1,url:gt(d(h.volume,h.path))}),e[0]=d,e[1]=l,e[2]=u):u=e[2];const f=u;let m;if(e[3]!==d||e[4]!==r||e[5]!==n||e[6]!==i||e[7]!==a||e[8]!==o.data?.length||e[9]!==c.data||e[10]!==c.isPending||e[11]!==f){const h=c.data??[],x=h.slice(0,Xe),v=h.slice(Xe);let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(J,{children:"Folders"}),e[13]=j):j=e[13];let y;e[14]!==n||e[15]!==a?(y=bt.map(g=>t.jsx(gn,{volume:g.id,displayName:g.id==="home"?fs(a.slug):void 0,description:g.description,glyph:g.glyph,onOpen:()=>n(g.id)},g.id)),e[14]=n,e[15]=a,e[16]=y):y=e[16];let k;e[17]!==n||e[18]!==o.data?.length?(k=(o.data?.length??0)>0&&t.jsx(Ne,{name:"public",meta:`${o.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:nt,readOnly:!0,onOpen:()=>n("public")}),e[17]=n,e[18]=o.data?.length,e[19]=k):k=e[19];let N;e[20]!==y||e[21]!==k?(N=t.jsxs("div",{className:"flex flex-col gap-3",children:[j,t.jsxs(X,{children:[y,k]})]}),e[20]=y,e[21]=k,e[22]=N):N=e[22],m=t.jsxs(t.Fragment,{children:[c.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(Re,{})]}):x.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(X,{children:x.map(g=>t.jsx(Xs,{filename:A(g.path),updatedAt:g.updatedAt,size:g.size,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]}):t.jsx(qe,{children:"No files yet — upload one, or ask an agent to produce something."}),N,v.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"All files"}),t.jsx(X,{children:v.map(g=>t.jsx(mt,{filename:A(g.path),updatedAt:g.updatedAt,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]})]}),e[3]=d,e[4]=r,e[5]=n,e[6]=i,e[7]=a,e[8]=o.data?.length,e[9]=c.data,e[10]=c.isPending,e[11]=f,e[12]=m}else m=e[12];return m}function jn(s){const e=S.c(11),{onOpenDir:n}=s,i=ct();if(i.isPending){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Re,{}),e[0]=o):o=e[0],o}let l;e[1]!==i.data?(l=i.data??[],e[1]=i.data,e[2]=l):l=e[2];const r=l;if(r.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(qe,{children:"No public skill sets are configured."}),e[3]=o):o=e[3],o}let a;if(e[4]!==n||e[5]!==r){let o;e[7]!==n?(o=d=>t.jsx(Ne,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>n(`public/${d}`)},d),e[7]=n,e[8]=o):o=e[8],a=r.map(o),e[4]=n,e[5]=r,e[6]=a}else a=e[6];let c;return e[9]!==a?(c=t.jsx(X,{children:a}),e[9]=a,e[10]=c):c=e[10],c}function yn(s){const e=S.c(34),{location:n,onOpenDir:i,onOpenFile:l,onOpenSkill:r,onOpenBrand:a,onShare:c,onDelete:o}=s,d=n.volume??"",u=Le(d,n.dirPath),f=be();if(u.isPending){let k;return e[0]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Re,{rows:2}),e[0]=k):k=e[0],k}if(u.isError){const k=u.error instanceof Error?u.error.message:"Failed to load";let N;return e[1]!==k?(N=t.jsx("p",{className:"text-sm text-destructive",children:k}),e[1]=k,e[2]=N):N=e[2],N}let m,h,x,v,j;if(e[3]!==f||e[4]!==u.data||e[5]!==n||e[6]!==o||e[7]!==a||e[8]!==i||e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==d){j=Symbol.for("react.early_return_sentinel");e:{const k=u.data??[],N=k.filter(Sn),g=k.filter(Nn),C=k.filter(kn),D=k.filter(wn);if(k.length===0){const p=n.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let T;e[18]!==p?(T=t.jsx(qe,{children:p}),e[18]=p,e[19]=T):T=e[19],j=T;break e}let P;e[20]!==n.readOnly||e[21]!==o||e[22]!==d?(P=p=>n.readOnly?void 0:()=>o({volume:d,path:p.path,kind:p.kind}),e[20]=n.readOnly,e[21]=o,e[22]=d,e[23]=P):P=e[23];const $=P;let F;e[24]!==f||e[25]!==n.readOnly||e[26]!==c||e[27]!==d?(F=p=>n.readOnly?void 0:()=>c({volume:d,path:p.path,kind:p.kind,shareMode:p.shareMode??"private",effectivePublic:p.effectivePublic??!1,url:p.kind==="file"?gt(f(d,p.path)):void 0}),e[24]=f,e[25]=n.readOnly,e[26]=c,e[27]=d,e[28]=F):F=e[28];const z=F;m=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Skills"}),t.jsx(X,{children:N.map(p=>t.jsx(Us,{dirName:A(p.path),updatedAt:p.updatedAt,skillMdUrl:f(d,`${p.path}/SKILL.md`),publicState:oe(p),onOpen:()=>r(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),h=g.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Brands"}),t.jsx(X,{children:g.map(p=>t.jsx(_s,{dirName:A(p.path),updatedAt:p.updatedAt,tokensUrl:f(d,`${p.path}/tokens.css`),onOpen:()=>a(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onDelete:$(p)},p.path))})]}),x=C.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Folders"}),t.jsx(X,{children:C.map(p=>t.jsx(Ne,{name:A(p.path),meta:ce(p.updatedAt),readOnly:n.readOnly,publicState:oe(p),onOpen:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),v=D.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Files"}),t.jsx(X,{children:D.map(p=>t.jsx(mt,{filename:A(p.path),updatedAt:p.updatedAt,downloadUrl:f(d,p.path),publicState:oe(p),onOpen:()=>l(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]})}e[3]=f,e[4]=u.data,e[5]=n,e[6]=o,e[7]=a,e[8]=i,e[9]=l,e[10]=r,e[11]=c,e[12]=d,e[13]=m,e[14]=h,e[15]=x,e[16]=v,e[17]=j}else m=e[13],h=e[14],x=e[15],v=e[16],j=e[17];if(j!==Symbol.for("react.early_return_sentinel"))return j;let y;return e[29]!==m||e[30]!==h||e[31]!==x||e[32]!==v?(y=t.jsxs(t.Fragment,{children:[m,h,x,v]}),e[29]=m,e[30]=h,e[31]=x,e[32]=v,e[33]=y):y=e[33],y}function wn(s){return s.kind==="file"}function kn(s){return s.kind==="dir"&&!s.hasSkill&&!s.hasBrand}function Nn(s){return s.kind==="dir"&&s.hasBrand&&!s.hasSkill}function Sn(s){return s.kind==="dir"&&s.hasSkill}function Ze(){const{org:s}=Fe(),e=Je(),n=et(),i=it(),l=tt({strict:!1}),r=l.path??"",a=Be(r),c=a.segments.length===0,o=(w,I)=>n({to:".",search:ne=>({...ne,[w]:I||void 0})}),d=w=>o("path",w),u=(w,I)=>n({to:".",search:ne=>({...ne,preview:void 0,skill:void 0,brand:void 0,[w]:I})}),f=w=>u("preview",w),m=w=>u("skill",w),h=w=>u("brand",w),[x,v]=U.useState(null),[j,y]=U.useState(null),[k,N]=U.useState(!1),[g,C]=U.useState(""),D=U.useRef(null),[P,$]=U.useState(!1),F=U.useRef(0),z=a.readOnly?null:a.volume??"uploads",p=a.volume?a.dirPath:"",{upload:T,mkdir:E}=Pe(z??"uploads"),{remove:L}=Pe(x?.volume??"uploads");async function q(w){if(!(!z||!w||w.length===0))try{await T.mutateAsync({dir:p,files:[...w]}),W.success(w.length===1?`Uploaded ${w[0]?.name}`:`Uploaded ${w.length} files`)}catch(I){W.error(I instanceof Error?I.message:"Upload failed")}finally{D.current&&(D.current.value="")}}const R=z!==null,Q=c?"uploads":a.segments.at(-1)??"this folder";function O(w){return w.dataTransfer.types.includes("Files")}function G(w){!R||!O(w)||(w.preventDefault(),F.current+=1,$(!0))}function se(w){!R||!O(w)||w.preventDefault()}function Se(){R&&(F.current=Math.max(0,F.current-1),F.current===0&&$(!1))}function ue(w){R&&(w.preventDefault(),F.current=0,$(!1),w.dataTransfer.files.length>0&&q(w.dataTransfer.files))}async function H(){const w=g.trim();if(!(!z||!w))try{await E.mutateAsync(p?`${p}/${w}`:w),W.success(`Folder "${w}" created`),N(!1),C("")}catch(I){W.error(I instanceof Error?I.message:"Failed to create folder")}}async function $e(){if(!x)return;const w=x;try{await L.mutateAsync(w.path),W.success(`Deleted ${A(w.path)}`)}catch(I){W.error(I instanceof Error?I.message:"Delete failed")}finally{v(null)}}function V(){for(const w of bt)e.invalidateQueries({queryKey:B.orgFsVolume(s.id,w.id)});a.volume&&e.invalidateQueries({queryKey:B.orgFsVolume(s.id,a.volume)}),e.invalidateQueries({queryKey:B.orgFsRecent(s.id)}),e.invalidateQueries({queryKey:B.orgFsPublicSets(s.id)})}return t.jsxs("div",{className:"relative h-full",onDragEnter:G,onDragOver:se,onDragLeave:Se,onDrop:ue,children:[P&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(xe,{size:28,className:"text-primary"}),t.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",Q]})]})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!c&&t.jsx(bn,{segments:a.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:c?"Library":a.segments.at(-1)??"Library"}),t.jsx(_,{variant:"ghost",size:"icon",onClick:V,"aria-label":"Refresh",children:t.jsx(Tt,{size:14})}),!c&&z&&t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[t.jsx(At,{size:14}),"New folder"]}),a.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(st,{size:12}),"Read-only"]}):t.jsxs(_,{size:"sm",disabled:T.isPending,onClick:()=>D.current?.click(),children:[t.jsx(xe,{size:14}),T.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:D,type:"file",multiple:!0,className:"hidden",onChange:w=>{q(w.target.files)}})]})]}),c?t.jsx(vn,{onOpenDir:d,onOpenFile:f,onShare:y,onDelete:v}):a.volume===null?t.jsx(jn,{onOpenDir:d}):t.jsx(yn,{location:a,onOpenDir:d,onOpenFile:f,onOpenSkill:m,onOpenBrand:h,onShare:y,onDelete:v},a.volume)]})}),i&&(l.preview?t.jsx(ts,{previewPath:l.preview,onClose:()=>o("preview",null)}):l.skill?t.jsx(hn,{skillPath:l.skill,onClose:()=>o("skill",null)},l.skill):l.brand?t.jsx(dn,{brandPath:l.brand,onClose:()=>o("brand",null)},l.brand):null),t.jsx(Ae,{open:k,onOpenChange:N,children:t.jsxs(Ee,{children:[t.jsxs(Ht,{children:[t.jsx(Me,{children:"New folder"}),t.jsxs(Vt,{children:["Create a folder in ",r||"the library","."]})]}),t.jsx(Ue,{autoFocus:!0,placeholder:"folder-name",value:g,onChange:w=>C(w.target.value),onKeyDown:w=>{w.key==="Enter"&&H()}}),t.jsxs(Gt,{children:[t.jsx(_,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),t.jsx(_,{disabled:!g.trim()||E.isPending,onClick:()=>{H()},children:"Create"})]})]})}),t.jsx(ss,{target:j,onOpenChange:w=>{w||y(null)}}),t.jsx(Ut,{open:x!==null,onOpenChange:w=>{w||v(null)},children:t.jsxs(Bt,{children:[t.jsxs(Lt,{children:[t.jsxs(_t,{children:["Delete ",x?A(x.path):"","?"]}),t.jsx(Rt,{children:x?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(qt,{children:[t.jsx(It,{children:"Cancel"}),t.jsx(Kt,{onClick:()=>{$e()},children:"Delete"})]})]})})]})}function rl(){const s=S.c(12),e=it(),n=et();let i;s[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},s[0]=i):i=s[0];const l=tt(i);let r;s[1]!==n?(r=d=>n({to:".",search:u=>({...u,[d]:void 0})}),s[1]=n,s[2]=r):r=s[2];const a=r;let c,o;if(s[3]!==a||s[4]!==e||s[5]!==l.brand||s[6]!==l.preview||s[7]!==l.skill){o=Symbol.for("react.early_return_sentinel");e:{const d=l.preview?{key:"preview",path:l.preview,panel:t.jsx(Xt,{previewPath:l.preview,onClose:()=>a("preview")})}:l.skill?{key:"skill",path:l.skill,panel:t.jsx(pn,{skillPath:l.skill,onClose:()=>a("skill")},l.skill)}:l.brand?{key:"brand",path:l.brand,panel:t.jsx(fn,{brandPath:l.brand,onClose:()=>a("brand")},l.brand)}:null;if(e){let f;s[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})}),s[10]=f):f=s[10],o=f;break e}let u;s[11]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})})})}),s[11]=u):u=s[11],c=t.jsxs(Zt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[u,d&&t.jsxs(t.Fragment,{children:[t.jsx(Qt.Tabs,{children:t.jsx(Jt,{title:A(d.path),icon:{kind:"component",Component:f=>d.key==="preview"?t.jsx(ie,{filename:A(d.path),...f}):d.key==="skill"?t.jsx(Oe,{...f}):t.jsx(pe,{...f})},active:!0,onClick:()=>a(d.key)})}),t.jsx(es,{className:"bg-sidebar"}),t.jsx(Ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:d.panel})})})})]})]})}s[3]=a,s[4]=e,s[5]=l.brand,s[6]=l.preview,s[7]=l.skill,s[8]=c,s[9]=o}else c=s[8],o=s[9];return o!==Symbol.for("react.early_return_sentinel")?o:c}export{rl as default};
169
+ `);async function We(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function rn(s,e){const n=e?`<style>${e}</style>`:"";return s.replaceAll("{{{slides}}}",ln).replaceAll("{{title}}",nn).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${n}</head>`)}function an(s){const e=S.c(23),{readUrl:n,title:i,tokensUrl:l}=s;let r;e[0]!==n?(r=B.fileText(n),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==n?(a=()=>We(n),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==a?(c={queryKey:r,queryFn:a,staleTime:6e4,retry:!1},e[4]=r,e[5]=a,e[6]=c):c=e[6];const o=Y(c);let d;e[7]!==l?(d=B.fileText(l??""),e[7]=l,e[8]=d):d=e[8];const u=!!l;let f;e[9]!==l?(f=()=>We(l??""),e[9]=l,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==u||e[13]!==f?(m={queryKey:d,enabled:u,queryFn:f,staleTime:6e4,retry:!1},e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14];const h=Y(m);if(o.isPending||l&&h.isPending){let y;return e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(K,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[15]=y):y=e[15],y}if(o.isError||!o.data){let y;return e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[16]=y):y=e[16],y}const x=h.data??null;let v;e[17]!==x||e[18]!==o.data?(v=rn(o.data,x),e[17]=x,e[18]=o.data,e[19]=v):v=e[19];let j;return e[20]!==v||e[21]!==i?(j=t.jsx("iframe",{title:i,srcDoc:v,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=v,e[21]=i,e[22]=j):j=e[22],j}async function Ye(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function ae(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function on(s){const e=S.c(16),{family:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;let c;e[0]!==n?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>{const h=r(m),x=`${m.name.replace(/^--brand-/,"")}: ${h}`;return l&&/^#/.test(h)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:js(h),onChange:v=>a(m.name,v.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:h}},m.name)},e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function cn(s){const e=S.c(9),{token:n,value:i}=s;if(n.kind==="space"){let r;return e[0]!==i?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:i,maxWidth:"100%"}})}),e[0]=i,e[1]=r):r=e[1],r}if(n.kind==="radius"){let r;return e[2]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:i}}),e[2]=i,e[3]=r):r=e[3],r}if(n.kind==="shadow"){let r;return e[4]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:i}}),e[4]=i,e[5]=r):r=e[5],r}if(n.kind==="type"&&/^--brand-text-/.test(n.name)){const r=`min(${i}, 22px)`;let a;return e[6]!==r?(a=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=a):a=e[7],a}let l;return e[8]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=l):l=e[8],l}function ht(s){const e=S.c(17),{token:n,value:i,editing:l,onEdit:r}=s;let a;e[0]!==n||e[1]!==i?(a=t.jsx(cn,{token:n,value:i}),e[0]=n,e[1]=i,e[2]=a):a=e[2];let c;if(e[3]!==n.name){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/^--brand-/,e[5]=f):f=e[5],c=n.name.replace(f,""),e[3]=n.name,e[4]=c}else c=e[4];let o;e[6]!==c?(o=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==n.name||e[11]!==i?(d=l?t.jsx(Ue,{value:i,onChange:f=>r(n.name,f.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:i}),e[8]=l,e[9]=r,e[10]=n.name,e[11]=i,e[12]=d):d=e[12];let u;return e[13]!==a||e[14]!==o||e[15]!==d?(u=t.jsxs("div",{className:"flex items-center gap-3",children:[a,o,d]}),e[13]=a,e[14]=o,e[15]=d,e[16]=u):u=e[16],u}function re(s){const e=S.c(16),{label:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;if(i.length===0)return null;let c;e[0]!==n?(c=t.jsx(ae,{children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>t.jsx(ht,{token:m,value:r(m),editing:l,onEdit:a},m.name),e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-3",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function pt({brandPath:s,onClose:e,variant:n}){const{org:i}=Fe(),l=Be(s),r=l.volume??"",a=l.dirPath,c=A(a),o=l.readOnly,d=Je(),u=be(),f=Wt(r),{upload:m,remove:h}=Pe(r),x=U.useRef(null),v=Le(r,a),j=v.data??[],y=b=>j.some(M=>M.kind==="file"&&A(M.path)===b),k=y("tokens.css"),N=y("brand.md"),g=y("slides-theme.html"),C=Ns(j),D=u(r,`${a}/tokens.css`),P=u(r,`${a}/brand.md`),$=u(r,`${a}/slides-theme.html`),F=Y({queryKey:B.fileText(D),enabled:k,queryFn:()=>Ye(D),staleTime:6e4,retry:!1}),z=Y({queryKey:B.fileText(P),enabled:N,queryFn:()=>Ye(P),staleTime:6e4,retry:!1}),[p,T]=U.useState(!1),[E,L]=U.useState({}),[q,R]=U.useState(null),[Q,O]=U.useState(!1),[G,se]=U.useState(!1),[Se,ue]=U.useState("deck"),H=F.data?dt(F.data):[],$e=b=>H.find(M=>M.name===b)?.value,V=b=>E[b.name]??b.value,w=ws(H),I=H.filter(b=>b.kind==="font"),ne=H.filter(b=>b.kind==="type"),vt=H.filter(b=>b.kind==="space"),jt=H.filter(b=>b.kind==="radius"),yt=H.filter(b=>b.kind==="shadow"),wt=H.filter(b=>b.kind==="motion"),kt=H.filter(b=>b.kind==="other"),Z=(b,M)=>L(he=>({...he,[b]:M})),me=g&&Se==="deck",Ce=q??z.data??"",De=Object.entries(E).filter(([b,M])=>$e(b)!==M),Ie=q!==null&&q!==(z.data??""),Nt=De.length>0||Ie;function St(){L({}),R(null),T(!1)}async function $t(){O(!0);try{if(De.length>0){let b=F.data??"";for(const[M,he]of De)b=ks(b,M,he);await f.mutateAsync({path:`${a}/tokens.css`,body:b,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(D)})}Ie&&q!==null&&(await f.mutateAsync({path:`${a}/brand.md`,body:q,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(P)})),d.invalidateQueries({queryKey:B.orgFsVolume(i.id,r)}),d.invalidateQueries({queryKey:B.orgFsRecent(i.id)}),L({}),R(null),T(!1),W.success("Brand saved")}catch(b){W.error(b instanceof Error?b.message:"Failed to save brand")}finally{O(!1)}}async function Ct(b){const M=b?.[0];if(!M)return;const Ke=`logo.${(M.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:a,files:[new File([M],Ke,{type:M.type})]}),C&&A(C)!==Ke&&await h.mutateAsync(C),W.success("Logo updated")}catch(He){W.error(He instanceof Error?He.message:"Logo upload failed")}finally{x.current&&(x.current.value="")}}const Dt=!v.isPending&&!k&&!N&&!C;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(pe,{size:18})}),n==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!o&&(p?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"ghost",size:"sm",onClick:St,disabled:Q,children:"Cancel"}),t.jsx(_,{size:"sm",disabled:!Nt||Q,onClick:()=>{$t()},children:Q?"Saving…":"Save"})]}):t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[t.jsx(Ot,{size:14}),"Edit"]})),n==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(ge,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:v.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(K,{className:"h-40 w-full rounded-xl"}),t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-4 w-2/3"})]}):Dt?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):t.jsxs(t.Fragment,{children:[(g||k)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":G?"Show preview":"Hide preview",onClick:()=>se(b=>!b),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),se(M=>!M))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:b=>b.stopPropagation(),children:[g&&t.jsx("button",{type:"button",onClick:()=>{ue("deck"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),t.jsx("button",{type:"button",onClick:()=>{ue("components"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),G?t.jsx(as,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(os,{size:16,className:"shrink-0 text-muted-foreground"})]}),!G&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:ee("w-full overflow-hidden rounded-xl border border-border bg-muted/30",me?"aspect-[16/9]":"h-96"),children:me?t.jsx(an,{readUrl:$,title:`${c} deck theme`,tokensUrl:D}):t.jsx(sn,{tokensUrl:D})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Logo"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:C?t.jsx("img",{src:u(r,C),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(pe,{size:28,className:"text-muted-foreground/50"})}),p&&t.jsxs("div",{children:[t.jsxs(_,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(xe,{size:14}),C?"Replace logo":"Add logo"]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:b=>{Ct(b.target.files)}})]})]})]}),w.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Colors"}),w.map(b=>t.jsx(on,{family:b.family,tokens:b.tokens,editing:p,valueOf:V,onEdit:Z},b.family))]}),(I.length>0||ne.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Typography"}),I.map(b=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:b.name.replace(/^--brand-font-?/,"")||"font"}),p?t.jsx(Ue,{value:V(b),onChange:M=>Z(b.name,M.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:V(b)},children:V(b)})]},b.name)),ne.map(b=>t.jsx(ht,{token:b,value:V(b),editing:p,onEdit:Z},b.name))]}),t.jsx(re,{label:"Spacing",tokens:vt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Radius",tokens:jt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Shadows",tokens:yt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Motion",tokens:wt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Tokens",tokens:kt,editing:p,valueOf:V,onEdit:Z}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Voice & guidelines"}),p?t.jsx(rs,{value:Ce,onChange:b=>R(b.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):z.isPending&&N?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"})]}):Ce.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(ot,{id:`brand-preview-${s}`,text:Ce})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function dn(s){const e=S.c(8),{brandPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==i?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"dialog"})}),e[2]=n,e[3]=i,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function fn(s){const e=S.c(3),{brandPath:n,onClose:i}=s;let l;return e[0]!==n||e[1]!==i?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"panel"})}),e[0]=n,e[1]=i,e[2]=l):l=e[2],l}function xt(s){const e=S.c(23),{skillPath:n,onClose:i,variant:l}=s,r=Be(n),{volume:a,dirPath:c}=r,o=be(),d=o(a??"",`${c}/SKILL.md`),u=B.fileText(d);let f;e[0]!==d?(f=async()=>{const O=await fetch(d,{credentials:"include"});if(!O.ok)throw new Error(`fetch failed: ${O.status}`);return O.text()},e[0]=d,e[1]=f):f=e[1];let m;e[2]!==u||e[3]!==f?(m={queryKey:u,queryFn:f,staleTime:6e4,retry:!1},e[2]=u,e[3]=f,e[4]=m):m=e[4];const h=Y(m),x=Le(a??"",c);let v;e[5]!==c?(v=A(c),e[5]=c,e[6]=v):v=e[6];const j=v;let y;e[7]!==h.data?(y=h.data?ft(h.data):null,e[7]=h.data,e[8]=y):y=e[8];const k=y,N=mn;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=(O,G)=>N(O.path)?-1:N(G.path)?1:A(O.path).localeCompare(A(G.path)),e[9]=g):g=e[9];const C=(x.data??[]).filter(un).sort(g),[D,P]=U.useState(null),$=D===null?null:C.find(O=>O.path===D)??null,F=k?.name??j;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Oe,{size:18})}),e[10]=z):z=e[10];let p;e[11]!==F||e[12]!==l?(p=l==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:F}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:F}),e[11]=F,e[12]=l,e[13]=p):p=e[13];let T;e[14]!==i||e[15]!==l?(T=l==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:i,children:t.jsx(ge,{size:16})}),e[14]=i,e[15]=l,e[16]=T):T=e[16];let E;e[17]!==p||e[18]!==T?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,p,T]}),e[17]=p,e[18]=T,e[19]=E):E=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=L):L=e[20];const q="relative flex min-w-0 flex-1 flex-col overflow-y-auto",R=$?t.jsx(Yt,{file:{key:$.path,filename:A($.path),size:$.size,downloadUrl:o(a??"",$.path)}}):h.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"}),t.jsx(K,{className:"h-3 w-2/3"})]}):h.isError||!k?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:k.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ot,{id:`skill-preview-${n}`,text:k.body})})]});let Q;return e[21]!==R?(Q=t.jsx("div",{className:q,children:R}),e[21]=R,e[22]=Q):Q=e[22],t.jsxs(t.Fragment,{children:[E,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[L,x.isPending?t.jsx(K,{className:"mx-2 h-4 w-24"}):C.map(O=>{const G=N(O.path)?$===null:D===O.path;return t.jsxs("button",{type:"button",onClick:()=>P(N(O.path)?null:O.path),className:ee("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(ie,{filename:A(O.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:ee("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:A(O.path)})]},O.path)})]}),Q]})]})}function un(s){return s.kind==="file"}function mn(s){return A(s)==="SKILL.md"}function hn(s){const e=S.c(8),{skillPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"dialog"})}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function pn(s){const e=S.c(3),{skillPath:n,onClose:i}=s;let l;return e[0]!==i||e[1]!==n?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"panel"})}),e[0]=i,e[1]=n,e[2]=l):l=e[2],l}function gt(s){return`${window.location.origin}${s}`}function oe(s){if(s.shareMode==="password")return"password";if(s.shareMode==="public"||s.readPublic)return"public";if(s.effectivePublic)return"inherited"}const bt=[{id:"home",description:"Your organization's home folder",glyph:Et},{id:"uploads",description:"Files your team uploads",glyph:xe},{id:"outputs",description:"Agent run outputs",glyph:Mt}],Xe=3;function J(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function X(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:n})}),e[0]=n,e[1]=i):i=e[1],i}function Re(s){const e=S.c(2),{rows:n}=s,i=n===void 0?1:n;let l;return e[0]!==i?(l=t.jsx(X,{children:Array.from({length:i*3},xn)}),e[0]=i,e[1]=l):l=e[1],l}function xn(s,e){return t.jsx(K,{className:"h-16 rounded-2xl"},e)}function qe(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function gn(s){const e=S.c(6),{volume:n,displayName:i,description:l,glyph:r,onOpen:a}=s,c=ls(n),o=i??n,d=c.data?`${c.data.files} files`:void 0;let u;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==o||e[4]!==d?(u=t.jsx(Ne,{name:o,meta:d,subtitle:l,glyph:r,onOpen:a}),e[0]=l,e[1]=r,e[2]=a,e[3]=o,e[4]=d,e[5]=u):u=e[5],u}function bn(s){const e=S.c(8),{segments:n,onNavigate:i}=s;let l;e[0]!==i?(l=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=n.map((c,o)=>{const d=n.slice(0,o+1).join("/"),u=o===n.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(zt,{size:12,className:"shrink-0 text-muted-foreground"}),u?t.jsx("span",{className:"truncate font-medium text-foreground",children:c}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:c})]},d)}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[l,r]}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function vn(s){const e=S.c(23),{onOpenDir:n,onOpenFile:i,onShare:l,onDelete:r}=s,{org:a}=Fe(),c=ns(),o=ct(),d=be();let u;e[0]!==d||e[1]!==l?(u=h=>l({volume:h.volume,path:h.path,kind:"file",shareMode:h.shareMode??"private",effectivePublic:h.effectivePublic??!1,url:gt(d(h.volume,h.path))}),e[0]=d,e[1]=l,e[2]=u):u=e[2];const f=u;let m;if(e[3]!==d||e[4]!==r||e[5]!==n||e[6]!==i||e[7]!==a||e[8]!==o.data?.length||e[9]!==c.data||e[10]!==c.isPending||e[11]!==f){const h=c.data??[],x=h.slice(0,Xe),v=h.slice(Xe);let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(J,{children:"Folders"}),e[13]=j):j=e[13];let y;e[14]!==n||e[15]!==a?(y=bt.map(g=>t.jsx(gn,{volume:g.id,displayName:g.id==="home"?fs(a.slug):void 0,description:g.description,glyph:g.glyph,onOpen:()=>n(g.id)},g.id)),e[14]=n,e[15]=a,e[16]=y):y=e[16];let k;e[17]!==n||e[18]!==o.data?.length?(k=(o.data?.length??0)>0&&t.jsx(Ne,{name:"public",meta:`${o.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:nt,readOnly:!0,onOpen:()=>n("public")}),e[17]=n,e[18]=o.data?.length,e[19]=k):k=e[19];let N;e[20]!==y||e[21]!==k?(N=t.jsxs("div",{className:"flex flex-col gap-3",children:[j,t.jsxs(X,{children:[y,k]})]}),e[20]=y,e[21]=k,e[22]=N):N=e[22],m=t.jsxs(t.Fragment,{children:[c.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(Re,{})]}):x.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(X,{children:x.map(g=>t.jsx(Xs,{filename:A(g.path),updatedAt:g.updatedAt,size:g.size,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]}):t.jsx(qe,{children:"No files yet — upload one, or ask an agent to produce something."}),N,v.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"All files"}),t.jsx(X,{children:v.map(g=>t.jsx(mt,{filename:A(g.path),updatedAt:g.updatedAt,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]})]}),e[3]=d,e[4]=r,e[5]=n,e[6]=i,e[7]=a,e[8]=o.data?.length,e[9]=c.data,e[10]=c.isPending,e[11]=f,e[12]=m}else m=e[12];return m}function jn(s){const e=S.c(11),{onOpenDir:n}=s,i=ct();if(i.isPending){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Re,{}),e[0]=o):o=e[0],o}let l;e[1]!==i.data?(l=i.data??[],e[1]=i.data,e[2]=l):l=e[2];const r=l;if(r.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(qe,{children:"No public skill sets are configured."}),e[3]=o):o=e[3],o}let a;if(e[4]!==n||e[5]!==r){let o;e[7]!==n?(o=d=>t.jsx(Ne,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>n(`public/${d}`)},d),e[7]=n,e[8]=o):o=e[8],a=r.map(o),e[4]=n,e[5]=r,e[6]=a}else a=e[6];let c;return e[9]!==a?(c=t.jsx(X,{children:a}),e[9]=a,e[10]=c):c=e[10],c}function yn(s){const e=S.c(34),{location:n,onOpenDir:i,onOpenFile:l,onOpenSkill:r,onOpenBrand:a,onShare:c,onDelete:o}=s,d=n.volume??"",u=Le(d,n.dirPath),f=be();if(u.isPending){let k;return e[0]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Re,{rows:2}),e[0]=k):k=e[0],k}if(u.isError){const k=u.error instanceof Error?u.error.message:"Failed to load";let N;return e[1]!==k?(N=t.jsx("p",{className:"text-sm text-destructive",children:k}),e[1]=k,e[2]=N):N=e[2],N}let m,h,x,v,j;if(e[3]!==f||e[4]!==u.data||e[5]!==n||e[6]!==o||e[7]!==a||e[8]!==i||e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==d){j=Symbol.for("react.early_return_sentinel");e:{const k=u.data??[],N=k.filter(Sn),g=k.filter(Nn),C=k.filter(kn),D=k.filter(wn);if(k.length===0){const p=n.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let T;e[18]!==p?(T=t.jsx(qe,{children:p}),e[18]=p,e[19]=T):T=e[19],j=T;break e}let P;e[20]!==n.readOnly||e[21]!==o||e[22]!==d?(P=p=>n.readOnly?void 0:()=>o({volume:d,path:p.path,kind:p.kind}),e[20]=n.readOnly,e[21]=o,e[22]=d,e[23]=P):P=e[23];const $=P;let F;e[24]!==f||e[25]!==n.readOnly||e[26]!==c||e[27]!==d?(F=p=>n.readOnly?void 0:()=>c({volume:d,path:p.path,kind:p.kind,shareMode:p.shareMode??"private",effectivePublic:p.effectivePublic??!1,url:p.kind==="file"?gt(f(d,p.path)):void 0}),e[24]=f,e[25]=n.readOnly,e[26]=c,e[27]=d,e[28]=F):F=e[28];const z=F;m=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Skills"}),t.jsx(X,{children:N.map(p=>t.jsx(Us,{dirName:A(p.path),updatedAt:p.updatedAt,skillMdUrl:f(d,`${p.path}/SKILL.md`),publicState:oe(p),onOpen:()=>r(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),h=g.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Brands"}),t.jsx(X,{children:g.map(p=>t.jsx(_s,{dirName:A(p.path),updatedAt:p.updatedAt,tokensUrl:f(d,`${p.path}/tokens.css`),onOpen:()=>a(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onDelete:$(p)},p.path))})]}),x=C.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Folders"}),t.jsx(X,{children:C.map(p=>t.jsx(Ne,{name:A(p.path),meta:ce(p.updatedAt),readOnly:n.readOnly,publicState:oe(p),onOpen:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),v=D.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Files"}),t.jsx(X,{children:D.map(p=>t.jsx(mt,{filename:A(p.path),updatedAt:p.updatedAt,downloadUrl:f(d,p.path),publicState:oe(p),onOpen:()=>l(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]})}e[3]=f,e[4]=u.data,e[5]=n,e[6]=o,e[7]=a,e[8]=i,e[9]=l,e[10]=r,e[11]=c,e[12]=d,e[13]=m,e[14]=h,e[15]=x,e[16]=v,e[17]=j}else m=e[13],h=e[14],x=e[15],v=e[16],j=e[17];if(j!==Symbol.for("react.early_return_sentinel"))return j;let y;return e[29]!==m||e[30]!==h||e[31]!==x||e[32]!==v?(y=t.jsxs(t.Fragment,{children:[m,h,x,v]}),e[29]=m,e[30]=h,e[31]=x,e[32]=v,e[33]=y):y=e[33],y}function wn(s){return s.kind==="file"}function kn(s){return s.kind==="dir"&&!s.hasSkill&&!s.hasBrand}function Nn(s){return s.kind==="dir"&&s.hasBrand&&!s.hasSkill}function Sn(s){return s.kind==="dir"&&s.hasSkill}function Ze(){const{org:s}=Fe(),e=Je(),n=et(),i=it(),l=tt({strict:!1}),r=l.path??"",a=Be(r),c=a.segments.length===0,o=(w,I)=>n({to:".",search:ne=>({...ne,[w]:I||void 0})}),d=w=>o("path",w),u=(w,I)=>n({to:".",search:ne=>({...ne,preview:void 0,skill:void 0,brand:void 0,[w]:I})}),f=w=>u("preview",w),m=w=>u("skill",w),h=w=>u("brand",w),[x,v]=U.useState(null),[j,y]=U.useState(null),[k,N]=U.useState(!1),[g,C]=U.useState(""),D=U.useRef(null),[P,$]=U.useState(!1),F=U.useRef(0),z=a.readOnly?null:a.volume??"uploads",p=a.volume?a.dirPath:"",{upload:T,mkdir:E}=Pe(z??"uploads"),{remove:L}=Pe(x?.volume??"uploads");async function q(w){if(!(!z||!w||w.length===0))try{await T.mutateAsync({dir:p,files:[...w]}),W.success(w.length===1?`Uploaded ${w[0]?.name}`:`Uploaded ${w.length} files`)}catch(I){W.error(I instanceof Error?I.message:"Upload failed")}finally{D.current&&(D.current.value="")}}const R=z!==null,Q=c?"uploads":a.segments.at(-1)??"this folder";function O(w){return w.dataTransfer.types.includes("Files")}function G(w){!R||!O(w)||(w.preventDefault(),F.current+=1,$(!0))}function se(w){!R||!O(w)||w.preventDefault()}function Se(){R&&(F.current=Math.max(0,F.current-1),F.current===0&&$(!1))}function ue(w){R&&(w.preventDefault(),F.current=0,$(!1),w.dataTransfer.files.length>0&&q(w.dataTransfer.files))}async function H(){const w=g.trim();if(!(!z||!w))try{await E.mutateAsync(p?`${p}/${w}`:w),W.success(`Folder "${w}" created`),N(!1),C("")}catch(I){W.error(I instanceof Error?I.message:"Failed to create folder")}}async function $e(){if(!x)return;const w=x;try{await L.mutateAsync(w.path),W.success(`Deleted ${A(w.path)}`)}catch(I){W.error(I instanceof Error?I.message:"Delete failed")}finally{v(null)}}function V(){for(const w of bt)e.invalidateQueries({queryKey:B.orgFsVolume(s.id,w.id)});a.volume&&e.invalidateQueries({queryKey:B.orgFsVolume(s.id,a.volume)}),e.invalidateQueries({queryKey:B.orgFsRecent(s.id)}),e.invalidateQueries({queryKey:B.orgFsPublicSets(s.id)})}return t.jsxs("div",{className:"relative h-full",onDragEnter:G,onDragOver:se,onDragLeave:Se,onDrop:ue,children:[P&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(xe,{size:28,className:"text-primary"}),t.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",Q]})]})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!c&&t.jsx(bn,{segments:a.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:c?"Library":a.segments.at(-1)??"Library"}),t.jsx(_,{variant:"ghost",size:"icon",onClick:V,"aria-label":"Refresh",children:t.jsx(Tt,{size:14})}),!c&&z&&t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[t.jsx(At,{size:14}),"New folder"]}),a.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(st,{size:12}),"Read-only"]}):t.jsxs(_,{size:"sm",disabled:T.isPending,onClick:()=>D.current?.click(),children:[t.jsx(xe,{size:14}),T.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:D,type:"file",multiple:!0,className:"hidden",onChange:w=>{q(w.target.files)}})]})]}),c?t.jsx(vn,{onOpenDir:d,onOpenFile:f,onShare:y,onDelete:v}):a.volume===null?t.jsx(jn,{onOpenDir:d}):t.jsx(yn,{location:a,onOpenDir:d,onOpenFile:f,onOpenSkill:m,onOpenBrand:h,onShare:y,onDelete:v},a.volume)]})}),i&&(l.preview?t.jsx(ts,{previewPath:l.preview,onClose:()=>o("preview",null)}):l.skill?t.jsx(hn,{skillPath:l.skill,onClose:()=>o("skill",null)},l.skill):l.brand?t.jsx(dn,{brandPath:l.brand,onClose:()=>o("brand",null)},l.brand):null),t.jsx(Ae,{open:k,onOpenChange:N,children:t.jsxs(Ee,{children:[t.jsxs(Ht,{children:[t.jsx(Me,{children:"New folder"}),t.jsxs(Vt,{children:["Create a folder in ",r||"the library","."]})]}),t.jsx(Ue,{autoFocus:!0,placeholder:"folder-name",value:g,onChange:w=>C(w.target.value),onKeyDown:w=>{w.key==="Enter"&&H()}}),t.jsxs(Gt,{children:[t.jsx(_,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),t.jsx(_,{disabled:!g.trim()||E.isPending,onClick:()=>{H()},children:"Create"})]})]})}),t.jsx(ss,{target:j,onOpenChange:w=>{w||y(null)}}),t.jsx(Ut,{open:x!==null,onOpenChange:w=>{w||v(null)},children:t.jsxs(Bt,{children:[t.jsxs(Lt,{children:[t.jsxs(_t,{children:["Delete ",x?A(x.path):"","?"]}),t.jsx(Rt,{children:x?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(qt,{children:[t.jsx(It,{children:"Cancel"}),t.jsx(Kt,{onClick:()=>{$e()},children:"Delete"})]})]})})]})}function rl(){const s=S.c(12),e=it(),n=et();let i;s[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},s[0]=i):i=s[0];const l=tt(i);let r;s[1]!==n?(r=d=>n({to:".",search:u=>({...u,[d]:void 0})}),s[1]=n,s[2]=r):r=s[2];const a=r;let c,o;if(s[3]!==a||s[4]!==e||s[5]!==l.brand||s[6]!==l.preview||s[7]!==l.skill){o=Symbol.for("react.early_return_sentinel");e:{const d=l.preview?{key:"preview",path:l.preview,panel:t.jsx(Xt,{previewPath:l.preview,onClose:()=>a("preview")})}:l.skill?{key:"skill",path:l.skill,panel:t.jsx(pn,{skillPath:l.skill,onClose:()=>a("skill")},l.skill)}:l.brand?{key:"brand",path:l.brand,panel:t.jsx(fn,{brandPath:l.brand,onClose:()=>a("brand")},l.brand)}:null;if(e){let f;s[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})}),s[10]=f):f=s[10],o=f;break e}let u;s[11]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})})})}),s[11]=u):u=s[11],c=t.jsxs(Zt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[u,d&&t.jsxs(t.Fragment,{children:[t.jsx(Qt.Tabs,{children:t.jsx(Jt,{title:A(d.path),icon:{kind:"component",Component:f=>d.key==="preview"?t.jsx(ie,{filename:A(d.path),...f}):d.key==="skill"?t.jsx(Oe,{...f}):t.jsx(pe,{...f})},active:!0,onClick:()=>a(d.key)})}),t.jsx(es,{className:"bg-sidebar"}),t.jsx(Ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:d.panel})})})})]})]})}s[3]=a,s[4]=e,s[5]=l.brand,s[6]=l.preview,s[7]=l.skill,s[8]=c,s[9]=o}else c=s[8],o=s[9];return o!==Symbol.for("react.early_return_sentinel")?o:c}export{rl as default};
@@ -1 +1 @@
1
- import{c as g,e as p,j as s,i as u,N as a}from"./index-BhM87K40.js";import{a as x}from"./use-capability-CGQ_ecnh.js";import{C as j}from"./capability-load-error-gDA_XWS8.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{c as g,e as p,j as s,i as u,N as a}from"./index-DLQ4JwZN.js";import{a as x}from"./use-capability-GDRaaPxs.js";import{C as j}from"./capability-load-error-BssWdjEJ.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1 +1 @@
1
- import{c as s,l as a,j as d}from"./index-BhM87K40.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{c as s,l as a,j as d}from"./index-DLQ4JwZN.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{c as k,j as h,r as C,l as L}from"./index-BhM87K40.js";import{n as Z}from"./XCircle-BeS_rdZa.js";import{A as y}from"./agent-icon-DxayptCQ.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
1
+ import{c as k,j as h,r as C,l as L}from"./index-DLQ4JwZN.js";import{n as Z}from"./XCircle-CAZvEkjb.js";import{A as y}from"./agent-icon-DC15QH5N.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
@@ -1 +1 @@
1
- import{c as n,l as r,j as i,bI as p}from"./index-BhM87K40.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
1
+ import{c as n,l as r,j as i,bI as p}from"./index-DLQ4JwZN.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
@@ -1 +1 @@
1
- import{a,u as f,j as o,S as g,N as p}from"./index-BhM87K40.js";import{A as x}from"./auth-entry-lCRxMtrR.js";import{A as S}from"./auth-split-layout-UPGIe-CZ.js";import"./input-B3fwGRLy.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function L(){const e=a.useSession(),t=f({from:"/login"}),{next:i="/",client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_}=t,n=i.startsWith("/")&&!i.startsWith("//")?i:"/",c=y({client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_});return e.data?c?(window.location.href=c,o.jsx(g,{})):o.jsx(p,{to:n}):o.jsx(S,{children:o.jsx(x,{callbackUrl:n,redirectUrl:c})})}export{L as default};
1
+ import{a,u as f,j as o,S as g,N as p}from"./index-DLQ4JwZN.js";import{A as x}from"./auth-entry-BRIrNXJW.js";import{A as S}from"./auth-split-layout-MeF5ymWQ.js";import"./input-BFLS6IB9.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function L(){const e=a.useSession(),t=f({from:"/login"}),{next:i="/",client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_}=t,n=i.startsWith("/")&&!i.startsWith("//")?i:"/",c=y({client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_});return e.data?c?(window.location.href=c,o.jsx(g,{})):o.jsx(p,{to:n}):o.jsx(S,{children:o.jsx(x,{callbackUrl:n,redirectUrl:c})})}export{L as default};
@@ -1 +1 @@
1
- import{d as x,b as N,c as z,a as D}from"./auth-CvftsTU7.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
1
+ import{d as x,b as N,c as z,a as D}from"./auth-fUaquGnI.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
@@ -1,3 +1,3 @@
1
- import{s as $t,r as ce,D as he,m as ke,a as Dt,p as kt,d as xe,w as ue,t as G,K as ie,j as s,B as fe,c as J,q as Ft,k as Tt,l as $e,i as Xe,E as Ot}from"./index-BhM87K40.js";import{C as Lt}from"./collection-display-button-DGiHGZ5q.js";import{S as qt}from"./search-input-B_2r2KRh.js";import{P as _e}from"./index--T8_B07u.js";import{u as It,C as Bt}from"./use-organization-roles-DthsGMZM.js";import{E as We}from"./empty-state-wn-fH-_c.js";import{a as Kt,i as Vt,b as Qt,c as Ut,d as Gt,D as Jt}from"./dialog-BD0YSELz.js";import{a as Ht,F as rt,b as ct,c as Wt,d as mt,e as dt}from"./form-ky5gQWvG.js";import{d as et,b as tt,c as st,S as nt,a as it}from"./select-DCp4xmLi.js";import{T as Yt}from"./textarea-DM4qEV5B.js";import{u as lt}from"./use-org-auth-client-D2ysoG3X.js";import{b as Zt,S as Xt,a as es}from"./settings-section-k4LsHL-b.js";import{a as ts,u as ss}from"./use-join-requests-Lex6BTHJ.js";import{A as De}from"./avatar-DyemZXDO.js";import{u as ns}from"./use-members-lrTKUCiI.js";import{u as Fe}from"./studio-tools-flBlg18v.js";import{a as is,b as as,c as ls,T as os}from"./tooltip-BUxV_D6P.js";import{a as ut,e as ft,g as ht,b as pt,c as gt,d as xt,A as bt,f as jt}from"./alert-dialog-tMxAwGBu.js";import{B as Ue}from"./badge-DYzttO0q.js";import{C as vt}from"./card-Bxht1Pz7.js";import{D as At,a as Pt,b as Mt,d as rs,e as cs,f as ms,c as at,g as ds}from"./dropdown-menu-BYxo50Eo.js";import{a as Et}from"./DotsVertical-CD2_SPET.js";import{i as us}from"./Key01-BUffBtXO.js";import{i as fs}from"./Shield01-Cy2UxQ_z.js";import{b as hs}from"./SwitchHorizontal01-C20gqSxc.js";import{s as ps}from"./Trash01-BonmNT1r.js";import{s as _t}from"./XClose-DDDs6Mbr.js";import{C as Ct}from"./checkbox-zBVxVTpV.js";import{e as Ye,a as Ze,g as yt,C as gs,c as xs,d as bs,b as js}from"./command-DvtOmBox.js";import{b as vs,P as Cs,a as ys}from"./popover-CNCsQG7k.js";import{t as Ss}from"./ChevronDown-jaVETr_P.js";import{s as ws}from"./Plus-BMZPk-z1.js";import{R as Ns}from"./require-capability-CMniQrvy.js";import"./ChevronUp-CWfuGOeB.js";import"./view-mode-toggle-C8nDVI0J.js";import"./SearchMd-BqzQBy2h.js";import"./sidebar-B99ZGhiW.js";import"./LayoutLeft-DGLWhARC.js";import"./use-mobile-C07VmsnQ.js";import"./sheet-CSveQQ63.js";import"./X-BnhQ9YZ6.js";import"./table-2irqwFYt.js";import"./label-DHjkgYPE.js";import"./ArrowUpRight-BVel7TVT.js";import"./use-capability-CGQ_ecnh.js";import"./User01-Dzxgobw-.js";import"./ChevronRight-BIxpFMHu.js";import"./index-D74Vpeva.js";import"./access-gate-Bvgfz-li.js";import"./capability-load-error-gDA_XWS8.js";const Ts=$t().email("Invalid email address");function Is(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function As({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=he(),i=lt(),a=ke(),{data:r}=Dt.useSession(),o=r?.user?.email,{roles:g,isLoading:x}=It(),j=g.filter(m=>m.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),P=p.watch("role"),v=Is(b).filter(m=>{const c=Ts.safeParse(m).success,f=!o||m!==o.toLowerCase();return c&&f}),N=xe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await i.organization.inviteMember({email:w,role:c});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:c,role:f})=>{ue("member_invited",{count:c.length,role:f}),a.invalidateQueries({queryKey:ie.members(l)}),a.invalidateQueries({queryKey:ie.invitations(l)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{ue("member_invite_failed",{count:c.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!P;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Ht,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
1
+ import{s as $t,r as ce,D as he,m as ke,a as Dt,p as kt,d as xe,w as ue,t as G,K as ie,j as s,B as fe,c as J,q as Ft,k as Tt,l as $e,i as Xe,E as Ot}from"./index-DLQ4JwZN.js";import{C as Lt}from"./collection-display-button-5E1VxEVW.js";import{S as qt}from"./search-input-Cw_P0J35.js";import{P as _e}from"./index-DFanLV1X.js";import{u as It,C as Bt}from"./use-organization-roles-CEdyJBDf.js";import{E as We}from"./empty-state-wZACnL2J.js";import{a as Kt,i as Vt,b as Qt,c as Ut,d as Gt,D as Jt}from"./dialog-CaTEiJVO.js";import{a as Ht,F as rt,b as ct,c as Wt,d as mt,e as dt}from"./form-BWIorvmY.js";import{d as et,b as tt,c as st,S as nt,a as it}from"./select-C0lOOEoK.js";import{T as Yt}from"./textarea-DUeOU9F3.js";import{u as lt}from"./use-org-auth-client-FC6WdH_x.js";import{b as Zt,S as Xt,a as es}from"./settings-section-Bk_k5SKB.js";import{a as ts,u as ss}from"./use-join-requests-CPgAASRp.js";import{A as De}from"./avatar-VLg8_8qy.js";import{u as ns}from"./use-members-CbHGf6Jg.js";import{u as Fe}from"./studio-tools-COOhA4uQ.js";import{a as is,b as as,c as ls,T as os}from"./tooltip-BBVKuVWA.js";import{a as ut,e as ft,g as ht,b as pt,c as gt,d as xt,A as bt,f as jt}from"./alert-dialog-DgcsfpwV.js";import{B as Ue}from"./badge-CXqt8LsO.js";import{C as vt}from"./card-c1tDYTHP.js";import{D as At,a as Pt,b as Mt,d as rs,e as cs,f as ms,c as at,g as ds}from"./dropdown-menu-oCs7Iiv2.js";import{a as Et}from"./DotsVertical-21OsfYko.js";import{i as us}from"./Key01-qC4LCntt.js";import{i as fs}from"./Shield01-Dwjpxvd-.js";import{b as hs}from"./SwitchHorizontal01-YTEahx81.js";import{s as ps}from"./Trash01-B5-ciNMB.js";import{s as _t}from"./XClose-ssDuFEQg.js";import{C as Ct}from"./checkbox-BZ4Cev3m.js";import{e as Ye,a as Ze,g as yt,C as gs,c as xs,d as bs,b as js}from"./command-hmVb9nzj.js";import{b as vs,P as Cs,a as ys}from"./popover-BSP7ejLc.js";import{t as Ss}from"./ChevronDown-Ep-T2bbc.js";import{s as ws}from"./Plus-CexM6aI0.js";import{R as Ns}from"./require-capability-CikSO1sK.js";import"./ChevronUp-BCrNzv-A.js";import"./view-mode-toggle-CoFBmpiz.js";import"./SearchMd-BT6OYA0s.js";import"./sidebar-g2qAal9U.js";import"./LayoutLeft-DiBhmi5f.js";import"./use-mobile-D49EcQdA.js";import"./sheet-DAwn9AHA.js";import"./X-BKm6Fw1t.js";import"./table-C_RjqUn4.js";import"./label-TS_o46fE.js";import"./ArrowUpRight-D62C8hBG.js";import"./use-capability-GDRaaPxs.js";import"./User01-4kOfLZMN.js";import"./ChevronRight-BB8PtdU_.js";import"./index-B83rPo9I.js";import"./access-gate-BkA2GKhf.js";import"./capability-load-error-BssWdjEJ.js";const Ts=$t().email("Invalid email address");function Is(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function As({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=he(),i=lt(),a=ke(),{data:r}=Dt.useSession(),o=r?.user?.email,{roles:g,isLoading:x}=It(),j=g.filter(m=>m.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),P=p.watch("role"),v=Is(b).filter(m=>{const c=Ts.safeParse(m).success,f=!o||m!==o.toLowerCase();return c&&f}),N=xe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await i.organization.inviteMember({email:w,role:c});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:c,role:f})=>{ue("member_invited",{count:c.length,role:f}),a.invalidateQueries({queryKey:ie.members(l)}),a.invalidateQueries({queryKey:ie.invitations(l)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{ue("member_invite_failed",{count:c.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!P;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Ht,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
2
  e.g. user1@example.com, user2@example.com
3
3
  or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(dt,{})]})}),s.jsx(rt,{control:p.control,name:"role",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(mt,{children:s.jsxs(et,{value:m.value,onValueChange:m.onChange,disabled:N.isPending||x,children:[s.jsx(tt,{className:"w-full",children:s.jsx(st,{placeholder:"Select a role"})}),s.jsx(nt,{children:j.map(c=>{const f=[];return c.isBuiltin||(c.allowsAllStaticPermissions?f.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&f.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?f.push("All connections"):c.connectionCount&&c.connectionCount>0&&f.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?f.push("all tools"):c.toolCount&&c.toolCount>0&&f.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(it,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&f.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:f.join(", ")})]})},c.role)})})]})}),s.jsx(dt,{})]})}),s.jsxs(Jt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(fe,{type:"submit",disabled:N.isPending||!$,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ps(){const t=J.c(9),e=ts(),{approve:n,deny:l}=ss();if(e.length===0)return null;let i;if(t[0]!==n||t[1]!==l||t[2]!==e){let r;t[4]!==n||t[5]!==l?(r=o=>s.jsx(Zt,{icon:s.jsx(De,{url:o.user?.image??void 0,fallback:(o.user?.name??o.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:o.user?.name??o.user?.email??o.userId,description:o.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>l.mutate(o.id),disabled:l.isPending||n.isPending,children:"Deny"}),s.jsx(fe,{size:"sm",onClick:()=>n.mutate(o.id),disabled:n.isPending||l.isPending,children:"Approve"})]})},o.id),t[4]=n,t[5]=l,t[6]=r):r=t[6],i=e.map(r),t[0]=n,t[1]=l,t[2]=e,t[3]=i}else i=t[3];let a;return t[7]!==i?(a=s.jsx(Xt,{title:"Join requests",description:"People who requested to join via a domain in approval mode.",children:s.jsx(es,{children:i})}),t[7]=i,t[8]=a):a=t[8],a}function Ms(){const t=J.c(7),{locator:e}=he(),n=Fe();let l;t[0]!==e?(l=ie.invitations(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i},t[4]=l,t[5]=i,t[6]=a):a=t[6],Ft(a)}function Es(){const t=J.c(10),{locator:e}=he(),n=lt(),l=ke();let i;t[0]!==n?(i=async x=>{const j=await n.organization.cancelInvitation({invitationId:x});if(j?.error)throw new Error(j.error.message);return j.data},t[0]=n,t[1]=i):i=t[1];let a;t[2]!==e||t[3]!==l?(a=()=>{l.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=a):a=t[4];let r;t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:_s},t[5]=i,t[6]=a,t[7]=r):r=t[7];const o=xe(r);let g;return t[8]!==o?(g={cancel:o},t[8]=o,t[9]=g):g=t[9],g}function _s(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}function Rs(){const t=J.c(7),{locator:e}=he(),n=Fe();let l;t[0]!==e?(l=ie.tags(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>{const{tags:r}=await n.call("TAGS_LIST",{});return r},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[4]=l,t[5]=i,t[6]=a):a=t[6],Tt(a)}function zs(){const t=J.c(8),e=ke(),{locator:n}=he(),l=Fe();let i;t[0]!==l?(i=async o=>{const{tag:g}=await l.call("TAGS_CREATE",{name:o});return g},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=()=>{e.invalidateQueries({queryKey:ie.tags(n)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let r;return t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:$s},t[5]=i,t[6]=a,t[7]=r):r=t[7],xe(r)}function $s(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Ds(t){const e=J.c(10),{locator:n}=he(),l=Fe();let i;e[0]!==n||e[1]!==t?(i=ie.memberTags(n,t),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==l?(a=async()=>{const{tags:g}=await l.call("MEMBER_TAGS_GET",{memberId:t});return g},e[3]=t,e[4]=l,e[5]=a):a=e[5];const r=!!t;let o;return e[6]!==i||e[7]!==a||e[8]!==r?(o={queryKey:i,queryFn:a,staleTime:3e4,enabled:r},e[6]=i,e[7]=a,e[8]=r,e[9]=o):o=e[9],Tt(o)}function ks(){const t=J.c(8),e=ke(),{locator:n}=he(),l=Fe();let i;t[0]!==l?(i=async o=>{const{memberId:g,tagIds:x}=o;return await l.call("MEMBER_TAGS_SET",{memberId:g,tagIds:x})},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=(o,g)=>{e.invalidateQueries({queryKey:ie.memberTags(n,g.memberId)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let r;return t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:Fs},t[5]=i,t[6]=a,t[7]=r):r=t[7],xe(r)}function Fs(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function Rt(t){const e=J.c(44),{memberId:n,className:l,disabled:i,placeholder:a,maxDisplay:r}=t,o=i===void 0?!1:i,g=a===void 0?"Add tags...":a,x=r===void 0?2:r,[j,p]=ce.useState(!1),[b,P]=ce.useState(""),{data:R,isLoading:v}=Rs(),N=R===void 0?[]:R,{data:y,isLoading:$}=Ds(n),m=y===void 0?[]:y,c=zs(),f=ks(),I=v||$,w=m.map(Ls);let A;e[0]!==b?(A=S=>S.name.toLowerCase().includes(b.toLowerCase()),e[0]=b,e[1]=A):A=e[1];const z=N.filter(A);let T;e[2]!==b?(T=S=>S.name.toLowerCase()===b.toLowerCase(),e[2]=b,e[3]=T):T=e[3];const K=N.find(T),M=b.trim()&&!K,k=async S=>{const ge=w.includes(S.id)?w.filter(ve=>ve!==S.id):[...w,S.id];await f.mutateAsync({memberId:n,tagIds:ge})},E=async()=>{if(!b.trim())return;const S=await c.mutateAsync(b.trim());await f.mutateAsync({memberId:n,tagIds:[...w,S.id]}),P("")},d=async S=>{const ne=w.filter(ge=>ge!==S);await f.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||f.isPending,L=Cs;let D;e[4]!==j?(D=()=>p(!j),e[4]=j,e[5]=D):D=e[5];let F;e[6]!==l?(F=$e("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=F):F=e[7];const V=o||I,O=I?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):m.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[m.slice(0,x).map(Os),m.length>x&&s.jsxs(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",m.length-x]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:g});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Ss,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let q;e[9]!==V||e[10]!==O||e[11]!==D||e[12]!==F?(q=s.jsx(ys,{asChild:!0,children:s.jsxs(fe,{variant:"ghost",size:"sm",onClick:D,className:F,disabled:V,children:[O,Q]})}),e[9]=V,e[10]=O,e[11]=D,e[12]=F,e[13]=q):q=e[13];const U=vs,H="w-56 p-0",W="start";let Y;e[14]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>p(!1),e[14]=Y):Y=e[14];const ae=bs,be=!1;let Z;e[15]!==b?(Z=s.jsx(js,{placeholder:"Search or create...",value:b,onValueChange:P,className:"h-9"}),e[15]=b,e[16]=Z):Z=e[16];const le=xs,me=m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:m.map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),d(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(_t,{size:14})})]})},S.id))}),s.jsx(yt,{})]}),Re=Ye,je="Available",ze=z.length===0&&!M&&s.jsx(gs,{children:"No tags found."}),pe=z.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==Re||e[18]!==ze||e[19]!==pe?(oe=s.jsxs(Re,{heading:je,children:[ze,pe]}),e[17]=Re,e[18]=ze,e[19]=pe,e[20]=oe):oe=e[20];let re;e[21]!==E||e[22]!==C||e[23]!==b||e[24]!==M?(re=M&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:E,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(ws,{size:14}),s.jsxs("span",{children:['Create "',b.trim(),'"']})]})})})]}),e[21]=E,e[22]=C,e[23]=b,e[24]=M,e[25]=re):re=e[25];let X;e[26]!==le||e[27]!==me||e[28]!==oe||e[29]!==re?(X=s.jsxs(le,{children:[me,oe,re]}),e[26]=le,e[27]=me,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==ae||e[32]!==Z||e[33]!==X?(ee=s.jsxs(ae,{shouldFilter:be,children:[Z,X]}),e[31]=ae,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==U||e[36]!==Y||e[37]!==ee?(te=s.jsx(U,{className:H,align:W,onEscapeKeyDown:Y,children:ee}),e[35]=U,e[36]=Y,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==L||e[40]!==j||e[41]!==q||e[42]!==te?(se=s.jsxs(L,{open:j,onOpenChange:p,children:[q,te]}),e[39]=L,e[40]=j,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function Os(t){return s.jsx(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Ls(t){return t.id}const St=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],qs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Bs(t){const e=new Map;for(const[n,l]of Object.entries(qs))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,St[n%St.length]??"bg-neutral-400")}return e}function Ks(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Ve(t){const e=J.c(79),{role:n,memberId:l,isOwner:i,roleColorMap:a,selectableRoles:r,onRoleChange:o,size:g,className:x}=t,j=g===void 0?"xs":g;let p,b,P,R,v,N,y,$,m,c,f;if(e[0]!==x||e[1]!==i||e[2]!==l||e[3]!==o||e[4]!==n||e[5]!==a||e[6]!==r||e[7]!==j){f=Symbol.for("react.early_return_sentinel");e:{const E=a.get(n)??"bg-neutral-400";if(i){let d;e[19]!==l||e[20]!==o?(d=H=>o(l,H),e[19]=l,e[20]=o,e[21]=d):d=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:$e("size-2 rounded-full shrink-0",E)}),C]});let D;e[24]!==L?(D=s.jsx(st,{children:L}),e[24]=L,e[25]=D):D=e[25];let F;e[26]!==x||e[27]!==j||e[28]!==D?(F=s.jsx(tt,{size:j,className:x,children:D}),e[26]=x,e[27]=j,e[28]=D,e[29]=F):F=e[29];let V;if(e[30]!==a||e[31]!==r){let H;e[33]!==a?(H=W=>{const Y=a.get(W.role)??"bg-neutral-400";return s.jsx(it,{value:W.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",Y)}),s.jsx("span",{className:"capitalize",children:W.label})]})},W.role)},e[33]=a,e[34]=H):H=e[34],V=r.map(H),e[30]=a,e[31]=r,e[32]=V}else V=e[32];let O;e[35]!==V?(O=s.jsx(nt,{children:V}),e[35]=V,e[36]=O):O=e[36];let Q;e[37]!==i||e[38]!==n||e[39]!==d||e[40]!==F||e[41]!==O?(Q=s.jsx(is,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(et,{value:n,onValueChange:d,disabled:i,children:[F,O]})})}),e[37]=i,e[38]=n,e[39]=d,e[40]=F,e[41]=O,e[42]=Q):Q=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(as,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let U;e[44]!==Q?(U=s.jsx(ls,{children:s.jsxs(os,{children:[Q,q]})}),e[44]=Q,e[45]=U):U=e[45],f=U;break e}P=et,$=n,e[46]!==l||e[47]!==o?(m=d=>o(l,d),e[46]=l,e[47]=o,e[48]=m):m=e[48],c=i,b=tt,N=j,y=x,p=st,v="flex items-center gap-2 min-w-0",R=$e("size-2 rounded-full shrink-0",E)}e[0]=x,e[1]=i,e[2]=l,e[3]=o,e[4]=n,e[5]=a,e[6]=r,e[7]=j,e[8]=p,e[9]=b,e[10]=P,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=$,e[16]=m,e[17]=c,e[18]=f}else p=e[8],b=e[9],P=e[10],R=e[11],v=e[12],N=e[13],y=e[14],$=e[15],m=e[16],c=e[17],f=e[18];if(f!==Symbol.for("react.early_return_sentinel"))return f;let I;e[49]!==R?(I=s.jsx("div",{className:R}),e[49]=R,e[50]=I):I=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let A;e[53]!==I||e[54]!==w||e[55]!==v?(A=s.jsxs("div",{className:v,children:[I,w]}),e[53]=I,e[54]=w,e[55]=v,e[56]=A):A=e[56];let z;e[57]!==p||e[58]!==A?(z=s.jsx(p,{children:A}),e[57]=p,e[58]=A,e[59]=z):z=e[59];let T;e[60]!==b||e[61]!==z||e[62]!==N||e[63]!==y?(T=s.jsx(b,{size:N,className:y,children:z}),e[60]=b,e[61]=z,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==a||e[66]!==r){let E;e[68]!==a?(E=d=>{const C=a.get(d.role)??"bg-neutral-400";return s.jsx(it,{value:d.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:d.label})]})},d.role)},e[68]=a,e[69]=E):E=e[69],K=r.map(E),e[65]=a,e[66]=r,e[67]=K}else K=e[67];let M;e[70]!==K?(M=s.jsx(nt,{children:K}),e[70]=K,e[71]=M):M=e[71];let k;return e[72]!==P||e[73]!==T||e[74]!==M||e[75]!==$||e[76]!==m||e[77]!==c?(k=s.jsxs(P,{value:$,onValueChange:m,disabled:c,children:[T,M]}),e[72]=P,e[73]=T,e[74]=M,e[75]=$,e[76]=m,e[77]=c,e[78]=k):k=e[78],k}function wt(t){const e=J.c(51),{member:n,roles:l,onChangeRole:i,onRemove:a,isUpdating:r}=t,o=r===void 0?!1:r,g=n.role==="owner";let x,j,p,b,P,R,v,N,y;if(e[0]!==g||e[1]!==o||e[2]!==n.id||e[3]!==n.role||e[4]!==i||e[5]!==l){let T;e[15]!==n.role?(T=d=>d.role!==n.role&&d.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=l.filter(T);b=At;let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Et,{size:20}),e[17]=M):M=e[17],e[18]!==g?(y=s.jsx(Pt,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:g,onClick:Qs,children:M})}),e[18]=g,e[19]=y):y=e[19],p=Mt,v="end",N=Vs,j=rs;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(hs,{size:16}),e[20]=k):k=e[20],e[21]!==o?(R=s.jsxs(cs,{disabled:o,children:[k,"Change Role"]}),e[21]=o,e[22]=R):R=e[22],x=ms;let E;e[23]!==o||e[24]!==n.id||e[25]!==i?(E=d=>{const C=[];return d.isBuiltin||(d.allowsAllStaticPermissions?C.push("Full org access"):d.staticPermissionCount&&d.staticPermissionCount>0&&C.push(`${d.staticPermissionCount} org perm${d.staticPermissionCount!==1?"s":""}`),d.allowsAllConnections?C.push("All connections"):d.connectionCount&&d.connectionCount>0&&C.push(`${d.connectionCount} connection${d.connectionCount!==1?"s":""}`),(d.connectionCount!==0||d.allowsAllConnections)&&(d.allowsAllTools?C.push("all tools"):d.toolCount&&d.toolCount>0&&C.push(`${d.toolCount} tool${d.toolCount!==1?"s":""}`))),s.jsxs(at,{onClick:L=>{L.stopPropagation(),i(n.id,d.role)},disabled:o,children:[d.isBuiltin?s.jsx(fs,{size:16}):s.jsx(us,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:d.label}),!d.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},d.role)},e[23]=o,e[24]=n.id,e[25]=i,e[26]=E):E=e[26],P=K.map(E),e[0]=g,e[1]=o,e[2]=n.id,e[3]=n.role,e[4]=i,e[5]=l,e[6]=x,e[7]=j,e[8]=p,e[9]=b,e[10]=P,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else x=e[6],j=e[7],p=e[8],b=e[9],P=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let $;e[27]!==x||e[28]!==P?($=s.jsx(x,{children:P}),e[27]=x,e[28]=P,e[29]=$):$=e[29];let m;e[30]!==j||e[31]!==R||e[32]!==$?(m=s.jsxs(j,{children:[R,$]}),e[30]=j,e[31]=R,e[32]=$,e[33]=m):m=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ds,{}),e[34]=c):c=e[34];let f;e[35]!==n.id||e[36]!==a?(f=T=>{T.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=f):f=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ps,{size:16}),e[38]=I):I=e[38];let w;e[39]!==f?(w=s.jsxs(at,{variant:"destructive",onClick:f,children:[I,"Remove Member"]}),e[39]=f,e[40]=w):w=e[40];let A;e[41]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==m?(A=s.jsxs(p,{align:v,onClick:N,children:[m,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=m,e[46]=A):A=e[46];let z;return e[47]!==b||e[48]!==A||e[49]!==y?(z=s.jsxs(b,{children:[y,A]}),e[47]=b,e[48]=A,e[49]=y,e[50]=z):z=e[50],z}function Vs(t){return t.stopPropagation()}function Qs(t){return t.stopPropagation()}function Nt(t){const e=J.c(8),{invitationId:n,onCancel:l,isCancelling:i}=t,a=i===void 0?!1:i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Pt,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Gs,children:s.jsx(Et,{size:20})})}),e[0]=r):r=e[0];let o;e[1]!==n||e[2]!==l?(o=j=>{j.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=o):o=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(_t,{size:16}),e[4]=g):g=e[4];let x;return e[5]!==a||e[6]!==o?(x=s.jsxs(At,{children:[r,s.jsx(Mt,{align:"end",onClick:Us,children:s.jsxs(at,{variant:"destructive",onClick:o,disabled:a,children:[g,"Cancel Invitation"]})})]}),e[5]=a,e[6]=o,e[7]=x):x=e[7],x}function Us(t){return t.stopPropagation()}function Gs(t){return t.stopPropagation()}function Js(){const t=J.c(103),{data:e}=ns(),{data:n}=Ms(),l=Es(),i=ke(),{locator:a}=he(),r=lt(),[o,g]=ce.useState(null),[x,j]=ce.useState(null),[p,b]=ce.useState(""),[P,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,$]=ce.useState("asc"),m=e?.data?.members;let c;t[0]!==v?(c=u=>{v===u?$(ln):(N(u),$("asc"))},t[0]=v,t[1]=c):c=t[1];const f=c;let I=m??[],w=n??[];if(p){const u=p.toLowerCase();I=I.filter(h=>h.user?.name?.toLowerCase().includes(u)||h.user?.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u)),w=w.filter(h=>h.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u))}if(v&&y){let u;t[2]!==y||t[3]!==v?(u=(h,_)=>{let B,de;e:switch(v){case"member":{B=h.user?.name||"",de=_.user?.name||"";break e}case"role":{B=h.role||"",de=_.role||"";break e}case"joined":{B=h.createdAt?typeof h.createdAt=="string"?h.createdAt:h.createdAt.toISOString():"",de=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=y,t[3]=v,t[4]=u):u=t[4],I=[...I].sort(u)}const A=I;let z;t[5]!==r?(z=async u=>{const h=await r.organization.removeMember({memberIdOrEmail:u});if(h?.error)throw new Error(h.error.message)},t[5]=r,t[6]=z):z=t[6];let T;t[7]!==a||t[8]!==i?(T=()=>{ue("member_removed"),i.invalidateQueries({queryKey:ie.members(a)}),G.success("Member has been removed from the organization"),g(null)},t[7]=a,t[8]=i,t[9]=T):T=t[9];let K;t[10]!==z||t[11]!==T?(K={mutationFn:z,onSuccess:T,onError:an},t[10]=z,t[11]=T,t[12]=K):K=t[12];const M=xe(K);let k;t[13]!==r?(k=async u=>{const{memberId:h,role:_}=u,B=await r.organization.updateMemberRole({memberId:h,role:[_]});if(B?.error)throw new Error(B.error.message)},t[13]=r,t[14]=k):k=t[14];let E;t[15]!==a||t[16]!==i?(E=(u,h)=>{ue("member_role_updated",{new_role:h.role}),i.invalidateQueries({queryKey:ie.members(a)}),G.success("Member's role has been updated")},t[15]=a,t[16]=i,t[17]=E):E=t[17];let d;t[18]!==k||t[19]!==E?(d={mutationFn:k,onSuccess:E,onError:nn},t[18]=k,t[19]=E,t[20]=d):d=t[20];const C=xe(d);let L;t[21]!==r?(L=async u=>{const{invitationId:h,role:_,email:B}=u,de=await r.organization.cancelInvitation({invitationId:h});if(de?.error)throw new Error(de.error.message);const ot=await r.organization.inviteMember({email:B,role:_});if(ot?.error)throw new Error(ot.error.message)},t[21]=r,t[22]=L):L=t[22];let D;t[23]!==a||t[24]!==i?(D=(u,h)=>{ue("invitation_role_updated",{new_role:h.role}),i.invalidateQueries({queryKey:ie.invitations(a)}),G.success("Invitation role has been updated")},t[23]=a,t[24]=i,t[25]=D):D=t[25];let F;t[26]!==L||t[27]!==D?(F={mutationFn:L,onSuccess:D,onError:sn},t[26]=L,t[27]=D,t[28]=F):F=t[28];const V=xe(F),{roles:O,customRoles:Q}=It();let q;t[29]!==Q?(q=Bs(Q),t[29]=Q,t[30]=q):q=t[30];const U=q;let H;t[31]!==O?(H=O.filter(tn),t[31]=O,t[32]=H):H=t[32];const W=H;let Y;t[33]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"member",header:"Member",render:en,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=Y):Y=t[33];let ae;t[34]!==U||t[35]!==W||t[36]!==V||t[37]!==C?(ae={id:"role",header:"Role",render:u=>u.type==="member"?s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:u.data.role==="owner",roleColorMap:U,selectableRoles:W,onRoleChange:(h,_)=>C.mutate({memberId:h,role:_}),className:"w-36"}):s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:W,onRoleChange:(h,_)=>V.mutate({invitationId:h,role:_,email:u.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=U,t[35]=W,t[36]=V,t[37]=C,t[38]=ae):ae=t[38];let be,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(be={id:"tags",header:"Tags",render:Xs,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Zs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=be,t[40]=Z):(be=t[39],Z=t[40]);let le;t[41]!==l.cancel.isPending||t[42]!==O||t[43]!==C?(le={id:"actions",header:"",render:u=>u.type==="member"?s.jsx(wt,{member:u.data,roles:O,onChangeRole:(h,_)=>C.mutate({memberId:h,role:_}),onRemove:g,isUpdating:C.isPending}):s.jsx(Nt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=O,t[43]=C,t[44]=le):le=t[44];let me;t[45]!==ae||t[46]!==le?(me=[Y,ae,be,Z,le],t[45]=ae,t[46]=le,t[47]=me):me=t[47];const Re=me;let je;t[48]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(As,{trigger:s.jsx(fe,{children:"Invite Member"})})}),t[48]=je):je=t[48];const ze=je,pe=[...A.map(Ys),...w.filter(Ws).map(Hs)],oe=_e,re=!!x;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>j(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(pt,{children:[s.jsx(gt,{children:"Cancel Invitation"}),s.jsx(xt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(bt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==l.cancel||t[53]!==x?(se=()=>{x&&(l.cancel.mutate(x),j(null))},t[52]=l.cancel,t[53]=x,t[54]=se):se=t[54];let S;t[55]!==l.cancel.isPending||t[56]!==se?(S=s.jsxs(ut,{children:[ee,s.jsxs(ft,{children:[te,s.jsx(ht,{onClick:se,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(jt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const ge=!!o;let ve;t[61]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>g(null),t[61]=ve):ve=t[61];let Oe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsxs(pt,{children:[s.jsx(gt,{children:"Remove Member"}),s.jsx(xt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Oe):Oe=t[62];let Le;t[63]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(bt,{children:"Cancel"}),t[63]=Le):Le=t[63];let Ce;t[64]!==o||t[65]!==M?(Ce=()=>o&&M.mutate(o),t[64]=o,t[65]=M,t[66]=Ce):Ce=t[66];let ye;t[67]!==M.isPending||t[68]!==Ce?(ye=s.jsxs(ut,{children:[Oe,s.jsxs(ft,{children:[Le,s.jsx(ht,{onClick:Ce,disabled:M.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=M.isPending,t[68]=Ce,t[69]=ye):ye=t[69];let Se;t[70]!==ge||t[71]!==ye?(Se=s.jsx(jt,{open:ge,onOpenChange:ve,children:ye}),t[70]=ge,t[71]=ye,t[72]=Se):Se=t[72];const Ge=_e,Je=_e,zt="flex flex-col gap-6";let we,Ne;t[73]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Ps,{}),Ne=s.jsx(_e.Title,{children:"Members"}),t[73]=we,t[74]=Ne):(we=t[73],Ne=t[74]);let qe;t[75]===Symbol.for("react.memo_cache_sentinel")?(qe=u=>{u.key==="Escape"&&(b(""),u.target.blur())},t[75]=qe):qe=t[75];let Te;t[76]!==p?(Te=s.jsx(qt,{value:p,onChange:b,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:qe}),t[76]=p,t[77]=Te):Te=t[77];let Be;t[78]===Symbol.for("react.memo_cache_sentinel")?(Be=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[78]=Be):Be=t[78];let Ie;t[79]!==f||t[80]!==y||t[81]!==v||t[82]!==P?(Ie=s.jsx(Lt,{viewMode:P,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:f,sortOptions:Be}),t[79]=f,t[80]=y,t[81]=v,t[82]=P,t[83]=Ie):Ie=t[83];let Ae;t[84]!==Te||t[85]!==Ie?(Ae=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Te,Ie]}),ze]}),t[84]=Te,t[85]=Ie,t[86]=Ae):Ae=t[86];const He=P==="cards"?s.jsx("div",{children:pe.length===0?s.jsx(We,{title:"No members found",description:p?`No members match "${p}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:pe.map(u=>{if(u.type==="invitation")return s.jsxs(vt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Nt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{fallback:Qe(u.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:u.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ue,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:W,onRoleChange:(_,B)=>V.mutate({invitationId:_,role:B,email:u.data.email}),className:"w-fit"})]})]})]},`inv-${u.data.id}`);const h=u.data;return s.jsxs(vt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{member:h,roles:O,onChangeRole:(_,B)=>C.mutate({memberId:_,role:B}),onRemove:g,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{url:h.user?.image??void 0,fallback:Qe(h.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:h.user?.email}),s.jsx(Ve,{role:h.role,memberId:h.id,isOwner:h.role==="owner",roleColorMap:U,selectableRoles:W,onRoleChange:(_,B)=>C.mutate({memberId:_,role:B}),className:"w-fit"}),s.jsx(Rt,{memberId:h.id,maxDisplay:3})]})]})]},h.id)})})}):s.jsx(Bt,{columns:Re,data:pe,isLoading:!1,sortKey:v,sortDirection:y,onSort:f,emptyState:p?s.jsx(We,{title:"No members found",description:`No members match "${p}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let Pe;t[87]!==we||t[88]!==Ne||t[89]!==Ae||t[90]!==He?(Pe=s.jsxs("div",{className:zt,children:[we,Ne,Ae,He]}),t[87]=we,t[88]=Ne,t[89]=Ae,t[90]=He,t[91]=Pe):Pe=t[91];let Me;t[92]!==Je.Body||t[93]!==Pe?(Me=s.jsx(Je.Body,{children:Pe}),t[92]=Je.Body,t[93]=Pe,t[94]=Me):Me=t[94];let Ee;t[95]!==Ge.Content||t[96]!==Me?(Ee=s.jsx(Ge.Content,{children:Me}),t[95]=Ge.Content,t[96]=Me,t[97]=Ee):Ee=t[97];let Ke;return t[98]!==oe||t[99]!==ne||t[100]!==Se||t[101]!==Ee?(Ke=s.jsxs(oe,{children:[ne,Se,Ee]}),t[98]=oe,t[99]=ne,t[100]=Se,t[101]=Ee,t[102]=Ke):Ke=t[102],Ke}function Hs(t){return{type:"invitation",data:t}}function Ws(t){return t.status==="pending"}function Ys(t){return{type:"member",data:t}}function Zs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ks(t.data.createdAt):"N/A"}):s.jsx(Ue,{variant:"outline",children:"Pending"})}function Xs(t){return t.type==="member"?s.jsx(Rt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function en(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{url:t.data.user?.image??void 0,fallback:Qe(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{fallback:Qe(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function tn(t){return t.role!=="owner"}function sn(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function nn(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function an(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function ln(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function on(){const t=J.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(_e,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ot,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(_e,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Js,{})})}),t[1]=n):n=t[1],n}function ii(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ns,{capability:"members:manage",area:"members",children:s.jsx(on,{})}),t[0]=e):e=t[0],e}export{ii as default};
@@ -1,4 +1,4 @@
1
- import{c as L,j as f,r as p,am as O}from"./index-BhM87K40.js";import{l as I,F as $}from"./index-D26xsVrw.js";import{S as N}from"./chat-context-CMdxOOBP.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{c as L,j as f,r as p,am as O}from"./index-DLQ4JwZN.js";import{l as I,F as $}from"./index-6BQORbvL.js";import{S as N}from"./chat-context-DAyh5sec.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object