decocms 4.574.5 → 4.574.7

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 (398) hide show
  1. package/dist/client/assets/{AlertCircle-Dhxv_VvX.js → AlertCircle-r3-65QGa.js} +1 -1
  2. package/dist/client/assets/{AreaChart-p06QdUOH.js → AreaChart-C5PjXsTV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DPiUStmH.js → ArrowLeft-D6scOXD-.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-C5MIVxlv.js → ArrowUp-Cn2kMl0m.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-CR71csgM.js → CartesianChart-B1oaYNTr.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-C7-Bo6NS.js → CategoricalChart-DzzGNLUP.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DQiPh0bs.js → CheckCircle-Uj5wL5gk.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-C_LOUUD2.js → ChevronSelectorVertical-zTQaeZAI.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BusAGBPt.js → ChevronUp-BjA2VknT.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-B86ybMWX.js → CreditCard01-BvXb2Lni.js} +1 -1
  11. package/dist/client/assets/{Globe04-BgmGeS07.js → Globe04-CoUsMEms.js} +1 -1
  12. package/dist/client/assets/{Key01-bRc0D6iU.js → Key01-Cwya0Bqg.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-CExBuGlw.js → LinkBroken01-BsflEjnj.js} +1 -1
  14. package/dist/client/assets/{Minus-BuxaQmfP.js → Minus-B714ZjWA.js} +1 -1
  15. package/dist/client/assets/{Monitor01-CWmH5Gyz.js → Monitor01-Cuwl6kJ_.js} +1 -1
  16. package/dist/client/assets/{Play-xrfH4Yz5.js → Play-BwysvS-E.js} +1 -1
  17. package/dist/client/assets/{Plus-BRIZEm-m.js → Plus-Dhutz31g.js} +1 -1
  18. package/dist/client/assets/ReferenceLine-TBQQ-iJC.js +1 -0
  19. package/dist/client/assets/{SearchMd-CHeeKxSQ.js → SearchMd-DYX8MZiO.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-CpRghVvA.js → ShoppingBag01-gbNNAeM0.js} +1 -1
  21. package/dist/client/assets/{Sun-fB3zW2OU.js → Sun-BQnmg69t.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-DIK7cKae.js → SwitchHorizontal01-xcLba1bf.js} +1 -1
  23. package/dist/client/assets/{Tool01-Bw_Gs9HT.js → Tool01-CBLhcG71.js} +1 -1
  24. package/dist/client/assets/{Tooltip-XKGOcBmc.js → Tooltip-B0F_Vcsg.js} +1 -1
  25. package/dist/client/assets/{Trash01-BIlzZ3AH.js → Trash01-BTmzVQk_.js} +1 -1
  26. package/dist/client/assets/{Upload01-DuNH7edt.js → Upload01-Cl2zCfWN.js} +1 -1
  27. package/dist/client/assets/{UserSquare-BV7Jqoa-.js → UserSquare-DGUSiZ1P.js} +1 -1
  28. package/dist/client/assets/{Users01-Cy9FwTEl.js → Users01-DZO5qwDg.js} +1 -1
  29. package/dist/client/assets/{XClose-DeJhJbxg.js → XClose-G4YrC3Pn.js} +1 -1
  30. package/dist/client/assets/{Zap-Bp1s63-N.js → Zap-vn2maseg.js} +1 -1
  31. package/dist/client/assets/{access-gate-BO57Fy6P.js → access-gate-DIjds3ci.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-BC7Osx_R.js → add-connection-dialog-COyMgVte.js} +1 -1
  33. package/dist/client/assets/agent-app-D5QgsYqc.js +1 -0
  34. package/dist/client/assets/{agent-assets-BUrt3dPh.js → agent-assets-fNqBCKHt.js} +1 -1
  35. package/dist/client/assets/{agent-automation-BNwHO-72.js → agent-automation-VkyKtW9U.js} +1 -1
  36. package/dist/client/assets/{agent-automations-BAX6zuIx.js → agent-automations-CVJfPHfF.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-vVzb3Jt5.js → agent-calendar-Bo7r9Vky.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-CpYu5jEI.js → agent-capabilities-BYI80-yc.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-BuHIOYH8.js → agent-connect-sources-B1ogKhmB.js} +1 -1
  40. package/dist/client/assets/agent-deck-DFSjszrf.js +1 -0
  41. package/dist/client/assets/{agent-e2e-HxqodN3d.js → agent-e2e-iOKW7dHH.js} +1 -1
  42. package/dist/client/assets/agent-experiments-I73pTJTd.js +1 -0
  43. package/dist/client/assets/{agent-file-9keGK7G7.js → agent-file-VFhRgETL.js} +1 -1
  44. package/dist/client/assets/{agent-hosting-Ba3TD5BK.js → agent-hosting-F7wnXc5D.js} +1 -1
  45. package/dist/client/assets/{agent-icon-DbfcsXV4.js → agent-icon-Bd5DjuVH.js} +1 -1
  46. package/dist/client/assets/agent-library-DWh6KRhL.js +1 -0
  47. package/dist/client/assets/agent-library-file-lCIRTUSD.js +1 -0
  48. package/dist/client/assets/agent-overview-Cz7UwSDQ.js +1 -0
  49. package/dist/client/assets/{agent-releases-DUbgEATu.js → agent-releases-JjIyhQ8o.js} +2 -2
  50. package/dist/client/assets/agent-settings-i843C-TL.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-uQzxcM8C.js → agent-site-editor-DyvD6coP.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-D-9tyAcE.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-DZG2siue.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-B1i0x30d.js +1 -0
  55. package/dist/client/assets/agent-view-BM-3dQi3.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-W_TpFLj2.js → agent-view-guard-L6gyipxF.js} +1 -1
  57. package/dist/client/assets/{ai-providers-BHXvN3lN.js → ai-providers-DuSrjEsM.js} +1 -1
  58. package/dist/client/assets/{alert-DBbkuMuk.js → alert-DKmdEqFw.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-B3bcjZGS.js → analytics-sections-BwF8iocD.js} +1 -1
  60. package/dist/client/assets/{api-keys-BxiY8kcp.js → api-keys-BGBs72Hh.js} +1 -1
  61. package/dist/client/assets/api-keys-Dm40J7UN.js +1 -0
  62. package/dist/client/assets/{app-editor-r0R62IBH.js → app-editor-DEKiUudf.js} +1 -1
  63. package/dist/client/assets/{asset-utils-MeaeLnLx.js → asset-utils-Bn1iB4IB.js} +1 -1
  64. package/dist/client/assets/{auth-eHRARwQ2.js → auth-B9FRbbSg.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-BT8BEBDX.js → auth-catchall-Cfn19MlN.js} +1 -1
  66. package/dist/client/assets/{auth-entry-z3QPpDZU.js → auth-entry-DarDiRFD.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-DfToASYD.js → auth-split-layout-NuyNrtc1.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-CjW_HJT8.js → authenticate-and-persist-oauth-DbBE_3KO.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-DDqzJ6yN.js → automation-list-row-DhNblfKh.js} +1 -1
  70. package/dist/client/assets/{automation-runs-Ck7meZnh.js → automation-runs-CM_NVYxO.js} +1 -1
  71. package/dist/client/assets/{automations-Bl1cCncB.js → automations-DRiO_jED.js} +1 -1
  72. package/dist/client/assets/{autosend-YTrROtL8.js → autosend-BQzY1y5n.js} +1 -1
  73. package/dist/client/assets/{badge-BLj5oaM_.js → badge-D17_WC-Q.js} +1 -1
  74. package/dist/client/assets/{block-document-BISqnz_T.js → block-document-BLA0kAXd.js} +1 -1
  75. package/dist/client/assets/{blocks-preview-workspace-context-BtXgnaQN.js → blocks-preview-workspace-context-BGXxGGI-.js} +1 -1
  76. package/dist/client/assets/blocks-tab-states-5fAC-Jvu.js +1 -0
  77. package/dist/client/assets/{blog-schema-DD6KWf6e.js → blog-schema-D1br3hZ9.js} +1 -1
  78. package/dist/client/assets/{buckets-BQqb0o4o.js → buckets-Bnooosbl.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-80nYNz4Z.js → build-improve-prompt-doc-U_S4OhQh.js} +1 -1
  80. package/dist/client/assets/{calendar-BI3ebszn.js → calendar-BBjKT4Y4.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-D_eJcYHf.js → capability-load-error-B5mCDF3r.js} +1 -1
  82. package/dist/client/assets/{category-editor-I5YxNQQ5.js → category-editor-Bj6oJb66.js} +1 -1
  83. package/dist/client/assets/chart-DHbQOnD2.js +13 -0
  84. package/dist/client/assets/{chat-context-DrqBnMGV.js → chat-context-D__edm74.js} +1 -1
  85. package/dist/client/assets/{chat-draft-DSgKm45E.js → chat-draft-DOwDIvwR.js} +1 -1
  86. package/dist/client/assets/{checkbox-CfVXlX4u.js → checkbox-Xa1XT9y9.js} +1 -1
  87. package/dist/client/assets/{choose-editor-D3_bqd8J.js → choose-editor-BZDc27QM.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-CCk5-b6l.js → cli-auth-success-DcNBgMWE.js} +1 -1
  89. package/dist/client/assets/{client-icons-DE5s9EhF.js → client-icons-Baga43Je.js} +1 -1
  90. package/dist/client/assets/{cms-settings-editor-DUGWgHGi.js → cms-settings-editor-DwsfGfxl.js} +1 -1
  91. package/dist/client/assets/cms-store-drafts-DO3GS-BC.js +1 -0
  92. package/dist/client/assets/{collapsible-DCKPxsPs.js → collapsible--DSKOo3p.js} +1 -1
  93. package/dist/client/assets/{collection-detail-99jcqq1O.js → collection-detail-l5EAxPj8.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-DJquIZj0.js → collection-display-button-CAXaH0_X.js} +1 -1
  95. package/dist/client/assets/{collection-search-CcswFoQz.js → collection-search-iWjyQyoE.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-u0Q_f-Jr.js → collection-table-wrapper-DULM5aVC.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-B6DksJOI.js → collection-tabs-D5bCrQWd.js} +1 -1
  98. package/dist/client/assets/{combobox-f-1LbAQg.js → combobox-BojjAtvD.js} +1 -1
  99. package/dist/client/assets/{command-B13rzls6.js → command-Dz2oRnZb.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-Dhc8wIjl.js → companion-mcps-section-C9oCfjV-.js} +1 -1
  101. package/dist/client/assets/{config-CODdLsbj.js → config-Bx8A1535.js} +1 -1
  102. package/dist/client/assets/{connect-nqV0IwGn.js → connect--gHxmjfk.js} +3 -3
  103. package/dist/client/assets/{connect-layout-CV6GZLu5.js → connect-layout-nODaAO4K.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-CGrEF7EH.js → connect-source-dialog-D4ezswW7.js} +1 -1
  105. package/dist/client/assets/{connection-CpcxYbw-.js → connection-C6vq1sCN.js} +1 -1
  106. package/dist/client/assets/{connection-card-DbTrHYwh.js → connection-card-DByKtq4T.js} +1 -1
  107. package/dist/client/assets/{connection-detail-BXwTjfTg.js → connection-detail-BYMgTrKV.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-BFeW48f1.js → connection-form-helpers-BovE5YOR.js} +1 -1
  109. package/dist/client/assets/{connection-slug-BlCRUE5Z.js → connection-slug-DNLnZOJk.js} +1 -1
  110. package/dist/client/assets/{connections-C3cZP6N-.js → connections-B6YR0-M-.js} +1 -1
  111. package/dist/client/assets/{content-tab-BZA7n8sL.js → content-tab-DKxUFS3M.js} +3 -3
  112. package/dist/client/assets/{context-EiAaoy2D.js → context-VrbAdDEo.js} +1 -1
  113. package/dist/client/assets/{context-menu-CoBBaT-n.js → context-menu-BERaowmZ.js} +1 -1
  114. package/dist/client/assets/{context-shell-DYEfNRo8.js → context-shell-Cz6NPjEK.js} +3 -3
  115. package/dist/client/assets/{core.esm-CZ_suStd.js → core.esm-zdyJobf2.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-CsKJ38nv.js → create-organization-dialog-DKVN237m.js} +1 -1
  117. package/dist/client/assets/{device-hint-DlZdZHNJ.js → device-hint-BDdfDIcL.js} +1 -1
  118. package/dist/client/assets/{discover-V8VmtY63.js → discover-DTSj3AvJ.js} +1 -1
  119. package/dist/client/assets/{domain-settings-CqMNMzW1.js → domain-settings-BSfIsMFs.js} +1 -1
  120. package/dist/client/assets/{drawer-Cgf4oN4m.js → drawer-BqEmUb4n.js} +1 -1
  121. package/dist/client/assets/{editor-Bl3rIcVI.js → editor-4N5Zqxy_.js} +1 -1
  122. package/dist/client/assets/{editor-classes-D2R7rw-c.js → editor-classes-Dg5BrFCM.js} +1 -1
  123. package/dist/client/assets/{empty-state-aXWI3-Mm.js → empty-state-DB3KUDYc.js} +1 -1
  124. package/dist/client/assets/{empty-state-D5-IJmKF.js → empty-state-DzKImAtb.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-CcWoxHNu.js → experiments-tab-choice-DJfA9UFl.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-D7JZIpe1.js → extract-connection-data-Ba81Qqm1.js} +1 -1
  127. package/dist/client/assets/{feature-gate-BB1BinIq.js → feature-gate-CUU0Fv0y.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-DadXALbq.js → feature-paywall--88Nne2L.js} +1 -1
  129. package/dist/client/assets/{file-explorer-Dl028uja.js → file-explorer-DoNlypVE.js} +1 -1
  130. package/dist/client/assets/{file-preview-4Tbf_ub4.js → file-preview-D77KJkpr.js} +1 -1
  131. package/dist/client/assets/{file-share-button-DjQHOi0O.js → file-share-button-Bl7t6a9g.js} +1 -1
  132. package/dist/client/assets/{file-type-icon-Bdzds_J6.js → file-type-icon-B8ydIjHI.js} +1 -1
  133. package/dist/client/assets/{folder-icon-JFUPr6Oa.js → folder-icon-CwFmdi5D.js} +1 -1
  134. package/dist/client/assets/{form-BYhtZm8M.js → form-BXj3YBhn.js} +1 -1
  135. package/dist/client/assets/{general-DbKg9blt.js → general-Rkm9HtwH.js} +1 -1
  136. package/dist/client/assets/{github-icon-iZdKbq4s.js → github-icon-BIb5Vfpr.js} +1 -1
  137. package/dist/client/assets/{home-DVdXJNEh.js → home-B8En4Jxp.js} +1 -1
  138. package/dist/client/assets/{home-overview-8NqH5SXV.js → home-overview-uLEZMT8T.js} +1 -1
  139. package/dist/client/assets/{hosted-reconcile-DBUQw0wz.js → hosted-reconcile-v19CihgF.js} +1 -1
  140. package/dist/client/assets/{icon-button-Bkz9RDzV.js → icon-button-zoxb5UGy.js} +1 -1
  141. package/dist/client/assets/{index-BV2_mRhH.js → index-7_HMIPHJ.js} +1 -1
  142. package/dist/client/assets/{index-DVzGX6Yk.js → index-B3ZR6FKh.js} +1 -1
  143. package/dist/client/assets/{index-D2JCiu4r.js → index-BPLzAbmE.js} +1 -1
  144. package/dist/client/assets/{index-DENYSVWJ.js → index-C5zKB8Ws.js} +1 -1
  145. package/dist/client/assets/{index-CBKPLOSd.js → index-CX-DNJFH.js} +1 -1
  146. package/dist/client/assets/{index-DV7H7fST.js → index-CbmJOLRb.js} +1 -1
  147. package/dist/client/assets/{index-CorYIdad.js → index-D-pfNS-S.js} +1 -1
  148. package/dist/client/assets/{index-DatF-lrE.js → index-DG86sSdc.js} +1 -1
  149. package/dist/client/assets/{index-cvR6uZtJ.js → index-DHdn4GVF.js} +1 -1
  150. package/dist/client/assets/{index-I6t84B1M.js → index-DJiYOFZT.js} +1 -1
  151. package/dist/client/assets/{index-BYLma6nR.js → index-DLrFWx5Y.js} +39 -39
  152. package/dist/client/assets/{index-BiJyBzx-.js → index-DlGI6s_b.js} +1 -1
  153. package/dist/client/assets/{index-DXd61UF-.js → index-M2AI6x1u.js} +1 -1
  154. package/dist/client/assets/{index-DNAVFVoL.js → index-_tlLxqQr.js} +1 -1
  155. package/dist/client/assets/{index-CyB8FMpF.js → index-rSGOnG16.js} +1 -1
  156. package/dist/client/assets/{index-redirect-2Xzyc9Yp.js → index-redirect-DJgUOEFg.js} +1 -1
  157. package/dist/client/assets/{index-jDgMG-M0.js → index-uzZt69XO.js} +1 -1
  158. package/dist/client/assets/{infiniteQueryObserver-deqizdYY.js → infiniteQueryObserver-CxT8wQIc.js} +1 -1
  159. package/dist/client/assets/{infra-billing-tyxMYA7K.js → infra-billing-B-yG5gsq.js} +1 -1
  160. package/dist/client/assets/{input-CZkeDxU4.js → input-9_e3fHfS.js} +1 -1
  161. package/dist/client/assets/{input-ZtRkRndM.js → input-f_GWmlkU.js} +4 -4
  162. package/dist/client/assets/{integration-icon-CknO8J8O.js → integration-icon-Chtj05eK.js} +1 -1
  163. package/dist/client/assets/{jira-icon-MwO2xsZ2.js → jira-icon-BeOKkf6M.js} +1 -1
  164. package/dist/client/assets/{label-CjHEjKyC.js → label-DzXAppDM.js} +1 -1
  165. package/dist/client/assets/{layout-BPQjilkO.js → layout-D4jG7v-0.js} +1 -1
  166. package/dist/client/assets/{legacy-admin-welcome-dialog-CCJK6F5I.js → legacy-admin-welcome-dialog-BKs0Fyaf.js} +1 -1
  167. package/dist/client/assets/{legacy-agents-deep-CJaEmbG0.js → legacy-agents-deep-eH17kCQv.js} +1 -1
  168. package/dist/client/assets/{legacy-main-redirect-vnkqH-1j.js → legacy-main-redirect-DmyZ5nIX.js} +1 -1
  169. package/dist/client/assets/library-CPmo79Aj.js +1 -0
  170. package/dist/client/assets/{library-tab-CdWEZxRI.js → library-tab-zuXLBhZD.js} +1 -1
  171. package/dist/client/assets/{login-DS_iw6N1.js → login-f4ji59Ob.js} +1 -1
  172. package/dist/client/assets/{markdown-Da1uCT0e.js → markdown-D6jTtk0G.js} +1 -1
  173. package/dist/client/assets/{mcp-app-renderer-mf0rf7E1.js → mcp-app-renderer-voFMel4o.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-HzcRe8g5.js → mcp-oauth-BWAVhH3v.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-CaiLBqRy.js → mcp-oauth-Do-na6T3.js} +1 -1
  176. package/dist/client/assets/{members-CMznzVfQ.js → members-CqQBQk1P.js} +1 -1
  177. package/dist/client/assets/{memory-DBtEhQbQ.js → memory-Bfk8WziL.js} +1 -1
  178. package/dist/client/assets/{mock-board-WAMSCCQz.js → mock-board-DLFDSUsN.js} +3 -3
  179. package/dist/client/assets/{monaco-editor-DOm9wfYQ.js → monaco-editor-BhbaBg5Q.js} +1 -1
  180. package/dist/client/assets/{monitoring-DLU9E9jL.js → monitoring-B_xzjSSK.js} +1 -1
  181. package/dist/client/assets/{monitoring-stats-row-BZhbxHPL.js → monitoring-stats-row-t5zQGycF.js} +1 -1
  182. package/dist/client/assets/{multi-select-DrnuD1mN.js → multi-select-CDQPcRMW.js} +1 -1
  183. package/dist/client/assets/{mustache-BrMR8WIh.js → mustache-3I6NpSTH.js} +1 -1
  184. package/dist/client/assets/{named-rule-view-DFynUe1k.js → named-rule-view-DbZxafsz.js} +1 -1
  185. package/dist/client/assets/{new-project-dialog-EugQEueI.js → new-project-dialog-BjM9FoLr.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-qT5-0tMU.js → oauth-callback-DvbDZuYM.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider--_rbTYAf.js → oauth-callback-ai-provider--FzfmjdQ.js} +1 -1
  188. package/dist/client/assets/{oauth-consent-cQG5I8Ec.js → oauth-consent-Cr-zlxu_.js} +1 -1
  189. package/dist/client/assets/{onboarding-C7OJySzu.js → onboarding-uguDJVea.js} +1 -1
  190. package/dist/client/assets/{openai-conversation-Cm9EexiP.js → openai-conversation-B8S0Gyws.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-DQEq-a-n.js → optimistic-project-sidebar-views-3XRF84J-.js} +1 -1
  192. package/dist/client/assets/{order-monitor-day-Baz0Q4B-.js → order-monitor-day-CRhx574b.js} +1 -1
  193. package/dist/client/assets/{organization-choice-BvHaYYrY.js → organization-choice-D6svk97q.js} +1 -1
  194. package/dist/client/assets/{orgs-CO5qg_zx.js → orgs-S0_l6-lv.js} +1 -1
  195. package/dist/client/assets/{own-accounts-section-sv1QSuWm.js → own-accounts-section-ORFpyS1q.js} +1 -1
  196. package/dist/client/assets/{pair-BV2vQ0xm.js → pair-B7REjwrW.js} +8 -8
  197. package/dist/client/assets/{parse-sections-4T2NkKUg.js → parse-sections-BJOrOXAt.js} +3 -3
  198. package/dist/client/assets/{plan-CurU7CCP.js → plan-BGVf8uPH.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-Bu3Ap_FZ.js → plan-ladder-CLj7THz5.js} +1 -1
  200. package/dist/client/assets/{plan-usage-card-BoXPSn1R.js → plan-usage-card-B9gvfgRW.js} +2 -2
  201. package/dist/client/assets/{popover-N7uvMIxz.js → popover-C5Rig4oB.js} +1 -1
  202. package/dist/client/assets/{post-calendar-dGcUdPXO.js → post-calendar-C7USsx2-.js} +1 -1
  203. package/dist/client/assets/{post-editor-C7cux0l4.js → post-editor-DoW4sTc1.js} +1 -1
  204. package/dist/client/assets/{preview-content-CT2MLe31.js → preview-content-DV5sFV9o.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-j29O32-o.js → preview-dialog-CD582B_r.js} +1 -1
  206. package/dist/client/assets/{preview-panel-DrbFpZBA.js → preview-panel-BxgHibuA.js} +1 -1
  207. package/dist/client/assets/{preview-tab-DXgIeou6.js → preview-tab-ULIonVmC.js} +3 -3
  208. package/dist/client/assets/{product-picker-dialog-DQbb069K.js → product-picker-dialog-DyKE58eB.js} +1 -1
  209. package/dist/client/assets/{profile-B1D5-rlo.js → profile-CuCEVON6.js} +1 -1
  210. package/dist/client/assets/project-app-view-CDYBe6LA.js +1 -0
  211. package/dist/client/assets/{project-apps-CmXREDt2.js → project-apps-1PIcY2fU.js} +1 -1
  212. package/dist/client/assets/{project-icon-BFruPc7B.js → project-icon-lOdr7-bW.js} +1 -1
  213. package/dist/client/assets/{project-index-BZNO31D8.js → project-index-DnzvcYr9.js} +1 -1
  214. package/dist/client/assets/project-reports-CAXpt4HL.js +1 -0
  215. package/dist/client/assets/project-tasks-BQyDwkep.js +1 -0
  216. package/dist/client/assets/{projects-iB2V9afU.js → projects-BzNvdAj8.js} +1 -1
  217. package/dist/client/assets/{projects-empty-state-MtIbG9US.js → projects-empty-state-C50kQmxR.js} +1 -1
  218. package/dist/client/assets/{prompts-BG_4qmzz.js → prompts-DYWwdVd5.js} +1 -1
  219. package/dist/client/assets/{record-editor-8mMyqAq_.js → record-editor-BtPiEFZl.js} +1 -1
  220. package/dist/client/assets/{redirect-editor-DODrcHmb.js → redirect-editor-CSPQETPg.js} +1 -1
  221. package/dist/client/assets/reports-0rcav9J3.js +1 -0
  222. package/dist/client/assets/{reports-u6Dfo5ym.js → reports-Bv-k3l8Z.js} +1 -1
  223. package/dist/client/assets/{reports-onboarding-0hyPuCKx.js → reports-onboarding-Cl8M6F_R.js} +1 -1
  224. package/dist/client/assets/{reports-tab-Bz7eFHcA.js → reports-tab-eTrrOJiF.js} +2 -2
  225. package/dist/client/assets/repositories-CFYcSU_L.js +1 -0
  226. package/dist/client/assets/{repositories-CFziQK7w.js → repositories-DjXcvvKn.js} +1 -1
  227. package/dist/client/assets/{repository-binding-BkD30urH.js → repository-binding-Z_PJssXg.js} +1 -1
  228. package/dist/client/assets/{repository-picker-CfUR1P6V.js → repository-picker-Ms6PvgtV.js} +1 -1
  229. package/dist/client/assets/{require-capability-B1_EID-G.js → require-capability-DgcGeKzj.js} +1 -1
  230. package/dist/client/assets/{required-auth-layout-DFKnKCtp.js → required-auth-layout-C2eHliL_.js} +1 -1
  231. package/dist/client/assets/{reset-password-DjNcJ5K0.js → reset-password-BcwahPOk.js} +1 -1
  232. package/dist/client/assets/{resizable-CSObW6nE.js → resizable-C-HNoLnr.js} +1 -1
  233. package/dist/client/assets/{resolve-tab-icon-j_0ryOQr.js → resolve-tab-icon-DrkwPXhW.js} +1 -1
  234. package/dist/client/assets/{review-settings-WwIoSq9p.js → review-settings-_1imHTyn.js} +1 -1
  235. package/dist/client/assets/{role-color-beneWoQ9.js → role-color-D2Bpci18.js} +1 -1
  236. package/dist/client/assets/{roles-DmQOwh5E.js → roles-D2CchlZ1.js} +1 -1
  237. package/dist/client/assets/{route-Bd0M38TP.js → route-BHnz08YL.js} +1 -1
  238. package/dist/client/assets/{route-Dnfk_OL6.js → route-BrONX68k.js} +1 -1
  239. package/dist/client/assets/route-LJXnhVhn.js +1 -0
  240. package/dist/client/assets/{sandbox-lifecycle-context-B7r5ICXq.js → sandbox-lifecycle-context-Do_X3N1Q.js} +1 -1
  241. package/dist/client/assets/{schema-x3j4FByb.js → schema-C3iRMQDR.js} +1 -1
  242. package/dist/client/assets/{schema-hGrr4U87.js → schema-DflsRwxx.js} +1 -1
  243. package/dist/client/assets/{scroll-area-BUQV_LXH.js → scroll-area-BjnkF9XV.js} +1 -1
  244. package/dist/client/assets/{search-input-CuXTJoya.js → search-input-Dk-PX53Q.js} +1 -1
  245. package/dist/client/assets/{search-toggle-Dozi3jn4.js → search-toggle-KA6A8kEs.js} +1 -1
  246. package/dist/client/assets/{secret-picker-BjW_LSzb.js → secret-picker-B3ZqYPjh.js} +1 -1
  247. package/dist/client/assets/{secrets-D3c82efw.js → secrets-D8UbBg_V.js} +1 -1
  248. package/dist/client/assets/{section-array-field-DdQmkBVv.js → section-array-field-DTz67Y2Z.js} +1 -1
  249. package/dist/client/assets/{sections-editor-vn3XqGqZ.js → sections-editor-DI0biq8F.js} +1 -1
  250. package/dist/client/assets/{sections-BugzxN3d.js → sections-r0ffiyN1.js} +1 -1
  251. package/dist/client/assets/{select-D61WZk1O.js → select-BYZPn2vc.js} +1 -1
  252. package/dist/client/assets/{select-model-B9-VeM83.js → select-model-BNTqmjVq.js} +1 -1
  253. package/dist/client/assets/{seo-editor-CHKnAUms.js → seo-editor-phk-cNbV.js} +1 -1
  254. package/dist/client/assets/{separator-BVRCWUXh.js → separator-D2l0P7OD.js} +1 -1
  255. package/dist/client/assets/settings-tab-Bj09PR_D.js +1 -0
  256. package/dist/client/assets/{sheet-DIBHWB2f.js → sheet-BGkMUGZP.js} +1 -1
  257. package/dist/client/assets/{shell-layout-B0sxwrmk.js → shell-layout-C9pzHPCy.js} +1 -1
  258. package/dist/client/assets/{site-draft-actions-CIqEMxV-.js → site-draft-actions-CO6_hVyN.js} +1 -1
  259. package/dist/client/assets/{site-draft-view-CRnAEeje.js → site-draft-view-B5Rpd0IB.js} +1 -1
  260. package/dist/client/assets/site-editor-toast-D_mo8TLM.js +1 -0
  261. package/dist/client/assets/site-editor-y5BHxD0w.js +1 -0
  262. package/dist/client/assets/{skills-DSWQxTlW.js → skills-C_ZaFX-W.js} +1 -1
  263. package/dist/client/assets/{slider-DRwKc5id.js → slider-C6NJcOKc.js} +1 -1
  264. package/dist/client/assets/{sortable.esm-D0_nmGGR.js → sortable.esm-DkLzay3X.js} +1 -1
  265. package/dist/client/assets/{sso-CzNpdX7R.js → sso-aNPiZ-nK.js} +1 -1
  266. package/dist/client/assets/suggestion-XDtYV8VG.js +2 -0
  267. package/dist/client/assets/{super-agent-icon-CqYKR78y.js → super-agent-icon-CQ6xujSj.js} +1 -1
  268. package/dist/client/assets/{switch-DqhVUDGb.js → switch-aqNVrOiZ.js} +1 -1
  269. package/dist/client/assets/{synced-repos-bxt0QNXE.js → synced-repos-BevdaaXa.js} +1 -1
  270. package/dist/client/assets/{tab-icon-glyph-isGtQ89b.js → tab-icon-glyph-r819MRQJ.js} +1 -1
  271. package/dist/client/assets/{table-BjC5y-mI.js → table-DkeWUhEA.js} +1 -1
  272. package/dist/client/assets/{tabs-D47HrxyT.js → tabs-DdQ7zWRN.js} +1 -1
  273. package/dist/client/assets/{task-board-CpInFlas.js → task-board-P3oVDv96.js} +1 -1
  274. package/dist/client/assets/{task-route-BlJmoQnB.js → task-route-C_xiYnWJ.js} +1 -1
  275. package/dist/client/assets/{task-status-CtyIOSPd.js → task-status-DddMvcVZ.js} +1 -1
  276. package/dist/client/assets/{taskboard-analytics-lEMFRF2F.js → taskboard-analytics-BEIrDYqd.js} +1 -1
  277. package/dist/client/assets/tasks-Di0UVLcT.js +1 -0
  278. package/dist/client/assets/{tasks-iEvVDxme.js → tasks-XsUVhM-J.js} +3 -3
  279. package/dist/client/assets/{textarea-CjxhqOyq.js → textarea-Cfu8XQdh.js} +1 -1
  280. package/dist/client/assets/{thread-analytics-Bh5IuMZi.js → thread-analytics-BlolJtDD.js} +1 -1
  281. package/dist/client/assets/{thread-intent-D7K3VC0B.js → thread-intent-v870fhCT.js} +1 -1
  282. package/dist/client/assets/{thread-route-CsxQz3Zx.js → thread-route-CvlfcLbb.js} +1 -1
  283. package/dist/client/assets/{thread-route-D6poUO7_.js → thread-route-GRPoLral.js} +1 -1
  284. package/dist/client/assets/{thread-sheet-body-DYxNtyxr.js → thread-sheet-body-BfzpkGhR.js} +1 -1
  285. package/dist/client/assets/{time-range-picker-CikQym1Z.js → time-range-picker-DZeWndYv.js} +1 -1
  286. package/dist/client/assets/{toggle-group-CouAljQq.js → toggle-group-BgRJSOhH.js} +1 -1
  287. package/dist/client/assets/{tool-namespace-COJtiQ4T.js → tool-namespace-nRSGF6tI.js} +1 -1
  288. package/dist/client/assets/{tool-set-selector-D0VA8wi_.js → tool-set-selector-B214xmA9.js} +1 -1
  289. package/dist/client/assets/{toolbar-icon-button-BuwmFHmx.js → toolbar-icon-button-CDSVGpZE.js} +1 -1
  290. package/dist/client/assets/{tooltip-Bw3qe--M.js → tooltip-D4RVnddm.js} +1 -1
  291. package/dist/client/assets/{tooltipContext-6k_VEZRX.js → tooltipContext-BXwqSkFH.js} +1 -1
  292. package/dist/client/assets/{track-BwadfAZS.js → track-B8JEMHvk.js} +1 -1
  293. package/dist/client/assets/{types-CbWt7gMo.js → types-BQSSBiIo.js} +1 -1
  294. package/dist/client/assets/{url-slug-_FVYRYFw.js → url-slug-DdVUOIRJ.js} +1 -1
  295. package/dist/client/assets/{usage-stats-DQ3lpFK8.js → usage-stats-BbCFi8o4.js} +1 -1
  296. package/dist/client/assets/{use-ai-providers-BZwoM77S.js → use-ai-providers-CF3gJxn2.js} +1 -1
  297. package/dist/client/assets/{use-apply-named-rule-DBwwofns.js → use-apply-named-rule-KXbxqT7_.js} +1 -1
  298. package/dist/client/assets/use-ask-in-chat-sDCRGkVA.js +1 -0
  299. package/dist/client/assets/{use-automations-9JK3KVgm.js → use-automations-B-3A2umX.js} +1 -1
  300. package/dist/client/assets/{use-autosave-CSUjUglY.js → use-autosave-C6gNBer7.js} +1 -1
  301. package/dist/client/assets/use-blocks-v8-project-2B03tBP7.js +1 -0
  302. package/dist/client/assets/{use-chat-layout-state-COqGCuVV.js → use-chat-layout-state-BrmTWqoG.js} +1 -1
  303. package/dist/client/assets/{use-cms-publish-actions-BwV4F0O9.js → use-cms-publish-actions-CIJ6zHNm.js} +3 -3
  304. package/dist/client/assets/{use-connect-companion-BhuBsXQo.js → use-connect-companion-HZWizNOx.js} +1 -1
  305. package/dist/client/assets/use-connection-C5-uyAt3.js +1 -0
  306. package/dist/client/assets/{use-content-sync-sIXdICgs.js → use-content-sync-B98fKQ39.js} +1 -1
  307. package/dist/client/assets/{use-copy-D-EOd5RI.js → use-copy-DtaCyKxk.js} +1 -1
  308. package/dist/client/assets/{use-date-fns-locale-DXTlo7HL.js → use-date-fns-locale-mMKDMfq6.js} +1 -1
  309. package/dist/client/assets/{use-debounced-autosave-Ah58n7xN.js → use-debounced-autosave-BaLD9UYj.js} +1 -1
  310. package/dist/client/assets/{use-debounced-value-8OKqfUuy.js → use-debounced-value-CkSIMvSM.js} +1 -1
  311. package/dist/client/assets/{use-deco-credits-DV2KUq3D.js → use-deco-credits-CHzcLKoW.js} +1 -1
  312. package/dist/client/assets/{use-decopilot-events-CuinN1iK.js → use-decopilot-events-DNjBbEST.js} +1 -1
  313. package/dist/client/assets/{use-delete-connection-B-VzkPwb.js → use-delete-connection-d_sBLctd.js} +1 -1
  314. package/dist/client/assets/{use-deployment-admin-CE6RFF-x.js → use-deployment-admin-CSAQGY_O.js} +1 -1
  315. package/dist/client/assets/{use-entitlements-BsP1ZFGQ.js → use-entitlements-CNt3pGa0.js} +1 -1
  316. package/dist/client/assets/{use-fast-preview-draft-url-BfYOm91V.js → use-fast-preview-draft-url-7QxfEcUc.js} +1 -1
  317. package/dist/client/assets/{use-file-configs-BTHP9YUm.js → use-file-configs-C7s_koIb.js} +1 -1
  318. package/dist/client/assets/{use-id-selection-CzcA3Fgb.js → use-id-selection-BGMDhEyc.js} +1 -1
  319. package/dist/client/assets/{use-inbox-feed-Bh-qnCwx.js → use-inbox-feed-Dv0lvbq1.js} +1 -1
  320. package/dist/client/assets/{use-infinite-scroll-xgBjudJA.js → use-infinite-scroll-BZ3LS1DV.js} +1 -1
  321. package/dist/client/assets/{use-join-requests-VyWhRMSX.js → use-join-requests-C42CNIpx.js} +1 -1
  322. package/dist/client/assets/use-main-panel-tabs-OQ4A9hsj.js +1 -0
  323. package/dist/client/assets/{use-mcp-auth-status-CCwaj4pF.js → use-mcp-auth-status-WL287lkM.js} +1 -1
  324. package/dist/client/assets/{use-mcp-client-Ch_pgKFL.js → use-mcp-client-B5xjs2K9.js} +1 -1
  325. package/dist/client/assets/{use-mcp-prompts-M3rH9N-2.js → use-mcp-prompts-DEhNBwFv.js} +1 -1
  326. package/dist/client/assets/{use-mcp-tools-BAO0S55a.js → use-mcp-tools-CtEmHoLl.js} +1 -1
  327. package/dist/client/assets/{use-mobile-ye6iRWDK.js → use-mobile-DLEV_nGJ.js} +1 -1
  328. package/dist/client/assets/{use-move-blocks-Gvsecy1g.js → use-move-blocks-BVhwg8WS.js} +1 -1
  329. package/dist/client/assets/use-navigate-to-agent-DbsMPucS.js +1 -0
  330. package/dist/client/assets/{use-org-fs-DKzRfuIW.js → use-org-fs-BsN8VM5Z.js} +1 -1
  331. package/dist/client/assets/{use-org-repo-syncs-Cj0yTqTx.js → use-org-repo-syncs-Ddabxxnq.js} +1 -1
  332. package/dist/client/assets/{use-org-sso-BxORdMDV.js → use-org-sso-DvSOJZ_W.js} +1 -1
  333. package/dist/client/assets/{use-organization-settings-BQAdDt_y.js → use-organization-settings-BTNKvxbS.js} +1 -1
  334. package/dist/client/assets/{use-project-native-view-presence-CMhFGTuR.js → use-project-native-view-presence-C_VTJOR2.js} +1 -1
  335. package/dist/client/assets/{use-project-scope-CT4H1KgC.js → use-project-scope-DYHM9a74.js} +1 -1
  336. package/dist/client/assets/{use-recent-apps-CbbMz9JX.js → use-recent-apps-BwkYdV8J.js} +1 -1
  337. package/dist/client/assets/{use-reports-diagnostic-DrVbktZZ.js → use-reports-diagnostic-DxprW3FU.js} +1 -1
  338. package/dist/client/assets/{use-sandbox-events-DEsMUhZf.js → use-sandbox-events-BmsgjLgS.js} +1 -1
  339. package/dist/client/assets/{use-secrets-BS4OhqRX.js → use-secrets-9rv-ZTFT.js} +1 -1
  340. package/dist/client/assets/{use-section-preview-base-DRm79v_2.js → use-section-preview-base-BXQtliBp.js} +1 -1
  341. package/dist/client/assets/{use-sidebar-collapsed-BJ9DvrgE.js → use-sidebar-collapsed-iSryvG4A.js} +1 -1
  342. package/dist/client/assets/{use-tags-CWUQFfwf.js → use-tags-CTHOEC1c.js} +1 -1
  343. package/dist/client/assets/{use-task-board-analytics-DRF7V1gC.js → use-task-board-analytics-CJkqrRST.js} +1 -1
  344. package/dist/client/assets/{use-task-board-events-D_nE-0RI.js → use-task-board-events-CTeANaje.js} +1 -1
  345. package/dist/client/assets/{use-task-board-item-prs-CMNSM7NS.js → use-task-board-item-prs-DViaWzzx.js} +1 -1
  346. package/dist/client/assets/{use-task-board-items-BhqAiSTX.js → use-task-board-items-Bb0LBUTU.js} +1 -1
  347. package/dist/client/assets/{use-task-board-prompts-r37U5HHf.js → use-task-board-prompts-DDA-l1V3.js} +1 -1
  348. package/dist/client/assets/{use-task-metadata-CpdEm_Eq.js → use-task-metadata-4UYb5uTu.js} +1 -1
  349. package/dist/client/assets/{use-thread-outputs-BCCXEsgi.js → use-thread-outputs-CJJmQUoi.js} +1 -1
  350. package/dist/client/assets/{use-voice-input-CaKlieI0.js → use-voice-input-C35dv3A1.js} +1 -1
  351. package/dist/client/assets/useInfiniteQuery-B3nmwRd2.js +1 -0
  352. package/dist/client/assets/{useQueries-DWMnudrU.js → useQueries-DZSM8cCd.js} +1 -1
  353. package/dist/client/assets/useSuspenseInfiniteQuery-BHZshmPL.js +1 -0
  354. package/dist/client/assets/{users-Ct8iD2nc.js → users-Q-FJAOp2.js} +1 -1
  355. package/dist/client/assets/{utils-B4FS_bBy.js → utils-DsmWCt7e.js} +1 -1
  356. package/dist/client/assets/{variant-calendar-By_yM7B4.js → variant-calendar-o3Pktueb.js} +1 -1
  357. package/dist/client/assets/{variant-matcher-override-DQF4FE1V.js → variant-matcher-override-YE4lbHNL.js} +1 -1
  358. package/dist/client/assets/{view-header-Cv_9dvGb.js → view-header-D5ldHG8R.js} +1 -1
  359. package/dist/client/assets/{virtual-mcp-DzM6ah-n.js → virtual-mcp-DFlO2tW2.js} +1 -1
  360. package/dist/client/assets/{watch-sse-pool-DPXy7vY-.js → watch-sse-pool-CxFrglEk.js} +1 -1
  361. package/dist/client/index.html +1 -1
  362. package/dist/server/server.js +676 -676
  363. package/package.json +1 -1
  364. package/dist/client/assets/ReferenceLine-DTFZ8A_b.js +0 -1
  365. package/dist/client/assets/agent-app-Cj_RWyLT.js +0 -1
  366. package/dist/client/assets/agent-deck-DPIGRh0M.js +0 -1
  367. package/dist/client/assets/agent-experiments-CCFPdPhX.js +0 -1
  368. package/dist/client/assets/agent-library-CziMMPAP.js +0 -1
  369. package/dist/client/assets/agent-library-file-Bl2JiaxW.js +0 -1
  370. package/dist/client/assets/agent-overview-CCjalTIF.js +0 -1
  371. package/dist/client/assets/agent-settings-CLD9LbBl.js +0 -1
  372. package/dist/client/assets/agent-site-editor-code-CvwSMvs6.js +0 -2
  373. package/dist/client/assets/agent-site-editor-content-CyqRl7Mo.js +0 -1
  374. package/dist/client/assets/agent-site-editor-preview-BZ6vFBEq.js +0 -1
  375. package/dist/client/assets/agent-view-0jyw-9ou.js +0 -1
  376. package/dist/client/assets/api-keys-BDo54WOl.js +0 -1
  377. package/dist/client/assets/blocks-tab-states-Bf5o8VNw.js +0 -1
  378. package/dist/client/assets/chart-BtV3lIyv.js +0 -13
  379. package/dist/client/assets/cms-store-drafts-gAOezeiH.js +0 -1
  380. package/dist/client/assets/library-L-o62vZM.js +0 -1
  381. package/dist/client/assets/project-app-view-J0Hex_YV.js +0 -1
  382. package/dist/client/assets/project-reports-C2YJUhOx.js +0 -1
  383. package/dist/client/assets/project-tasks-RuOnvKJR.js +0 -1
  384. package/dist/client/assets/reports-CpJEGryk.js +0 -1
  385. package/dist/client/assets/repositories-C4iLn-xt.js +0 -1
  386. package/dist/client/assets/route-BEz3Pav8.js +0 -1
  387. package/dist/client/assets/settings-tab-W8DgvzPC.js +0 -1
  388. package/dist/client/assets/site-editor-DNhcEXBI.js +0 -1
  389. package/dist/client/assets/site-editor-toast-GFZxIyjf.js +0 -1
  390. package/dist/client/assets/suggestion-R4Fq_9Vs.js +0 -2
  391. package/dist/client/assets/tasks-CKan_WUB.js +0 -1
  392. package/dist/client/assets/use-ask-in-chat-DaKY6vDh.js +0 -1
  393. package/dist/client/assets/use-blocks-v8-project-BM6s65-m.js +0 -1
  394. package/dist/client/assets/use-connection-D5sijlzo.js +0 -1
  395. package/dist/client/assets/use-main-panel-tabs-DGfwa0le.js +0 -1
  396. package/dist/client/assets/use-navigate-to-agent-jetKe7lC.js +0 -1
  397. package/dist/client/assets/useInfiniteQuery-DmLlHKe0.js +0 -1
  398. package/dist/client/assets/useSuspenseInfiniteQuery-B6k_dV9w.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as N,q as W,i as C,K as g,eW as Ue,d2 as Fn,aE as Lt,aF as K,b9 as Qe,ba as Bn,e8 as De,e6 as Vn,bV as we,eX as Hn,eY as Jn,r as L,eZ as Wn,e_ as G,e$ as X,bA as Gn,a as Yn,as as _e,a4 as zn,bz as Ut,f0 as Xn,f1 as Qt,aq as Zn,bh as F,bo as Ct,f2 as qn,f3 as Kn,f4 as eo,t as ne,j as z}from"./index-DLrFWx5Y.js";import{u as Ce}from"./repository-binding-Z_PJssXg.js";import{e as Ft}from"./backoff-CrEUbyZT.js";import{b as Se}from"./sandbox-url-D3mC8qhT.js";import{u as to}from"./chat-context-D__edm74.js";import{i as no,u as oo}from"./use-sandbox-events-BmsgjLgS.js";import{u as Fe}from"./use-blocks-v8-project-2B03tBP7.js";import{u as Bt}from"./use-voice-input-C35dv3A1.js";import{s as ft}from"./thread-intent-v870fhCT.js";import{s as so}from"./utils-DsmWCt7e.js";import{a as ro}from"./sandbox-git-api-DcqI6XE4.js";const w={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class S extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new S(t.code,t.message,t.data)}}const te="deco-content",Te={major:1},Vt=1;async function io(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const Re={major:Te.major,minor:Vt},Ht=`the endpoint speaks an older ${te} than this client needs (${Re.major}.${Re.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ae(e,t,n){const o={reason:t,required:{...Re}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const s=n.server;typeof s?.name=="string"&&typeof s.version=="string"&&(o.server={name:s.name,version:s.version})}return new S(w.Unsupported,e,o)}function Jt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==te)throw ae(`the endpoint speaks ${JSON.stringify(n)}, not ${te}`,"protocol",t);if(o?.major!==Te.major)throw ae(`the endpoint speaks ${te} ${String(o?.major)}.x; this client speaks ${Te.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<Vt)throw ae(Ht,"outdated",t);return e}function dt(e,t){return t.code===w.MethodNotFound&&e.startsWith("changes.")?ae(Ht,"outdated"):S.from(t)}function Be(e){const t=e.fetch??(r=>fetch(r));let n=1;async function o(r){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(r)}));let c;try{c=await io(a)}catch{throw new S(w.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?S.from(l):new S(w.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const s=async(r,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:r,params:i??{}});if(c.error)throw dt(r,c.error);return c.result};return{call:s,describe:async()=>Jt(await s("describe")),schemaGet:r=>s("schema.get",r),blocksList:r=>s("blocks.list",r),blocksApply:r=>s("blocks.apply",r),changesList:r=>s("changes.list",r),changesGet:r=>s("changes.get",r),changesDiscard:r=>s("changes.discard",r),async batch(r){const i=r.map(()=>n++),a=await o(r.map((l,u)=>({jsonrpc:"2.0",id:i[u],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,u)=>{const d=c.get(l);return d?d.error?{ok:!1,error:dt(r[u].method,d.error)}:{ok:!0,result:d.result}:{ok:!1,error:new S(w.InternalError,"no response for this call")}})}}}function Ve(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const ht=20,gt=5,vt=500;function He(e){return e instanceof S?e.code===w.MethodNotFound?!0:e.code===w.Unsupported&&e.data?.reason==="outdated":!1}function de(e,t,n=e){return n&&n!==e?n:t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function ao(e,t,n){const o=g.contentChanges(n),s=e.getQueryData(o),r=await t.changesList(Ve(s)),i=de(s,r,e.getQueryData(o));if(i)return i;const a=await t.changesList({}),c=de(void 0,a,e.getQueryData(o));if(!c)throw new S(w.InternalError,"changes.list returned notModified without a cached list");return c}async function Wt(e,t){const n=[];for(let r=0;r<t.length;r+=ht)n.push(t.slice(r,r+ht));const o=Object.create(null),s=[];for(let r=0;r<n.length;r+=gt){const i=await e.batch(n.slice(r,r+gt).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),s.push(...c.diagnostics)}}return{entries:o,diagnostics:s}}async function Ar(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=vt){const s=t.slice(o,o+vt),r=await e.changesDiscard({names:s.map(i=>i.name),ifMatch:Object.fromEntries(s.map(i=>[i.name,i.version]))});n={revision:r.revision,versions:{...n.versions,...r.versions}}}return n}function Mr(e){return e instanceof S&&e.code===w.Conflict}function Je(e){return e?.kind==="protocol"?e:null}function Lr(e,t,n){const o=N.c(14);let s;o[0]!==n?(s={},o[0]=n,o[1]=s):s=o[1];const r=s,i=W();let a;o[2]!==e?(a=Je(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&r.enabled!==!1;let u;o[4]!==t?(u=g.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let d;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(d=l?()=>ao(i,c.client,t):Ue,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=d):d=o[10];let f;return o[11]!==u||o[12]!==d?(f={queryKey:u,queryFn:d,staleTime:0},o[11]=u,o[12]=d,o[13]=f):f=o[13],C(f)}function co(e){if(!e)return"";const t=Object.entries(e.changes).sort(([n],[o])=>n<o?-1:n>o?1:0).map(([n,o])=>[n,o.kind,o.version,o.baseVersion]);return JSON.stringify([e.revision,e.base.revision,e.base.resolvedRef,t])}function Ur(e,t,n){const o=N.c(14);let s;o[0]!==e?(s=Je(e),o[0]=e,o[1]=s):s=o[1];const r=s;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!r&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?(l=g.contentChangeSides(t??"",co(n)),o[4]=t,o[5]=n,o[6]=l):l=o[6];let u;o[7]!==c||o[8]!==a||o[9]!==r?(u=c?()=>Wt(r.client,a):Ue,o[7]=c,o[8]=a,o[9]=r,o[10]=u):u=o[10];let d;return o[11]!==l||o[12]!==u?(d={queryKey:l,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=u,o[13]=d):d=o[13],C(d)}function Qr(e,t,n){const o=N.c(16);let s;o[0]!==e?(s=Je(e),o[0]=e,o[1]=s):s=o[1];const r=s;let i,a,c,l;if(o[2]!==t||o[3]!==n?.changes||o[4]!==r){const f=Object.entries(n?.changes??{}).filter(go).map(ho).sort(fo);a=f.map(uo);const h=JSON.stringify(f.map(lo));i=!!r&&!!t&&a.length>0,l=C,c=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=r,o[5]=i,o[6]=a,o[7]=c,o[8]=l}else i=o[5],a=o[6],c=o[7],l=o[8];let u;o[9]!==i||o[10]!==a||o[11]!==r?(u=i?async()=>{const f=await Wt(r.client,a),h=Object.create(null);for(const[v,b]of Object.entries(f.entries))h[v]=b.before&&typeof b.before=="object"?b.before:null;return h}:Ue,o[9]=i,o[10]=a,o[11]=r,o[12]=u):u=o[12];let d;return o[13]!==c||o[14]!==u?(d={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY,placeholderData:Fn},o[13]=c,o[14]=u,o[15]=d):d=o[15],l(d)}function lo(e){return[e.name,e.base]}function uo(e){return e.name}function fo(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function ho(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function go(e){const[,t]=e;return t.kind==="delete"}function Gt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function he(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const Yt=Lt({endpoint:K().max(2048).refine(e=>Gt(e)&&new URL(e).pathname==="/rpc").transform(he)});function Cr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=Yt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function zt(e){const t=Yt.safeParse(e);return t.success?t.data:null}const Xt="studio:deco-serve-last";function Fr(e){try{localStorage.setItem(Xt,JSON.stringify(e))}catch{}}function Br(){try{const e=localStorage.getItem(Xt);return e?zt(JSON.parse(e)):null}catch{return null}}function Vr(e){try{return new URL(he(e)).host}catch{return e}}function vo(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const bo="http://localhost:4545/rpc";class We extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function mo(e){if(e instanceof We)return{reason:"not-deco-serve"};if(!(e instanceof S))return{reason:"not-answering"};switch(e.code){case w.Unauthorized:case w.MethodNotFound:return{reason:"outdated"};case w.Unsupported:return He(e)?{reason:"outdated"}:{reason:"version-mismatch"};case w.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Hr(e,t){if(e)return[he(e.endpoint)];const n=[t?.endpoint,bo].filter(o=>!!o).map(he);return[...new Set(n)]}const po=Lt({blocks:De(K(),De(K(),Vn()).refine(Qe)),versions:De(K(),K().min(1)),missing:Bn(K())});function wo(e,t){const n=po.parse(e),o=Object.keys(n.blocks),s=Object.keys(n.versions),r=[...o,...n.missing],i=new Set(t);if(s.length!==o.length||o.some(a=>!Object.hasOwn(n.versions,a))||r.length!==i.size||new Set(r).size!==r.length||r.some(a=>!i.has(a)))throw new Error("The CMS block response did not account for the requested names");return n}function oe(e,t){const n=e.index?.entries[t];return!!n&&Qe(e.blocks[t])&&e.versions[t]===n.version}function So(e,t,n){const o=new Map;let s=!1;for(const[r,i]of Object.entries(n.blocks)){const a=t.index?.entries[r];if(a){if(n.versions[r]!==a.version){s||=a.version===e.index?.entries[r]?.version;continue}t.blocks[r]!==e.blocks[r]||t.versions[r]!==e.versions[r]||o.set(r,i)}}return s||=n.missing.some(r=>!!t.index?.entries[r]),{blocks:o.size?{...t.blocks,...Object.fromEntries(o)}:t.blocks,versions:o.size?{...t.versions,...Object.fromEntries([...o.keys()].map(r=>[r,n.versions[r]]))}:t.versions,refreshIndex:s}}function yo(e,t,n){return!!e.index&&t.every(o=>e.index?.entries[o]?oe(e,o)&&(!n||n[o]===e.blocks[o]):!n||n[o]===void 0)}const bt=50,mt=10;function ko(e,t=n=>fetch(n)){let n=1;return{async batch(o){const s=o.map(()=>n++),r=await t(new Request(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",signal:we(),body:JSON.stringify(o.map((c,l)=>({jsonrpc:"2.0",id:s[l],method:c.method,params:c.params??{}})))}));if(!r.ok)throw new S(w.Unavailable,`the hosted CMS answered ${r.status}`);const i=await r.json(),a=new Map((Array.isArray(i)?i:[]).map(c=>[c.id,c]));return s.map(c=>{const l=a.get(c);return l?l.error?{ok:!1,error:S.from(l.error)}:{ok:!0,result:l.result}:{ok:!1,error:new S(w.InternalError,"no response for this call")}})}}}function Oo(e,t){if(!e)return t??{};const n={};for(const[o,s]of Object.entries(e.entries)){if(t&&Object.hasOwn(t,o)){n[o]=t[o];continue}n[o]={[Jn]:!0,...s.meta?.type?{__resolveType:s.meta.type}:{},...s.meta?.path!==void 0?{path:s.meta.path}:{},...s.meta?.refs?.length?{[Hn]:s.meta.refs}:{}}}for(const[o,s]of Object.entries(t??{}))Object.hasOwn(n,o)||(n[o]=s);return n}function Eo(e,t){return e?.entries[t]?.meta?.refs??[]}function Do(e,t){return Object.hasOwn(e.draft,t)?e.draft[t]?.version??null:null}function Ge(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function xe(e,t){if(Array.isArray(e)){for(const n of e)xe(n,t);return}if(Ge(e))for(const[n,o]of Object.entries(e))n==="__resolveType"&&typeof o=="string"?t.add(o):xe(o,t)}function Zt(e,t){if(!Ge(e))return;const n={};typeof e.__resolveType=="string"&&(n.type=e.__resolveType),typeof e.path=="string"&&(n.path=e.path);const o=new Set;xe(e,o);const s=[...o].filter(r=>t.has(r)).sort();return s.length>0&&(n.refs=s),Object.keys(n).length>0?n:void 0}function qt(e,t,n,o){G(e),e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.entries},i={...s.draft},a=new Set([...Object.keys(r),...Object.keys(o)]);for(const[c,l]of Object.entries(n)){const u=i[c]?.editor??null;if(l===null||l===X){delete r[c],i[c]={operation:"delete",version:X,editor:u};continue}const d=Zt(o[c],a);r[c]={version:l,...d?{meta:d}:{}},i[c]={operation:"set",version:l,editor:u}}return{...s,entries:r,draft:i}})}function Io(e,t,n,o){e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.draft},i={...s.entries};if(o===null)delete r[n];else if(r[n]={operation:o.block===null?"delete":"set",version:o.version,editor:r[n]?.editor??null},o.block===null)delete i[n];else{const a=new Set([...Object.keys(i),n]),c=Zt(o.block,a);i[n]={version:o.version,...c?{meta:c}:{}}}return{...s,entries:i,draft:r}})}const pt=new WeakMap;async function Ye(e,t,n,o,s=new Set){const r=e.getQueryData(g.contentIndex(n));if(!r)throw new S(w.Unavailable,"The CMS index is not loaded yet");let i=pt.get(e);i||(i=new Map,pt.set(e,i));const a=e.getQueryData(g.decofile(n))??{},c=e.getQueryData(g.contentVersions(n))??{},l=[],u=[];for(const f of new Set(o)){const h=r.entries[f];if(!h||s.has(f)||Qe(a[f])&&c[f]===h.version)continue;const v=i.get(`${n}\0${f}`);v?l.push(v):u.push(f)}if(u.length>0){const f=To(e,t,n,u);for(const h of u){const v=`${n}\0${h}`;i.set(v,f),f.catch(()=>{}).finally(()=>{i.get(v)===f&&i.delete(v)})}l.push(f)}await Promise.all(l);const d=ge(e,n);if(o.some(f=>d.index?.entries[f]&&!s.has(f)&&!oe(d,f)))throw new S(w.Unavailable,"A CMS block changed while loading; try again")}async function _o(e,t,n,o,s){if(!t){const i=o?.[s];return Ge(i)&&!Gn(i)?i:void 0}await Ye(e,t,n,[s]);const r=ge(e,n);return r.index?.entries[s]&&oe(r,s)?r.blocks[s]:void 0}function ge(e,t){return{index:e.getQueryData(g.contentIndex(t)),blocks:e.getQueryData(g.decofile(t))??{},versions:e.getQueryData(g.contentVersions(t))??{}}}async function To(e,t,n,o){const s=ge(e,n),r=[];for(let i=0;i<o.length;i+=bt)r.push(o.slice(i,i+bt));for(let i=0;i<r.length;i+=mt){const a=r.slice(i,i+mt),c=await t.batch(a.map(l=>({method:"cms.blocks",params:{names:l}})));if(c.length!==a.length)throw new S(w.InternalError,"Incomplete CMS batch response");for(const[l,u]of c.entries()){if(!u.ok)throw u.error;const d=wo(u.result,a[l]),f=ge(e,n),h=So(s,f,d);if(G(e),h.blocks!==f.blocks&&e.setQueryData(g.decofile(n),h.blocks),h.versions!==f.versions&&e.setQueryData(g.contentVersions(n),h.versions),h.refreshIndex)throw e.invalidateQueries({queryKey:g.decofile(n),exact:!0},{cancelRefetch:!1}),new S(w.Unavailable,"The CMS index changed while loading blocks; try again")}}}function ze(e){const t=N.c(4);let n;t[0]!==e?(n=g.contentIndex(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Ro,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=C(o);return s}async function Ro(){throw new Error("the content index is set by the poll")}function wt(e,t){const n=N.c(8);let o;n[0]!==t?(o=Wn(t),n[0]=t,n[1]=o):o=n[1];const s=o;let r;n[2]!==e||n[3]!==s?(r=a=>e.getQueryCache().subscribe(c=>{c.query.queryHash===s&&a()}),n[2]=e,n[3]=s,n[4]=r):r=n[4];let i;return n[5]!==e||n[6]!==t?(i=()=>e.getQueryData(t),n[5]=e,n[6]=t,n[7]=i):i=n[7],L.useSyncExternalStore(r,i)}const St=3e4;function xo(e){if(!(e instanceof S))return;const t=e.data?.retryAfterMs;return typeof t=="number"&&t>0?t:void 0}function Po(e,t,n,o){const s=N.c(15),r=W(),i=ze(t);let a;s[0]!==t?(a=g.decofile(t),s[0]=t,s[1]=a):a=s[1];const c=wt(r,a);let l;s[2]!==t?(l=g.contentVersions(t),s[2]=t,s[3]=l):l=s[3];const u=wt(r,l),d=o?.withRefs??!1,f=new Set(n);if(d)for(const p of n)for(const E of Eo(i,p))f.add(E);const h=[...f].filter(p=>!!i?.entries[p]).sort(),v={index:i,blocks:c??{},versions:u??{}},b=h.some(p=>!oe(v,p)),m=JSON.stringify(h.map(p=>[p,i?.entries[p]?.version,oe(v,p)])),[R,k]=L.useState(null),[$,I]=L.useState(0),_=R?.key===m?R:null;L.useEffect(()=>{if(!e||!m)return;let p=!0;const E=JSON.parse(m).map($o);return Ye(r,e,t,E).then(()=>{p&&k(j=>j?.key===m?null:j)},j=>{p&&k(U=>({key:m,count:(U?.key===m?U.count:0)+1,retryAfterMs:xo(j)}))}),()=>{p=!1}},[e,r,t,m,$]);let T;s[4]!==_||s[5]!==I?(T=()=>{if(!_)return;const p=Math.min(St,_.retryAfterMs??Ft(St,1e3,_.count-1,2,.5)),E=setTimeout(()=>I(jo),p);return()=>clearTimeout(E)},s[4]=_,s[5]=I,s[6]=T):T=s[6];let y;s[7]!==_?(y=[_],s[7]=_,s[8]=y):y=s[8],L.useEffect(T,y);const O=!e||yo(v,[...f],o?.listing),D=!!e&&b&&_!==null;let x;s[9]!==I?(x=()=>I(No),s[9]=I,s[10]=x):x=s[10];let A;return s[11]!==O||s[12]!==D||s[13]!==x?(A={ready:O,failed:D,retry:x},s[11]=O,s[12]=D,s[13]=x,s[14]=A):A=s[14],A}function No(e){return e+1}function jo(e){return e+1}function $o(e){const[t]=e;return t}const Kt=L.createContext(null);function Ao(e){const t=N.c(24),n=L.useContext(Kt),o=Fe(n?null:e),{data:s}=Yn.useSession(),r=s?.user?.id??"",i=!!e&&!!r;let a;t[0]!==i||t[1]!==r||t[2]!==e?(a=i?_e.decoServeConnection(r,e):null,t[0]=i,t[1]=r,t[2]=e,t[3]=a):a=t[3];const[c,l]=kt(a);let u;t[4]!==i||t[5]!==r||t[6]!==e?(u=i?_e.decoServeEndpoint(r,e):null,t[4]=i,t[5]=r,t[6]=e,t[7]=u):u=t[7];const[d,f]=kt(u);if(n)return n;let h;t[8]!==c||t[9]!==i||t[10]!==o?(h=i&&o?zt(c):null,t[8]=c,t[9]=i,t[10]=o,t[11]=h):h=t[11];const v=h,b=i&&o&&typeof d=="string"?d:null;let m;t[12]!==f||t[13]!==l||t[14]!==i?(m=$=>{i&&(l($),f($.endpoint))},t[12]=f,t[13]=l,t[14]=i,t[15]=m):m=t[15];let R;t[16]!==l||t[17]!==i?(R=()=>{i&&l(null)},t[16]=l,t[17]=i,t[18]=R):R=t[18];let k;return t[19]!==v||t[20]!==b||t[21]!==m||t[22]!==R?(k={connection:v,lastEndpoint:b,set:m,clear:R},t[19]=v,t[20]=b,t[21]=m,t[22]=R,t[23]=k):k=t[23],k}function yt(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function kt(e){const t=N.c(17),n=W(),o=e??"";let s;t[0]!==o?(s=["localStorage",o],t[0]=o,t[1]=s):s=t[1];const r=s;let i,a;t[2]!==e?(i=()=>e?yt(e):null,a=()=>e?yt(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==r||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:r,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=r,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:u}=C(l);let d;t[10]!==e||t[11]!==n||t[12]!==r?(d=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(r,b)}},t[10]=e,t[11]=n,t[12]=r,t[13]=d):d=t[13];const f=d,h=e?u??null:null;let v;return t[14]!==f||t[15]!==h?(v=[h,f],t[14]=f,t[15]=h,t[16]=v):v=t[16],v}function en(e,t=""){return{source:e,cacheKeySuffix:e==="github"?"":e==="sandbox"?":sandbox":`:serve:${t}`}}function Mo(e){return JSON.stringify([e.kind==="legacy"?"legacy":"protocol",e.source,e.cacheKeySuffix])}function Jr(e){return e.kind==="protocol"||e.kind==="unavailable"}function Wr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function Gr(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Yr(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&Gt(t)?t:null}function zr(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function tn(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function Lo(e){if(!e.hasProject)return"legacy";const t=tn(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function Uo(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function Ot(e){return e.isError||e.errorUpdateCount>0}function Qo(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const s of n)Object.hasOwn(t,s)?o[s]=t[s]:delete o[s];return o}function Co(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const nn="__noSchema";function on(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[nn]:!0}}function Xr(e){return!!e&&e[nn]===!0}function Xe(e){if(!e.ok)return e.error.code===w.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function Fo(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const Bo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Zr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},r=typeof s.__resolveType=="string"?s.__resolveType:null,i=t.get(r)??[];i.push({key:n,label:Fo(n,s)}),t.set(r,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(Bo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:Et(n.resolveType).localeCompare(Et(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function Et(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Dt(e,t,n){if(t.length===0)return n;const[o,...s]=t;if(Array.isArray(e)&&typeof o=="number"){const r=e.slice();return r[o]=Dt(e[o],s,n),r}if(e&&typeof e=="object"&&typeof o=="string"){const r=e,i={};for(const a of Object.keys(r))i[a]=a===o?Dt(r[a],s,n):r[a];return i}return e}function qr(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class It extends Error{}const Ze="site-not-owned";async function Vo(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Ho(e,t=n=>fetch(n)){const n=Be({endpoint:e,fetch:async o=>{const s=await t(new Request(o,{signal:we(o.signal)}));if(await Vo(s))throw new It;return s}});try{return await Ke(n)}catch(o){if(o instanceof It)return Ze;throw o}}async function Jo(e,t,n){await t();const o=await Ho(e,n);return o===Ze?o:{...o,hosted:ko(e,n)}}const qe=5e3;function Wo(e){if(!e.site)throw new Error("this project names no site");return Xn(e.site,e.branch)}function Go(e){return new URL(Se(e,"rpc"),window.location.origin).href}async function Ke(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==te)throw new We;const s=Jt(t.result);if(!n)throw new Error("no schema.get");if(Xe(n))return{client:e,describe:s,hasSchema:!1};if(n.ok)return{client:e,describe:s,hasSchema:!0};throw n.error}function Yo(e,t=n=>fetch(n)){return Ke(Be({endpoint:e,fetch:n=>t(new Request(n,{signal:we(n.signal)}))}))}function re(e,t){const n=N.c(40),{org:o}=zn(),{connection:s}=Ao(e),{runtime:r}=Bt(e),i=L.useContext(Kt),a=Fe(e),c=Ut(Ce(e)?.metadata),l=tn({hasServeConnection:!!s,runtime:r}),u=en(l,s?.endpoint??""),d=to()?.taskId??null,f=no(oo().lifecycle.phase),h=W(),v=Uo({mode:l,v8:a,workingTreeReady:f}),b=v.github&&!!o.slug&&!!e&&!!t,m=C({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>Jo(Wo({orgSlug:o.slug,site:c,branch:t}),()=>Qt(c,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,..._t}),R=v.sandbox&&!!o.slug&&!!e&&!!t;let k;n[0]!==t||n[1]!==o.slug||n[2]!==d||n[3]!==e?(k=()=>Yo(Go({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:d})),n[0]=t,n[1]=o.slug,n[2]=d,n[3]=e,n[4]=k):k=n[4];const $=C({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",d??""),queryFn:k,enabled:R,staleTime:Number.POSITIVE_INFINITY,..._t}),I=!!s;let _;n[5]!==s?.endpoint||n[6]!==o.slug||n[7]!==e?(_=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[5]=s?.endpoint,n[6]=o.slug,n[7]=e,n[8]=_):_=n[8];let T;n[9]!==s?(T=()=>ts(s.endpoint),n[9]=s,n[10]=T):T=n[10];let y;n[11]!==I||n[12]!==_||n[13]!==T?(y={queryKey:_,queryFn:T,enabled:I,staleTime:Number.POSITIVE_INFINITY,retry:Zo,retryDelay:Xo,refetchInterval:zo},n[11]=I,n[12]=_,n[13]=T,n[14]=y):y=n[14];const O=C(y);let D;n[15]!==s?.endpoint||n[16]!==o.slug||n[17]!==e?(D=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[15]=s?.endpoint,n[16]=o.slug,n[17]=e,n[18]=D):D=n[18];const x=D;let A;n[19]!==s?.endpoint||n[20]!==o.slug||n[21]!==e?(A=g.contentBackend(o.slug,e??"","local-describe",s?.endpoint??""),n[19]=s?.endpoint,n[20]=o.slug,n[21]=e,n[22]=A):A=n[22];let p;n[23]!==O.data||n[24]!==x||n[25]!==h?(p=async()=>{try{return await O.data.client.describe()}catch(q){const Cn=q;throw h.invalidateQueries({queryKey:x,exact:!0},{cancelRefetch:!1}),Cn}},n[23]=O.data,n[24]=x,n[25]=h,n[26]=p):p=n[26];const E=!!O.data&&!i;let j;n[27]!==A||n[28]!==p||n[29]!==E?(j={queryKey:A,queryFn:p,enabled:E,refetchInterval:qe,retry:!1},n[27]=A,n[28]=p,n[29]=E,n[30]=j):j=n[30];const M=C(j).data??O.data?.describe,Q=Lo({hasProject:!!e,hasServeConnection:!!s,runtime:r,v8:a,githubSite:m.data===Ze?"not-owned":m.data?"ready":Ot(m)?"error":"loading",sandboxSite:qo({data:$.data,isError:Ot($),workingTreeReady:f})});if(Q==="pending")return{kind:"pending",...u};if(Q==="retrying-sandbox")return{kind:"pending",retrying:"sandbox",...u};if(Q==="legacy")return{kind:"legacy"};if(Q==="protocol-github")return{...Pe(u,m.data),site:c};if(Q==="site-not-owned-github")return{kind:"unavailable",...u,siteNotOwned:!0};if(Q==="protocol-sandbox")return Pe(u,$.data);if(Q==="unavailable-github"){let q;return n[31]!==u?(q={kind:"unavailable",...u},n[31]=u,n[32]=q):q=n[32],q}const P=O.error??O.failureReason,V=s?.endpoint??"";let H;return n[33]!==M||n[34]!==O.data||n[35]!==O.failureCount||n[36]!==O.isError||n[37]!==V||n[38]!==P?(H=es({probed:O.data,isError:O.isError,failureCount:O.failureCount,failure:P,describe:M,endpoint:V}),n[33]=M,n[34]=O.data,n[35]=O.failureCount,n[36]=O.isError,n[37]=V,n[38]=P,n[39]=H):H=n[39],H}function zo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?qe:!1}function Xo(e){return vo(e+1)}function Zo(e,t){return!(t instanceof S)&&!(t instanceof We)}function qo(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const Ko=3;function es(e){const t=en("local",e.endpoint),n=e.probed?Pe(t,{...e.probed,describe:e.describe??e.probed.describe}):null;return e.isError||e.failureCount>0?n?.kind==="protocol"&&!e.isError&&e.failureCount<Ko?n:{kind:"unavailable",...t,problem:mo(e.failure)}:n??{kind:"pending",...t}}const _t={retry:2,refetchInterval:e=>e.state.status==="error"?qe:!1};function Pe(e,t){return{kind:"protocol",...e,client:t.client,describe:t.describe,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function ts(e,t){return Ke(Be({endpoint:e,fetch:n=>fetch(n,{signal:we(t?AbortSignal.any([t,n.signal]):n.signal)})}))}function Ne(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function ns(e,t){return Ne({...e,protocolSuffix:t.cacheKeySuffix})}function os(e,t,n){return e?t==="pending"?{ready:!1,failed:!1}:t==="unavailable"?{ready:!1,failed:!0}:n:{ready:!0,failed:!1}}function ss(e,t){return JSON.stringify([e?.orgSlug,e?.virtualMcpId,e?.branch,Mo(t)])}function rs(e,t,n){const o=N.c(21),s=W(),r=re(e?.virtualMcpId,e?.branch),i=e&&r.kind==="protocol"&&r.hosted?r:null;let a;o[0]!==i||o[1]!==e?(a=i&&e?ns(e,i):"",o[0]=i,o[1]=e,o[2]=a):a=o[2];const c=Po(i?.hosted,a,t,n),l=e!==null;let u;o[3]!==r.kind||o[4]!==c||o[5]!==l?(u=os(l,r.kind,c),o[3]=r.kind,o[4]=c,o[5]=l,o[6]=u):u=o[6];const d=u,f=r.kind!=="legacy";let h;o[7]!==r||o[8]!==e?(h=ss(e,r),o[7]=r,o[8]=e,o[9]=h):h=o[9];let v;o[10]!==r.kind||o[11]!==r.source||o[12]!==c||o[13]!==s||o[14]!==e?(v=()=>{if(c.retry(),!e||r.kind!=="unavailable")return;const m=r.source;s.resetQueries({queryKey:g.contentBackend(e.orgSlug,e.virtualMcpId,...m==="local"?["local"]:[e.branch,m])})},o[10]=r.kind,o[11]=r.source,o[12]=c,o[13]=s,o[14]=e,o[15]=v):v=o[15];let b;return o[16]!==d||o[17]!==f||o[18]!==h||o[19]!==v?(b={...d,v8:f,scopeKey:h,retry:v},o[16]=d,o[17]=f,o[18]=h,o[19]=v,o[20]=b):b=o[20],b}function sn(e){const t=N.c(12);let n;t[0]!==e?(n=_e.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[s,r]=Zn(o,null),i=Fe(e);let a;t[2]!==s||t[3]!==e?(a=e?ft(s):null,t[2]=s,t[3]=e,t[4]=a):a=t[4];const l=i?null:a;let u,d;t[5]!==r?(u=h=>r(ft(h)),d=()=>r(null),t[5]=r,t[6]=u,t[7]=d):(u=t[6],d=t[7]);let f;return t[8]!==l||t[9]!==u||t[10]!==d?(f={url:l,setUrl:u,clear:d},t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}const Tt=6e4,is=2147483647;function as(e,t){if(e===null||e.trim()==="")return Tt;const n=e.trim(),o=/^\d+(?:\.\d+)?$/.test(n)?Number(n)*1e3:/^[A-Za-z]{3}, /.test(n)?Math.max(0,Date.parse(n)-t):Number.NaN;return Number.isFinite(o)&&o>=0&&o<=is?o:Tt}class rn extends Error{constructor(t,n,o,s=Date.now()){super(t),this.status=n,this.name="ContentResponseError",this.retryAt=n===429?s+as(o,s):null}status;retryAt}function cs(e,t,n=Date.now()){const o=Ft(5e3,1e3,e,2,0);return t instanceof rn&&t.retryAt!==null?Math.max(o,t.retryAt-n):o}async function et(e,t){const n=await e.json().catch(()=>null),o=n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?n.error:`${t} failed (${e.status})`;throw new rn(o,e.status,e.headers.get("retry-after"))}function ls(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Rt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function ye(e,t,n){return["decofile-write",e,t,n]}function us(e,t,n){return{id:ye(e,t,n).join(":")}}class tt extends Error{constructor(t,n,o=[],s=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=s,this.name="BlockConflictError"}blocks;fields;carriedStored}function nt(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function ot(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function fs(e,t){return et(e,t)}function ds(e,t,n){e.setQueryData(g.decofileDraft(nt(t)),n)}function hs(e,t){return e.getQueryData(g.decofileDraft(nt(t)))??null}async function gs(e,t){return(await fetch(ot(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function Kr(e){const t=N.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?nt(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:vs,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=C(o);return s??null}async function vs(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function bs(e,t){const n=await fetch(ot(t),{cache:"no-store"});if(!n.ok)return et(n,"Read decofile");const o=await n.json();return o.token&&ds(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function ei(e,t){const n=await fetch(ot(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const s=await n.json().catch(()=>({}));throw s.code==="block-conflict"?new tt(s.blocks??[],s.error??"Block changed"):new Error(s.error??`Save failed (${n.status})`)}if(!n.ok)return fs(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const an=3e3,ms=15e3,ps=2*6e4,cn={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function ws(e){return e<ps?an:ms}function Ss(e,t=cn){const n=t.now();let o=!1,s=!1,r=null;const i=()=>{o||(r=t.setTimeout(a,ws(t.now()-n)))},a=()=>{if(r=null,o)return;const{read:c,skip:l}=e();if(s||t.hidden()||l?.()){i();return}s=!0;let u;try{u=c()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{s=!1}),i()};return i(),()=>{o=!0,r!==null&&t.clearTimeout(r)}}const xt=()=>0;function ys(e,t,n=cn){const o=L.useRef(t);o.current=t;const[s]=L.useState(()=>({polling:()=>Ss(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?s.polling:s.idle,xt,xt)}function ln(e,t){return Se(e,t)}function ks(e,t){return Se(e,"preview-fetch",{path:t})}function ti(e){return ln(e,"preview-invoke")}function ni(e){return ln(e,"catalog-invoke")}function un(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function Os(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&un(n))return n}return null}function Es(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Os();return n&&un(n)?new URL(t,n).toString():ks(e,t)}function Ds(e){return Es(e,"/.decofile")}function Is(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function Pt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function _s(e,t){const n=Se(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),s=Is(o.status);if(s==="absent")return{kind:"absent"};if(s==="unavailable")return{kind:"unavailable"};if(s==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const r=await o.json();return typeof r.content!="string"?{kind:"unavailable"}:{kind:"data",data:so(r.content)}}async function Ts(e,t){const n=await _s(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function oi(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok)return et(n,"Read committed meta");try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Rs(e){return Ce(e)?.metadata?.runtime?.path??null}function je(e,t,n,o){const s=F(e),r=Object.keys(n?.changes??{}).find(a=>F(a)===s);if(r!==void 0&&n)return n.changes[r].baseVersion;const i=Object.keys(t?.draft??{}).some(a=>F(a)===s);if(t&&!i){const a=Object.keys(t.entries).find(c=>F(c)===s);return a===void 0?null:t.entries[a].version}return o?.[e]??null}class fn extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function si(e){return e instanceof S&&e.code===w.Conflict}function dn(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class st extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class rt extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function ri(e,t){return(t instanceof st||t instanceof rt)&&(t.message=hn(e,t,"github")),t}function hn(e,t,n){if(t instanceof st)return e("siteEditor.save.draftUnread");if(t instanceof rt)return e("siteEditor.save.keptChanging");if(t instanceof tt)return t.message;if(n==="local")return Ps(e,t);if(t instanceof S)switch(t.code){case w.Conflict:return e("siteEditor.save.conflict");case w.ReadOnly:return e("siteEditor.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("siteEditor.save.invalid");case w.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function xs(e,t){if(t==="local"||e instanceof tt||e instanceof st||e instanceof rt)return null;if(e instanceof S){const n=e.code===w.InvalidBlock||e.code===w.InvalidParams?dn(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Ps(e,t){if(t instanceof fn)return e("decoServe.save.serverGone");if(t instanceof S)switch(t.code){case w.Conflict:return e("decoServe.save.conflict");case w.ReadOnly:return e("decoServe.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("decoServe.save.invalid",{detail:dn(t)});case w.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Ns(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function js(e,t){const[n,o]=L.useState(e),s=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){s.current??=Date.now();return}if(!n)return;const r=()=>{s.current=null,o(!1)},i=Ns(s.current,Date.now(),t);if(i===0){r();return}const a=setTimeout(r,i);return()=>clearTimeout(a)},[e,n,t]),n}const $s="decocms:content-writes",$e=new Set;let Y;function gn(){if(Y!==void 0)return Y;Y=null;try{typeof BroadcastChannel=="function"&&(Y=new BroadcastChannel($s),Y.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...$e])n(t)}))}catch{Y=null}return Y}function As(e){try{gn()?.postMessage({cacheKey:e})}catch{}}function Ms(e){return gn(),$e.add(e),()=>{$e.delete(e)}}const vn="__at=",bn="__test=",Ls=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Us(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function ee(e){return typeof e=="string"&&Ls.test(e)}function Nt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Qs(e){const t=e.tests??{};return[...e.at!==void 0?[vn+Nt(e.at)]:[],...Object.keys(t).map(n=>bn+Nt(`${n}=${t[n]?"on":"off"}`))]}function jt(e,t){const o=[...e.split("&").filter(s=>s&&!s.startsWith(vn)&&!s.startsWith(bn)),...t];return o.length>0?`?${o.join("&")}`:""}function ve(e,t){const n=Qs(t),o=e.indexOf("?"),s=o===-1?e:e.slice(0,o);if(ee(s))return s+jt(o===-1?"":e.slice(o+1),n);const r=e.lastIndexOf("@");if(r<=0)return e;const i=e.slice(0,r),a=i.indexOf("?"),c=a===-1?i:i.slice(0,a),l=a===-1?"":i.slice(a+1);return`${c}${jt(l,n)}${e.slice(r)}`}function ii(e,t,n){if(!Us(t))return e;try{const o=new URL(e),s=o.searchParams.get("__draft");return s&&s!=="off"?(o.searchParams.set("__draft",ve(s,t)),o.toString()):ee(n)?(o.searchParams.set("__draft",ve(n,t)),o.toString()):e}catch{return e}}function ai(e,t,n="/"){if(!e||!ee(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function mn(e){return btoa(encodeURIComponent(e))}function ci(e,t,n){const o=Cs(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function Cs(e,t,n){const o=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return s.searchParams.set("path","/"),s.searchParams.set("pathTemplate","/"),s.searchParams.set("props",mn(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),s}const Fs="__draft";function li(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const Bs="off";function Vs(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Fs,t),n.toString()}function ui(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:s,...r}=e.pageBlock,i=JSON.stringify({__props:r,__decofile:e.decofile});return{src:o.toString(),body:i}}function fi(e,t,n,o){const s=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,s);r.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),r.searchParams.set("props",mn(JSON.stringify({sections:i}))),r.toString()}function di(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const $t="__variant=";function pn(e,t,n){return`${e}@${t}=${n}`}function hi(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[pn(e,"sections",t.index)]}function gi(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[pn(e.pageKey,o,e.selectedVariantIndex)]}function vi(e,t){return[...t,...e]}function Hs(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function it(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),s=o.indexOf("?"),r=s===-1?o:o.slice(0,s),a=[...s===-1?[]:o.slice(s+1).split("&").filter(l=>l&&!l.startsWith($t)),...t.map(l=>$t+Hs(l))],c=a.length>0?`?${a.join("&")}`:"";return`${r}${c}${e.slice(n)}`}function bi(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),s=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return it(`${s}${o.pathname}@local`,t)}catch{return null}}function mi(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",it(o,t)),n.toString())}catch{return e}}function Js(e){const{pointer:t}=e;if(!t||t===Bs)return null;const n=t.indexOf("?");return ee(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:ee(e.heldRevision)&&e.forcedVariants.length===0?ve(e.heldRevision,e.previewOptions):ve(it(t,e.forcedVariants),e.previewOptions)}function Ws(e,t){if(!e||!t)return null;try{return Vs(e,t)}catch{return null}}function pi(e,t,n){if(!e||!n)return null;try{return Ws(new URL(t,e).toString(),n)}catch{return null}}const be={forcedVariants:[],previewOptions:{}},ce=new Map,le=new Map,Ae=new Map;function wn(e){for(const t of Ae.get(e)??[])t()}function Sn(e,t){const n=ee(t)?t:null;(le.get(e)??null)!==n&&(n?le.set(e,n):le.delete(e),wn(e))}function Gs(e){return le.get(e)??null}function Ys(e,t){return JSON.stringify(e)===JSON.stringify(t)}function wi(e,t){const n=ce.get(e)??be,o=t??be;Ys(n,o)||(t?ce.set(e,o):ce.delete(e),wn(e))}function zs(e){return ce.get(e)??be}function yn(e,t){let n=Ae.get(e);return n||(n=new Set,Ae.set(e,n)),n.add(t),()=>{n.delete(t)}}function Xs(e){const t=N.c(3);let n,o;return t[0]!==e?(n=s=>yn(e,s),o=()=>zs(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,Zs)}function Zs(){return be}function qs(e){const t=N.c(3);let n,o;return t[0]!==e?(n=s=>e?yn(e,s):er,o=()=>e?Gs(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,Ks)}function Ks(){return null}function er(){}function Si(e,t){const n=N.c(4),o=Xs(e),s=qs(e);let r;return n[0]!==o||n[1]!==s||n[2]!==t?(r=Js({pointer:t,heldRevision:s,...o}),n[0]=o,n[1]=s,n[2]=t,n[3]=r):r=n[3],r}const kn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},tr=15e3,me=new Map;function Z(e,t){return`${e}/${t}`}function B(e){let t=me.get(e);return t||(t={state:kn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},me.set(e,t)),t}function J(e,t){const n=B(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function ke(e){e.timer&&clearTimeout(e.timer),e.timer=null}function at(e){return me.get(e)?.state??kn}function nr(e,t){const n=B(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function yi(e){const t=B(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(ke(t),J(e,{phase:"idle"}))}}function ki(e){const t=me.get(e);!t||t.state.phase!=="reloading"||(ke(t),J(e,{phase:"idle"}))}function On(e){const t=B(e);ke(t),J(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ue(e,t){const n=B(e),o=Math.max(0,n.state.inFlight-1);if(o>0){J(e,{inFlight:o});return}if(!t.ok||n.previews===0){J(e,{phase:"idle",inFlight:o});return}En(e,t.navigates,o)}function En(e,t,n=0){const o=B(e);ke(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&J(e,{phase:"idle"})},tr),J(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function or(e){return e?.kind==="protocol"&&e.source==="github"}async function fe(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,s)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=r?g.protocolDraftRead(o,s,r):null,u=l?JSON.stringify(n.getQueryData(l)??null):null,d=c?[c]:[];if(a&&t.reread&&d.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&d.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),r&&i.source==="sandbox"&&d.push(n.invalidateQueries({queryKey:ro(o,s,r)})),or(i)&&l&&!t.adopted&&d.push(n.invalidateQueries({queryKey:l})),await Promise.all(d),t.kind!=="edit"){const v=Z(o,s);J(v,{epoch:at(v).epoch+1})}const f=l?JSON.stringify(n.getQueryData(l)??null):null,h=u!==f;return h&&await new Promise(v=>Ct.schedule(v)),{navigates:h}}async function sr(e,t){return On(Z(e.orgSlug,e.virtualMcpId)),Dn(e,t)}function At(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Dn(e,t){const n=Z(e.orgSlug,e.virtualMcpId),o=t.adopted?At(e):null;let s;try{s=await t.write()}catch(i){throw ue(n,{ok:!1,navigates:!1}),t.refreshOnError&&fe(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&As(e.cacheKey),Sn(n,t.shownRevision?.(s)??null),t.adopted){const i=At(e)!==o;return i&&await new Promise(a=>Ct.schedule(a)),ue(n,{ok:!0,navigates:i}),t.reread&&fe(e,t).catch(()=>{}),s}let r=!1;try{({navigates:r}=await fe(e,t))}catch{}finally{ue(n,{ok:!0,navigates:r})}return s}function Oi(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r}=e,i=Z(o,s),a=new Set(t.blockKeys);for(const u of[...B(i).discardListeners])u(a);On(i);let c=!1;const l=()=>(c=!0,Dn(e,{kind:"discard",reread:!0,write:t.write}));return r?n.getMutationCache().build(n,{mutationKey:ye(o,s,r),scope:us(o,s,r),mutationFn:l}).execute(void 0).catch(u=>{throw c||ue(i,{ok:!1,navigates:!1}),u}):l()}function Ei(e,t,n){const o=N.c(8);let s;o[0]!==e||o[1]!==t?(s=Z(e,t),o[0]=e,o[1]=t,o[2]=s):s=o[2];const r=s;let i;o[3]!==n||o[4]!==r?(i=()=>{const c=B(r).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=r,o[5]=i):i=o[5];let a;o[6]!==r?(a=[r],o[6]=r,o[7]=a):a=o[7],L.useEffect(i,a)}function In(e){const t=Z(e.orgSlug,e.virtualMcpId);at(t).inFlight>0||(Sn(t,null),fe(e,{kind:"external"}).then(({navigates:n})=>{const o=B(t);o.previews>0&&o.state.inFlight===0&&En(t,n)}).catch(()=>{}))}function rr(e,t){const n=N.c(7);let o;n[0]!==e||n[1]!==t?(o=Z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const s=o;let r;n[3]!==s?(r=l=>nr(s,l),n[3]=s,n[4]=r):r=n[4];const i=r;let a;n[5]!==s?(a=()=>at(s),n[5]=s,n[6]=a):a=n[6];const c=a;return L.useSyncExternalStore(i,c,c)}const ir=500;function Di(e,t){const{phase:n}=rr(e,t);return js(n!=="idle",ir)}function ar(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function _n(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function Ii(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Do(i,n):cr(e,t,n)}const s=e.getQueryData(g.contentVersions(t));if(!s)return;if(Object.hasOwn(s,n))return s[n];const r=e.getQueryData(g.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Tn(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(s=>F(s)===n);return o===void 0?void 0:e.changes[o]}function cr(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return Rn(o,Oe(e,t),n)}function Rn(e,t,n){const o=Tn(e,n);return o?.kind==="delete"?o.version??X:o?o.version:t.has(F(n))?X:null}function _i(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const s=Tn(o,n);return s?s.kind==="set"&&s.baseVersion===null:Oe(e,t).has(F(n))}function Ti(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const s=Oe(e,t);return{blocks:n,versionOf:r=>Rn(o,s,r)}}function Oe(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const s=F(n),r=Oe(e,t);r.has(s)!==o&&(o?r.add(s):r.delete(s),G(e),e.setQueryData(g.contentDraftTombstones(t),[...r]))}function xn(e,t,n,o){const s=o.revision,r=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([f,h])=>[f,h===X?null:h]),a=e.getQueryData(g.contentChanges(n)),c=e.getQueryData(g.contentIndex(n)),l=new Set(i.flatMap(([f])=>je(f,c,a,r)===null?[f]:[])),u=new Set(i.flatMap(([f,h])=>h===null?[]:[F(f)]));e.setQueryData(g.contentChanges(n),f=>{if(!f)return f;const h={...f.changes};for(const[v,b]of i){const m=je(v,c,f,r);b!==null?h[v]={kind:"set",version:b,baseVersion:m}:m!==null?h[v]={kind:"delete",version:null,baseVersion:m}:delete h[v]}return{...f,changes:h,edited:!0}});for(const[f,h]of i)h!==null?pe(e,n,f,!1):!u.has(F(f))&&l.has(f)&&pe(e,n,f,!0);const d=o.revision;return d&&d!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),f=>f&&{...f,version:d}),s}function Ee(e,t,n){G(e),e.setQueryData(g.contentVersions(t),o=>{const s={...o};for(const[r,i]of Object.entries(n))i===null?delete s[r]:s[r]=i;return s})}function Pn(e,t){const n=e.getMutationCache().findAll({mutationKey:ye(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>Co(o.state.variables)))}function Me(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function se(e,t,n,o){try{return await o()}catch(s){const r=!(s instanceof S);throw t.source==="local"&&r?(Me(e,n),new fn(s)):(t.source==="local"&&He(s)&&Me(e,n),s)}}const Mt=new WeakMap;function ct(e){let t=Mt.get(e);return t||(t={inFlight:new Map,rereading:new Set},Mt.set(e,t)),t}function Nn(e,t,n,o){const{inFlight:s}=ct(e),r=s.get(o);if(r)return r;const i=lt(e,t,n,o,!0);return s.set(o,i),i.finally(()=>{s.get(o)===i&&s.delete(o)})}function lr(e,t,n){const o=N.c(8),s=W(),r=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let c,l;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==r||o[4]!==s||o[5]!==i?(c=()=>{if(!e||!r||!i||!a)return;const u={orgSlug:r,virtualMcpId:i,branch:a},{rereading:d}=ct(s);return Ms(f=>{f===n&&(d.has(n)||(d.add(n),fr(s,e,u,n).catch(ur).finally(()=>d.delete(n))))})},l=[s,e,r,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=r,o[4]=s,o[5]=i,o[6]=c,o[7]=l):(c=o[6],l=o[7]),L.useEffect(c,l)}function ur(){}async function fr(e,t,n,o){const s=ct(e).inFlight.get(o);return s&&await s.catch(()=>{}),Nn(e,t,n,o)}async function lt(e,t,n,o,s){G(e);const r=g.decofile(o),i=_n(n,t),a=g.contentRevision(o),c=g.contentVersions(o),l=e.getQueryData(r),u=e.getQueryData(c),f=e.getQueryData(i),h=e.getQueryData(a)??void 0,v=s&&l&&u?h?.revision:void 0,b=s&&f?h?.schemaVersion:void 0,m=g.contentChanges(o),R=e.getQueryData(m);if(t.source==="github"&&t.hosted)return dr(e,t,t.hosted,n,o,{conditional:s,seen:h,currentMeta:f,schemaIfNoneMatch:b,seenChanges:R});const[k,$,I]=await se(e,t,n,()=>t.client.batch([{method:"blocks.list",params:v?{ifNoneMatch:v}:{}},{method:"schema.get",params:b?{ifNoneMatch:b}:{}},{method:"changes.list",params:Ve(R)}])),_=e.getQueryData(a)?.revision,T=_!==void 0&&_!==h?.revision;if(I?.ok){const E=T?null:de(R,I.result);E&&e.setQueryData(m,E)}else I&&t.source==="local"&&He(I.error)&&Me(e,n);if(!k?.ok)throw k?.error??new Error("no blocks.list");if(!$)throw new Error("no schema.get");const y=k.result,O=Xe($),D=$.ok&&!O?$.result:null;if(y.notModified&&(!l||!u)||D?.notModified&&!f)return lt(e,t,n,o,!1);const x=y.notModified?new Set:Pn(e,n),A=y.notModified?l:Qo(y.blocks,l,x),p=O?on():D?D.notModified?f:D.schema:$.error;if(e.setQueryData(a,{revision:T?_:y.notModified?h?.revision:y.revision,schemaVersion:D?D.notModified?h?.schemaVersion:D.version??void 0:void 0}),e.setQueryData(r,A),!y.notModified){const E=e.getQueryData(c),j={...y.versions};for(const U of x){const M=E?.[U];M!==void 0?j[U]=M:delete j[U]}e.setQueryData(c,j)}return p instanceof S||e.setQueryData(i,p),!T&&!y.notModified&&l&&h?.revision&&y.revision!==h.revision&&In({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:p}}async function dr(e,t,n,o,s,r){const i=g.decofile(s),a=g.contentIndex(s),c=g.contentRevision(s),l=g.contentVersions(s),u=_n(o,t),d=g.contentChanges(s),f=e.getQueryData(a),h=r.conditional&&f?r.seen?.revision:void 0,[v,b,m]=await se(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:r.schemaIfNoneMatch?{ifNoneMatch:r.schemaIfNoneMatch}:{}},{method:"changes.list",params:Ve(r.seenChanges)}])),R=e.getQueryData(a)??f,k=e.getQueryData(c)?.revision,$=k!==void 0&&k!==r.seen?.revision;if(m?.ok&&!$){const P=de(r.seenChanges,m.result);P&&e.setQueryData(d,P)}if(!v?.ok)throw v?.error??new Error("no cms.index");if(!b)throw new Error("no schema.get");const I=v.result,_=Xe(b),T=b.ok&&!_?b.result:null;if(I.notModified&&!f||T?.notModified&&!r.currentMeta)return lt(e,t,o,s,!1);const y=_?on():T?T.notModified?r.currentMeta:T.schema:b.error;y instanceof S||e.setQueryData(u,y);const O=T?T.notModified?r.seen?.schemaVersion:T.version??void 0:void 0,D=e.getQueryData(i)??{};if(I.notModified||$)return e.setQueryData(c,{revision:$?k:r.seen?.revision,schemaVersion:O}),e.setQueryData(i,D),{blocks:D,meta:y};const x={revision:I.revision,resolvedRef:I.resolvedRef,sequence:I.sequence,entries:I.entries,draft:I.draft};e.setQueryData(a,x);const A=!!r.seen?.revision&&x.revision!==r.seen.revision&&(!r.seen.revision.startsWith("s-")||!!f&&jn(f.draft,x.draft));A&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),P=>P&&{...P,version:x.revision}),e.setQueryData(c,{revision:x.revision,schemaVersion:O});const p=Pn(e,o),E=e.getQueryData(l)??{},j={},U={},M=[];for(const[P,V]of Object.entries(D)){const H=x.entries[P];!H&&!p.has(P)||(j[P]=V,E[P]!==void 0&&(U[P]=E[P]),H&&!p.has(P)&&E[P]!==H.version&&M.push(P))}return e.setQueryData(i,j),e.setQueryData(l,U),M.length>0&&await Ye(e,n,s,M,p),R&&A&&hr(R,x)&&In({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:s}),{blocks:e.getQueryData(i)??j,meta:y}}function hr(e,t){if(jn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function jn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function gr(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function Ie(e){if(!(e instanceof S)||e.code!==w.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}async function vr(e,t){if(!(e instanceof S)||e.code!==w.Conflict)return;const n=e.data?.entries;if(!n||typeof n!="object")return;const o=Object.entries(n);if(o.length===0)return;const s=t.set??{},r=new Set(t.delete??[]),i={};for(const[a,c]of o){const l=c?.actual;if(typeof l!="string"||(Object.hasOwn(s,a)?await eo(s[a]):r.has(a)?X:void 0)!==l)return;i[a]=l}return i}function br(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([s])=>!Object.hasOwn(t,s))),o=(e.delete??[]).filter(s=>!Object.hasOwn(t,s));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function ie(e,t,n,o,s){G(e),xn(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:s}),Ee(e,n,Object.fromEntries(Object.entries(s).map(([r,i])=>[r,i===X?null:i]))),qt(e,n,s,o.set??{})}async function Ri(e,t,n,o,s,r){if(t.source==="github"){const a=[...Object.keys(s.set??{}),...s.delete??[]].filter(l=>!r||!Object.hasOwn(r,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const c=qn(s.set);if(c.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${c.join(", ")})`)}return sr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=(u,d=r)=>se(e,t,n,()=>t.client.blocksApply({set:u.set,delete:u.delete,...d?{ifMatch:gr(d,u)}:{}}));let a;try{a=await i(s)}catch(u){const d=t.source==="github"?Ie(u):void 0;if(!d)throw u;const f=br(s,d);Object.keys(d).length>0&&ie(e,n,o,s,d);let h;try{h=await i(f)}catch(v){const b=Ie(v);b&&Object.keys(b).length>0&&ie(e,n,o,f,b);const m=await vr(v,f);if(!m)throw v;ie(e,n,o,f,m);try{h=await i(f,{...r,...m})}catch(R){const k=Ie(R);throw k&&Object.keys(k).length>0&&ie(e,n,o,f,k),R}}a={...h,versions:{...d,...h.versions}}}G(e);const c=t.source==="github"?xn(e,n,o,a):a.revision;t.source==="github"&&qt(e,o,a.versions??{},s.set??{}),e.setQueryData(g.contentRevision(o),u=>({...u,revision:c}));const l=a.versions??{};return Ee(e,o,l),{revision:c,versions:l}}})}function $n(e,t){if(!(e instanceof S))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function An(e,t,n){if(!(n instanceof S))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[s,r]of Object.entries(o))r===null&&pe(e,t,s,!1)}function Mn(e,t,n,o){G(e),Kn(e,n,o);const s=o.block===null,r=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=je(n,e.getQueryData(g.contentIndex(t)),i,r);if(i){const c=F(n),l=Object.fromEntries(Object.entries(i.changes).filter(([u])=>F(u)!==c));s?a!==null&&(l[n]={kind:"delete",version:null,baseVersion:a}):l[n]={kind:"set",version:o.version,baseVersion:a},e.setQueryData(g.contentChanges(t),{...i,changes:l,edited:!0})}pe(e,t,n,s&&a===null),e.setQueryData(g.decofile(t),c=>{const l={...c};return s?delete l[n]:l[n]=o.block,l}),Ee(e,t,{[n]:s?null:o.version}),Io(e,t,n,o)}function xi(e,t,n,o){if(t.source!=="github"||!(o instanceof S))return!1;An(e,n,o);const s=o.data?.draft;if(!s||typeof s!="object")return!1;const r=Object.keys(s),i=r.map(a=>$n(o,a));return r.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),r.forEach((a,c)=>{Mn(e,n,a,i[c])}),!0)}async function Pi(e,t,n,o,s,r){t.source==="github"&&An(e,o,r);const i=t.source==="github"?$n(r,s):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),Mn(e,o,s,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const l=(await se(e,t,n,()=>t.client.changesGet({names:[s]}))).entries[s];if(l&&l.after===null&&l.version!==null)return!1;a={value:l?.after??null,version:l?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),u=>{if(!u)return u;const d={...u.changes};return l?.kind?d[s]={kind:l.kind,version:l.version,baseVersion:l.baseVersion}:delete d[s],{...u,changes:d,edited:!0}})}catch{const c=await se(e,t,n,()=>t.client.blocksList({}));if(c.notModified)return!1;a={value:c.blocks[s]??null,version:c.versions[s]??null}}return e.setQueryData(g.decofile(o),c=>{const l={...c};return a.value===null?delete l[s]:l[s]=a.value,l}),Ee(e,o,{[s]:a.version}),!1}function mr(e){const t=N.c(17),n=Ce(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=Ut(n),t[0]=n,t[1]=o):o=t[1];const s=o;let r;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(r=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=r):r=t[5];let i;t[6]!==e||t[7]!==s?(i=async()=>{const b=await Qt(s,e.branch),m=b.pointer?.lastIndexOf("@")??-1;return{draft:b.pointer&&m>0?b.pointer.slice(0,m):null,version:b.pointer&&m>0?b.pointer.slice(m+1):b.etag}},t[6]=e,t[7]=s,t[8]=i):i=t[8];const a=!!e&&!!s;let c;t[9]!==r||t[10]!==i||t[11]!==a?(c={queryKey:r,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=r,t[10]=i,t[11]=a,t[12]=c):c=t[12];const{data:l,isPending:u,isError:d}=C(c),f=!!e&&!!s&&u&&!d;if(!e||!l?.draft||!l.version){let b;return t[13]!==f?(b={pointer:null,pending:f},t[13]=f,t[14]=b):b=t[14],b}const h=`${l.draft}@${l.version}`;let v;return t[15]!==h?(v={pointer:h,pending:!1},t[15]=h,t[16]=v):v=t[16],v}function Ni(e){return mr(e).pointer}function ji(e){const t=N.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:pr,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=C(o);return s?.revision}async function pr(){throw new Error("content revisions are set by reads and writes")}function ut(e,t){const n=N.c(6),{url:o}=sn(e?.virtualMcpId),s=re(e?.virtualMcpId,e?.branch);if(!e)return"";let r;return n[0]!==s.cacheKeySuffix||n[1]!==s.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(r=s.kind!=="legacy"&&s.cacheKeySuffix!==void 0?Ne({...e,protocolSuffix:s.cacheKeySuffix}):Ne({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=s.cacheKeySuffix,n[1]=s.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=r):r=n[5],r}function $i(e,t){const n=N.c(46),{url:o}=sn(e?.virtualMcpId),s=!!o,r=re(e?.virtualMcpId,e?.branch),i=r.kind==="protocol"?r:null,a=ut(e),c=t?.fetchEnabled??!0,l=Rs(e?.virtualMcpId),u=Bt(e?.virtualMcpId).runtime==="cms",d=W();let f;n[0]!==a?(f=g.decofile(a),n[0]=a,n[1]=f):f=n[1];const h=f;lr(i,i&&e?e:null,a);let v;n[2]!==e||n[3]!==d||n[4]!==h?(v=()=>{if(!e||d.isMutating({mutationKey:ye(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const E=d.getQueryState(h);return E?.fetchStatus==="fetching"||Date.now()-(E?.dataUpdatedAt??0)<an/2},n[2]=e,n[3]=d,n[4]=h,n[5]=v):v=n[5];let b;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==i||n[10]!==d||n[11]!==h?(b=async()=>{if(e){if(!i&&u&&!s){const E=hs(d,e)?.version;if(E&&!await gs(e,E))return}await d.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=i,n[10]=d,n[11]=h,n[12]=b):b=n[12];let m;n[13]!==v||n[14]!==b?(m={skip:v,read:b},n[13]=v,n[14]=b,n[15]=m):m=n[15],ys(!!t?.pollWhile&&!!e,m);const R=ze(i?.hosted?a:"");let k;n[16]!==r.kind||n[17]!==u||n[18]!==c||n[19]!==a||n[20]!==s||n[21]!==o||n[22]!==l||n[23]!==e||n[24]!==i||n[25]!==d?(k=async()=>{if(i)return(await Nn(d,i,e,a)).blocks;if(r.kind==="unavailable")throw ar("decofile");if(s){const M=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Sr),Q=M?.ok?Rt(await M.text()):null;if(Q)return Q;const P=new Error("decofile unavailable (local tunnel unreachable)");throw P.status=502,P}if(u)return bs(d,e);const E=()=>Ts(e,ls(l,".deco/blocks.gen.json"));if(c){const M=await fetch(Ds(e),{cache:"no-store"}).catch(wr);if(M?.ok){const V=Rt(await M.text());if(V)return V}const Q=await E();if(Q.kind==="data")return Q.data;const P=new Error(`Failed to fetch decofile: ${M?.status??"network error"}`);throw P.status=Pt({liveOk:!!M?.ok,liveStatus:M?.status,committedAbsent:Q.kind==="absent"}),P}const j=await E();if(j.kind==="data")return j.data;const U=new Error("decofile unavailable (preview down, no committed snapshot)");throw U.status=Pt({liveOk:!1,committedAbsent:j.kind==="absent"}),U},n[16]=r.kind,n[17]=u,n[18]=c,n[19]=a,n[20]=s,n[21]=o,n[22]=l,n[23]=e,n[24]=i,n[25]=d,n[26]=k):k=n[26];const $=!!e&&r.kind!=="pending",I=i?0:3e4,_=i?.describe.pollIntervalMs,T=i?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==i?(y=(E,j)=>{if(i||u||s)return E<3;const U=j.status;return U!==502&&U!==404&&E<2},n[27]=u,n[28]=s,n[29]=i,n[30]=y):y=n[30];let O;n[31]!==h||n[32]!==k||n[33]!==$||n[34]!==I||n[35]!==_||n[36]!==T||n[37]!==y?(O={queryKey:h,queryFn:k,enabled:$,staleTime:I,refetchInterval:_,refetchIntervalInBackground:!1,refetchOnWindowFocus:T,retry:y,retryDelay:cs},n[31]=h,n[32]=k,n[33]=$,n[34]=I,n[35]=_,n[36]=T,n[37]=y,n[38]=O):O=n[38];const D=C(O);let x;n[39]!==R||n[40]!==D?(x=R&&D.data?Oo(R,D.data):void 0,n[39]=R,n[40]=D,n[41]=x):x=n[41];const A=x;let p;return n[42]!==A||n[43]!==i?.hosted||n[44]!==D?(p=i?.hosted&&A?{...D,data:A}:D,n[42]=A,n[43]=i?.hosted,n[44]=D,n[45]=p):p=n[45],p}function wr(){return null}function Sr(){return null}function Ai(e,t,n){return rs(e,t,n)}function Mi(e){const t=N.c(4),n=W(),o=re(e?.virtualMcpId,e?.branch),s=ut(e),r=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==s||t[1]!==n||t[2]!==r?(i=(a,c)=>_o(n,r,s,a,c),t[0]=s,t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function Li(e,t){const n=N.c(3),o=re(e?.virtualMcpId,e?.branch),s=ut(e),r=ze(o.kind==="protocol"&&o.hosted?s:"");let i;return n[0]!==r?.entries||n[1]!==t?(i=Object.entries(r?.entries??{}).filter(a=>{const[,c]=a;return t(c.meta?.type??"")}).map(yr),n[0]=r?.entries,n[1]=t,n[2]=i):i=n[2],i}function yr(e){const[t]=e;return t}const kr="site-editor-save",Ln={id:kr,description:void 0,action:void 0,cancel:void 0},Ui="site-editor-undo",Le="site-editor-publish";function Or(e){const t=N.c(7),{label:n,detail:o}=e;let s;t[0]!==n?(s=z.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=s):s=t[1];let r;t[2]!==o?(r=z.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=r):r=t[3];let i;return t[4]!==s||t[5]!==r?(i=z.jsxs("details",{className:"mt-1 text-xs",children:[s,r]}),t[4]=s,t[5]=r,t[6]=i):i=t[6],i}function Un(e,t){return t?z.jsx(Or,{label:e("siteEditor.details"),detail:t}):void 0}function Qi(e,t,n){ne.error(hn(e,t,n),{...Ln,description:Un(e,xs(t,n))})}function Ci(e,t,n=!1){ne.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Ln,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Qn={action:void 0,duration:void 0};function Fi(e,t){ne.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Qn,id:Le,description:void 0})}function Bi(e,{headline:t,body:n,detail:o,retry:s,pending:r,tone:i="error"}){const a=Un(e,o??null);ne[i](t,{id:Le,description:n&&a?z.jsxs(z.Fragment,{children:[z.jsx("p",{children:n}),a]}):n??a,action:s?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),ne.loading(r??e("thread.publishPopover.publishing"),{...Qn,id:Le,description:void 0}),s()}}:void 0,duration:s?Number.POSITIVE_INFINITY:void 0})}function Vi(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Mo as $,Yr as A,di as B,Mi as C,Di as D,Gr as E,mr as F,Z as G,qs as H,wi as I,bi as J,ve as K,Bs as L,Vs as M,ii as N,mi as O,ci as P,ki as Q,yi as R,rr as S,Kt as T,ji as U,ui as V,us as W,ye as X,sr as Y,_s as Z,fs as _,Hr as a,fi as a$,ns as a0,Lr as a1,Qr as a2,Li as a3,rs as a4,Ci as a5,_i as a6,ri as a7,tt as a8,si as a9,Si as aA,pi as aB,rt as aC,xi as aD,Nn as aE,cs as aF,oi as aG,Le as aH,Qn as aI,Fi as aJ,Oi as aK,Ar as aL,Mr as aM,He as aN,Kr as aO,Ni as aP,li as aQ,ee as aR,ai as aS,Bi as aT,Ui as aU,Ln as aV,S as aW,w as aX,Ye as aY,Pn as aZ,Oo as a_,ar as aa,fr as ab,st as ac,Ri as ad,Pi as ae,Qi as af,Ii as ag,_n as ah,ds as ai,ei as aj,Ei as ak,Ti as al,Wr as am,Zr as an,Et as ao,Dt as ap,qr as aq,Es as ar,zr as as,bo as at,Un as au,Vi as av,Cs as aw,Ur as ax,ao as ay,Or as az,Ao as b,ni as b0,hi as b1,gi as b2,vi as b3,sn as c,vo as d,Vr as e,mo as f,ts as g,ti as h,Gt as i,ks as j,$i as k,ut as l,Jr as m,Xr as n,Rs as o,Cr as p,ls as q,Br as r,Fr as s,Ai as t,re as u,Js as v,Ws as w,Us as x,Ts as y,tn as z};
@@ -0,0 +1 @@
1
+ import{c as u,r as g,j as n,J as G,a0 as F,a as E,l as O,b as P,n as y,L as H}from"./index-DLrFWx5Y.js";import{C as M}from"./chat-context-D__edm74.js";import{C as x}from"./index-uzZt69XO.js";import{L}from"./index-B3ZR6FKh.js";import{B as V}from"./blocks-preview-workspace-context-BGXxGGI-.js";import{e as T,p as J,s as K,a as W,r as U,T as $,u as R,b as z}from"./site-editor-toast-D_mo8TLM.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-ULIonVmC.js";import{C as Y}from"./content-tab-DKxUFS3M.js";import{T as Z}from"./tab-icon-glyph-r819MRQJ.js";import{r as tt}from"./resolve-tab-icon-DrkwPXhW.js";import et from"./agent-site-editor-DyvD6coP.js";import"./autosend-BQzY1y5n.js";import"./thread-route-CvlfcLbb.js";import"./use-project-scope-DYHM9a74.js";import"./repository-binding-Z_PJssXg.js";import"./use-mcp-client-B5xjs2K9.js";import"./auth-B9FRbbSg.js";import"./thread-intent-v870fhCT.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CxFrglEk.js";import"./task-board-P3oVDv96.js";import"./schema-C3iRMQDR.js";import"./use-entitlements-CNt3pGa0.js";import"./use-ai-providers-CF3gJxn2.js";import"./use-decopilot-events-DNjBbEST.js";import"./use-organization-settings-BTNKvxbS.js";import"./use-mobile-DLEV_nGJ.js";import"./use-sidebar-collapsed-iSryvG4A.js";import"./use-chat-layout-state-BrmTWqoG.js";import"./agent-icon-Bd5DjuVH.js";import"./AlertCircle-r3-65QGa.js";import"./Tool01-CBLhcG71.js";import"./ArrowUp-Cn2kMl0m.js";import"./ArrowLeft-D6scOXD-.js";import"./LinkBroken01-BsflEjnj.js";import"./ShoppingBag01-gbNNAeM0.js";import"./Globe04-CoUsMEms.js";import"./CheckCircle-Uj5wL5gk.js";import"./ChevronUp-BjA2VknT.js";import"./ChevronSelectorVertical-zTQaeZAI.js";import"./UserSquare-DGUSiZ1P.js";import"./CreditCard01-BvXb2Lni.js";import"./SwitchHorizontal01-xcLba1bf.js";import"./Key01-Cwya0Bqg.js";import"./Minus-B714ZjWA.js";import"./Monitor01-Cuwl6kJ_.js";import"./Sun-BQnmg69t.js";import"./Play-BwysvS-E.js";import"./Plus-Dhutz31g.js";import"./SearchMd-DYX8MZiO.js";import"./Trash01-BTmzVQk_.js";import"./Upload01-Cl2zCfWN.js";import"./Users01-DZO5qwDg.js";import"./XClose-G4YrC3Pn.js";import"./Zap-vn2maseg.js";import"./tooltip-D4RVnddm.js";import"./index-D-pfNS-S.js";import"./toolbar-icon-button-CDSVGpZE.js";import"./shell-layout-C9pzHPCy.js";import"./use-deployment-admin-CSAQGY_O.js";import"./admin-fetch-BhTJlAsX.js";import"./command-Dz2oRnZb.js";import"./index-BPLzAbmE.js";import"./integration-icon-Chtj05eK.js";import"./project-icon-lOdr7-bW.js";import"./use-navigate-to-agent-DbsMPucS.js";import"./use-debounced-value-CkSIMvSM.js";import"./new-project-dialog-BjM9FoLr.js";import"./label-DzXAppDM.js";import"./repository-picker-Ms6PvgtV.js";import"./github-icon-BIb5Vfpr.js";import"./useInfiniteQuery-B3nmwRd2.js";import"./infiniteQueryObserver-CxT8wQIc.js";import"./collection-search-iWjyQyoE.js";import"./legacy-admin-welcome-dialog-BKs0Fyaf.js";import"./drawer-BqEmUb4n.js";import"./required-auth-layout-C2eHliL_.js";import"./use-org-sso-DvSOJZ_W.js";import"./sheet-BGkMUGZP.js";import"./resizable-C-HNoLnr.js";import"./core.esm-zdyJobf2.js";import"./sortable.esm-DkLzay3X.js";import"./context-menu-BERaowmZ.js";import"./create-organization-dialog-DKVN237m.js";import"./form-BXj3YBhn.js";import"./project-apps-1PIcY2fU.js";import"./use-recent-apps-BwkYdV8J.js";import"./feedback-BqoIMOg7.js";import"./textarea-Cfu8XQdh.js";import"./sandbox-url-D3mC8qhT.js";import"./use-sandbox-events-BmsgjLgS.js";import"./use-blocks-v8-project-2B03tBP7.js";import"./use-voice-input-C35dv3A1.js";import"./popover-C5Rig4oB.js";import"./index-DHdn4GVF.js";import"./checkbox-Xa1XT9y9.js";import"./select-BYZPn2vc.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./utils-DsmWCt7e.js";import"./sandbox-git-api-DcqI6XE4.js";import"./parse-sections-BJOrOXAt.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-B7REjwrW.js";import"./collapsible--DSKOo3p.js";import"./use-copy-DtaCyKxk.js";import"./usage-stats-BbCFi8o4.js";import"./tool-namespace-nRSGF6tI.js";import"./utils-CVEq3hMx.js";import"./markdown-D6jTtk0G.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-voFMel4o.js";import"./types-BQSSBiIo.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-C5-uyAt3.js";import"./use-mcp-prompts-DEhNBwFv.js";import"./use-thread-outputs-CJJmQUoi.js";import"./file-type-icon-B8ydIjHI.js";import"./section-array-field-DTz67Y2Z.js";import"./blocks-tab-states-5fAC-Jvu.js";import"./empty-state-DzKImAtb.js";import"./hosted-reconcile-v19CihgF.js";import"./slider-C6NJcOKc.js";import"./index-DlGI6s_b.js";import"./tooltipContext-BXwqSkFH.js";import"./CategoricalChart-DzzGNLUP.js";import"./index-_tlLxqQr.js";import"./switch-aqNVrOiZ.js";import"./scroll-area-BjnkF9XV.js";import"./monaco-editor-BhbaBg5Q.js";import"./editor-4N5Zqxy_.js";import"./calendar-BBjKT4Y4.js";import"./editor-classes-Dg5BrFCM.js";import"./toggle-group-BgRJSOhH.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BojjAtvD.js";import"./search-input-Dk-PX53Q.js";import"./tabs-DdQ7zWRN.js";import"./use-file-configs-C7s_koIb.js";import"./asset-utils-Bn1iB4IB.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-Do_X3N1Q.js";import"./variant-matcher-override-YE4lbHNL.js";import"./use-fast-preview-draft-url-7QxfEcUc.js";import"./useQueries-DZSM8cCd.js";import"./device-hint-BDdfDIcL.js";import"./alert-DKmdEqFw.js";import"./virtual-mcp-DFlO2tW2.js";import"./url-slug-DdVUOIRJ.js";import"./app-preview-url-9Od4s8Sz.js";import"./agent-capabilities-BYI80-yc.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-4UYb5uTu.js";import"./view-header-D5ldHG8R.js";import"./use-cms-publish-actions-CIJ6zHNm.js";import"./use-content-sync-B98fKQ39.js";import"./mustache-3I6NpSTH.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-BVhwg8WS.js";import"./badge-D17_WC-Q.js";import"./empty-state-DB3KUDYc.js";import"./collection-table-wrapper-DULM5aVC.js";import"./table-DkeWUhEA.js";import"./site-draft-actions-CO6_hVyN.js";import"./separator-D2l0P7OD.js";import"./cms-store-drafts-DO3GS-BC.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-M2AI6x1u.js";import"./input-f_GWmlkU.js";import"./icon-button-zoxb5UGy.js";import"./chat-draft-DOwDIvwR.js";import"./use-deco-credits-CHzcLKoW.js";import"./input-9_e3fHfS.js";import"./suggestion-XDtYV8VG.js";import"./use-org-fs-BsN8VM5Z.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall--88Nne2L.js";import"./plan-ladder-CLj7THz5.js";import"./add-connection-dialog-COyMgVte.js";import"./extract-connection-data-Ba81Qqm1.js";import"./metadata-D72DunRR.js";import"./connection-C6vq1sCN.js";import"./connection-card-DByKtq4T.js";import"./connection-slug-DNLnZOJk.js";import"./schema-DflsRwxx.js";import"./connection-form-helpers-BovE5YOR.js";import"./authenticate-and-persist-oauth-DbBE_3KO.js";import"./mcp-oauth-BWAVhH3v.js";import"./mcp-oauth-Do-na6T3.js";import"./collection-tabs-D5bCrQWd.js";import"./use-infinite-scroll-BZ3LS1DV.js";import"./useSuspenseInfiniteQuery-BHZshmPL.js";import"./use-task-board-events-CTeANaje.js";import"./save-changes-debug-nBi-n9eV.js";import"./site-draft-view-B5Rpd0IB.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const ot=e=>e;function it(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?ot:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(rt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function rt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=G(),{language:s}=r;let p;t[0]!==m?(p=N=>m({endpoint:N}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let S;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(S=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=S):S=t[12];const _=S;let j;return t[13]!==C||t[14]!==i||t[15]!==_?(j=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=j):j=t[16],j}const v="deco-serve",w="working-tree",nt={id:"",slug:"",name:"",logo:null},st={id:v,slug:v},mt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function pt(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?J(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&K(o),{candidates:W(o,U()),invalidLink:t&&!o}}const at=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function ct(){const e=u.c(6),t=P();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:lt},e[0]=o):o=e[0];const c=O(o);let m;e[1]!==t||e[2]!==c?(m=at.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(H,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Z,{icon:tt({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function lt(e){return e.matches.at(-1)?.staticData.siteEditorView}function A(e){const t=u.c(14),{children:o}=e,c=P(),{connection:m}=z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function dt(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const D={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ut(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ft},e[0]=o):o=e[0];const c=O(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ct,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(et,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ft(e){return e.matches.at(-1)?.staticData.siteEditorView}function ht(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},vt={connection:null,set:b,clear:b};function er(){const e=u.c(3),[t]=g.useState(pt);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(F,{org:nt,project:st,children:n.jsx(it,{candidates:t.candidates,invalidLink:t.invalidLink,shell:kt,editor:xt})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function xt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(dt,{onLost:t}),n.jsx(M,{value:mt,children:n.jsx(V,{children:n.jsx(ut,{})})})]})}function kt(e){return n.jsx($.Provider,{value:vt,children:n.jsx(ht,{children:e})})}function or(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function ir(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{ir as SiteEditorContent,or as SiteEditorPreview,er as default};
@@ -1 +1 @@
1
- import{b as ee,a4 as te,q as ne,r as E,j as t,B as H,n as F,bC as ae,a5 as ce,aM as me,aL as pe,aI as de,aG as ue,aH as ge,aK as fe,aJ as he,bj as xe,t as C,c8 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as G,gw as Ce}from"./index-BYLma6nR.js";import{a as we}from"./SwitchHorizontal01-DIK7cKae.js";import{N as De}from"./agent-icon-DbfcsXV4.js";import{s as Ne}from"./Trash01-BIlzZ3AH.js";import{i as Pe}from"./Upload01-DuNH7edt.js";import{i as ie}from"./Zap-Bp1s63-N.js";import{S as Ae}from"./search-toggle-Dozi3jn4.js";import{E as Y}from"./empty-state-D5-IJmKF.js";import{C as Ee}from"./collection-tabs-B6DksJOI.js";import{S as Me,F as Oe}from"./folder-icon-JFUPr6Oa.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-DKzRfuIW.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-DrqBnMGV.js";import{c as _e}from"./context-shell-DYEfNRo8.js";import"./AlertCircle-Dhxv_VvX.js";import"./Tool01-Bw_Gs9HT.js";import"./ArrowUp-C5MIVxlv.js";import"./ArrowLeft-DPiUStmH.js";import"./LinkBroken01-CExBuGlw.js";import"./ShoppingBag01-CpRghVvA.js";import"./Globe04-BgmGeS07.js";import"./CheckCircle-DQiPh0bs.js";import"./ChevronUp-BusAGBPt.js";import"./ChevronSelectorVertical-C_LOUUD2.js";import"./UserSquare-BV7Jqoa-.js";import"./CreditCard01-B86ybMWX.js";import"./Key01-bRc0D6iU.js";import"./Minus-BuxaQmfP.js";import"./Monitor01-CWmH5Gyz.js";import"./Sun-fB3zW2OU.js";import"./Play-xrfH4Yz5.js";import"./Plus-BRIZEm-m.js";import"./SearchMd-CHeeKxSQ.js";import"./Users01-Cy9FwTEl.js";import"./XClose-DeJhJbxg.js";import"./icon-button-Bkz9RDzV.js";import"./tooltip-Bw3qe--M.js";import"./index-CorYIdad.js";import"./badge-BLj5oaM_.js";import"./markdown-Da1uCT0e.js";import"./use-copy-D-EOd5RI.js";import"./use-mobile-ye6iRWDK.js";import"./autosend-YTrROtL8.js";import"./thread-route-CsxQz3Zx.js";import"./use-project-scope-CT4H1KgC.js";import"./repository-binding-BkD30urH.js";import"./use-mcp-client-Ch_pgKFL.js";import"./auth-eHRARwQ2.js";import"./task-board-CpInFlas.js";import"./schema-x3j4FByb.js";import"./file-preview-4Tbf_ub4.js";import"./utils-B4FS_bBy.js";import"./editor-Bl3rIcVI.js";import"./file-type-icon-Bdzds_J6.js";import"./useInfiniteQuery-DmLlHKe0.js";import"./infiniteQueryObserver-deqizdYY.js";import"./thread-intent-D7K3VC0B.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DPXy7vY-.js";import"./use-entitlements-BsP1ZFGQ.js";import"./use-ai-providers-BZwoM77S.js";import"./use-decopilot-events-CuinN1iK.js";import"./use-organization-settings-BQAdDt_y.js";import"./require-capability-B1_EID-G.js";import"./access-gate-BO57Fy6P.js";import"./capability-load-error-D_eJcYHf.js";import"./sections-BugzxN3d.js";import"./textarea-CjxhqOyq.js";import"./use-ask-in-chat-DaKY6vDh.js";import"./shell-layout-B0sxwrmk.js";import"./use-deployment-admin-CE6RFF-x.js";import"./admin-fetch-BhTJlAsX.js";import"./command-B13rzls6.js";import"./index-D2JCiu4r.js";import"./integration-icon-CknO8J8O.js";import"./project-icon-BFruPc7B.js";import"./use-navigate-to-agent-jetKe7lC.js";import"./use-debounced-value-8OKqfUuy.js";import"./new-project-dialog-EugQEueI.js";import"./label-CjHEjKyC.js";import"./repository-picker-CfUR1P6V.js";import"./github-icon-iZdKbq4s.js";import"./collection-search-CcswFoQz.js";import"./legacy-admin-welcome-dialog-CCJK6F5I.js";import"./drawer-Cgf4oN4m.js";import"./required-auth-layout-DFKnKCtp.js";import"./use-org-sso-BxORdMDV.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function Q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return Q(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=Q(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function Ge(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:De}}function He(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:I}=M;let w;e[3]!==i?(w=B(i),e[3]=i,e[4]=w):w=e[4];const R=w,D=o?"opacity-60":"hover:bg-accent";let f;e[5]!==D?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",D),e[5]=D,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(we,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function ws(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,I]=E.useState(L),[w,R]=E.useState(!1),[D,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.useState(null),x=()=>{a.invalidateQueries({queryKey:G.slashSkills(e.id)}),a.invalidateQueries({queryKey:G.orgFsSkills(e.id)})},j=r=>a.setQueryData(G.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>Q(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=Ge($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(H,{size:"sm",disabled:w,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(w?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:M,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Ee,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(He,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),D&&t.jsx(Me,{skillPath:D,onClose:()=>f(null)},D),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{ws as default};
1
+ import{b as ee,a4 as te,q as ne,r as E,j as t,B as H,n as F,bC as ae,a5 as ce,aM as me,aL as pe,aI as de,aG as ue,aH as ge,aK as fe,aJ as he,bj as xe,t as C,c8 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as G,gv as Ce}from"./index-DLrFWx5Y.js";import{a as De}from"./SwitchHorizontal01-xcLba1bf.js";import{N as we}from"./agent-icon-Bd5DjuVH.js";import{s as Ne}from"./Trash01-BTmzVQk_.js";import{i as Pe}from"./Upload01-Cl2zCfWN.js";import{i as ie}from"./Zap-vn2maseg.js";import{S as Ae}from"./search-toggle-KA6A8kEs.js";import{E as Y}from"./empty-state-DzKImAtb.js";import{C as Ee}from"./collection-tabs-D5bCrQWd.js";import{S as Me,F as Oe}from"./folder-icon-CwFmdi5D.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-BsN8VM5Z.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-D__edm74.js";import{c as _e}from"./context-shell-Cz6NPjEK.js";import"./AlertCircle-r3-65QGa.js";import"./Tool01-CBLhcG71.js";import"./ArrowUp-Cn2kMl0m.js";import"./ArrowLeft-D6scOXD-.js";import"./LinkBroken01-BsflEjnj.js";import"./ShoppingBag01-gbNNAeM0.js";import"./Globe04-CoUsMEms.js";import"./CheckCircle-Uj5wL5gk.js";import"./ChevronUp-BjA2VknT.js";import"./ChevronSelectorVertical-zTQaeZAI.js";import"./UserSquare-DGUSiZ1P.js";import"./CreditCard01-BvXb2Lni.js";import"./Key01-Cwya0Bqg.js";import"./Minus-B714ZjWA.js";import"./Monitor01-Cuwl6kJ_.js";import"./Sun-BQnmg69t.js";import"./Play-BwysvS-E.js";import"./Plus-Dhutz31g.js";import"./SearchMd-DYX8MZiO.js";import"./Users01-DZO5qwDg.js";import"./XClose-G4YrC3Pn.js";import"./icon-button-zoxb5UGy.js";import"./tooltip-D4RVnddm.js";import"./index-D-pfNS-S.js";import"./badge-D17_WC-Q.js";import"./markdown-D6jTtk0G.js";import"./use-copy-DtaCyKxk.js";import"./use-mobile-DLEV_nGJ.js";import"./autosend-BQzY1y5n.js";import"./thread-route-CvlfcLbb.js";import"./use-project-scope-DYHM9a74.js";import"./repository-binding-Z_PJssXg.js";import"./use-mcp-client-B5xjs2K9.js";import"./auth-B9FRbbSg.js";import"./task-board-P3oVDv96.js";import"./schema-C3iRMQDR.js";import"./file-preview-D77KJkpr.js";import"./utils-DsmWCt7e.js";import"./editor-4N5Zqxy_.js";import"./file-type-icon-B8ydIjHI.js";import"./useInfiniteQuery-B3nmwRd2.js";import"./infiniteQueryObserver-CxT8wQIc.js";import"./thread-intent-v870fhCT.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CxFrglEk.js";import"./use-entitlements-CNt3pGa0.js";import"./use-ai-providers-CF3gJxn2.js";import"./use-decopilot-events-DNjBbEST.js";import"./use-organization-settings-BTNKvxbS.js";import"./require-capability-DgcGeKzj.js";import"./access-gate-DIjds3ci.js";import"./capability-load-error-B5mCDF3r.js";import"./sections-r0ffiyN1.js";import"./textarea-Cfu8XQdh.js";import"./use-ask-in-chat-sDCRGkVA.js";import"./shell-layout-C9pzHPCy.js";import"./use-deployment-admin-CSAQGY_O.js";import"./admin-fetch-BhTJlAsX.js";import"./command-Dz2oRnZb.js";import"./index-BPLzAbmE.js";import"./integration-icon-Chtj05eK.js";import"./project-icon-lOdr7-bW.js";import"./use-navigate-to-agent-DbsMPucS.js";import"./use-debounced-value-CkSIMvSM.js";import"./new-project-dialog-BjM9FoLr.js";import"./label-DzXAppDM.js";import"./repository-picker-Ms6PvgtV.js";import"./github-icon-BIb5Vfpr.js";import"./collection-search-iWjyQyoE.js";import"./legacy-admin-welcome-dialog-BKs0Fyaf.js";import"./drawer-BqEmUb4n.js";import"./required-auth-layout-C2eHliL_.js";import"./use-org-sso-DvSOJZ_W.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function Q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return Q(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=Q(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function Ge(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function He(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:I}=M;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const R=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ds(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,I]=E.useState(L),[D,R]=E.useState(!1),[w,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.useState(null),x=()=>{a.invalidateQueries({queryKey:G.slashSkills(e.id)}),a.invalidateQueries({queryKey:G.orgFsSkills(e.id)})},j=r=>a.setQueryData(G.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>Q(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=Ge($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(H,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:M,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Ee,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(He,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Me,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ds as default};
@@ -1 +1 @@
1
- import{c as _,m as N,j}from"./index-BYLma6nR.js";import{T as k,R as z,a as D,b as S}from"./index-BiJyBzx-.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
1
+ import{c as _,m as N,j}from"./index-DLrFWx5Y.js";import{T as k,R as z,a as D,b as S}from"./index-DlGI6s_b.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
@@ -1 +1 @@
1
- import{r as v,fi as K}from"./index-BYLma6nR.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-CZ_suStd.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
1
+ import{r as v,fh as K}from"./index-DLrFWx5Y.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-zdyJobf2.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
@@ -1 +1 @@
1
- import{b as A,a4 as B,r as v,j as e,n as x,hj as k,gM as b,g2 as y,g3 as a,i0 as D,B as m,I as g,aM as z,aL as T,aI as O,aG as R,aK as M,aJ as F,bj as q,E as C,t as c,c as U}from"./index-BYLma6nR.js";import{D as $}from"./domain-settings-CqMNMzW1.js";import{S as G}from"./switch-DqhVUDGb.js";import{a as H,b as J,c as K,d as Q}from"./use-org-sso-BxORdMDV.js";import{s as V}from"./Trash01-BIlzZ3AH.js";import{R as W}from"./require-capability-B1_EID-G.js";import"./badge-BLj5oaM_.js";import"./select-D61WZk1O.js";import"./index-BdQq_4o_.js";import"./index-CorYIdad.js";import"./ChevronUp-BusAGBPt.js";import"./access-gate-BO57Fy6P.js";import"./capability-load-error-D_eJcYHf.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:I}=H(o.id,o.slug),f=J(o.id,o.slug),S=K(o.id,o.slug),E=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[P,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,_=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},w=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!u&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(u?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},L=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},N=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx($,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx(G,{checked:n.enforced,onCheckedChange:N,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(m,{variant:"outline",size:"sm",onClick:_,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:w,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:P,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(M,{children:[e.jsx(F,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(q,{onClick:L,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function de(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{de as default};
1
+ import{b as A,a4 as B,r as v,j as e,n as x,hi as k,gL as b,g1 as y,g2 as a,h$ as D,B as m,I as g,aM as z,aL as T,aI as O,aG as R,aK as F,aJ as M,bj as q,E as C,t as c,c as U}from"./index-DLrFWx5Y.js";import{D as $}from"./domain-settings-BSfIsMFs.js";import{S as G}from"./switch-aqNVrOiZ.js";import{a as H,b as J,c as K,d as Q}from"./use-org-sso-DvSOJZ_W.js";import{s as V}from"./Trash01-BTmzVQk_.js";import{R as W}from"./require-capability-DgcGeKzj.js";import"./badge-D17_WC-Q.js";import"./select-BYZPn2vc.js";import"./index-BdQq_4o_.js";import"./index-D-pfNS-S.js";import"./ChevronUp-BjA2VknT.js";import"./access-gate-DIjds3ci.js";import"./capability-load-error-B5mCDF3r.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:I}=H(o.id,o.slug),f=J(o.id,o.slug),S=K(o.id,o.slug),E=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[P,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,L=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},_=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!u&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(u?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},w=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},N=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx($,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx(G,{checked:n.enforced,onCheckedChange:N,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(m,{variant:"outline",size:"sm",onClick:L,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:_,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:P,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(M,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(q,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function de(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{de as default};
@@ -0,0 +1,2 @@
1
+ import{t as Ye,n as ie,o as Ge,D as Qe,v as ze,w as Ze}from"./usage-stats-BbCFi8o4.js";import{r as p,ge as Je,g5 as we,gf as et,gg as j,gh as te,j as I,bR as tt,gi as nt,gj as ne,gk as ot,gl as rt,gm as st,gn as it,go as at,gp as lt,gq as Ce,gr as ct,c as H,V as ut,K as dt,gs as ft,gt,gu as mt,b as pt,m as vt,h as ht}from"./index-DLrFWx5Y.js";import{g as bt,d as xt}from"./tool-namespace-nRSGF6tI.js";import{A as yt}from"./agent-icon-Bd5DjuVH.js";var Hn=Ye;var Rt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ae=Rt.join(","),Ie=typeof Element>"u",Q=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,J=!Ie&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ee=function(e,t){var o;t===void 0&&(t=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),s=r===""||r==="true",i=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return i},St=function(e){var t,o=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return o===""||o==="true"},Et=function(e,t,o){if(ee(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ae));return t&&Q.call(e,ae)&&r.unshift(e),r=r.filter(o),r},le=function(e,t,o){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!ee(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=le(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var d=Q.call(i,ae);d&&o.filter(i)&&(t||!e.includes(i))&&r.push(i);var u=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!ee(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(u&&g){var h=le(u===!0?i.children:u.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return r},Te=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Pe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||St(e))&&!Te(e)?0:e.tabIndex},wt=function(e,t){var o=Pe(e);return o<0&&t&&!Te(e)?0:o},Ct=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ae=function(e){return e.tagName==="INPUT"},It=function(e){return Ae(e)&&e.type==="hidden"},Tt=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pt=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},At=function(e){if(!e.name)return!0;var t=e.form||J(e),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Pt(r,e.form);return!s||s===e},Nt=function(e){return Ae(e)&&e.type==="radio"},Dt=function(e){return Nt(e)&&!At(e)},Mt=function(e){var t,o=e&&J(e),r=(t=o)===null||t===void 0?void 0:t.host,s=!1;if(o&&o!==e){var i,a,l;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&r;){var c,d,u;o=J(r),r=(c=o)===null||c===void 0?void 0:c.host,s=!!((d=r)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(r))}}return s},ge=function(e){var t=e.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Ot=function(e,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=Q.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(Q.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var c=e.parentElement,d=J(e);if(c&&!c.shadowRoot&&r(c)===!0)return ge(e);e.assignedSlot?e=e.assignedSlot:!c&&d!==e.ownerDocument?e=d.host:e=c}e=l}if(Mt(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return ge(e);return!1},Ft=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return Q.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},qt=function(e,t){return!(t.disabled||It(t)||Ot(t,e)||Tt(t)||Ft(t))},me=function(e,t){return!(Dt(t)||Pe(t)<0||!qt(e,t))},$t=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ne=function(e){var t=[],o=[];return e.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,l=wt(a,i),c=i?Ne(r.candidates):a;l===0?i?t.push.apply(t,c):t.push(a):o.push({documentOrder:s,tabIndex:l,item:r,isScope:i,content:c})}),o.sort(Ct).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},De=function(e,t){t=t||{};var o;return t.getShadowRoot?o=le([e],t.includeContainer,{filter:me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:$t}):o=Et(e,t.includeContainer,me.bind(null,t)),Ne(o)};function kt(){return/apple/i.test(navigator.vendor)}const pe="data-floating-ui-focusable";function _t(n){let e=n.activeElement;for(;((t=e)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;e=e.shadowRoot.activeElement}return e}function ce(n,e){if(!n||!e)return!1;const t=e.getRootNode==null?void 0:e.getRootNode();if(n.contains(e))return!0;if(t&&Je(t)){let o=e;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function G(n){return"composedPath"in n?n.composedPath()[0]:n.target}function oe(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function Lt(n){return n.matches("html,body")}function z(n){return n?.ownerDocument||document}function jt(n){return n?n.hasAttribute(pe)?n:n.querySelector("["+pe+"]")||n:null}function Z(n,e,t){return t===void 0&&(t=!0),n.filter(r=>{var s;return r.parentId===e&&(!t||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Z(n,r.id,t)])}function Kt(n){return"nativeEvent"in n}var Bt=typeof document<"u",Ut=function(){},V=Bt?p.useLayoutEffect:Ut;const Vt={...we},Wt=Vt.useInsertionEffect,Ht=Wt||(n=>n());function W(n){const e=p.useRef(()=>{});return Ht(()=>{e.current=n}),p.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return e.current==null?void 0:e.current(...o)},[])}const Me=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oe(n,e){const t=De(n,Me()),o=t.length;if(o===0)return;const r=_t(z(n)),s=t.indexOf(r),i=s===-1?e===1?0:o-1:s+e;return t[i]}function Xt(n){return Oe(z(n).body,1)||n}function Yt(n){return Oe(z(n).body,-1)||n}function re(n,e){const t=e||n.currentTarget,o=n.relatedTarget;return!o||!ce(t,o)}function Gt(n){De(n,Me()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function ve(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}const Qt="data-floating-ui-focusable",he="active",be="selected",zt={...we};let xe=!1,Zt=0;const ye=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Zt++;function Jt(){const[n,e]=p.useState(()=>xe?ye():void 0);return V(()=>{n==null&&e(ye())},[]),p.useEffect(()=>{xe=!0},[]),n}const en=zt.useId,ue=en||Jt;function tn(){const n=new Map;return{emit(e,t){var o;(o=n.get(e))==null||o.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){var o;(o=n.get(e))==null||o.delete(t)}}}const nn=p.createContext(null),on=p.createContext(null),Fe=()=>{var n;return((n=p.useContext(nn))==null?void 0:n.id)||null},qe=()=>p.useContext(on);function de(n){return"data-floating-ui-"+n}const rn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Re=p.forwardRef(function(e,t){const[o,r]=p.useState();V(()=>{kt()&&r("button")},[]);const s={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[de("focus-guard")]:"",style:rn};return I.jsx("span",{...e,...s})}),sn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},$e=p.createContext(null),Se=de("portal");function an(n){n===void 0&&(n={});const{id:e,root:t}=n,o=ue(),r=cn(),[s,i]=p.useState(null),a=p.useRef(null);return V(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),V(()=>{if(!o||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const c=document.createElement("div");c.id=o,c.setAttribute(Se,""),l.appendChild(c),a.current=c,i(c)},[e,o]),V(()=>{if(t===null||!o||a.current)return;let l=t||r?.portalNode;l&&!it(l)&&(l=l.current),l=l||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,l.appendChild(c));const d=document.createElement("div");d.id=o,d.setAttribute(Se,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[e,t,o,r]),s}function ln(n){const{children:e,id:t,root:o,preserveTabOrder:r=!0}=n,s=an({id:t,root:o}),[i,a]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),g=i?.modal,h=i?.open,y=!!i&&!i.modal&&i.open&&r&&!!(o||s);return p.useEffect(()=>{if(!s||!r||g)return;function m(f){s&&re(f)&&(f.type==="focusin"?ve:Gt)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,r,g]),p.useEffect(()=>{s&&(h||ve(s))},[h,s]),I.jsxs($e.Provider,{value:p.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[r,s]),children:[y&&s&&I.jsx(Re,{"data-type":"outside",ref:l,onFocus:m=>{if(re(m,s)){var f;(f=d.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Yt(x);b?.focus()}}}),y&&s&&I.jsx("span",{"aria-owns":s.id,style:sn}),s&&tt.createPortal(e,s),y&&s&&I.jsx(Re,{"data-type":"outside",ref:c,onFocus:m=>{if(re(m,s)){var f;(f=u.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Xt(x);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const cn=()=>p.useContext($e),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ee=n=>{var e,t;return{escapeKey:typeof n=="boolean"?n:(e=n?.escapeKey)!=null?e:!1,outsidePress:typeof n=="boolean"?n:(t=n?.outsidePress)!=null?t:!0}};function fn(n,e){e===void 0&&(e={});const{open:t,onOpenChange:o,elements:r,dataRef:s}=n,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:g=!1,bubbles:h,capture:y}=e,m=qe(),f=W(typeof l=="function"?l:()=>!1),x=typeof l=="function"?f:l,b=p.useRef(!1),{escapeKey:R,outsidePress:v}=Ee(h),{escapeKey:D,outsidePress:C}=Ee(y),O=p.useRef(!1),A=W(S=>{var E;if(!t||!i||!a||S.key!=="Escape"||O.current)return;const P=(E=s.current.floatingContext)==null?void 0:E.nodeId,M=m?Z(m.nodesRef.current,P):[];if(!R&&(S.stopPropagation(),M.length>0)){let w=!0;if(M.forEach(N=>{var q;if((q=N.context)!=null&&q.open&&!N.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}o(!1,Kt(S)?S.nativeEvent:S,"escape-key")}),F=W(S=>{var E;const P=()=>{var M;A(S),(M=G(S))==null||M.removeEventListener("keydown",P)};(E=G(S))==null||E.addEventListener("keydown",P)}),T=W(S=>{var E;const P=s.current.insideReactTree;s.current.insideReactTree=!1;const M=b.current;if(b.current=!1,c==="click"&&M||P||typeof x=="function"&&!x(S))return;const w=G(S),N="["+de("inert")+"]",q=z(r.floating).querySelectorAll(N);let L=j(w)?w:null;for(;L&&!ne(L);){const k=ot(L);if(ne(k)||!j(k))break;L=k}if(q.length&&j(w)&&!Lt(w)&&!ce(w,r.floating)&&Array.from(q).every(k=>!ce(L,k)))return;if(rt(w)&&K){const k=ne(w),B=st(w),Y=/auto|scroll/,Ke=k||Y.test(B.overflowX),Be=k||Y.test(B.overflowY),Ue=Ke&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Ve=Be&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,We=B.direction==="rtl",He=Ve&&(We?S.offsetX<=w.offsetWidth-w.clientWidth:S.offsetX>w.clientWidth),Xe=Ue&&S.offsetY>w.clientHeight;if(He||Xe)return}const U=(E=s.current.floatingContext)==null?void 0:E.nodeId,X=m&&Z(m.nodesRef.current,U).some(k=>{var B;return oe(S,(B=k.context)==null?void 0:B.elements.floating)});if(oe(S,r.floating)||oe(S,r.domReference)||X)return;const fe=m?Z(m.nodesRef.current,U):[];if(fe.length>0){let k=!0;if(fe.forEach(B=>{var Y;if((Y=B.context)!=null&&Y.open&&!B.context.dataRef.current.__outsidePressBubbles){k=!1;return}}),!k)return}o(!1,S,"outside-press")}),$=W(S=>{var E;const P=()=>{var M;T(S),(M=G(S))==null||M.removeEventListener(c,P)};(E=G(S))==null||E.addEventListener(c,P)});p.useEffect(()=>{if(!t||!i)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=v;let S=-1;function E(q){o(!1,q,"ancestor-scroll")}function P(){window.clearTimeout(S),O.current=!0}function M(){S=window.setTimeout(()=>{O.current=!1},nt()?5:0)}const w=z(r.floating);a&&(w.addEventListener("keydown",D?F:A,D),w.addEventListener("compositionstart",P),w.addEventListener("compositionend",M)),x&&w.addEventListener(c,C?$:T,C);let N=[];return g&&(j(r.domReference)&&(N=te(r.domReference)),j(r.floating)&&(N=N.concat(te(r.floating))),!j(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(te(r.reference.contextElement)))),N=N.filter(q=>{var L;return q!==((L=w.defaultView)==null?void 0:L.visualViewport)}),N.forEach(q=>{q.addEventListener("scroll",E,{passive:!0})}),()=>{a&&(w.removeEventListener("keydown",D?F:A,D),w.removeEventListener("compositionstart",P),w.removeEventListener("compositionend",M)),x&&w.removeEventListener(c,C?$:T,C),N.forEach(q=>{q.removeEventListener("scroll",E)}),window.clearTimeout(S)}},[s,r,a,x,c,t,o,g,i,R,v,A,D,F,T,C,$]),p.useEffect(()=>{s.current.insideReactTree=!1},[s,x,c]);const _=p.useMemo(()=>({onKeyDown:A,...d&&{[un[u]]:S=>{o(!1,S.nativeEvent,"reference-press")},...u!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[A,o,d,u]),K=p.useMemo(()=>{function S(E){E.button===0&&(b.current=!0)}return{onKeyDown:A,onMouseDown:S,onMouseUp:S,[dn[c]]:()=>{s.current.insideReactTree=!0}}},[A,c,s]);return p.useMemo(()=>i?{reference:_,floating:K}:{},[i,_,K])}function gn(n){const{open:e=!1,onOpenChange:t,elements:o}=n,r=ue(),s=p.useRef({}),[i]=p.useState(()=>tn()),a=Fe()!=null,[l,c]=p.useState(o.reference),d=W((h,y,m)=>{s.current.openEvent=h?y:void 0,i.emit("openchange",{open:h,event:y,reason:m,nested:a}),t?.(h,y,m)}),u=p.useMemo(()=>({setPositionReference:c}),[]),g=p.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return p.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:g,events:i,floatingId:r,refs:u}),[e,d,g,i,r,u])}function mn(n){n===void 0&&(n={});const{nodeId:e}=n,t=gn({...n,elements:{reference:null,floating:null,...n.elements}}),o=n.rootContext||t,r=o.elements,[s,i]=p.useState(null),[a,l]=p.useState(null),d=r?.domReference||s,u=p.useRef(null),g=qe();V(()=>{d&&(u.current=d)},[d]);const h=et({...n,elements:{...r,...a&&{reference:a}}}),y=p.useCallback(R=>{const v=j(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;l(v),h.refs.setReference(v)},[h.refs]),m=p.useCallback(R=>{(j(R)||R===null)&&(u.current=R,i(R)),(j(h.refs.reference.current)||h.refs.reference.current===null||R!==null&&!j(R))&&h.refs.setReference(R)},[h.refs]),f=p.useMemo(()=>({...h.refs,setReference:m,setPositionReference:y,domReference:u}),[h.refs,m,y]),x=p.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=p.useMemo(()=>({...h,...o,refs:f,elements:x,nodeId:e}),[h,f,x,e,o]);return V(()=>{o.dataRef.current.floatingContext=b;const R=g?.nodesRef.current.find(v=>v.id===e);R&&(R.context=b)}),p.useMemo(()=>({...h,context:b,refs:f,elements:x}),[h,f,x,b])}function se(n,e,t){const o=new Map,r=t==="item";let s=n;if(r&&n){const{[he]:i,[be]:a,...l}=n;s=l}return{...t==="floating"&&{tabIndex:-1,[Qt]:""},...s,...e.map(i=>{const a=i?i[t]:null;return typeof a=="function"?n?a(n):null:a}).concat(n).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(r&&[he,be].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof d=="function"){var u;(u=o.get(c))==null||u.push(d),i[c]=function(){for(var g,h=arguments.length,y=new Array(h),m=0;m<h;m++)y[m]=arguments[m];return(g=o.get(c))==null?void 0:g.map(f=>f(...y)).find(f=>f!==void 0)}}}else i[c]=d}),i),{})}}function pn(n){n===void 0&&(n=[]);const e=n.map(a=>a?.reference),t=n.map(a=>a?.floating),o=n.map(a=>a?.item),r=p.useCallback(a=>se(a,n,"reference"),e),s=p.useCallback(a=>se(a,n,"floating"),t),i=p.useCallback(a=>se(a,n,"item"),o);return p.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hn(n,e){var t,o;e===void 0&&(e={});const{open:r,elements:s,floatingId:i}=n,{enabled:a=!0,role:l="dialog"}=e,c=ue(),d=((t=s.domReference)==null?void 0:t.id)||c,u=p.useMemo(()=>{var b;return((b=jt(s.floating))==null?void 0:b.id)||i},[s.floating,i]),g=(o=vn.get(l))!=null?o:l,y=Fe()!=null,m=p.useMemo(()=>g==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?u:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:d},...g==="menu"&&y&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,u,y,r,d,l]),f=p.useMemo(()=>{const b={id:u,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":d}}},[g,u,d,l]),x=p.useCallback(b=>{let{active:R,selected:v}=b;const D={role:"option",...R&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":v}}return{}},[u,l]);return p.useMemo(()=>a?{reference:m,floating:f,item:x}:{},[a,m,f,x])}function bn(n){var e;const{char:t,allowSpaces:o,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,$position:a}=n,l=o&&!r,c=Ze(t),d=new RegExp(`\\s${c}$`),u=i?"^":"",g=r?"":c,h=l?new RegExp(`${u}${c}.*?(?=\\s${g}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${g}]*`,"gm"),y=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!y)return null;const m=a.pos-y.length,f=Array.from(y.matchAll(h)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const x=f.input.slice(Math.max(0,f.index-1),f.index),b=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!b)return null;const R=m+f.index;let v=R+f[0].length;return l&&d.test(y.slice(v-1,v+1))&&(f[0]+=" ",v+=1),R<a.pos&&v>=a.pos?{range:{from:R,to:v},query:f[0].slice(t.length),text:f[0]}:null}function xn(n){return n.docChanged?n.steps.some(e=>{const t=e.slice;if(!t?.content)return!1;const o=t.content.textBetween(0,t.content.size,`
2
+ `);return/\s/.test(o)}):!1}function yn(n){return()=>{const e=n.state.selection.$anchor.pos,{top:t,right:o,bottom:r,left:s}=n.view.coordsAtPos(e);try{return new DOMRect(s,t,o-s,r-t)}catch{return null}}}function Rn(n,e,t,o){return t?()=>{const r=o.getState(n.state),s=r?.decorationId,i=e.dom.querySelector(`[data-decoration-id="${s}"]`);return i?.getBoundingClientRect()||null}:yn(n)}function Sn({match:n,dismissedRange:e,state:t,transaction:o,editor:r,shouldResetDismissed:s,effectiveAllowSpaces:i}){return s?.({editor:r,state:t,range:e,match:n,transaction:o,allowSpaces:i})?!1:i?n.range.from===e.from:n.range.from===e.from&&!xn(o)}function En({view:n,pluginKeyRef:e}){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}function wn({pluginKey:n,decorationTag:e,decorationClass:t,decorationContent:o,decorationEmptyClass:r,renderer:s,dispatchExit:i}){return{handleKeyDown(a,l){var c;const d=n.getState(a.state);if(!d.active)return!1;if(l.key==="Escape"||l.key==="Esc"){var u;return s==null||(u=s.onKeyDown)===null||u===void 0||u.call(s,{view:a,event:l,range:d.range}),i(a),!0}return(s==null||(c=s.onKeyDown)===null||c===void 0?void 0:c.call(s,{view:a,event:l,range:d.range}))||!1},decorations(a){const{active:l,range:c,decorationId:d,query:u}=n.getState(a);if(!l)return null;const g=!u?.length,h=[t];return g&&h.push(r),Qe.create(a.doc,[ze.inline(c.from,c.to,{nodeName:e,class:h.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":o})])}}}function Cn({editor:n,char:e,effectiveAllowSpaces:t,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,findSuggestionMatch:i,allow:a,shouldShow:l,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,g,h,y){const{isEditable:m}=n,{composing:f}=n.view,{selection:x}=u,{empty:b,from:R}=x,v={...g},D=u.getMeta(d);if(D&&D.exit)return v.active=!1,v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null,v.dismissedRange=g.active?{...g.range}:g.dismissedRange,v;if(v.composing=f,u.docChanged&&v.dismissedRange!==null&&(v.dismissedRange={from:u.mapping.map(v.dismissedRange.from),to:u.mapping.map(v.dismissedRange.to)}),m&&(b||n.view.composing)){(R<g.range.from||R>g.range.to)&&!f&&!g.composing&&(v.active=!1);const C=i({char:e,allowSpaces:t,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,$position:x.$from}),O=`id_${Math.floor(Math.random()*4294967295)}`;C&&a({editor:n,state:y,range:C.range,isActive:g.active})&&(!l||l({editor:n,range:C.range,query:C.query,text:C.text,transaction:u}))?(v.dismissedRange!==null&&!c({match:C,dismissedRange:v.dismissedRange,state:y,transaction:u})&&(v.dismissedRange=null),v.dismissedRange===null?(v.active=!0,v.decorationId=g.decorationId||O,v.range=C.range,v.query=C.query,v.text=C.text):v.active=!1):(C||(v.dismissedRange=null),v.active=!1)}else v.active=!1;return v.active||(v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null),v}}}function In({editor:n,items:e}){let t=null,o=null,r=null;const s=()=>{o!==null&&(clearTimeout(o),o=null),r?.(),r=null},i=c=>new Promise(d=>{r=d,o=setTimeout(()=>{o=null;const u=r;r=null,u?.()},c)}),a=()=>{t?.abort(),s(),t=null};return{abort:a,fetch:async(c,d)=>{a(),t=new AbortController;const u=t;if(d>0&&await i(d),t!==u||u.signal.aborted)return{status:"aborted"};try{const g=await e({editor:n,query:c,signal:u.signal});return t!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:g}}catch{return t!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function Tn({placement:n,offset:e,flip:t,floatingUi:o}){var r,s,i,a;const l=[at({mainAxis:(r=e.mainAxis)!==null&&r!==void 0?r:4,crossAxis:(s=e.crossAxis)!==null&&s!==void 0?s:0})];return t&&l.push(lt()),!(o==null||(i=o.middleware)===null||i===void 0)&&i.length&&l.push(...o.middleware),{placement:n,strategy:(a=o?.strategy)!==null&&a!==void 0?a:"absolute",middleware:l}}function Pn(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function An({getReferenceRect:n,contextElement:e,config:t,container:o,dismissOnOutsideClick:r,dismiss:s}){return(i,a={})=>{const l={getBoundingClientRect:()=>{var y;return(y=n())!==null&&y!==void 0?y:new DOMRect},contextElement:e};let c=!1;const d=!i.isConnected;d&&Pn(o).appendChild(i),a.onPosition||(i.style.visibility="hidden",i.style.width="max-content");const g=Ce(l,i,()=>{ct(l,i,{placement:t.placement,strategy:t.strategy,middleware:t.middleware}).then(({x:y,y:m,placement:f,strategy:x})=>{if(a.onPosition){a.onPosition({x:y,y:m,placement:f,strategy:x});return}Object.assign(i.style,{position:x,left:`${y}px`,top:`${m}px`}),c||(c=!0,i.style.visibility="")})},a.autoUpdate);let h;return r&&(h=y=>{const m=y.target;!(m instanceof Node)||i.contains(m)||e.contains(m)||s()},document.addEventListener("pointerdown",h,!0)),()=>{g(),h&&document.removeEventListener("pointerdown",h,!0),d&&i.remove()}}}function Nn({editor:n,pluginKey:e,items:t,renderer:o,minQueryLength:r,debounce:s,initialItems:i,placement:a,offset:l,container:c,flip:d,floatingUi:u,dismissOnOutsideClick:g,command:h,clientRectFor:y,dispatchExit:m}){let f;const x=In({editor:n,items:t}),b=Tn({placement:a,offset:l,flip:d,floatingUi:u});function R(v,D){switch(v){case"started":var C;o==null||(C=o.onStart)===null||C===void 0||C.call(o,D);break;case"updated":var O;o==null||(O=o.onUpdate)===null||O===void 0||O.call(o,D);break;case"stopped":var A;o==null||(A=o.onExit)===null||A===void 0||A.call(o,D)}}return{update:async(v,D)=>{var C,O;const A=e.getState(D),F=e.getState(v.state);if(!A||!F)return;let T=null;const $=A.query!==F.query,_=A.text!==F.text,K=A.range.from!==F.range.from||A.range.to!==F.range.to,S=$||_||K;if(!A.active&&F.active)T="started";else if(A.active&&!F.active)T="stopped";else if(F.active&&S)T="updated";else return;const E=T==="stopped"?A:F,P=v.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`),M=y(v,P),w=r===0||(E.query?E.query.length>=r:!1),N=(T==="started"||T==="updated")&&w;if(f={editor:n,range:E.range,query:E.query||"",text:E.text||"",items:i??[],command:U=>h({editor:n,range:E.range,props:U}),decorationNode:P,clientRect:M,loading:N,placement:a,offset:{mainAxis:(C=l.mainAxis)!==null&&C!==void 0?C:4,crossAxis:(O=l.crossAxis)!==null&&O!==void 0?O:0},container:c,flip:d,floatingUi:b,mount:An({getReferenceRect:M,contextElement:v.dom,config:b,container:c,dismissOnOutsideClick:g,dismiss:()=>m(n.view)})},T==="started"){var q;o==null||(q=o.onBeforeStart)===null||q===void 0||q.call(o,f)}if(T==="updated"){var L;o==null||(L=o.onBeforeUpdate)===null||L===void 0||L.call(o,f)}if(T==="started"&&R(T,f),T==="started"||T==="updated")if(!N)x.abort(),f={...f,items:i??[],loading:!1};else{f={...f,items:i??[],loading:!0},T="updated",R(T,f);const U=await x.fetch(E.query||"",s);if(U.status==="aborted")return;const X=e.getState(v.state);if(!X?.active){x.abort();return}f=U.status==="resolved"?{...f,items:U.items,loading:!1}:{...f,loading:!1}}if(T==="stopped"){x.abort(),R(T,f),f=void 0;return}T==="updated"&&R(T,f)},destroy:()=>{var v;x.abort(),f&&(o==null||(v=o.onExit)===null||v===void 0||v.call(o,f))}}}const ke=new ie("suggestion");function _e({pluginKey:n=ke,editor:e,char:t="@",allowSpaces:o=!1,allowToIncludeChar:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:g=()=>[],minQueryLength:h=0,debounce:y=0,initialItems:m,placement:f="bottom-start",offset:x={},container:b,flip:R=!0,floatingUi:v,dismissOnOutsideClick:D=!0,render:C=()=>({}),allow:O=()=>!0,findSuggestionMatch:A=bn,shouldShow:F,shouldResetDismissed:T}){const $=C?.(),_=o&&!r,K=(P,M)=>Rn(e,P,M,n);function S(P){return Sn({...P,editor:e,shouldResetDismissed:T,effectiveAllowSpaces:_})}const E=P=>En({view:P,pluginKeyRef:n});return new Ge({key:n,view:()=>Nn({editor:e,pluginKey:n,items:g,renderer:$,minQueryLength:h,debounce:y,initialItems:m,placement:f,offset:x,container:b,flip:R,floatingUi:v,dismissOnOutsideClick:D,command:u,clientRectFor:K,dispatchExit:E}),state:Cn({editor:e,char:t,effectiveAllowSpaces:_,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,findSuggestionMatch:A,allow:O,shouldShow:F,shouldKeepDismissed:S,pluginKey:n}),props:wn({pluginKey:n,decorationTag:a,decorationClass:l,decorationContent:c,decorationEmptyClass:d,renderer:$,dispatchExit:E})})}function Xn(n,e=ke){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}var Yn=_e;function Dn(n){const e=H.c(17),{editor:t,query:o,items:r,onSelect:s,onClose:i}=n,[a,l]=p.useState(0),c=p.useRef(r),d=p.useRef(a),u=p.useRef(s),g=p.useRef(i),h=p.useDeferredValue(o),[y,m]=p.useState(h);y!==h&&(m(h),l(0)),a>=r.length&&r.length>0&&l(0);let f,x;e[0]!==r?(f=()=>{c.current=r},x=[r],e[0]=r,e[1]=f,e[2]=x):(f=e[1],x=e[2]),p.useEffect(f,x);let b,R;e[3]!==a?(b=()=>{d.current=a},R=[a],e[3]=a,e[4]=b,e[5]=R):(b=e[4],R=e[5]),p.useEffect(b,R);let v,D;e[6]!==s?(v=()=>{u.current=s},D=[s],e[6]=s,e[7]=v,e[8]=D):(v=e[7],D=e[8]),p.useEffect(v,D);let C,O;e[9]!==i?(C=()=>{g.current=i},O=[i],e[9]=i,e[10]=C,e[11]=O):(C=e[10],O=e[11]),p.useEffect(C,O);let A,F;e[12]!==t?(F=()=>{if(t?.isDestroyed)return;let _;try{_=t.view.dom}catch{return}if(!_)return;const K=E=>{const P=c.current;if(!P.length)return!1;const M=()=>l(N=>(N+1)%P.length),w=()=>l(N=>(N-1+P.length)%P.length);switch(E.key){case"ArrowUp":return E.preventDefault(),w(),!0;case"ArrowDown":return E.preventDefault(),M(),!0;case"Tab":return E.preventDefault(),E.shiftKey?w():M(),!0;case"Home":return E.preventDefault(),l(0),!0;case"End":return E.preventDefault(),l(P.length-1),!0;case"Enter":{if(E.isComposing)return!1;E.preventDefault();const N=d.current;return N!==-1&&P[N]&&u.current?.(P[N],N),!0}case"Escape":return E.preventDefault(),g.current?.(),!0;default:return!1}},S=E=>{K(E)};return _.addEventListener("keydown",S,!0),()=>{_?.removeEventListener("keydown",S,!0)}},A=[t],e[12]=t,e[13]=A,e[14]=F):(A=e[13],F=e[14]),p.useEffect(F,A);const T=r.length?a:void 0;let $;return e[15]!==T?($={selectedIndex:T,setSelectedIndex:l},e[15]=T,e[16]=$):$=e[16],$}function Mn(n,e){switch(e.type){case"SET_SELECTED_ITEM":return{...n,selectedItem:e.payload};case"ON_START":return{...n,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...n,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return n}}const Le=p.createContext(void 0);function je(){const n=p.useContext(Le);if(!n)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return n}function On(n){const e=H.c(16),{editor:t,char:o,pluginKey:r,allow:s,onOpenChange:i}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=a):a=e[0];const[l,c]=p.useReducer(Mn,a);let d;e[1]!==i?(d=m=>{i?.(m)},e[1]=i,e[2]=d):d=e[2];const u=p.useEffectEvent(d);let g;e[3]!==o||e[4]!==s||e[5]!==t||e[6]!==u||e[7]!==r?(g=()=>{if(t?.isDestroyed)return;const m=r instanceof ie?r:new ie(r);t.state.plugins.find(b=>b.spec.key===m)&&t.unregisterPlugin(m);const x=_e({pluginKey:m,editor:t,char:o,allow(b){const R=t.state.doc.resolve(b.range.from);for(let v=R.depth;v>0;v--)if(R.node(v).type.name==="image")return!1;return!(s&&!s(b))},command(){},render:()=>({onStart:b=>{c({type:"ON_START",payload:{element:b.decorationNode??null,query:b.query,range:b.range}}),u(!0)},onUpdate:b=>{c({type:"ON_UPDATE",payload:{element:b.decorationNode??null,query:b.query,range:b.range}})},onKeyDown:b=>b.event.key==="Escape"?(c({type:"ON_EXIT"}),!0):!1,onExit:()=>{c({type:"ON_EXIT"}),u(!1)}}),items:Fn});return t.registerPlugin(x),()=>{t?.isDestroyed||t.unregisterPlugin(m)}},e[3]=o,e[4]=s,e[5]=t,e[6]=u,e[7]=r,e[8]=g):g=e[8];let h;e[9]!==o||e[10]!==s||e[11]!==t||e[12]!==r?(h=[t,r,o,c,s],e[9]=o,e[10]=s,e[11]=t,e[12]=r,e[13]=h):h=e[13],p.useEffect(g,h);let y;return e[14]!==l?(y={state:l,dispatch:c},e[14]=l,e[15]=y):y=e[15],y}function Fn(){return[]}function qn({editor:n,queryKey:e,queryFn:t,onSelect:o}){const{state:r,dispatch:s}=je(),i=p.useDeferredValue(r.query),{data:a}=ut({queryKey:dt.suggestionItems(e,r.open,i),queryFn:()=>r.open?t({query:i}):[]}),l=()=>{s({type:"ON_EXIT"})},c=async(u,g)=>{if(!(r.selectedItem!==null||!r.range)){s({type:"SET_SELECTED_ITEM",payload:u});try{const{view:h}=n,m=h.state.selection.$to.nodeAfter?.text?.startsWith(" "),f=r.range?{...r.range}:{from:0,to:0};m&&r.range&&(f.to+=1),await o({range:f,item:u})===!1?s({type:"SET_SELECTED_ITEM",payload:null}):l()}catch{l()}}},{selectedIndex:d}=Dn({editor:n,query:i,items:a,onSelect:c,onClose:l});return{selectedItem:r.selectedItem,items:a,selectedIndex:d,close:l,onSelect:c}}function $n({children:n}){const{state:e,dispatch:t}=je(),{open:o,element:r}=e,s=()=>{t({type:"ON_EXIT"})},{refs:i,floatingStyles:a,context:l}=mn({placement:"bottom-start",open:o,onOpenChange:g=>{g||s()},elements:{reference:r},middleware:[ft(10),gt(),mt()],whileElementsMounted:Ce}),c=fn(l,{outsidePress:g=>!(g.target instanceof Element&&g.target.closest(".ProseMirror"))}),d=hn(l,{role:"listbox"}),{getFloatingProps:u}=pn([c,d]);return o?I.jsx(ln,{children:I.jsx("div",{ref:i.setFloating,style:a,...u(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-soft outline-hidden overflow-hidden",children:n})}):null}const kn=n=>{const e=H.c(17),{item:t,isSelected:o,onSelect:r,isLoading:s,ref:i,renderItem:a}=n;let l;if(e[0]!==t){const x=bt(t._meta);l=t.title||xt(t.name,x),e[0]=t,e[1]=l}else l=e[1];const c=l,d=t.description||null,u=t.icon,g=o&&"bg-accent text-accent-foreground",h=s&&"pointer-events-none opacity-50";let y;e[2]!==g||e[3]!==h?(y=vt("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",g,h),e[2]=g,e[3]=h,e[4]=y):y=e[4];let m;e[5]!==d||e[6]!==u||e[7]!==s||e[8]!==t||e[9]!==c||e[10]!==a?(m=a?a(t):I.jsxs(I.Fragment,{children:[u!==void 0&&I.jsx(yt,{icon:u,name:c,size:"xs",className:"mr-2"}),I.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:c}),s&&I.jsx(ht,{size:"xs"})]}),d&&I.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:d})]}),t.drillable&&I.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-2xs font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"})]}),e[5]=d,e[6]=u,e[7]=s,e[8]=t,e[9]=c,e[10]=a,e[11]=m):m=e[11];let f;return e[12]!==r||e[13]!==i||e[14]!==y||e[15]!==m?(f=I.jsx("div",{ref:i,onClick:r,className:y,children:m}),e[12]=r,e[13]=i,e[14]=y,e[15]=m,e[16]=f):f=e[16],f},_n=n=>{const e=H.c(24),{editor:t,queryKey:o,queryFn:r,onSelect:s,renderItem:i,emptyLabel:a}=n,l=pt();let c;e[0]!==t||e[1]!==s||e[2]!==r||e[3]!==o?(c={editor:t,queryKey:o,queryFn:r,onSelect:s},e[0]=t,e[1]=s,e[2]=r,e[3]=o,e[4]=c):c=e[4];const{items:d,selectedIndex:u,onSelect:g,selectedItem:h}=qn(c);if(!d.length){let x;e[5]!==a||e[6]!==l?(x=a??l("chat.mention.noItemsFound"),e[5]=a,e[6]=l,e[7]=x):x=e[7];let b;return e[8]!==x?(b=I.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-soft p-3 text-sm",children:x}),e[8]=x,e[9]=b):b=e[9],b}let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[10]=y):y=e[10];let m;if(e[11]!==g||e[12]!==d||e[13]!==i||e[14]!==u||e[15]!==h?.name){let x;e[17]!==g||e[18]!==i||e[19]!==u||e[20]!==h?.name?(x=(b,R)=>I.jsx(kn,{item:b,isSelected:R===u,ref:R===u?Kn:void 0,onSelect:()=>g(b,R),isLoading:h?.name===b.name,renderItem:i},`${b.kind??"item"}:${b.name}`),e[17]=g,e[18]=i,e[19]=u,e[20]=h?.name,e[21]=x):x=e[21],m=d.map(x),e[11]=g,e[12]=d,e[13]=i,e[14]=u,e[15]=h?.name,e[16]=m}else m=e[16];let f;return e[22]!==m?(f=I.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:y,children:I.jsx("div",{className:"p-1",children:m})}),e[22]=m,e[23]=f):f=e[23],f};function Ln(){const n=H.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=I.jsx("div",{className:"p-1",children:[...Array(3)].map(jn)}),n[0]=e):e=n[0],e}function jn(n,e){return I.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[I.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),I.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function Gn(n){const e=H.c(20),{editor:t,char:o,pluginKey:r,queryKey:s,queryFn:i,onSelect:a,allow:l,onOpenChange:c,renderItem:d,emptyLabel:u}=n;let g;e[0]!==l||e[1]!==o||e[2]!==t||e[3]!==c||e[4]!==r?(g={editor:t,char:o,pluginKey:r,allow:l,onOpenChange:c},e[0]=l,e[1]=o,e[2]=t,e[3]=c,e[4]=r,e[5]=g):g=e[5];const{state:h,dispatch:y}=On(g);let m;e[6]!==y||e[7]!==h?(m={state:h,dispatch:y},e[6]=y,e[7]=h,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=I.jsx(Ln,{}),e[9]=f):f=e[9];let x;e[10]!==t||e[11]!==u||e[12]!==a||e[13]!==i||e[14]!==s||e[15]!==d?(x=I.jsx($n,{children:I.jsx(p.Suspense,{fallback:f,children:I.jsx(_n,{editor:t,queryKey:s,queryFn:i,onSelect:a,renderItem:d,emptyLabel:u})})}),e[10]=t,e[11]=u,e[12]=a,e[13]=i,e[14]=s,e[15]=d,e[16]=x):x=e[16];let b;return e[17]!==m||e[18]!==x?(b=I.jsx(Le.Provider,{value:m,children:x}),e[17]=m,e[18]=x,e[19]=b):b=e[19],b}function Kn(n){n&&n.scrollIntoView({block:"center",behavior:"smooth"})}export{Gn as S,Yn as a,Xn as e,Hn as s};
@@ -1 +1 @@
1
- import{c as l,m as a,j as m,gN as u}from"./index-BYLma6nR.js";function p(r){const e=l.c(8),{size:n,className:c}=r,t=n===void 0?16:n;let s;e[0]!==t?(s={width:t,height:t},e[0]=t,e[1]=s):s=e[1];let i;e[2]!==c?(i=a("shrink-0 rounded-full object-cover",c),e[2]=c,e[3]=i):i=e[3];let o;return e[4]!==t||e[5]!==s||e[6]!==i?(o=m.jsx("img",{src:u,alt:"Super Agent",width:t,height:t,style:s,className:i}),e[4]=t,e[5]=s,e[6]=i,e[7]=o):o=e[7],o}export{p as S};
1
+ import{c as l,m as a,j as m,gM as u}from"./index-DLrFWx5Y.js";function p(r){const e=l.c(8),{size:n,className:c}=r,t=n===void 0?16:n;let s;e[0]!==t?(s={width:t,height:t},e[0]=t,e[1]=s):s=e[1];let i;e[2]!==c?(i=a("shrink-0 rounded-full object-cover",c),e[2]=c,e[3]=i):i=e[3];let o;return e[4]!==t||e[5]!==s||e[6]!==i?(o=m.jsx("img",{src:u,alt:"Super Agent",width:t,height:t,style:s,className:i}),e[4]=t,e[5]=s,e[6]=i,e[7]=o):o=e[7],o}export{p as S};
@@ -1 +1 @@
1
- import{r as n,j as i,cG as C,cE as _,cB as T,cH as I,cM as M,cX as H,cT as z,c as A,m as g}from"./index-BYLma6nR.js";var b="Switch",[U]=z(b),[q,L]=U(b),y=n.forwardRef((o,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:c,required:a,disabled:d,value:u="on",onCheckedChange:w,form:l,...k}=o,[p,h]=n.useState(null),S=_(e,m=>h(m)),v=n.useRef(!1),x=p?l||!!p.closest("form"):!0,[f,N]=T({prop:r,defaultProp:c??!1,onChange:w,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":a,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...k,ref:S,onClick:I(o.onClick,m=>{N(B=>!B),x&&(v.current=m.isPropagationStopped(),v.current||m.stopPropagation())})}),x&&i.jsx(R,{control:p,bubbles:!v.current,name:s,value:u,checked:f,required:a,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});y.displayName=b;var E="SwitchThumb",P=n.forwardRef((o,e)=>{const{__scopeSwitch:t,...s}=o,r=L(E,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});P.displayName=E;var O="SwitchBubbleInput",R=n.forwardRef(({__scopeSwitch:o,control:e,checked:t,bubbles:s=!0,...r},c)=>{const a=n.useRef(null),d=_(a,c),u=M(t),w=H(e);return n.useEffect(()=>{const l=a.current;if(!l)return;const k=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==t&&h){const S=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(S)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});R.displayName=O;function j(o){return o?"checked":"unchecked"}var X=y,$=P;function F(o){const e=A.c(9);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 r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-foreground/15 inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border-2 border-transparent transition-colors outline-none focus-ring disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-3.5 rounded-full shadow-[0_0_0_1px_#0000000f] ring-0 transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0")}),e[5]=c):c=e[5];let a;return e[6]!==s||e[7]!==r?(a=i.jsx(X,{"data-slot":"switch",className:r,...s,children:c}),e[6]=s,e[7]=r,e[8]=a):a=e[8],a}export{F as S};
1
+ import{r as n,j as i,cG as C,cE as _,cB as T,cH as I,cM as M,cX as H,cT as z,c as A,m as g}from"./index-DLrFWx5Y.js";var b="Switch",[U]=z(b),[q,L]=U(b),y=n.forwardRef((o,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:c,required:a,disabled:d,value:u="on",onCheckedChange:w,form:l,...k}=o,[p,h]=n.useState(null),S=_(e,m=>h(m)),v=n.useRef(!1),x=p?l||!!p.closest("form"):!0,[f,N]=T({prop:r,defaultProp:c??!1,onChange:w,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":a,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...k,ref:S,onClick:I(o.onClick,m=>{N(B=>!B),x&&(v.current=m.isPropagationStopped(),v.current||m.stopPropagation())})}),x&&i.jsx(R,{control:p,bubbles:!v.current,name:s,value:u,checked:f,required:a,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});y.displayName=b;var E="SwitchThumb",P=n.forwardRef((o,e)=>{const{__scopeSwitch:t,...s}=o,r=L(E,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});P.displayName=E;var O="SwitchBubbleInput",R=n.forwardRef(({__scopeSwitch:o,control:e,checked:t,bubbles:s=!0,...r},c)=>{const a=n.useRef(null),d=_(a,c),u=M(t),w=H(e);return n.useEffect(()=>{const l=a.current;if(!l)return;const k=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==t&&h){const S=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(S)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});R.displayName=O;function j(o){return o?"checked":"unchecked"}var X=y,$=P;function F(o){const e=A.c(9);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 r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-foreground/15 inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border-2 border-transparent transition-colors outline-none focus-ring disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-3.5 rounded-full shadow-[0_0_0_1px_#0000000f] ring-0 transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0")}),e[5]=c):c=e[5];let a;return e[6]!==s||e[7]!==r?(a=i.jsx(X,{"data-slot":"switch",className:r,...s,children:c}),e[6]=s,e[7]=r,e[8]=a):a=e[8],a}export{F as S};
@@ -1 +1 @@
1
- import{c as ee,j as s,hX as he,b as fe,r as oe,B as Z,g2 as pe,c8 as ge,m as xe,g3 as je,hv as Re,t as re,bC as Se,x as ve,aS as be,w as De,I as Ce,y as _e,v as Pe,D as Ae,aG as ke,aH as Ne,aI as Ee,aJ as Ie,bj as Oe,aK as ze,aL as we,aM as Te}from"./index-BYLma6nR.js";import{s as ue}from"./Plus-BRIZEm-m.js";import{E as $e}from"./empty-state-aXWI3-Mm.js";import{u as Fe,G as Ge,R as He}from"./repository-picker-CfUR1P6V.js";import{u as Be,b as Le,c as qe}from"./use-org-repo-syncs-Cj0yTqTx.js";import{R as Je}from"./require-capability-B1_EID-G.js";import"./ArrowLeft-DPiUStmH.js";import"./tooltip-Bw3qe--M.js";import"./index-CorYIdad.js";import"./label-CjHEjKyC.js";import"./github-icon-iZdKbq4s.js";import"./useInfiniteQuery-DmLlHKe0.js";import"./infiniteQueryObserver-deqizdYY.js";import"./collection-search-CcswFoQz.js";import"./SearchMd-CHeeKxSQ.js";import"./ShoppingBag01-CpRghVvA.js";import"./use-debounced-value-8OKqfUuy.js";import"./use-organization-settings-BQAdDt_y.js";import"./schema-x3j4FByb.js";import"./task-board-CpInFlas.js";import"./access-gate-BO57Fy6P.js";import"./capability-load-error-D_eJcYHf.js";function Ke(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Me(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:Re(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=ee.c(30),{config:n,onRemove:i}=e,c=fe(),d=Me(n,c),m=Fe();let r;t[0]!==n.repositoryId||t[1]!==m.data?(r=m.data?.find(D=>D.id===n.repositoryId),t[0]=n.repositoryId,t[1]=m.data,t[2]=r):r=t[2];const a=r,l=je;let f;t[3]!==a?(f=a?s.jsx(Ge,{provider:a.provider,size:16}):s.jsx(ge,{size:16}),t[3]=a,t[4]=f):f=t[4];const j=a?.path??`${n.repoOwner}/${n.repoName}`;let R;t[5]!==j?(R=s.jsx("span",{className:"truncate",children:j}),t[5]=j,t[6]=R):R=t[6];let g;t[7]!==n.ref?(g=s.jsxs("span",{className:"text-xs font-normal text-muted-foreground shrink-0",children:["@",n.ref]}),t[7]=n.ref,t[8]=g):g=t[8];let S;t[9]!==R||t[10]!==g?(S=s.jsxs("span",{className:"flex items-center gap-2",children:[R,g]}),t[9]=R,t[10]=g,t[11]=S):S=t[11];const b=xe(d.error&&"text-destructive");let v;t[12]!==n.volume||t[13]!==c?(v=c("settings.syncedRepos.rowSubtitle",{volume:n.volume}),t[12]=n.volume,t[13]=c,t[14]=v):v=t[14];let u;t[15]!==d.label||t[16]!==b||t[17]!==v?(u=s.jsxs("span",{className:b,children:[v," ·"," ",d.label]}),t[15]=d.label,t[16]=b,t[17]=v,t[18]=u):u=t[18];let y;t[19]!==c?(y=c("settings.syncedRepos.remove"),t[19]=c,t[20]=y):y=t[20];let p;t[21]!==i||t[22]!==y?(p=s.jsx(Z,{variant:"outline",size:"sm",onClick:i,children:y}),t[21]=i,t[22]=y,t[23]=p):p=t[23];let h;return t[24]!==l||t[25]!==p||t[26]!==f||t[27]!==S||t[28]!==u?(h=s.jsx(l,{icon:f,title:S,description:u,action:p}),t[24]=l,t[25]=p,t[26]=f,t[27]=S,t[28]=u,t[29]=h):h=t[29],h}function Xe(e){const t=ee.c(15),{onAdd:n}=e,i=fe();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ge,{}),t[0]=c):c=t[0];let d;t[1]!==i?(d=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=d):d=t[2];let m;t[3]!==i?(m=i("settings.syncedRepos.emptyDescription"),t[3]=i,t[4]=m):m=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ue,{size:14}),t[5]=r):r=t[5];let a;t[6]!==i?(a=i("settings.syncedRepos.addRepo"),t[6]=i,t[7]=a):a=t[7];let l;t[8]!==n||t[9]!==a?(l=s.jsxs(Z,{onClick:n,size:"sm",children:[r,a]}),t[8]=n,t[9]=a,t[10]=l):l=t[10];let f;return t[11]!==d||t[12]!==m||t[13]!==l?(f=s.jsx(pe,{children:s.jsx($e,{size:"inline",icon:c,title:d,description:m,children:l})}),t[11]=d,t[12]=m,t[13]=l,t[14]=f):f=t[14],f}function Qe(){const e=ee.c(102),t=fe(),n=Be(),i=Le(),c=qe(),[d,m]=oe.useState(!1),[r,a]=oe.useState(null),[l,f]=oe.useState(""),[j,R]=oe.useState(null);let g;e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==l?(g=function(){!r||!l.trim()||i.mutate({repositoryId:r.id,volume:l.trim()},{onSuccess:x=>{a(null),re.success(t("settings.syncedRepos.created",{volume:x.volume}))},onError:x=>{re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=r,e[2]=t,e[3]=l,e[4]=g):g=e[4];const S=g;let b;e[5]!==j||e[6]!==c||e[7]!==t?(b=function(){j&&c.mutate(j.id,{onSuccess:()=>re.success(t("settings.syncedRepos.removed")),onError:x=>re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed")),onSettled:()=>R(null)})},e[5]=j,e[6]=c,e[7]=t,e[8]=b):b=e[8];const v=b;if(n.isPending){let o;return e[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Se,{className:"h-32 w-full"}),e[9]=o):o=e[9],o}let u;e[10]!==n.data?(u=n.data??[],e[10]=n.data,e[11]=u):u=e[11];const y=u;let p;e[12]!==y||e[13]!==t?(p=y.length===0?s.jsx(Xe,{onAdd:()=>m(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Z,{onClick:()=>m(!0),size:"sm",children:[s.jsx(ue,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx(pe,{children:y.map(o=>s.jsx(Ve,{config:o,onRemove:()=>R(o)},o.id))})]}),e[12]=y,e[13]=t,e[14]=p):p=e[14];let h;e[15]!==t?(h=t("settings.syncedRepos.pickerTitle"),e[15]=t,e[16]=h):h=e[16];let D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=o=>{const{repository:x}=o;m(!1),a(x),f(Ke(x.path.split("/").at(-1)??x.path))},e[17]=D):D=e[17];let C;e[18]!==d||e[19]!==h?(C=s.jsx(He,{open:d,onOpenChange:m,title:h,onPicked:D}),e[18]=d,e[19]=h,e[20]=C):C=e[20];const ae=r!==null;let te;e[21]===Symbol.for("react.memo_cache_sentinel")?(te=o=>{o||a(null)},e[21]=te):te=e[21];let _;e[22]!==t?(_=t("settings.syncedRepos.nameDialogTitle"),e[22]=t,e[23]=_):_=e[23];let P;e[24]!==_?(P=s.jsx(ve,{children:_}),e[24]=_,e[25]=P):P=e[25];const ce=r?r.path:"";let A;e[26]!==t||e[27]!==ce?(A=t("settings.syncedRepos.nameDialogDescription",{repo:ce}),e[26]=t,e[27]=ce,e[28]=A):A=e[28];let k;e[29]!==A?(k=s.jsx(be,{children:A}),e[29]=A,e[30]=k):k=e[30];let N;e[31]!==P||e[32]!==k?(N=s.jsxs(De,{children:[P,k]}),e[31]=P,e[32]=k,e[33]=N):N=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se=o=>f(o.target.value),e[34]=se):se=e[34];let E;e[35]!==t?(E=t("settings.syncedRepos.namePlaceholder"),e[35]=t,e[36]=E):E=e[36];let I;e[37]!==E||e[38]!==l?(I=s.jsx(Ce,{value:l,onChange:se,placeholder:E,autoFocus:!0}),e[37]=E,e[38]=l,e[39]=I):I=e[39];let ie;e[40]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>a(null),e[40]=ie):ie=e[40];const ye=i.isPending;let O;e[41]!==t?(O=t("settings.syncedRepos.cancel"),e[41]=t,e[42]=O):O=e[42];let z;e[43]!==i.isPending||e[44]!==O?(z=s.jsx(Z,{variant:"outline",onClick:ie,disabled:ye,children:O}),e[43]=i.isPending,e[44]=O,e[45]=z):z=e[45];let w;e[46]!==i.isPending||e[47]!==l?(w=!l.trim()||i.isPending,e[46]=i.isPending,e[47]=l,e[48]=w):w=e[48];let T;e[49]!==i.isPending||e[50]!==t?(T=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[49]=i.isPending,e[50]=t,e[51]=T):T=e[51];let $;e[52]!==S||e[53]!==w||e[54]!==T?($=s.jsx(Z,{disabled:w,onClick:S,children:T}),e[52]=S,e[53]=w,e[54]=T,e[55]=$):$=e[55];let F;e[56]!==z||e[57]!==$?(F=s.jsxs(_e,{children:[z,$]}),e[56]=z,e[57]=$,e[58]=F):F=e[58];let G;e[59]!==N||e[60]!==I||e[61]!==F?(G=s.jsxs(Pe,{className:"sm:max-w-sm",children:[N,I,F]}),e[59]=N,e[60]=I,e[61]=F,e[62]=G):G=e[62];let H;e[63]!==G||e[64]!==ae?(H=s.jsx(Ae,{open:ae,onOpenChange:te,children:G}),e[63]=G,e[64]=ae,e[65]=H):H=e[65];const de=j!==null;let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=o=>{o||R(null)},e[66]=ne):ne=e[66];const me=j?.volume??"";let B;e[67]!==t||e[68]!==me?(B=t("settings.syncedRepos.removeTitle",{volume:me}),e[67]=t,e[68]=me,e[69]=B):B=e[69];let L;e[70]!==B?(L=s.jsx(ke,{children:B}),e[70]=B,e[71]=L):L=e[71];let q;e[72]!==t?(q=t("settings.syncedRepos.removeDescription"),e[72]=t,e[73]=q):q=e[73];let J;e[74]!==q?(J=s.jsx(Ne,{children:q}),e[74]=q,e[75]=J):J=e[75];let K;e[76]!==L||e[77]!==J?(K=s.jsxs(Ee,{children:[L,J]}),e[76]=L,e[77]=J,e[78]=K):K=e[78];let M;e[79]!==t?(M=t("settings.syncedRepos.cancel"),e[79]=t,e[80]=M):M=e[80];let V;e[81]!==M?(V=s.jsx(Ie,{children:M}),e[81]=M,e[82]=V):V=e[82];let X;e[83]!==t?(X=t("settings.syncedRepos.remove"),e[83]=t,e[84]=X):X=e[84];let Q;e[85]!==v||e[86]!==X?(Q=s.jsx(Oe,{onClick:v,children:X}),e[85]=v,e[86]=X,e[87]=Q):Q=e[87];let U;e[88]!==V||e[89]!==Q?(U=s.jsxs(ze,{children:[V,Q]}),e[88]=V,e[89]=Q,e[90]=U):U=e[90];let W;e[91]!==K||e[92]!==U?(W=s.jsxs(we,{children:[K,U]}),e[91]=K,e[92]=U,e[93]=W):W=e[93];let Y;e[94]!==de||e[95]!==W?(Y=s.jsx(Te,{open:de,onOpenChange:ne,children:W}),e[94]=de,e[95]=W,e[96]=Y):Y=e[96];let le;return e[97]!==H||e[98]!==p||e[99]!==Y||e[100]!==C?(le=s.jsxs(s.Fragment,{children:[p,C,H,Y]}),e[97]=H,e[98]=p,e[99]=Y,e[100]=C,e[101]=le):le=e[101],le}function Ue(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(he,{group:"storage",children:s.jsx(Qe,{})}),e[0]=t):t=e[0],t}function jt(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Je,{capability:"file-configs:manage",area:"files",children:s.jsx(Ue,{})}),e[0]=t):t=e[0],t}export{jt as default};
1
+ import{c as ee,j as s,hW as he,b as fe,r as oe,B as Z,g1 as pe,c8 as ge,m as xe,g2 as je,hu as Re,t as re,bC as Se,x as ve,aS as be,w as De,I as Ce,y as _e,v as Pe,D as Ae,aG as ke,aH as Ne,aI as Ee,aJ as Ie,bj as Oe,aK as ze,aL as we,aM as Te}from"./index-DLrFWx5Y.js";import{s as ue}from"./Plus-Dhutz31g.js";import{E as $e}from"./empty-state-DB3KUDYc.js";import{u as Fe,G as Ge,R as He}from"./repository-picker-Ms6PvgtV.js";import{u as Be,b as Le,c as qe}from"./use-org-repo-syncs-Ddabxxnq.js";import{R as Je}from"./require-capability-DgcGeKzj.js";import"./ArrowLeft-D6scOXD-.js";import"./tooltip-D4RVnddm.js";import"./index-D-pfNS-S.js";import"./label-DzXAppDM.js";import"./github-icon-BIb5Vfpr.js";import"./useInfiniteQuery-B3nmwRd2.js";import"./infiniteQueryObserver-CxT8wQIc.js";import"./collection-search-iWjyQyoE.js";import"./SearchMd-DYX8MZiO.js";import"./ShoppingBag01-gbNNAeM0.js";import"./use-debounced-value-CkSIMvSM.js";import"./use-organization-settings-BTNKvxbS.js";import"./schema-C3iRMQDR.js";import"./task-board-P3oVDv96.js";import"./access-gate-DIjds3ci.js";import"./capability-load-error-B5mCDF3r.js";function Ke(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Me(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:Re(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=ee.c(30),{config:n,onRemove:i}=e,c=fe(),d=Me(n,c),m=Fe();let r;t[0]!==n.repositoryId||t[1]!==m.data?(r=m.data?.find(D=>D.id===n.repositoryId),t[0]=n.repositoryId,t[1]=m.data,t[2]=r):r=t[2];const a=r,l=je;let f;t[3]!==a?(f=a?s.jsx(Ge,{provider:a.provider,size:16}):s.jsx(ge,{size:16}),t[3]=a,t[4]=f):f=t[4];const j=a?.path??`${n.repoOwner}/${n.repoName}`;let R;t[5]!==j?(R=s.jsx("span",{className:"truncate",children:j}),t[5]=j,t[6]=R):R=t[6];let g;t[7]!==n.ref?(g=s.jsxs("span",{className:"text-xs font-normal text-muted-foreground shrink-0",children:["@",n.ref]}),t[7]=n.ref,t[8]=g):g=t[8];let S;t[9]!==R||t[10]!==g?(S=s.jsxs("span",{className:"flex items-center gap-2",children:[R,g]}),t[9]=R,t[10]=g,t[11]=S):S=t[11];const b=xe(d.error&&"text-destructive");let v;t[12]!==n.volume||t[13]!==c?(v=c("settings.syncedRepos.rowSubtitle",{volume:n.volume}),t[12]=n.volume,t[13]=c,t[14]=v):v=t[14];let u;t[15]!==d.label||t[16]!==b||t[17]!==v?(u=s.jsxs("span",{className:b,children:[v," ·"," ",d.label]}),t[15]=d.label,t[16]=b,t[17]=v,t[18]=u):u=t[18];let y;t[19]!==c?(y=c("settings.syncedRepos.remove"),t[19]=c,t[20]=y):y=t[20];let p;t[21]!==i||t[22]!==y?(p=s.jsx(Z,{variant:"outline",size:"sm",onClick:i,children:y}),t[21]=i,t[22]=y,t[23]=p):p=t[23];let h;return t[24]!==l||t[25]!==p||t[26]!==f||t[27]!==S||t[28]!==u?(h=s.jsx(l,{icon:f,title:S,description:u,action:p}),t[24]=l,t[25]=p,t[26]=f,t[27]=S,t[28]=u,t[29]=h):h=t[29],h}function We(e){const t=ee.c(15),{onAdd:n}=e,i=fe();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ge,{}),t[0]=c):c=t[0];let d;t[1]!==i?(d=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=d):d=t[2];let m;t[3]!==i?(m=i("settings.syncedRepos.emptyDescription"),t[3]=i,t[4]=m):m=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ue,{size:14}),t[5]=r):r=t[5];let a;t[6]!==i?(a=i("settings.syncedRepos.addRepo"),t[6]=i,t[7]=a):a=t[7];let l;t[8]!==n||t[9]!==a?(l=s.jsxs(Z,{onClick:n,size:"sm",children:[r,a]}),t[8]=n,t[9]=a,t[10]=l):l=t[10];let f;return t[11]!==d||t[12]!==m||t[13]!==l?(f=s.jsx(pe,{children:s.jsx($e,{size:"inline",icon:c,title:d,description:m,children:l})}),t[11]=d,t[12]=m,t[13]=l,t[14]=f):f=t[14],f}function Qe(){const e=ee.c(102),t=fe(),n=Be(),i=Le(),c=qe(),[d,m]=oe.useState(!1),[r,a]=oe.useState(null),[l,f]=oe.useState(""),[j,R]=oe.useState(null);let g;e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==l?(g=function(){!r||!l.trim()||i.mutate({repositoryId:r.id,volume:l.trim()},{onSuccess:x=>{a(null),re.success(t("settings.syncedRepos.created",{volume:x.volume}))},onError:x=>{re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=r,e[2]=t,e[3]=l,e[4]=g):g=e[4];const S=g;let b;e[5]!==j||e[6]!==c||e[7]!==t?(b=function(){j&&c.mutate(j.id,{onSuccess:()=>re.success(t("settings.syncedRepos.removed")),onError:x=>re.error(x instanceof Error?x.message:t("settings.syncedRepos.failed")),onSettled:()=>R(null)})},e[5]=j,e[6]=c,e[7]=t,e[8]=b):b=e[8];const v=b;if(n.isPending){let o;return e[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Se,{className:"h-32 w-full"}),e[9]=o):o=e[9],o}let u;e[10]!==n.data?(u=n.data??[],e[10]=n.data,e[11]=u):u=e[11];const y=u;let p;e[12]!==y||e[13]!==t?(p=y.length===0?s.jsx(We,{onAdd:()=>m(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Z,{onClick:()=>m(!0),size:"sm",children:[s.jsx(ue,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx(pe,{children:y.map(o=>s.jsx(Ve,{config:o,onRemove:()=>R(o)},o.id))})]}),e[12]=y,e[13]=t,e[14]=p):p=e[14];let h;e[15]!==t?(h=t("settings.syncedRepos.pickerTitle"),e[15]=t,e[16]=h):h=e[16];let D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=o=>{const{repository:x}=o;m(!1),a(x),f(Ke(x.path.split("/").at(-1)??x.path))},e[17]=D):D=e[17];let C;e[18]!==d||e[19]!==h?(C=s.jsx(He,{open:d,onOpenChange:m,title:h,onPicked:D}),e[18]=d,e[19]=h,e[20]=C):C=e[20];const ae=r!==null;let te;e[21]===Symbol.for("react.memo_cache_sentinel")?(te=o=>{o||a(null)},e[21]=te):te=e[21];let _;e[22]!==t?(_=t("settings.syncedRepos.nameDialogTitle"),e[22]=t,e[23]=_):_=e[23];let P;e[24]!==_?(P=s.jsx(ve,{children:_}),e[24]=_,e[25]=P):P=e[25];const ce=r?r.path:"";let A;e[26]!==t||e[27]!==ce?(A=t("settings.syncedRepos.nameDialogDescription",{repo:ce}),e[26]=t,e[27]=ce,e[28]=A):A=e[28];let k;e[29]!==A?(k=s.jsx(be,{children:A}),e[29]=A,e[30]=k):k=e[30];let N;e[31]!==P||e[32]!==k?(N=s.jsxs(De,{children:[P,k]}),e[31]=P,e[32]=k,e[33]=N):N=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se=o=>f(o.target.value),e[34]=se):se=e[34];let E;e[35]!==t?(E=t("settings.syncedRepos.namePlaceholder"),e[35]=t,e[36]=E):E=e[36];let I;e[37]!==E||e[38]!==l?(I=s.jsx(Ce,{value:l,onChange:se,placeholder:E,autoFocus:!0}),e[37]=E,e[38]=l,e[39]=I):I=e[39];let ie;e[40]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>a(null),e[40]=ie):ie=e[40];const ye=i.isPending;let O;e[41]!==t?(O=t("settings.syncedRepos.cancel"),e[41]=t,e[42]=O):O=e[42];let z;e[43]!==i.isPending||e[44]!==O?(z=s.jsx(Z,{variant:"outline",onClick:ie,disabled:ye,children:O}),e[43]=i.isPending,e[44]=O,e[45]=z):z=e[45];let w;e[46]!==i.isPending||e[47]!==l?(w=!l.trim()||i.isPending,e[46]=i.isPending,e[47]=l,e[48]=w):w=e[48];let T;e[49]!==i.isPending||e[50]!==t?(T=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[49]=i.isPending,e[50]=t,e[51]=T):T=e[51];let $;e[52]!==S||e[53]!==w||e[54]!==T?($=s.jsx(Z,{disabled:w,onClick:S,children:T}),e[52]=S,e[53]=w,e[54]=T,e[55]=$):$=e[55];let F;e[56]!==z||e[57]!==$?(F=s.jsxs(_e,{children:[z,$]}),e[56]=z,e[57]=$,e[58]=F):F=e[58];let G;e[59]!==N||e[60]!==I||e[61]!==F?(G=s.jsxs(Pe,{className:"sm:max-w-sm",children:[N,I,F]}),e[59]=N,e[60]=I,e[61]=F,e[62]=G):G=e[62];let H;e[63]!==G||e[64]!==ae?(H=s.jsx(Ae,{open:ae,onOpenChange:te,children:G}),e[63]=G,e[64]=ae,e[65]=H):H=e[65];const de=j!==null;let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=o=>{o||R(null)},e[66]=ne):ne=e[66];const me=j?.volume??"";let B;e[67]!==t||e[68]!==me?(B=t("settings.syncedRepos.removeTitle",{volume:me}),e[67]=t,e[68]=me,e[69]=B):B=e[69];let L;e[70]!==B?(L=s.jsx(ke,{children:B}),e[70]=B,e[71]=L):L=e[71];let q;e[72]!==t?(q=t("settings.syncedRepos.removeDescription"),e[72]=t,e[73]=q):q=e[73];let J;e[74]!==q?(J=s.jsx(Ne,{children:q}),e[74]=q,e[75]=J):J=e[75];let K;e[76]!==L||e[77]!==J?(K=s.jsxs(Ee,{children:[L,J]}),e[76]=L,e[77]=J,e[78]=K):K=e[78];let M;e[79]!==t?(M=t("settings.syncedRepos.cancel"),e[79]=t,e[80]=M):M=e[80];let V;e[81]!==M?(V=s.jsx(Ie,{children:M}),e[81]=M,e[82]=V):V=e[82];let W;e[83]!==t?(W=t("settings.syncedRepos.remove"),e[83]=t,e[84]=W):W=e[84];let Q;e[85]!==v||e[86]!==W?(Q=s.jsx(Oe,{onClick:v,children:W}),e[85]=v,e[86]=W,e[87]=Q):Q=e[87];let U;e[88]!==V||e[89]!==Q?(U=s.jsxs(ze,{children:[V,Q]}),e[88]=V,e[89]=Q,e[90]=U):U=e[90];let X;e[91]!==K||e[92]!==U?(X=s.jsxs(we,{children:[K,U]}),e[91]=K,e[92]=U,e[93]=X):X=e[93];let Y;e[94]!==de||e[95]!==X?(Y=s.jsx(Te,{open:de,onOpenChange:ne,children:X}),e[94]=de,e[95]=X,e[96]=Y):Y=e[96];let le;return e[97]!==H||e[98]!==p||e[99]!==Y||e[100]!==C?(le=s.jsxs(s.Fragment,{children:[p,C,H,Y]}),e[97]=H,e[98]=p,e[99]=Y,e[100]=C,e[101]=le):le=e[101],le}function Ue(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(he,{group:"storage",children:s.jsx(Qe,{})}),e[0]=t):t=e[0],t}function jt(){const e=ee.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Je,{capability:"file-configs:manage",area:"files",children:s.jsx(Ue,{})}),e[0]=t):t=e[0],t}export{jt as default};
@@ -1 +1 @@
1
- import{c as a,m as f,j as i}from"./index-BYLma6nR.js";import{N as p}from"./agent-icon-DbfcsXV4.js";function j(m){const s=a.c(10),{icon:o,className:l}=m,e=l===void 0?"size-4":l;if(o.kind==="component"){const{Component:c}=o;let t;return s[0]!==c||s[1]!==e?(t=i.jsx(c,{className:e}),s[0]=c,s[1]=e,s[2]=t):t=s[2],t}if(o.kind==="url"){const c=o.src;let t;s[3]!==e?(t=f(e,"rounded-sm object-cover"),s[3]=e,s[4]=t):t=s[4];let r;return s[5]!==o.src||s[6]!==t?(r=i.jsx("img",{src:c,alt:"",className:t}),s[5]=o.src,s[6]=t,s[7]=r):r=s[7],r}let n;return s[8]!==e?(n=i.jsx(p,{className:e}),s[8]=e,s[9]=n):n=s[9],n}export{j as T};
1
+ import{c as a,m as f,j as i}from"./index-DLrFWx5Y.js";import{N as p}from"./agent-icon-Bd5DjuVH.js";function j(m){const s=a.c(10),{icon:o,className:l}=m,e=l===void 0?"size-4":l;if(o.kind==="component"){const{Component:c}=o;let t;return s[0]!==c||s[1]!==e?(t=i.jsx(c,{className:e}),s[0]=c,s[1]=e,s[2]=t):t=s[2],t}if(o.kind==="url"){const c=o.src;let t;s[3]!==e?(t=f(e,"rounded-sm object-cover"),s[3]=e,s[4]=t):t=s[4];let r;return s[5]!==o.src||s[6]!==t?(r=i.jsx("img",{src:c,alt:"",className:t}),s[5]=o.src,s[6]=t,s[7]=r):r=s[7],r}let n;return s[8]!==e?(n=i.jsx(p,{className:e}),s[8]=e,s[9]=n):n=s[9],n}export{j as T};
@@ -1 +1 @@
1
- import{c as f,m as r,j as c}from"./index-BYLma6nR.js";function u(o){const e=f.c(15);let t,l,s;e[0]!==o?({className:t,variant:s,...l}=o,e[0]=o,e[1]=t,e[2]=l,e[3]=s):(t=e[1],l=e[2],s=e[3]);const a=s===void 0?"card":s,m=a==="card"&&"bg-card rounded-xl shadow-edge overflow-hidden";let n;e[4]!==m?(n=r("w-full min-w-0",m),e[4]=m,e[5]=n):n=e[5];const p=a==="flush"&&"[&_th]:text-muted-foreground [&_th]:font-normal [&_tr]:border-border/50";let i;e[6]!==t||e[7]!==p?(i=r("w-full caption-bottom text-sm min-w-0",p,t),e[6]=t,e[7]=p,e[8]=i):i=e[8];let d;e[9]!==l||e[10]!==i?(d=c.jsx("table",{"data-slot":"table",className:i,...l}),e[9]=l,e[10]=i,e[11]=d):d=e[11];let b;return e[12]!==n||e[13]!==d?(b=c.jsx("div",{"data-slot":"table-container",className:n,children:d}),e[12]=n,e[13]=d,e[14]=b):b=e[14],b}function h(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function N(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function w(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function j(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function g(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{j as T,h as a,w as b,g as c,N as d,u as e};
1
+ import{c as f,m as r,j as c}from"./index-DLrFWx5Y.js";function u(o){const e=f.c(15);let t,l,s;e[0]!==o?({className:t,variant:s,...l}=o,e[0]=o,e[1]=t,e[2]=l,e[3]=s):(t=e[1],l=e[2],s=e[3]);const a=s===void 0?"card":s,m=a==="card"&&"bg-card rounded-xl shadow-edge overflow-hidden";let n;e[4]!==m?(n=r("w-full min-w-0",m),e[4]=m,e[5]=n):n=e[5];const p=a==="flush"&&"[&_th]:text-muted-foreground [&_th]:font-normal [&_tr]:border-border/50";let i;e[6]!==t||e[7]!==p?(i=r("w-full caption-bottom text-sm min-w-0",p,t),e[6]=t,e[7]=p,e[8]=i):i=e[8];let d;e[9]!==l||e[10]!==i?(d=c.jsx("table",{"data-slot":"table",className:i,...l}),e[9]=l,e[10]=i,e[11]=d):d=e[11];let b;return e[12]!==n||e[13]!==d?(b=c.jsx("div",{"data-slot":"table-container",className:n,children:d}),e[12]=n,e[13]=d,e[14]=b):b=e[14],b}function h(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function N(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function w(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function j(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function g(o){const e=f.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=r("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{j as T,h as a,w as b,g as c,N as d,u as e};