decocms 4.524.0 → 4.524.1

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 (407) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-gwLrBsiR.js → ActiveShapeUtils-Bp4fmUBo.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-COLuN3Qe.js → AlertCircle-Bq5T03B8.js} +1 -1
  3. package/dist/client/assets/{AreaChart-Dud7jvcC.js → AreaChart-CCyND0Jp.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BYNlToA0.js → ArrowLeft-Bwi_Jr7f.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CRFAWnPc.js → ArrowUp-CzX0fTk7.js} +1 -1
  6. package/dist/client/assets/{BarChart-JFNliGSV.js → BarChart-wLDzzyOQ.js} +1 -1
  7. package/dist/client/assets/{Building02-DinMBe3_.js → Building02-A_MT9tNO.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-Cjgu2ECY.js → CartesianChart-B0qX_dpC.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-Bx8yFu23.js → CategoricalChart-BDZ_2Tmn.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-DCMOdEuL.js → CheckCircle-BE1i_X4b.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-Dwu4Nr-2.js → ChevronSelectorVertical-DNrt0MHW.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-4EkxqYyz.js → ChevronUp-RlBkcpdd.js} +1 -1
  13. package/dist/client/assets/{Copy01-Tog1jA1S.js → Copy01-B9x501ud.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-B7MC6SfH.js → CreditCard01-Bu_qRR36.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-qUaZHjqd.js → DotsVertical-D9231JAc.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-C1p765z-.js → ErrorBarContext-PGp8cmoe.js} +1 -1
  17. package/dist/client/assets/{Globe04-CGEgYyKw.js → Globe04-DQlP6Nhr.js} +1 -1
  18. package/dist/client/assets/{Image01-CW7Pcq-W.js → Image01-ClayPF_a.js} +1 -1
  19. package/dist/client/assets/{Key01-D_nzK0xg.js → Key01-CxKYO-oQ.js} +1 -1
  20. package/dist/client/assets/{Link01-CpcYQ7Qt.js → Link01-B7BHRxIW.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Ctb4MZUK.js → LinkBroken01-XqJUgSE7.js} +1 -1
  22. package/dist/client/assets/{Minus-DoRDGpun.js → Minus-Bh6ogRng.js} +1 -1
  23. package/dist/client/assets/{Monitor01-L9jyZGZ2.js → Monitor01-BpzvJnXA.js} +1 -1
  24. package/dist/client/assets/{Play-Du5BNsRy.js → Play-w4omVTRa.js} +1 -1
  25. package/dist/client/assets/{Plus-BfnmJh1R.js → Plus-CcJNnBya.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-DCCnHWMQ.js → ReferenceLine-CI6ZmeJ0.js} +1 -1
  27. package/dist/client/assets/{SearchMd-JUAl7Zv6.js → SearchMd-5lGv5a5H.js} +1 -1
  28. package/dist/client/assets/{Sector-DL6Ad47o.js → Sector-gkUUnvA4.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-usYkWunw.js → ShoppingBag01-C82UeRR9.js} +1 -1
  30. package/dist/client/assets/{Sun-B7TolJAG.js → Sun-IvvKZ51n.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-DcP8c_x_.js → SwitchHorizontal01-B1MoYKPo.js} +1 -1
  32. package/dist/client/assets/{Tool01-Bon-ixH5.js → Tool01-BvlRH5Ln.js} +1 -1
  33. package/dist/client/assets/{Trash01-cH2tYIUn.js → Trash01-C9E8l_mI.js} +1 -1
  34. package/dist/client/assets/{Upload01-Bo60o4T6.js → Upload01-mlw10ZK-.js} +1 -1
  35. package/dist/client/assets/{UserSquare-DsAVH788.js → UserSquare-DwNuAluZ.js} +1 -1
  36. package/dist/client/assets/{Users01-Bo_9DitT.js → Users01-DcHPIKgH.js} +1 -1
  37. package/dist/client/assets/{XClose-DhoOL-T1.js → XClose-BBReaSBA.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-B1U_CHeD.js → ZoomOut-CnbxUNSo.js} +1 -1
  39. package/dist/client/assets/{access-gate-CGDwkzkf.js → access-gate-BNOWXoYR.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-8gQOdlVv.js → add-connection-dialog-CEj8kbGq.js} +1 -1
  41. package/dist/client/assets/agent-analytics-DcqQcnI_.js +1 -0
  42. package/dist/client/assets/agent-app-BWM9EEcJ.js +1 -0
  43. package/dist/client/assets/{agent-assets-Q4lV98mF.js → agent-assets-CppO2yKd.js} +1 -1
  44. package/dist/client/assets/{agent-automation-Dsupi3DF.js → agent-automation-BtSTyUKu.js} +1 -1
  45. package/dist/client/assets/{agent-automations-BonoDEyJ.js → agent-automations-Bf-0_57T.js} +1 -1
  46. package/dist/client/assets/agent-calendar-Bp6Y1tPy.js +1 -0
  47. package/dist/client/assets/{agent-connect-sources-C0oR1IIZ.js → agent-connect-sources-C_0x6Udu.js} +1 -1
  48. package/dist/client/assets/agent-deck-BOaej8yV.js +1 -0
  49. package/dist/client/assets/{agent-e2e-nbY2lllw.js → agent-e2e-DokyQFgS.js} +1 -1
  50. package/dist/client/assets/agent-experiments-7O17P9sC.js +1 -0
  51. package/dist/client/assets/{agent-file-DKmgj6b-.js → agent-file-B5Z-mSXW.js} +1 -1
  52. package/dist/client/assets/{agent-hosting-BC5YnVoX.js → agent-hosting-v3_GHpmO.js} +1 -1
  53. package/dist/client/assets/{agent-icon-CVEMdYFU.js → agent-icon-KvVT3fA8.js} +1 -1
  54. package/dist/client/assets/agent-library-B3W6CGJl.js +1 -0
  55. package/dist/client/assets/agent-library-file-CHgoG2j3.js +1 -0
  56. package/dist/client/assets/agent-monitor-C9pMT5KA.js +1 -0
  57. package/dist/client/assets/{agent-overview-DU1IP4XS.js → agent-overview-9FhsI0nk.js} +1 -1
  58. package/dist/client/assets/{agent-releases-BuXXsH8W.js → agent-releases-CRh6y5DW.js} +1 -1
  59. package/dist/client/assets/agent-settings-CfNarIdW.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-DSqJlDXx.js → agent-site-editor-BALtgla6.js} +1 -1
  61. package/dist/client/assets/agent-site-editor-code-D6BBbIl8.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-DAMOp9X5.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-B0IbykqU.js +1 -0
  64. package/dist/client/assets/agent-view-B5q0EqmS.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-Bvqt9A7d.js → agent-view-guard-bPXLqLsK.js} +1 -1
  66. package/dist/client/assets/{agents-list-BV-RY6eO.js → agents-list-DrT_0gVh.js} +1 -1
  67. package/dist/client/assets/{ai-providers-D8opLVHp.js → ai-providers-DorJXBZe.js} +1 -1
  68. package/dist/client/assets/{alert-CYZdSIKq.js → alert-DEw5BVAh.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-BqhdlzKZ.js → analytics-sections-g9foqwY5.js} +1 -1
  70. package/dist/client/assets/{analytics-tab-BWgFTW72.js → analytics-tab-D5KshkAH.js} +1 -1
  71. package/dist/client/assets/api-keys-B-qwgNok.js +1 -0
  72. package/dist/client/assets/{api-keys-Dj50tYQ9.js → api-keys-CIPiPSYY.js} +1 -1
  73. package/dist/client/assets/app-editor-ChUXEXt-.js +1 -0
  74. package/dist/client/assets/{asset-utils-DcPLl2K6.js → asset-utils-DRJP317P.js} +1 -1
  75. package/dist/client/assets/{auth-CEIITB7d.js → auth-Dqt9menC.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-CEBn1SGS.js → auth-catchall-B5Em8iaq.js} +1 -1
  77. package/dist/client/assets/{auth-entry-iXHgBQJV.js → auth-entry-CNtzQsix.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-CsXqgaOS.js → auth-split-layout-BoWG-no5.js} +1 -1
  79. package/dist/client/assets/{authenticate-and-persist-oauth-CN-ocXe3.js → authenticate-and-persist-oauth-BziZaG_M.js} +1 -1
  80. package/dist/client/assets/{automation-list-row-JOMePUFR.js → automation-list-row-BRtPLrxX.js} +1 -1
  81. package/dist/client/assets/{automation-runs-KPGkDZAM.js → automation-runs-C0-BhIZn.js} +1 -1
  82. package/dist/client/assets/{automations-BTtfVGNa.js → automations-CXOQ5gKM.js} +1 -1
  83. package/dist/client/assets/{autosend-CbkP_bEt.js → autosend-BRUzWk70.js} +1 -1
  84. package/dist/client/assets/{badge-DeNt4-FX.js → badge-Ckz5LqgP.js} +1 -1
  85. package/dist/client/assets/{block-document-BzAW7wGZ.js → block-document-BPaZQC5L.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-aUwmyorT.js → blocks-preview-workspace-context-C-uj3YG0.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-PBqE8hLO.js → blocks-tab-states-BcxrQPOR.js} +1 -1
  88. package/dist/client/assets/{blog-schema-BYLQdC9S.js → blog-schema-Du7ILh7Q.js} +1 -1
  89. package/dist/client/assets/{buckets-CFL4z0d-.js → buckets-CKZYh6Ij.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-BpkVMxpg.js → build-improve-prompt-doc-DJhZN8lj.js} +1 -1
  91. package/dist/client/assets/{calendar-GMyXKkbA.js → calendar-DkZz5VlH.js} +1 -1
  92. package/dist/client/assets/{campaigns-view-iaGM9YLd.js → campaigns-view-Dc88Zs16.js} +1 -1
  93. package/dist/client/assets/{capability-load-error-juzFeQ-_.js → capability-load-error-CRB9otZt.js} +1 -1
  94. package/dist/client/assets/category-editor-CSPe0t_-.js +1 -0
  95. package/dist/client/assets/{cdn-tab-QH34WF_J.js → cdn-tab-KPAxnC3T.js} +1 -1
  96. package/dist/client/assets/{chart-D9k22T0E.js → chart-Bp6om7lj.js} +1 -1
  97. package/dist/client/assets/{chat-context-C56OVvQP.js → chat-context-CIOqAIIy.js} +1 -1
  98. package/dist/client/assets/{chat-draft-DNgi8tda.js → chat-draft-OR83_S8w.js} +1 -1
  99. package/dist/client/assets/{checkbox-B6N4ay58.js → checkbox-BQ7Ebuar.js} +1 -1
  100. package/dist/client/assets/{choose-editor-CcEH03W4.js → choose-editor-CspgtGFS.js} +1 -1
  101. package/dist/client/assets/{cli-auth-success-CkyWspHU.js → cli-auth-success-CGyir_iF.js} +1 -1
  102. package/dist/client/assets/{client-icons-DyjyTud6.js → client-icons-BOMFh2QS.js} +1 -1
  103. package/dist/client/assets/cms-settings-editor-DbU_3ksB.js +1 -0
  104. package/dist/client/assets/{collapsible-D3gNdr7N.js → collapsible-BB8_usPT.js} +1 -1
  105. package/dist/client/assets/{collection-detail-D66AIxA0.js → collection-detail-H-UqYky8.js} +1 -1
  106. package/dist/client/assets/{collection-display-button-C28fH98T.js → collection-display-button-CulG1s8m.js} +1 -1
  107. package/dist/client/assets/{collection-search-BIuQ3VPN.js → collection-search-Cf4li4kg.js} +1 -1
  108. package/dist/client/assets/{collection-table-wrapper-7w5ciWB4.js → collection-table-wrapper-DnZHa5Lt.js} +1 -1
  109. package/dist/client/assets/{collection-tabs-m2567Q_Z.js → collection-tabs-x8ccQUAC.js} +1 -1
  110. package/dist/client/assets/{column-rules-DsLrWs5p.js → column-rules-C_DWUbCh.js} +1 -1
  111. package/dist/client/assets/{combobox-BEVN0Tvl.js → combobox-BZoZToki.js} +1 -1
  112. package/dist/client/assets/{command-N9BazZHl.js → command-MmMDew8i.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-BQyuFD3F.js → companion-mcps-section-By8_AO07.js} +1 -1
  114. package/dist/client/assets/{config-BmN9tmsx.js → config-DBn3iCC3.js} +1 -1
  115. package/dist/client/assets/{connect-CefgSXIv.js → connect-DbK_vN0J.js} +1 -1
  116. package/dist/client/assets/{connect-layout-CUTmKBkE.js → connect-layout-9tsE00M7.js} +1 -1
  117. package/dist/client/assets/{connect-source-dialog-CBjVXCAe.js → connect-source-dialog-DqWilbbC.js} +1 -1
  118. package/dist/client/assets/{connection-CQKYiXol.js → connection-QGwhnKZn.js} +1 -1
  119. package/dist/client/assets/{connection-card-CvmG6XsV.js → connection-card-DEMVrMsW.js} +1 -1
  120. package/dist/client/assets/{connection-detail-BloLauxz.js → connection-detail-4PyaBO0_.js} +1 -1
  121. package/dist/client/assets/{connection-form-helpers-ytOA1Nl6.js → connection-form-helpers-DCRY9s0M.js} +1 -1
  122. package/dist/client/assets/{connections-BxS3FS9g.js → connections-CpcdB3jc.js} +1 -1
  123. package/dist/client/assets/{content-tab-BwyJP-DI.js → content-tab-YME7HMCb.js} +3 -3
  124. package/dist/client/assets/{context-menu-C4h1P6Vl.js → context-menu-Cpvztbef.js} +1 -1
  125. package/dist/client/assets/context-oSwYvz9P.js +1 -0
  126. package/dist/client/assets/{context-shell-BxB7W0br.js → context-shell-BVBpRdKB.js} +3 -3
  127. package/dist/client/assets/{core.esm-BYOMVmVh.js → core.esm-B2cbbV3O.js} +1 -1
  128. package/dist/client/assets/{create-organization-dialog-DqU6G9od.js → create-organization-dialog-NLldLLor.js} +1 -1
  129. package/dist/client/assets/{daily-pulse-BlxIy31E.js → daily-pulse-ClSeB_Ta.js} +1 -1
  130. package/dist/client/assets/{discover-DMRyKZWE.js → discover-DmBynuR0.js} +1 -1
  131. package/dist/client/assets/{domain-settings-Cj-cRa8T.js → domain-settings-Cu3Pj63v.js} +1 -1
  132. package/dist/client/assets/{drawer-B7ajVnwC.js → drawer-GssD8cb3.js} +1 -1
  133. package/dist/client/assets/{editor-B7sIq_vQ.js → editor-BTovmEAS.js} +1 -1
  134. package/dist/client/assets/{editor-classes-BinXFbFk.js → editor-classes-CcPgajKG.js} +1 -1
  135. package/dist/client/assets/{empty-state-Cc_qF1X6.js → empty-state-D86P1Giw.js} +1 -1
  136. package/dist/client/assets/{empty-state-RpLaBfip.js → empty-state-DLNzdrwg.js} +1 -1
  137. package/dist/client/assets/{experiments-tab-BlgfPezU.js → experiments-tab-CjpJzYQ9.js} +1 -1
  138. package/dist/client/assets/{experiments-tab-choice-DZqY092h.js → experiments-tab-choice-pVOiMOWe.js} +1 -1
  139. package/dist/client/assets/{extract-connection-data-ClMH8dL9.js → extract-connection-data-DwkOg2rJ.js} +1 -1
  140. package/dist/client/assets/{feature-gate-Wo8Dn-M0.js → feature-gate-BIwsQPiQ.js} +1 -1
  141. package/dist/client/assets/{feature-paywall-C1_xpbwO.js → feature-paywall-DpVlsq5a.js} +1 -1
  142. package/dist/client/assets/{file-explorer-DCgzwH3u.js → file-explorer-B9Wz0lPl.js} +1 -1
  143. package/dist/client/assets/{file-preview-DFHvVsCR.js → file-preview-CX5xfaHR.js} +1 -1
  144. package/dist/client/assets/{file-share-button-DMtXDXf3.js → file-share-button-Cx66riM5.js} +1 -1
  145. package/dist/client/assets/{file-type-icon-may_hs3N.js → file-type-icon-tAeiI9_2.js} +1 -1
  146. package/dist/client/assets/{folder-icon-DREaQWIx.js → folder-icon-C25vLo5g.js} +1 -1
  147. package/dist/client/assets/{form-Gz8fbLdb.js → form-CKF06Eu0.js} +1 -1
  148. package/dist/client/assets/{general-DBULqBSQ.js → general-CA7uhFzP.js} +1 -1
  149. package/dist/client/assets/{held-block-view-DTUWWRfL.js → held-block-view-CU5t1B8c.js} +7 -7
  150. package/dist/client/assets/{home-DnXsGhyo.js → home-BuPVKVzx.js} +1 -1
  151. package/dist/client/assets/{icon-button-TQkFyvqB.js → icon-button-5JlhYc9R.js} +1 -1
  152. package/dist/client/assets/{index-CqFACk2B.js → index-AY0yzUAx.js} +1 -1
  153. package/dist/client/assets/{index-CaH8ekvn.js → index-B0Hb2bUK.js} +1 -1
  154. package/dist/client/assets/{index-C6_m0mjP.js → index-B8bCJ3Gm.js} +1 -1
  155. package/dist/client/assets/{index-DENKa8lW.js → index-BLRFIWph.js} +1 -1
  156. package/dist/client/assets/{index-BEX8cmtV.js → index-BerfNxBu.js} +1 -1
  157. package/dist/client/assets/{index-B9NLvHLf.js → index-Bz0XRw1e.js} +1 -1
  158. package/dist/client/assets/{index-BNmzMNlZ.js → index-C4tYnNih.js} +5 -5
  159. package/dist/client/assets/{index-DusHyRie.js → index-CDfG-oXn.js} +1 -1
  160. package/dist/client/assets/{index-BNtuHmZB.js → index-CJ8-jtJ3.js} +1 -1
  161. package/dist/client/assets/{index-bf-OLKAU.js → index-CMXP-HlZ.js} +1 -1
  162. package/dist/client/assets/{index-BGcfYf5c.js → index-CieIETkx.js} +1 -1
  163. package/dist/client/assets/{index-iynQP1if.js → index-D8kI0oe2.js} +1 -1
  164. package/dist/client/assets/{index-kd3fyZ9a.js → index-DG_Aoo8H.js} +1 -1
  165. package/dist/client/assets/{index-DgWAoWIc.js → index-DMcUJv3F.js} +1 -1
  166. package/dist/client/assets/{index-DNHxXhrW.js → index-DQ4MCRAi.js} +1 -1
  167. package/dist/client/assets/{index-redirect-DAPRiYQw.js → index-redirect-DSkhUiz1.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-ClGIthQz.js → infiniteQueryObserver-CyNcT3qz.js} +1 -1
  169. package/dist/client/assets/{infra-billing-Bn8rlKTp.js → infra-billing-OmwhvZsy.js} +1 -1
  170. package/dist/client/assets/{input-BS4EACP3.js → input-C0IBlV9i.js} +3 -3
  171. package/dist/client/assets/{input-DZSiMfCa.js → input-Drj3v1Rm.js} +1 -1
  172. package/dist/client/assets/{integration-icon-BrTM8z-s.js → integration-icon-wG7mou98.js} +1 -1
  173. package/dist/client/assets/{jira-icon-CvveHm37.js → jira-icon-Ct9neMH3.js} +1 -1
  174. package/dist/client/assets/{label-BCxqhVIq.js → label-Kngegn1Y.js} +1 -1
  175. package/dist/client/assets/{layout-C_-T37yU.js → layout-D1PXm8wr.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-HN0h-Vgf.js → legacy-agents-deep-CqqR00U7.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-HqwAGFUC.js → legacy-main-redirect-j5rWQTR7.js} +1 -1
  178. package/dist/client/assets/library-BB_eexuL.js +1 -0
  179. package/dist/client/assets/{login-D25rkjo_.js → login-dCZC1OIS.js} +1 -1
  180. package/dist/client/assets/{markdown-P8cO0xLZ.js → markdown-C-J5-sTt.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-CKUvsXnq.js → mcp-app-renderer-vHEVQIZL.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-C9hLQucs.js → mcp-oauth-5QMuPFQa.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-DBMA8wIh.js → mcp-oauth-CnB7EPe0.js} +1 -1
  184. package/dist/client/assets/{members-C_tx9w5g.js → members-D62Ns7xb.js} +1 -1
  185. package/dist/client/assets/{memory-CsXGZJq1.js → memory-BRnI6IWM.js} +1 -1
  186. package/dist/client/assets/{mini-report-page-DGZYey3l.js → mini-report-page-RV5HcY13.js} +1 -1
  187. package/dist/client/assets/{mock-board-BWzTY2k-.js → mock-board-C5ljPU5m.js} +3 -3
  188. package/dist/client/assets/{monaco-editor-CBJkBgIU.js → monaco-editor-CG1RPml4.js} +1 -1
  189. package/dist/client/assets/{monitoring-BLnrFAQj.js → monitoring-kGWQYp7Z.js} +1 -1
  190. package/dist/client/assets/{monitoring-stats-row-vWHUOUB3.js → monitoring-stats-row-BpfaRq5_.js} +1 -1
  191. package/dist/client/assets/{multi-select-BNfLnIfI.js → multi-select-D79TIC6v.js} +1 -1
  192. package/dist/client/assets/{mustache-Crsi4VAX.js → mustache-BdHuXtQC.js} +1 -1
  193. package/dist/client/assets/{named-rule-uses-D5gjZwOp.js → named-rule-uses-DDsPTKwP.js} +1 -1
  194. package/dist/client/assets/{named-rule-view-BVCpec2I.js → named-rule-view-CelDjugE.js} +1 -1
  195. package/dist/client/assets/{new-project-dialog-BzJmdXI6.js → new-project-dialog-DQPlctqf.js} +1 -1
  196. package/dist/client/assets/{oauth-callback-CwZ-b3nE.js → oauth-callback-ah6cR8xQ.js} +1 -1
  197. package/dist/client/assets/{oauth-callback-ai-provider-CujNNAU2.js → oauth-callback-ai-provider-C5jhPG9E.js} +1 -1
  198. package/dist/client/assets/{onboarding-Csy3KW6h.js → onboarding-BPgxXbEy.js} +1 -1
  199. package/dist/client/assets/{openai-conversation-DJfgyA82.js → openai-conversation-COLqoqqY.js} +1 -1
  200. package/dist/client/assets/{optimistic-project-sidebar-views-XzUayXF_.js → optimistic-project-sidebar-views-BXm7Dv06.js} +1 -1
  201. package/dist/client/assets/{order-monitor-day-BUk1fjA6.js → order-monitor-day-DzTTlxAw.js} +1 -1
  202. package/dist/client/assets/{organization-choice-BG-EMl8L.js → organization-choice-CMYQUq77.js} +1 -1
  203. package/dist/client/assets/{orgs-BOi51Yxa.js → orgs-Cb-j6SHO.js} +1 -1
  204. package/dist/client/assets/{page-seo-form-D4gneorY.js → page-seo-form-CCa1Xirx.js} +1 -1
  205. package/dist/client/assets/{pair-Dh_1oqHi.js → pair-CRFLUGB-.js} +1 -1
  206. package/dist/client/assets/{parse-sections-B30A8ECY.js → parse-sections-CBOr5TcU.js} +1 -1
  207. package/dist/client/assets/{plan-BXu8SQ3T.js → plan-CZiCKWsL.js} +1 -1
  208. package/dist/client/assets/{plan-ladder-CN5p5ylK.js → plan-ladder-Clu_D1dM.js} +1 -1
  209. package/dist/client/assets/{popover-DauDBkON.js → popover-7hw0_Cgu.js} +1 -1
  210. package/dist/client/assets/post-calendar-oSfCtk_Z.js +1 -0
  211. package/dist/client/assets/{post-editor-BChaRDNt.js → post-editor-DqdLoENq.js} +1 -1
  212. package/dist/client/assets/{preview-content-BvhoJjFR.js → preview-content-tpqwn9DV.js} +1 -1
  213. package/dist/client/assets/{preview-dialog-iRKqzeeN.js → preview-dialog-DDUA3zbn.js} +1 -1
  214. package/dist/client/assets/{preview-panel-DcbhbW1H.js → preview-panel-B7KDfk34.js} +1 -1
  215. package/dist/client/assets/{preview-tab-ClK0lOMy.js → preview-tab-CwHbL-uL.js} +3 -3
  216. package/dist/client/assets/{product-picker-dialog-CsTqbwXT.js → product-picker-dialog-q_j-OMur.js} +1 -1
  217. package/dist/client/assets/{profile-DE1V4tEF.js → profile--UpTdMEW.js} +1 -1
  218. package/dist/client/assets/{project-app-view-BpeI5cMf.js → project-app-view-BDtUwetx.js} +1 -1
  219. package/dist/client/assets/{project-apps-CNRV3DAE.js → project-apps-M24hPHW2.js} +1 -1
  220. package/dist/client/assets/{project-feed-BcaTqzKD.js → project-feed-Dm5w30sM.js} +1 -1
  221. package/dist/client/assets/{project-icon-9kbQzXfH.js → project-icon-BlULUcrw.js} +1 -1
  222. package/dist/client/assets/project-reports-BXESPzCU.js +1 -0
  223. package/dist/client/assets/project-tasks-CRajXa6Z.js +1 -0
  224. package/dist/client/assets/{projects-Kz2HQD_e.js → projects-C9fr3jni.js} +1 -1
  225. package/dist/client/assets/{projects-empty-state-Df7eS0pA.js → projects-empty-state-DRas-7X9.js} +1 -1
  226. package/dist/client/assets/{prompts-B4KLkb4I.js → prompts-CiGgpCOz.js} +1 -1
  227. package/dist/client/assets/record-editor-Dw_A1nYV.js +1 -0
  228. package/dist/client/assets/redirect-editor-DbPiIIKk.js +1 -0
  229. package/dist/client/assets/{releases-api-BDl7LEw1.js → releases-api-DA_Oz9WG.js} +1 -1
  230. package/dist/client/assets/{reports-Cp14zg57.js → reports-Czva0tSD.js} +1 -1
  231. package/dist/client/assets/reports-I3thcjRj.js +1 -0
  232. package/dist/client/assets/{reports-onboarding-D2UqC4mS.js → reports-onboarding-BsOWdPaY.js} +1 -1
  233. package/dist/client/assets/{reports-tab-C51R-6vi.js → reports-tab-C2STfD1k.js} +2 -2
  234. package/dist/client/assets/repositories-B5BeE82u.js +1 -0
  235. package/dist/client/assets/{repositories-CHKGn0VU.js → repositories-Dp2o7kK8.js} +1 -1
  236. package/dist/client/assets/{repository-binding-BZ7FmJ0X.js → repository-binding-C7GXruB1.js} +1 -1
  237. package/dist/client/assets/{repository-import-picker-Bjws7k2-.js → repository-import-picker-BIFRKH2H.js} +1 -1
  238. package/dist/client/assets/{repository-picker-DkvIZLAj.js → repository-picker-D6fEwnOk.js} +1 -1
  239. package/dist/client/assets/{require-capability-Bm5pde_M.js → require-capability-DSeRbn1u.js} +1 -1
  240. package/dist/client/assets/{required-auth-layout-Dn8nNstE.js → required-auth-layout-D4yn4VOg.js} +1 -1
  241. package/dist/client/assets/{reset-password-CHMCFAp9.js → reset-password-CLlk4Qyg.js} +1 -1
  242. package/dist/client/assets/{resizable-BYZDi11K.js → resizable-B3zVq59U.js} +1 -1
  243. package/dist/client/assets/{resolve-tab-icon-DLcHhSBW.js → resolve-tab-icon-NGCKQk4u.js} +1 -1
  244. package/dist/client/assets/{review-settings-DEFTQSp0.js → review-settings-ChOJMpqj.js} +1 -1
  245. package/dist/client/assets/{roles-BIj8m30-.js → roles-034YEIy0.js} +1 -1
  246. package/dist/client/assets/route-B9sbaFmI.js +1 -0
  247. package/dist/client/assets/{route-CwIKlFpH.js → route-D3_kGiYP.js} +1 -1
  248. package/dist/client/assets/{route-DQxiKHs8.js → route-DixoE7S2.js} +1 -1
  249. package/dist/client/assets/{sandbox-lifecycle-context-DMfngoi-.js → sandbox-lifecycle-context-DS1zxfZb.js} +1 -1
  250. package/dist/client/assets/{schema-DEyBWI2y.js → schema-DIZqRcY2.js} +1 -1
  251. package/dist/client/assets/{schema-DoiqvTL7.js → schema-DXQBt-Da.js} +1 -1
  252. package/dist/client/assets/{scroll-area-Cfsm1vBV.js → scroll-area-BYOXOcFm.js} +1 -1
  253. package/dist/client/assets/{search-input-DBKkXR0y.js → search-input-CM9T7koR.js} +1 -1
  254. package/dist/client/assets/{search-toggle-CzYTwp_L.js → search-toggle-BA_oiAdj.js} +1 -1
  255. package/dist/client/assets/{secret-picker-CqxG24X7.js → secret-picker-D2Cr-oRZ.js} +1 -1
  256. package/dist/client/assets/{secrets-CtByih4R.js → secrets-BRbaixQo.js} +1 -1
  257. package/dist/client/assets/section-array-field-TQFJqwVV.js +1 -0
  258. package/dist/client/assets/{sections-CCcpB_PT.js → sections-05hBo9NL.js} +1 -1
  259. package/dist/client/assets/sections-editor-BR_A8Bqr.js +1 -0
  260. package/dist/client/assets/{select-CTAm_W2d.js → select-BZ2tKCpr.js} +1 -1
  261. package/dist/client/assets/{select-model-Cvj2OnbU.js → select-model-DskJe0jJ.js} +1 -1
  262. package/dist/client/assets/seo-editor-DWsRiK1b.js +1 -0
  263. package/dist/client/assets/{separator-BeYssz5V.js → separator-DdBbm1xl.js} +1 -1
  264. package/dist/client/assets/settings-tab-5QV5D7iT.js +1 -0
  265. package/dist/client/assets/{sheet-C52S-h6R.js → sheet-DYw2VD7L.js} +1 -1
  266. package/dist/client/assets/{shell-layout-DYY0I41_.js → shell-layout-DQPoLlFW.js} +1 -1
  267. package/dist/client/assets/{site-draft-actions-DwqQ-cQC.js → site-draft-actions-dD4jyBUz.js} +7 -7
  268. package/dist/client/assets/site-draft-view-Ds5aQAqU.js +2 -0
  269. package/dist/client/assets/site-editor-D8vmphjE.js +1 -0
  270. package/dist/client/assets/{site-editor-toast-CT4NtD1f.js → site-editor-toast-gO0geSY6.js} +1 -1
  271. package/dist/client/assets/{skills-_WDetSCi.js → skills-BG0VOLIN.js} +1 -1
  272. package/dist/client/assets/{slider-rNbrBC-4.js → slider-ApiojjsY.js} +1 -1
  273. package/dist/client/assets/{sortable.esm-Cw5kBwgn.js → sortable.esm-DPfgkRcd.js} +1 -1
  274. package/dist/client/assets/{sso-DSG3YPMw.js → sso-CfSDpa9Z.js} +1 -1
  275. package/dist/client/assets/{suggestion-Dd_Uy5Bv.js → suggestion-DTo0Z5su.js} +1 -1
  276. package/dist/client/assets/{switch-nUFQi60k.js → switch-B3v6apDN.js} +1 -1
  277. package/dist/client/assets/{symbol-C3kEOGZ_.js → symbol-pDh9bf5z.js} +1 -1
  278. package/dist/client/assets/{synced-repos-DBmibobg.js → synced-repos-oiGV5Ihu.js} +1 -1
  279. package/dist/client/assets/{tab-icon-glyph-Bzpngl6a.js → tab-icon-glyph-BzFDI553.js} +1 -1
  280. package/dist/client/assets/{table-CxQHf5NT.js → table-CANIhtsr.js} +1 -1
  281. package/dist/client/assets/{tabs-BwD6LFyC.js → tabs-B5O9VNwn.js} +1 -1
  282. package/dist/client/assets/{task-assignee-avatar-Bg9ijzoY.js → task-assignee-avatar-BOAf_3H_.js} +1 -1
  283. package/dist/client/assets/{task-board-DreQgJBj.js → task-board-CBBaN9ua.js} +1 -1
  284. package/dist/client/assets/{task-route-B6QYswnx.js → task-route-1lojPQeZ.js} +1 -1
  285. package/dist/client/assets/{task-status-DcCdeelW.js → task-status-DM1NBqlc.js} +1 -1
  286. package/dist/client/assets/{taskboard-analytics-C_aUAX7S.js → taskboard-analytics-DK79qp1-.js} +1 -1
  287. package/dist/client/assets/tasks--LaoDxg8.js +1 -0
  288. package/dist/client/assets/{tasks-CYY9XlJ3.js → tasks-Czi5B_ZB.js} +1 -1
  289. package/dist/client/assets/{textarea-y7TWtoua.js → textarea-CAZh8Kr5.js} +1 -1
  290. package/dist/client/assets/{thread-analytics-BD8n1a8E.js → thread-analytics-K9PkKnHr.js} +1 -1
  291. package/dist/client/assets/{thread-intent-cB2EtHpg.js → thread-intent-B9ceQWmI.js} +1 -1
  292. package/dist/client/assets/{thread-route-D01w_vQB.js → thread-route-_-Jo9yAq.js} +1 -1
  293. package/dist/client/assets/{thread-route-Cr5f3jw8.js → thread-route-gmMlW4oz.js} +1 -1
  294. package/dist/client/assets/{thread-sheet-body-C0IyWshl.js → thread-sheet-body-ClyiLZhS.js} +1 -1
  295. package/dist/client/assets/{time-range-picker-bp6BeGMC.js → time-range-picker-m7OMfbU0.js} +1 -1
  296. package/dist/client/assets/{toggle-group-BIu6qfZV.js → toggle-group-8XrNtMoS.js} +1 -1
  297. package/dist/client/assets/{tool-namespace-Crbzrqv8.js → tool-namespace-cn6zTT0m.js} +1 -1
  298. package/dist/client/assets/{toolbar-icon-button-ByMmG3VL.js → toolbar-icon-button-fBm5AosV.js} +1 -1
  299. package/dist/client/assets/{tooltip-DibJz0Jl.js → tooltip-B1eS9Khq.js} +1 -1
  300. package/dist/client/assets/{tooltipContext-BzrsG1UN.js → tooltipContext-DMiC5t9-.js} +1 -1
  301. package/dist/client/assets/{track-C-8tVJFa.js → track-BcscPlt3.js} +1 -1
  302. package/dist/client/assets/{types-BdOsWOEi.js → types-C_LaIhQe.js} +1 -1
  303. package/dist/client/assets/{url-slug-CPCergXm.js → url-slug-BEmF9qH1.js} +1 -1
  304. package/dist/client/assets/{usage-stats-DDafRqWC.js → usage-stats-DtO_zGwF.js} +1 -1
  305. package/dist/client/assets/{use-ai-providers-Bsehd5pg.js → use-ai-providers-C315xBlf.js} +1 -1
  306. package/dist/client/assets/{use-apply-named-rule-CeNTU7vM.js → use-apply-named-rule-9ihG8ELj.js} +1 -1
  307. package/dist/client/assets/{use-automations-BscjsX1o.js → use-automations-BpSvam4M.js} +1 -1
  308. package/dist/client/assets/{use-autosave-D0y0c0lt.js → use-autosave-CRCl3eTr.js} +1 -1
  309. package/dist/client/assets/{use-chat-layout-state-DpOxQYv4.js → use-chat-layout-state-ByIICjWr.js} +1 -1
  310. package/dist/client/assets/{use-clock-tick-jRUiEK1v.js → use-clock-tick-QAJndZ00.js} +1 -1
  311. package/dist/client/assets/{use-connect-companion-BGtpVGmA.js → use-connect-companion-rEYy0Kcd.js} +1 -1
  312. package/dist/client/assets/{use-connection-CAR6Cxbr.js → use-connection-CBlLT-Gl.js} +1 -1
  313. package/dist/client/assets/{use-content-sync-bYlxy6np.js → use-content-sync-TKItZ8SP.js} +1 -1
  314. package/dist/client/assets/{use-copy-Dpm_jhm-.js → use-copy-C9NYM8DB.js} +1 -1
  315. package/dist/client/assets/{use-create-virtual-mcp-DcCX7uo7.js → use-create-virtual-mcp-DFsMYI92.js} +1 -1
  316. package/dist/client/assets/{use-date-fns-locale-hUyExEVb.js → use-date-fns-locale-bL-I5mOj.js} +1 -1
  317. package/dist/client/assets/{use-debounced-autosave-By6os5xD.js → use-debounced-autosave-DfJudaYl.js} +1 -1
  318. package/dist/client/assets/{use-debounced-value-BtR2lyTj.js → use-debounced-value-DOPKXMfX.js} +1 -1
  319. package/dist/client/assets/{use-deco-credits-DRIA1g3T.js → use-deco-credits-DL_DG4I5.js} +1 -1
  320. package/dist/client/assets/{use-decopilot-events-C4OBhauN.js → use-decopilot-events-4yDcDH2I.js} +1 -1
  321. package/dist/client/assets/{use-delete-connection-BM5PcuGQ.js → use-delete-connection-3ef0jZgj.js} +1 -1
  322. package/dist/client/assets/{use-deployment-admin-BmDeutjQ.js → use-deployment-admin-C2GaZpz9.js} +1 -1
  323. package/dist/client/assets/{use-fast-preview-draft-url-BUDoPHon.js → use-fast-preview-draft-url-CN-8cYCq.js} +1 -1
  324. package/dist/client/assets/{use-file-configs-CuVchUT-.js → use-file-configs-Dfr8whNN.js} +1 -1
  325. package/dist/client/assets/{use-inbox-feed-Bi03vVLM.js → use-inbox-feed-UXhkZ9eS.js} +1 -1
  326. package/dist/client/assets/{use-infinite-scroll-0YRynoMy.js → use-infinite-scroll-WEv8wBk9.js} +1 -1
  327. package/dist/client/assets/{use-join-requests-BhMSzUBO.js → use-join-requests-Bf1nx4BW.js} +1 -1
  328. package/dist/client/assets/{use-main-panel-tabs-QcdwwtJ8.js → use-main-panel-tabs-CnvhH3AB.js} +1 -1
  329. package/dist/client/assets/{use-mcp-auth-status-Ddp-NElL.js → use-mcp-auth-status-Dxn8Kcei.js} +1 -1
  330. package/dist/client/assets/{use-mcp-client-ClU7gdfw.js → use-mcp-client-BkBWhGyj.js} +1 -1
  331. package/dist/client/assets/{use-mcp-prompts-CFFfSPcj.js → use-mcp-prompts-DWjSk3XQ.js} +1 -1
  332. package/dist/client/assets/{use-mcp-tools-CsGOzrhW.js → use-mcp-tools-Cq-ES3mk.js} +1 -1
  333. package/dist/client/assets/{use-mobile-nW9hYb6L.js → use-mobile-BADuLdb7.js} +1 -1
  334. package/dist/client/assets/{use-move-blocks-BKlQlSno.js → use-move-blocks-Ds_0OJ4H.js} +1 -1
  335. package/dist/client/assets/{use-navigate-to-agent-CvuO-uuz.js → use-navigate-to-agent-B3bMlZK-.js} +1 -1
  336. package/dist/client/assets/{use-open-billing-url-6zduD8ZA.js → use-open-billing-url-Dfpg8Tio.js} +1 -1
  337. package/dist/client/assets/{use-org-fs-BcT14y41.js → use-org-fs-Dt6mQNyr.js} +1 -1
  338. package/dist/client/assets/{use-org-repo-syncs-BdTpYW4-.js → use-org-repo-syncs-D2j2_BKY.js} +1 -1
  339. package/dist/client/assets/{use-org-sso-DdzTjSOo.js → use-org-sso-CWvWEDQk.js} +1 -1
  340. package/dist/client/assets/{use-organization-roles-DQlsWqEE.js → use-organization-roles-DsjUZx1i.js} +1 -1
  341. package/dist/client/assets/{use-organization-settings-DeXdcCtZ.js → use-organization-settings-DBQ6GIch.js} +1 -1
  342. package/dist/client/assets/{use-panel-navigate-BrjENNrA.js → use-panel-navigate-DZO4-0o6.js} +1 -1
  343. package/dist/client/assets/{use-project-native-view-presence-OgGOYaV4.js → use-project-native-view-presence-Y3Sopx8q.js} +1 -1
  344. package/dist/client/assets/{use-project-scope-DryffHrf.js → use-project-scope-CKNjz3VB.js} +1 -1
  345. package/dist/client/assets/{use-recent-apps-CMgGjBH4.js → use-recent-apps-TrfPEwKE.js} +1 -1
  346. package/dist/client/assets/{use-releases-BQePeR_j.js → use-releases-DSFeRsP3.js} +1 -1
  347. package/dist/client/assets/{use-reports-diagnostic-KZB3C_26.js → use-reports-diagnostic-YBAEN0Wc.js} +1 -1
  348. package/dist/client/assets/{use-sandbox-events-ClbDdVRn.js → use-sandbox-events-C6ionJ0p.js} +1 -1
  349. package/dist/client/assets/{use-secrets-Cjihb12f.js → use-secrets-xwuuJgHg.js} +1 -1
  350. package/dist/client/assets/{use-section-preview-base-go9VMYa4.js → use-section-preview-base-BdMX2uY9.js} +1 -1
  351. package/dist/client/assets/{use-session-runtime-CQOTzbKn.js → use-session-runtime-CtTWKH1c.js} +1 -1
  352. package/dist/client/assets/{use-sidebar-collapsed-CUSnfCt-.js → use-sidebar-collapsed-DXyrU3VA.js} +1 -1
  353. package/dist/client/assets/{use-tags-CMyUN8Qd.js → use-tags-CwZHa3pE.js} +1 -1
  354. package/dist/client/assets/{use-task-board-analytics-BWzR51Kh.js → use-task-board-analytics-BzPvlYE9.js} +1 -1
  355. package/dist/client/assets/{use-task-board-events-DlFBtyOL.js → use-task-board-events-qI_skUMm.js} +1 -1
  356. package/dist/client/assets/{use-task-board-item-prs-D9Aj6NRX.js → use-task-board-item-prs-CiXpN6jW.js} +1 -1
  357. package/dist/client/assets/{use-task-metadata-DcdDwiSS.js → use-task-metadata-E8aNM85o.js} +1 -1
  358. package/dist/client/assets/{use-thread-analytics-cLhxQI8B.js → use-thread-analytics-DKupwFaR.js} +1 -1
  359. package/dist/client/assets/{use-thread-outputs-D8Bvo55q.js → use-thread-outputs-Di1RSISN.js} +1 -1
  360. package/dist/client/assets/useInfiniteQuery-CtWUiDbh.js +1 -0
  361. package/dist/client/assets/{useQueries-B8DPRYfS.js → useQueries-BOzKsoXi.js} +1 -1
  362. package/dist/client/assets/useSuspenseInfiniteQuery-Diw12fEI.js +1 -0
  363. package/dist/client/assets/{users-BIP3dsuH.js → users-Cup6bGNw.js} +1 -1
  364. package/dist/client/assets/{utils-DeFulDMz.js → utils-wTX1Gyo-.js} +1 -1
  365. package/dist/client/assets/{variant-calendar-C37bfPDk.js → variant-calendar-Doi5lHFb.js} +1 -1
  366. package/dist/client/assets/{variant-matcher-override-B4pYtxaz.js → variant-matcher-override-LGFgaSJn.js} +1 -1
  367. package/dist/client/assets/{virtual-mcp-D_aBBfQL.js → virtual-mcp-DO56RLOP.js} +1 -1
  368. package/dist/client/assets/{watch-sse-pool-Bk0Yni6j.js → watch-sse-pool-BBTCM7MS.js} +1 -1
  369. package/dist/client/index.html +1 -1
  370. package/dist/server/server.js +741 -741
  371. package/package.json +2 -2
  372. package/dist/client/assets/agent-analytics-Bd5QSkcr.js +0 -1
  373. package/dist/client/assets/agent-app-DSGhLy_N.js +0 -1
  374. package/dist/client/assets/agent-calendar-WpcQ_E3l.js +0 -1
  375. package/dist/client/assets/agent-deck-Y0SX6UB9.js +0 -1
  376. package/dist/client/assets/agent-experiments-XS7LGaQh.js +0 -1
  377. package/dist/client/assets/agent-library-CYxkIVFl.js +0 -1
  378. package/dist/client/assets/agent-library-file-DPhxbUtG.js +0 -1
  379. package/dist/client/assets/agent-monitor-C01cwPL-.js +0 -1
  380. package/dist/client/assets/agent-settings-B7CchDfJ.js +0 -1
  381. package/dist/client/assets/agent-site-editor-code-uiPbclqT.js +0 -2
  382. package/dist/client/assets/agent-site-editor-content-B9B2SztQ.js +0 -1
  383. package/dist/client/assets/agent-site-editor-preview-CQGXtn5w.js +0 -1
  384. package/dist/client/assets/agent-view-BNK8YJ86.js +0 -1
  385. package/dist/client/assets/api-keys-MofJBQfW.js +0 -1
  386. package/dist/client/assets/app-editor-BcJaA3eR.js +0 -1
  387. package/dist/client/assets/category-editor-lTx7E71S.js +0 -1
  388. package/dist/client/assets/cms-settings-editor-CjDcV3Uq.js +0 -1
  389. package/dist/client/assets/context-BakNzIE5.js +0 -1
  390. package/dist/client/assets/library-D2Mrm5WM.js +0 -1
  391. package/dist/client/assets/post-calendar-Ceopsk1u.js +0 -1
  392. package/dist/client/assets/project-reports-DZCmLCmE.js +0 -1
  393. package/dist/client/assets/project-tasks-D6qNETK3.js +0 -1
  394. package/dist/client/assets/record-editor-C5XOx_LV.js +0 -1
  395. package/dist/client/assets/redirect-editor-BxKT3ntE.js +0 -1
  396. package/dist/client/assets/reports-DBFNTtm-.js +0 -1
  397. package/dist/client/assets/repositories-C77B6dOt.js +0 -1
  398. package/dist/client/assets/route-L2EzRsks.js +0 -1
  399. package/dist/client/assets/secret-ciphertext-cTA7BSVY.js +0 -1
  400. package/dist/client/assets/sections-editor-DpO_mTF7.js +0 -1
  401. package/dist/client/assets/seo-editor-BPToAJRY.js +0 -1
  402. package/dist/client/assets/settings-tab-BRtykuoH.js +0 -1
  403. package/dist/client/assets/site-draft-view-CiKU2Icp.js +0 -2
  404. package/dist/client/assets/site-editor-CuXmo07G.js +0 -1
  405. package/dist/client/assets/tasks-CeouZ3tS.js +0 -1
  406. package/dist/client/assets/useInfiniteQuery-DWVaUM2t.js +0 -1
  407. package/dist/client/assets/useSuspenseInfiniteQuery-6Ovi3jRe.js +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-site-editor-BALtgla6.js","assets/index-C4tYnNih.js","assets/index-BQfNeaI1.css","assets/chat-context-CIOqAIIy.js","assets/use-panel-navigate-DZO4-0o6.js","assets/thread-route-_-Jo9yAq.js","assets/use-project-scope-CKNjz3VB.js","assets/repository-binding-C7GXruB1.js","assets/use-mcp-client-BkBWhGyj.js","assets/auth-Dqt9menC.js","assets/autosend-BRUzWk70.js","assets/thread-intent-B9ceQWmI.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-BBTCM7MS.js","assets/task-board-CBBaN9ua.js","assets/schema-DXQBt-Da.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-4yDcDH2I.js","assets/use-ai-providers-C315xBlf.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-DBQ6GIch.js","assets/site-draft-actions-dD4jyBUz.js","assets/separator-DdBbm1xl.js","assets/site-editor-toast-gO0geSY6.js","assets/use-session-runtime-CtTWKH1c.js","assets/experiments-tab-choice-pVOiMOWe.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-wTX1Gyo-.js","assets/ZoomOut-CnbxUNSo.js","assets/Image01-ClayPF_a.js","assets/use-sandbox-events-C6ionJ0p.js","assets/sandbox-git-api-CH_-QFpD.js","assets/shell-layout-DQPoLlFW.js","assets/Building02-A_MT9tNO.js","assets/UserSquare-DwNuAluZ.js","assets/agent-icon-KvVT3fA8.js","assets/AlertCircle-Bq5T03B8.js","assets/Tool01-BvlRH5Ln.js","assets/ArrowUp-CzX0fTk7.js","assets/ArrowLeft-Bwi_Jr7f.js","assets/LinkBroken01-XqJUgSE7.js","assets/ShoppingBag01-C82UeRR9.js","assets/CheckCircle-BE1i_X4b.js","assets/ChevronUp-RlBkcpdd.js","assets/ChevronSelectorVertical-DNrt0MHW.js","assets/Copy01-B9x501ud.js","assets/CreditCard01-Bu_qRR36.js","assets/DotsVertical-D9231JAc.js","assets/Globe04-DQlP6Nhr.js","assets/SwitchHorizontal01-B1MoYKPo.js","assets/Key01-CxKYO-oQ.js","assets/Link01-B7BHRxIW.js","assets/Minus-Bh6ogRng.js","assets/Monitor01-BpzvJnXA.js","assets/Sun-IvvKZ51n.js","assets/Play-w4omVTRa.js","assets/Plus-CcJNnBya.js","assets/SearchMd-5lGv5a5H.js","assets/Trash01-C9E8l_mI.js","assets/Upload01-mlw10ZK-.js","assets/Users01-DcHPIKgH.js","assets/XClose-BBReaSBA.js","assets/use-clock-tick-QAJndZ00.js","assets/command-MmMDew8i.js","assets/index-DG_Aoo8H.js","assets/integration-icon-wG7mou98.js","assets/project-icon-BlULUcrw.js","assets/new-project-dialog-DQPlctqf.js","assets/label-Kngegn1Y.js","assets/repository-import-picker-BIFRKH2H.js","assets/use-navigate-to-agent-B3bMlZK-.js","assets/repository-picker-D6fEwnOk.js","assets/tooltip-B1eS9Khq.js","assets/index-B0Hb2bUK.js","assets/useInfiniteQuery-CtWUiDbh.js","assets/infiniteQueryObserver-CyNcT3qz.js","assets/collection-search-Cf4li4kg.js","assets/use-debounced-value-DOPKXMfX.js","assets/required-auth-layout-D4yn4VOg.js","assets/use-org-sso-CWvWEDQk.js","assets/shell-layout-CE2Eihra.css","assets/toolbar-icon-button-fBm5AosV.js","assets/popover-7hw0_Cgu.js","assets/tabs-B5O9VNwn.js","assets/active-indicator-CCMhAsc_.js","assets/use-releases-DSFeRsP3.js","assets/serial-task-queue-CGOeQgpr.js","assets/virtual-mcp-DO56RLOP.js","assets/url-slug-BEmF9qH1.js","assets/use-fast-preview-draft-url-CN-8cYCq.js","assets/section-preview-url-7zfngvgW.js","assets/preview-link-C762yHOt.js","assets/variant-draft-pointer-BeAKcq_c.js","assets/parse-sections-CBOr5TcU.js","assets/index-Bz0XRw1e.js","assets/tool-namespace-cn6zTT0m.js","assets/drawer-GssD8cb3.js","assets/use-mobile-BADuLdb7.js","assets/use-mcp-prompts-DWjSk3XQ.js","assets/usage-stats-DtO_zGwF.js","assets/form-CKF06Eu0.js","assets/utils-CVEq3hMx.js","assets/markdown-C-J5-sTt.js","assets/use-copy-C9NYM8DB.js","assets/input-C0IBlV9i.js","assets/icon-button-5JlhYc9R.js","assets/file-type-icon-tAeiI9_2.js","assets/chat-draft-OR83_S8w.js","assets/select-BZ2tKCpr.js","assets/index-BdQq_4o_.js","assets/use-deco-credits-DL_DG4I5.js","assets/toggle-group-8XrNtMoS.js","assets/use-open-billing-url-Dfpg8Tio.js","assets/index-CJ8-jtJ3.js","assets/checkbox-BQ7Ebuar.js","assets/ai-providers-logos-DD3qZ33J.js","assets/input-Drj3v1Rm.js","assets/suggestion-DTo0Z5su.js","assets/use-org-fs-Dt6mQNyr.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-DpVlsq5a.js","assets/plan-ladder-Clu_D1dM.js","assets/add-connection-dialog-CEj8kbGq.js","assets/extract-connection-data-DwkOg2rJ.js","assets/metadata-D72DunRR.js","assets/connection-QGwhnKZn.js","assets/connection-card-DEMVrMsW.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CAZh8Kr5.js","assets/use-connection-CBlLT-Gl.js","assets/schema-DIZqRcY2.js","assets/connection-form-helpers-DCRY9s0M.js","assets/authenticate-and-persist-oauth-BziZaG_M.js","assets/mcp-oauth-CnB7EPe0.js","assets/mcp-oauth-5QMuPFQa.js","assets/collection-tabs-x8ccQUAC.js","assets/badge-Ckz5LqgP.js","assets/use-infinite-scroll-WEv8wBk9.js","assets/useSuspenseInfiniteQuery-Diw12fEI.js","assets/use-task-board-events-qI_skUMm.js","assets/use-chat-layout-state-ByIICjWr.js","assets/input-Bwd_JSM8.css","assets/pair-CRFLUGB-.js","assets/collapsible-BB8_usPT.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-vHEVQIZL.js","assets/types-C_LaIhQe.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-DYw2VD7L.js","assets/use-thread-outputs-Di1RSISN.js","assets/releases-api-DA_Oz9WG.js","assets/use-content-sync-TKItZ8SP.js","assets/named-rule-uses-DDsPTKwP.js","assets/device-hint-SeLRi17j.js","assets/editor-BTovmEAS.js","assets/section-array-field-TQFJqwVV.js","assets/alert-DEw5BVAh.js","assets/save-changes-debug-nBi-n9eV.js","assets/sandbox-lifecycle-context-DS1zxfZb.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/index-CDfG-oXn.js","assets/use-sidebar-collapsed-DXyrU3VA.js","assets/resizable-B3zVq59U.js","assets/agent-site-editor-DDGTF8rc.css","assets/agent-site-editor-content-DAMOp9X5.js","assets/agent-view-guard-bPXLqLsK.js","assets/use-main-panel-tabs-CnvhH3AB.js","assets/use-mcp-tools-Cq-ES3mk.js","assets/resolve-tab-icon-NGCKQk4u.js","assets/use-task-metadata-E8aNM85o.js","assets/preview-source-BsRLGWUP.js","assets/use-project-native-view-presence-Y3Sopx8q.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-Dfr8whNN.js","assets/site-slug-DebpOoQq.js","assets/feature-gate-BIwsQPiQ.js","assets/content-tab-YME7HMCb.js","assets/blocks-tab-states-BcxrQPOR.js","assets/slider-ApiojjsY.js","assets/index-B8bCJ3Gm.js","assets/tooltipContext-DMiC5t9-.js","assets/CategoricalChart-BDZ_2Tmn.js","assets/index-DMcUJv3F.js","assets/ActiveShapeUtils-Bp4fmUBo.js","assets/Sector-gkUUnvA4.js","assets/symbol-pDh9bf5z.js","assets/empty-state-D86P1Giw.js","assets/held-block-view-CU5t1B8c.js","assets/switch-B3v6apDN.js","assets/scroll-area-BYOXOcFm.js","assets/monaco-editor-CG1RPml4.js","assets/calendar-DkZz5VlH.js","assets/editor-classes-CcPgajKG.js","assets/core.esm-B2cbbV3O.js","assets/sortable.esm-DPfgkRcd.js","assets/combobox-BZoZToki.js","assets/search-input-CM9T7koR.js","assets/asset-utils-DRJP317P.js","assets/mustache-BdHuXtQC.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-Ds_0OJ4H.js","assets/empty-state-DLNzdrwg.js"])))=>i.map(i=>d[i]);
2
+ import{k as O,l as V,m as H}from"./named-rule-view-CelDjugE.js";import{h as N}from"./named-rule-uses-DDsPTKwP.js";import{ag as A,au as L}from"./parse-sections-CBOr5TcU.js";import{be as y,c as _,b as T,a4 as M,bj as U,j as c,n as F}from"./index-C4tYnNih.js";import{E as B}from"./empty-state-DLNzdrwg.js";import{u as K}from"./chat-context-CIOqAIIy.js";import{u as $,l as q}from"./site-editor-toast-gO0geSY6.js";import{i as Q,u as G,S as z}from"./blocks-tab-states-BcxrQPOR.js";import{a as J}from"./use-panel-navigate-DZO4-0o6.js";const P={running:0,everyone:1,off:2};function ce(s,e){const i=A(s,"experiments");if(i.kind==="conflict")return[];const o=e?.published??null;return Object.entries(i.values).map(([n,l],a)=>{const m=O(o,"experiments",n,l),b=m==="changed"?V(o,"experiments",n):void 0;return{order:a,row:{name:n,share:l,status:L(l),uses:e?N(e,"experiments",n):0,entryState:m,...b!==void 0?{publishedShare:b}:{}}}}).sort((n,l)=>P[n.row.status]-P[l.row.status]||n.order-l.order).map(n=>n.row)}function de(s,e){return H(s,e?.published??null,"experiments")}function ue(s){const e={contentPageVariant:s.focus?.pageVariant,contentSection:s.focus?.section,contentVariant:s.focus?.variant};return s.blockKind==="page"?{contentPageId:s.blockKey,contentCollection:void 0,contentItem:void 0,...e}:{contentPageId:void 0,contentCollection:"sections",contentItem:s.blockKey,...e}}let I=null;function W(){return I??=Promise.all([y(()=>import("./agent-site-editor-BALtgla6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164])),y(()=>import("./agent-site-editor-content-DAMOp9X5.js"),__vite__mapDeps([165,1,2,166,167,141,5,4,6,7,8,9,11,12,13,14,15,16,17,36,37,38,39,40,41,42,29,34,43,44,45,35,46,47,48,30,49,50,51,52,53,54,55,56,57,58,59,60,61,62,130,168,147,102,26,95,3,10,18,19,20,21,96,73,74,97,77,98,99,100,101,69,103,104,105,106,107,108,25,109,110,84,85,111,112,113,114,115,116,83,117,118,119,75,76,120,121,122,123,124,125,126,89,127,128,66,129,131,132,133,134,135,136,137,138,139,140,142,143,144,63,145,146,148,33,64,65,67,68,70,71,72,78,79,80,81,149,150,31,27,169,170,171,172,173,174,175,88,176,177,178,179,180,181,182,183,184,185,186,94,24,28,32,187,188,160,156,157,189,190,191,155,192,193,194,195,196,197,198,199,152,159,200,201,202]))]).catch(s=>{throw I=null,s}),I}function X(s){return e=>{if(!e)return;const i=()=>{s().catch(()=>{})};if(typeof requestIdleCallback=="function"){const t=requestIdleCallback(i,{timeout:2e3});return()=>cancelIdleCallback(t)}const o=setTimeout(i,200);return()=>clearTimeout(o)}}const Y=X(W);function R(s){const e=_.c(7),{icon:i,title:o,description:t,action:n}=s;let l;e[0]!==n?(l=n?{children:n.label,onClick:n.onClick}:void 0,e[0]=n,e[1]=l):l=e[1];let a;return e[2]!==t||e[3]!==i||e[4]!==l||e[5]!==o?(a=c.jsx(F,{children:c.jsx(F.Content,{children:c.jsx(F.Container,{children:c.jsx(B,{icon:i,title:o,description:t,buttonProps:l})})})}),e[2]=t,e[3]=i,e[4]=l,e[5]=o,e[6]=a):a=e[6],a}function fe(s){const e=_.c(28),{virtualMcpId:i,icon:o,copy:t,skeleton:n,children:l}=s,a=T(),{org:m}=M(),b=K(),p=b?.currentBranch??null,h=$(i,p);U(h.kind==="protocol"&&h.source==="github");const{openPanel:S}=J();if(!p){const r=t.noDraftTitle,k=t.noDraftDesc;let d;e[0]!==a?(d=a("sectionsEditor.namedRules.openEditor"),e[0]=a,e[1]=d):d=e[1];let u;e[2]!==S?(u=()=>S("content"),e[2]=S,e[3]=u):u=e[3];let f;e[4]!==d||e[5]!==u?(f={label:d,onClick:u},e[4]=d,e[5]=u,e[6]=f):f=e[6];let v;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==o||e[10]!==f?(v=c.jsx(R,{icon:o,title:r,description:k,action:f}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=o,e[10]=f,e[11]=v):v=e[11],v}if(Q(h)){let r;return e[12]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(z,{}),e[12]=r):r=e[12],r}if(h.kind==="pending"){let r;return e[13]!==n?(r=c.jsx(c.Fragment,{children:n}),e[13]=n,e[14]=r):r=e[14],r}if(h.kind!=="protocol"){let r;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==o?(r=c.jsx(R,{icon:o,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=o,e[18]=r):r=e[18],r}const g=b?.taskId??null;let x;return e[19]!==p||e[20]!==l||e[21]!==t||e[22]!==o||e[23]!==m.slug||e[24]!==n||e[25]!==g||e[26]!==i?(x=c.jsx(Z,{orgSlug:m.slug,virtualMcpId:i,branch:p,threadId:g,icon:o,copy:t,skeleton:n,children:l},p),e[19]=p,e[20]=l,e[21]=t,e[22]=o,e[23]=m.slug,e[24]=n,e[25]=g,e[26]=i,e[27]=x):x=e[27],x}function Z(s){const e=_.c(30),{orgSlug:i,virtualMcpId:o,branch:t,threadId:n,icon:l,copy:a,skeleton:m,children:b}=s,p=T();let h;e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==o?(h={orgSlug:i,virtualMcpId:o,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=i,e[2]=n,e[3]=o,e[4]=h):h=e[4];const S=h,g=q(S),x=G(S),r=g.data,k=x.data;if(!r||!k){if(g.isError||x.isError){const v=a.loadFailed,w=a.loadFailedHint;let C;e[5]!==p?(C=p("sectionsEditor.namedRules.tryAgain"),e[5]=p,e[6]=C):C=e[6];let E;e[7]!==g||e[8]!==x?(E=()=>{g.refetch(),x.refetch()},e[7]=g,e[8]=x,e[9]=E):E=e[9];let j;e[10]!==C||e[11]!==E?(j={label:C,onClick:E},e[10]=C,e[11]=E,e[12]=j):j=e[12];let D;return e[13]!==a.loadFailed||e[14]!==a.loadFailedHint||e[15]!==l||e[16]!==j?(D=c.jsx(R,{icon:l,title:v,description:w,action:j}),e[13]=a.loadFailed,e[14]=a.loadFailedHint,e[15]=l,e[16]=j,e[17]=D):D=e[17],D}let f;return e[18]!==m?(f=c.jsx(c.Fragment,{children:m}),e[18]=m,e[19]=f):f=e[19],f}let d;e[20]!==t||e[21]!==b||e[22]!==r||e[23]!==k||e[24]!==i||e[25]!==n||e[26]!==o?(d=b({orgSlug:i,virtualMcpId:o,branch:t,threadId:n,decofile:r,meta:k}),e[20]=t,e[21]=b,e[22]=r,e[23]=k,e[24]=i,e[25]=n,e[26]=o,e[27]=d):d=e[27];let u;return e[28]!==d?(u=c.jsx("div",{className:"contents",ref:Y,children:d}),e[28]=d,e[29]=u):u=e[29],u}export{fe as S,R as a,ue as c,ce as e,de as r};
@@ -0,0 +1 @@
1
+ import{c as u,r as g,j as n,H as F,$ as G,a0 as H,a as E,k as P,b as O,n as y,L as M}from"./index-C4tYnNih.js";import{C as V}from"./chat-context-CIOqAIIy.js";import{C as x}from"./index-CDfG-oXn.js";import{L}from"./index-BerfNxBu.js";import{B as K}from"./blocks-preview-workspace-context-C-uj3YG0.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as q}from"./site-editor-toast-gO0geSY6.js";import{u as Q,L as B,P as X,S as Y}from"./preview-tab-CwHbL-uL.js";import{C as Z}from"./content-tab-YME7HMCb.js";import{T as tt}from"./tab-icon-glyph-BzFDI553.js";import{r as et}from"./resolve-tab-icon-NGCKQk4u.js";import ot from"./agent-site-editor-BALtgla6.js";import"./use-panel-navigate-DZO4-0o6.js";import"./thread-route-_-Jo9yAq.js";import"./use-project-scope-CKNjz3VB.js";import"./repository-binding-C7GXruB1.js";import"./use-mcp-client-BkBWhGyj.js";import"./auth-Dqt9menC.js";import"./autosend-BRUzWk70.js";import"./thread-intent-B9ceQWmI.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BBTCM7MS.js";import"./task-board-CBBaN9ua.js";import"./schema-DXQBt-Da.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-4yDcDH2I.js";import"./use-ai-providers-C315xBlf.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-DBQ6GIch.js";import"./use-mobile-BADuLdb7.js";import"./use-sidebar-collapsed-DXyrU3VA.js";import"./use-chat-layout-state-ByIICjWr.js";import"./agent-icon-KvVT3fA8.js";import"./AlertCircle-Bq5T03B8.js";import"./Tool01-BvlRH5Ln.js";import"./ArrowUp-CzX0fTk7.js";import"./ArrowLeft-Bwi_Jr7f.js";import"./LinkBroken01-XqJUgSE7.js";import"./ShoppingBag01-C82UeRR9.js";import"./ZoomOut-CnbxUNSo.js";import"./Building02-A_MT9tNO.js";import"./CheckCircle-BE1i_X4b.js";import"./ChevronUp-RlBkcpdd.js";import"./ChevronSelectorVertical-DNrt0MHW.js";import"./UserSquare-DwNuAluZ.js";import"./Copy01-B9x501ud.js";import"./CreditCard01-Bu_qRR36.js";import"./DotsVertical-D9231JAc.js";import"./Image01-ClayPF_a.js";import"./Globe04-DQlP6Nhr.js";import"./SwitchHorizontal01-B1MoYKPo.js";import"./Key01-CxKYO-oQ.js";import"./Link01-B7BHRxIW.js";import"./Minus-Bh6ogRng.js";import"./Monitor01-BpzvJnXA.js";import"./Sun-IvvKZ51n.js";import"./Play-w4omVTRa.js";import"./Plus-CcJNnBya.js";import"./SearchMd-5lGv5a5H.js";import"./Trash01-C9E8l_mI.js";import"./Upload01-mlw10ZK-.js";import"./Users01-DcHPIKgH.js";import"./XClose-BBReaSBA.js";import"./tooltip-B1eS9Khq.js";import"./index-B0Hb2bUK.js";import"./toolbar-icon-button-fBm5AosV.js";import"./shell-layout-DQPoLlFW.js";import"./use-clock-tick-QAJndZ00.js";import"./command-MmMDew8i.js";import"./index-DG_Aoo8H.js";import"./integration-icon-wG7mou98.js";import"./project-icon-BlULUcrw.js";import"./new-project-dialog-DQPlctqf.js";import"./label-Kngegn1Y.js";import"./repository-import-picker-BIFRKH2H.js";import"./use-navigate-to-agent-B3bMlZK-.js";import"./repository-picker-D6fEwnOk.js";import"./useInfiniteQuery-CtWUiDbh.js";import"./infiniteQueryObserver-CyNcT3qz.js";import"./collection-search-Cf4li4kg.js";import"./use-debounced-value-DOPKXMfX.js";import"./required-auth-layout-D4yn4VOg.js";import"./use-org-sso-CWvWEDQk.js";import"./sheet-DYw2VD7L.js";import"./resizable-B3zVq59U.js";import"./core.esm-B2cbbV3O.js";import"./sortable.esm-DPfgkRcd.js";import"./context-menu-Cpvztbef.js";import"./create-organization-dialog-NLldLLor.js";import"./form-CKF06Eu0.js";import"./project-apps-M24hPHW2.js";import"./use-recent-apps-TrfPEwKE.js";import"./use-session-runtime-CtTWKH1c.js";import"./experiments-tab-choice-pVOiMOWe.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-wTX1Gyo-.js";import"./use-sandbox-events-C6ionJ0p.js";import"./sandbox-git-api-CH_-QFpD.js";import"./held-block-view-CU5t1B8c.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CRFLUGB-.js";import"./collapsible-BB8_usPT.js";import"./use-copy-C9NYM8DB.js";import"./usage-stats-DtO_zGwF.js";import"./tool-namespace-cn6zTT0m.js";import"./utils-CVEq3hMx.js";import"./markdown-C-J5-sTt.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-vHEVQIZL.js";import"./types-C_LaIhQe.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-connection-CBlLT-Gl.js";import"./use-mcp-prompts-DWjSk3XQ.js";import"./use-thread-outputs-Di1RSISN.js";import"./file-type-icon-tAeiI9_2.js";import"./section-array-field-TQFJqwVV.js";import"./alert-DEw5BVAh.js";import"./parse-sections-CBOr5TcU.js";import"./blocks-tab-states-BcxrQPOR.js";import"./slider-ApiojjsY.js";import"./index-B8bCJ3Gm.js";import"./index-BdQq_4o_.js";import"./tooltipContext-DMiC5t9-.js";import"./CategoricalChart-BDZ_2Tmn.js";import"./index-DMcUJv3F.js";import"./ActiveShapeUtils-Bp4fmUBo.js";import"./Sector-gkUUnvA4.js";import"./symbol-pDh9bf5z.js";import"./empty-state-D86P1Giw.js";import"./switch-B3v6apDN.js";import"./textarea-CAZh8Kr5.js";import"./popover-7hw0_Cgu.js";import"./scroll-area-BYOXOcFm.js";import"./monaco-editor-CG1RPml4.js";import"./editor-BTovmEAS.js";import"./calendar-DkZz5VlH.js";import"./select-BZ2tKCpr.js";import"./editor-classes-CcPgajKG.js";import"./toggle-group-8XrNtMoS.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BZoZToki.js";import"./search-input-CM9T7koR.js";import"./tabs-B5O9VNwn.js";import"./use-file-configs-Dfr8whNN.js";import"./asset-utils-DRJP317P.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-DS1zxfZb.js";import"./variant-matcher-override-LGFgaSJn.js";import"./variant-draft-pointer-BeAKcq_c.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-CN-8cYCq.js";import"./preview-link-C762yHOt.js";import"./useQueries-BOzKsoXi.js";import"./device-hint-SeLRi17j.js";import"./virtual-mcp-DO56RLOP.js";import"./url-slug-BEmF9qH1.js";import"./app-preview-url-9Od4s8Sz.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-E8aNM85o.js";import"./mustache-BdHuXtQC.js";import"./use-content-sync-TKItZ8SP.js";import"./checkbox-BQ7Ebuar.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-Ds_0OJ4H.js";import"./badge-Ckz5LqgP.js";import"./empty-state-DLNzdrwg.js";import"./site-draft-actions-dD4jyBUz.js";import"./separator-DdBbm1xl.js";import"./use-releases-DSFeRsP3.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-Bz0XRw1e.js";import"./drawer-GssD8cb3.js";import"./input-C0IBlV9i.js";import"./icon-button-5JlhYc9R.js";import"./chat-draft-OR83_S8w.js";import"./use-deco-credits-DL_DG4I5.js";import"./use-open-billing-url-Dfpg8Tio.js";import"./index-CJ8-jtJ3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./input-Drj3v1Rm.js";import"./suggestion-DTo0Z5su.js";import"./use-org-fs-Dt6mQNyr.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DpVlsq5a.js";import"./plan-ladder-Clu_D1dM.js";import"./add-connection-dialog-CEj8kbGq.js";import"./extract-connection-data-DwkOg2rJ.js";import"./metadata-D72DunRR.js";import"./connection-QGwhnKZn.js";import"./connection-card-DEMVrMsW.js";import"./connection-slug-CITJ0kGN.js";import"./schema-DIZqRcY2.js";import"./connection-form-helpers-DCRY9s0M.js";import"./authenticate-and-persist-oauth-BziZaG_M.js";import"./mcp-oauth-CnB7EPe0.js";import"./mcp-oauth-5QMuPFQa.js";import"./collection-tabs-x8ccQUAC.js";import"./use-infinite-scroll-WEv8wBk9.js";import"./useSuspenseInfiniteQuery-Diw12fEI.js";import"./use-task-board-events-qI_skUMm.js";import"./releases-api-DA_Oz9WG.js";import"./named-rule-uses-DDsPTKwP.js";import"./save-changes-debug-nBi-n9eV.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const it=e=>e;function rt(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?it: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(nt,{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 nt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),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 j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=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]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?W(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&J(o),{candidates:U(o,z()),invalidLink:t&&!o}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const e=u.c(6),t=O();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:dt},e[0]=o):o=e[0];const c=P(o);let m;e[1]!==t||e[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{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(tt,{icon:et({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 dt(e){return e.matches.at(-1)?.staticData.siteEditorView}function N(e){const t=u.c(14),{children:o}=e,c=O(),{connection:m}=q(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(Y,{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 ut(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 A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ht},e[0]=o):o=e[0];const c=P(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(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(ot,{}),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,{...A,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 ht(e){return e.matches.at(-1)?.staticData.siteEditorView}function vt(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,{...A,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=()=>{},xt={connection:null,set:b,clear:b};function pr(){const e=u.c(3),[t]=g.useState(at);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function kt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(e){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:e})})}function ar(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(X,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function cr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Z,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{cr as SiteEditorContent,ar as SiteEditorPreview,pr as default};
@@ -1 +1 @@
1
- import{c as P,q as z,m as M,K as h,eP as ct,aK as zt,aL as Xt,r as j,a as Zt,az as pe,a4 as qt,eQ as lt,eR as Ce,bh as be,eS as ue,eT as _e,eU as Ne,ax as Kt,bq as ut,eV as F,eW as ee,eX as we,eY as He,eZ as en,t as q,j as G}from"./index-BNmzMNlZ.js";import{u as dt}from"./use-session-runtime-CQOTzbKn.js";import{s as Ge}from"./thread-intent-cB2EtHpg.js";import{u as Re,b as tn}from"./experiments-tab-choice-DZqY092h.js";import{b as de}from"./sandbox-url-D3mC8qhT.js";import{s as nn}from"./utils-DeFulDMz.js";import{a as on}from"./repository-binding-BZ7FmJ0X.js";import{u as rn}from"./chat-context-C56OVvQP.js";import{i as sn,u as an}from"./use-sandbox-events-ClbDdVRn.js";import{a as cn}from"./sandbox-git-api-CH_-QFpD.js";import{e as ln}from"./backoff-CrEUbyZT.js";const S={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class D 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 D(t.code,t.message,t.data)}}const Z="deco-content",Se={major:1},ft=1;async function un(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 ye={major:Se.major,minor:ft},ht=`the endpoint speaks an older ${Z} than this client needs (${ye.major}.${ye.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ne(e,t,n){const o={reason:t,required:{...ye}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new D(S.Unsupported,e,o)}function gt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==Z)throw ne(`the endpoint speaks ${JSON.stringify(n)}, not ${Z}`,"protocol",t);if(o?.major!==Se.major)throw ne(`the endpoint speaks ${Z} ${String(o?.major)}.x; this client speaks ${Se.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ft)throw ne(ht,"outdated",t);return e}function Je(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?ne(ht,"outdated"):D.from(t)}function xe(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){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(s)}));let l;try{l=await un(a)}catch{throw new D(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?D.from(c):new D(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw Je(s,l.error);return l.result};return{call:r,describe:async()=>gt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,u)=>({jsonrpc:"2.0",id:i[u],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,u)=>{const d=l.get(c);return d?d.error?{ok:!1,error:Je(s[u].method,d.error)}:{ok:!0,result:d.result}:{ok:!1,error:new D(S.InternalError,"no response for this call")}})}}}function vt(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const We=20,Ye=5,ze=500;function Pe(e){return e instanceof D?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function Ee(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function dn(e,t,n){const o=h.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(vt(r)),i=Ee(r,s);if(i)return i;const a=await t.changesList({});return Ee(void 0,a)}async function fn(e,t){const n=[];for(let s=0;s<t.length;s+=We)n.push(t.slice(s,s+We));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Ye){const i=await e.batch(n.slice(s,s+Ye).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Jo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=ze){const r=t.slice(o,o+ze),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Wo(e){return e instanceof D&&e.code===S.Conflict}function mt(e){return e?.kind==="protocol"?e:null}function Yo(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=z();let a;o[2]!==e?(a=mt(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=h.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let d;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(d=c?()=>dn(i,l.client,t):ct,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=d):d=o[10];let g;return o[11]!==u||o[12]!==d?(g={queryKey:u,queryFn:d,staleTime:0},o[11]=u,o[12]=d,o[13]=g):g=o[13],M(g)}function zo(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=mt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=h.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let u;o[7]!==l||o[8]!==a||o[9]!==s?(u=l?()=>fn(s.client,a):ct,o[7]=l,o[8]=a,o[9]=s,o[10]=u):u=o[10];let d;return o[11]!==c||o[12]!==u?(d={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=u,o[13]=d):d=o[13],M(d)}function pt(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 ie(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 bt=zt({endpoint:Xt().max(2048).refine(e=>pt(e)&&new URL(e).pathname==="/rpc").transform(ie)});function Xo(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=bt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function wt(e){const t=bt.safeParse(e);return t.success?t.data:null}const St="studio:deco-serve-last";function Zo(e){try{localStorage.setItem(St,JSON.stringify(e))}catch{}}function qo(){try{const e=localStorage.getItem(St);return e?wt(JSON.parse(e)):null}catch{return null}}function Ko(e){try{return new URL(ie(e)).host}catch{return e}}function hn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const gn="http://localhost:4545/rpc",er="npx @decocms/blocks serve",tr="npx @decocms/blocks schema";class $e extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function vn(e){if(e instanceof $e)return{reason:"not-deco-serve"};if(!(e instanceof D))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Pe(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.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 nr(e,t){if(e)return[ie(e.endpoint)];const n=[t?.endpoint,gn].filter(o=>!!o).map(ie);return[...new Set(n)]}const yt=j.createContext(null);function mn(e){const t=P.c(27),n=j.useContext(yt),o=Re(n?null:e),{data:r}=Zt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?pe.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=Ze(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?pe.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[d,g]=Ze(u);if(n)return n;let f;t[8]!==l||t[9]!==i?(f=i?wt(l):null,t[8]=l,t[9]=i,t[10]=f):f=t[10];const v=f,b=!!v;let w;t[11]!==o||t[12]!==b?(w=pn(o,b),t[11]=o,t[12]=b,t[13]=w):w=t[13];const{applies:I,undecided:T}=w,x=I?v:null,_=i&&o==="v8"&&typeof d=="string"?d:null;let C;t[14]!==g||t[15]!==c||t[16]!==i?(C=N=>{i&&(c(N),g(N.endpoint))},t[14]=g,t[15]=c,t[16]=i,t[17]=C):C=t[17];let E;t[18]!==c||t[19]!==i?(E=()=>{i&&c(null)},t[18]=c,t[19]=i,t[20]=E):E=t[20];let k;return t[21]!==x||t[22]!==_||t[23]!==C||t[24]!==E||t[25]!==T?(k={connection:x,undecided:T,lastEndpoint:_,set:C,clear:E},t[21]=x,t[22]=_,t[23]=C,t[24]=E,t[25]=T,t[26]=k):k=t[26],k}function pn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Xe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ze(e){const t=P.c(17),n=z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Xe(e):null,a=()=>e?Xe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:u}=M(c);let d;t[10]!==e||t[11]!==n||t[12]!==s?(d=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(s,b)}},t[10]=e,t[11]=n,t[12]=s,t[13]=d):d=t[13];const g=d,f=e?u??null:null;let v;return t[14]!==g||t[15]!==f?(v=[f,g],t[14]=g,t[15]=f,t[16]=v):v=t[16],v}function or(e){return e.kind==="protocol"||e.kind==="unavailable"}function rr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function sr(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function ir(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&pt(t)?t:null}function ar(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Et(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bn(e){if(!e.hasProject)return"legacy";const t=Et(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function wn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function qe(e){return e.isError||e.errorUpdateCount>0}function Sn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function yn(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 kt="__noSchema";function En(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[kt]:!0}}function cr(e){return!!e&&e[kt]===!0}function Ot(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function kn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const On=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function lr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:kn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(On)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:Ke(n.resolveType).localeCompare(Ke(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function Ke(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function et(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=et(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?et(s[a],r,n):s[a];return i}return e}function ur(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class tt extends Error{}class nt extends Error{}const Dt="site-not-owned";async function Dn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Tn(e,t=r=>fetch(r),n,o){const r=xe({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[l,c]of Object.entries(ue("v8")))i.headers.set(l,c);const a=await t(i);if(await Dn(a))throw new nt;if(await _e(a))throw n?.(),new Ne;return a}});try{const s=await Le(r,be(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof nt)return Dt;throw s}}const Ae=5e3;function In(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function Cn(e){return new URL(de(e,"rpc"),window.location.origin).href}async function Le(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==Z)throw new $e;const s=gt(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:be(t.schema)};if(!o)throw new Error("no schema.get");if(Ot(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:be(i?.schema)}}throw o.error}async function _n(e,t=n=>fetch(n)){const n=xe({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new tt;return r}});try{const o=await Le(n);return o.v8Schema?o:null}catch(o){if(o instanceof tt)return null;throw o}}function Tt(e,t){const n=P.c(53),{org:o}=qt(),{connection:r,undecided:s}=mn(e),{runtime:i}=dt(e),a=j.useContext(yt),l=Re(a?null:e),c=tn(e),u=Et({hasServeConnection:!!r,runtime:i}),d=rn()?.taskId??null,g=sn(an().lifecycle.phase),f=z(),v=wn({mode:u,mainSchema:l,workingTreeReady:g}),b=v.github&&!!o.slug&&!!e&&!!t;let w;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(w=()=>Tn(In({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ce(f,o.slug,e),lt(f,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=w):w=n[4];const I=M({queryKey:h.contentBackend(o.slug,e??"",t??"","github"),queryFn:w,enabled:b,staleTime:Number.POSITIVE_INFINITY,...ot}),T=v.sandbox&&!!o.slug&&!!e&&!!t;let x;n[5]!==t||n[6]!==o.slug||n[7]!==d||n[8]!==e?(x=async()=>_n(Cn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:d})),n[5]=t,n[6]=o.slug,n[7]=d,n[8]=e,n[9]=x):x=n[9];const _=M({queryKey:h.contentBackend(o.slug,e??"",t??"","sandbox",d??""),queryFn:x,enabled:T,staleTime:Number.POSITIVE_INFINITY,...ot}),C=!!r;let E;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(E=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=E):E=n[13];let k;n[14]!==r?(k=()=>Le(xe({endpoint:r.endpoint})),n[14]=r,n[15]=k):k=n[15];let N;n[16]!==C||n[17]!==E||n[18]!==k?(N={queryKey:E,queryFn:k,enabled:C,staleTime:Number.POSITIVE_INFINITY,retry:xn,retryDelay:Rn,refetchInterval:Nn},n[16]=C,n[17]=E,n[18]=k,n[19]=N):N=n[19];const p=M(N);let O;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(O=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=O):O=n[23];const $=O;let y;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(y=h.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=y):y=n[27];let R;n[28]!==p.data||n[29]!==$||n[30]!==f?(R=async()=>{try{return await p.data.client.describe()}catch(m){const Y=m;throw f.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),Y}},n[28]=p.data,n[29]=$,n[30]=f,n[31]=R):R=n[31];const A=!!p.data&&!a;let U;n[32]!==y||n[33]!==R||n[34]!==A?(U={queryKey:y,queryFn:R,enabled:A,refetchInterval:Ae,retry:!1},n[32]=y,n[33]=R,n[34]=A,n[35]=U):U=n[35];const V=M(U).data??p.data?.describe,L=bn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:l,githubSite:I.data===Dt?"not-owned":I.data?"v8":I.data===null?"v7":qe(I)?"error":"loading",sandboxSite:Pn({data:_.data,isError:qe(_),workingTreeReady:g}),markedV8:c});if(L==="pending"){let m;return n[36]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[36]=m):m=n[36],m}if(L==="retrying-github"){let m;return n[37]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"github"},n[37]=m):m=n[37],m}if(L==="retrying-sandbox"){let m;return n[38]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[38]=m):m=n[38],m}if(L==="legacy"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[39]=m):m=n[39],m}if(L==="protocol-github"){const m=I.data;let Y;return n[40]!==m?(Y=ke("github",m,""),n[40]=m,n[41]=Y):Y=n[41],Y}if(L==="site-not-owned-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=m):m=n[42],m}if(L==="protocol-sandbox"){let m;return n[43]!==_.data?(m=ke("sandbox",_.data,":sandbox"),n[43]=_.data,n[44]=m):m=n[44],m}if(L==="unavailable-github"){let m;return n[45]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[45]=m):m=n[45],m}const W=p.error??p.failureReason,ve=r?.endpoint??"";let te;return n[46]!==V||n[47]!==p.data||n[48]!==p.failureCount||n[49]!==p.isError||n[50]!==W||n[51]!==ve?(te=An({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:W,describe:V,endpoint:ve}),n[46]=V,n[47]=p.data,n[48]=p.failureCount,n[49]=p.isError,n[50]=W,n[51]=ve,n[52]=te):te=n[52],te}function Nn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Ae:!1}function Rn(e){return hn(e+1)}function xn(e,t){return!(t instanceof D)&&!(t instanceof $e)}function Pn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $n=3;function An(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ke("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<$n?t:{kind:"unavailable",source:"local",problem:vn(e.failure)}:t??{kind:"pending"}}const ot={retry:2,refetchInterval:e=>e.state.status==="error"?Ae:!1};function ke(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function It(e){const t=P.c(13);let n;t[0]!==e?(n=pe.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Kt(o,null),i=Re(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const g=e?Ge(r):null;a=Ln({saved:g,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const l=a;let c,u;t[6]!==s?(c=g=>s(Ge(g)),u=()=>s(null),t[6]=s,t[7]=c,t[8]=u):(c=t[7],u=t[8]);let d;return t[9]!==l||t[10]!==c||t[11]!==u?(d={...l,setUrl:c,clear:u},t[9]=l,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function Ln(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function jn(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}class je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function Ue(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function fe(e,t,n){return["decofile-write",e,t,n]}function Un(e,t,n){return{id:fe(e,t,n).join(":")}}function Me(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Mn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Fn(e,t,n){e.setQueryData(h.decofileDraft(Ue(t)),n)}function Qn(e,t){return e.getQueryData(h.decofileDraft(Ue(t)))??null}async function Bn(e,t){const n=await fetch(Me(e),{cache:"no-store",headers:{...ue("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function dr(e){const t=P.c(4);let n;t[0]!==e?(n=h.decofileDraft(e?Ue(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Vn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r??null}async function Vn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Hn(e,t){const n=await fetch(Me(t),{cache:"no-store",headers:ue("v7")});if(await _e(n))throw Ce(e,t.orgSlug,t.virtualMcpId),new Ne;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Fn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function fr(e,t){const n=await fetch(Me(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Mn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ct=3e3,Gn=15e3,Jn=2*6e4,_t={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Wn(e){return e<Jn?Ct:Gn}function Yn(e,t=_t){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Wn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let u;try{u=l()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const st=()=>0;function zn(e,t,n=_t){const o=j.useRef(t);o.current=t;const[r]=j.useState(()=>({polling:()=>Yn(()=>o.current,n),idle:()=>()=>{}}));j.useSyncExternalStore(e?r.polling:r.idle,st,st)}function Nt(e,t){return de(e,t)}function Xn(e,t){return de(e,"preview-fetch",{path:t})}function hr(e){return Nt(e,"preview-invoke")}function gr(e){return Nt(e,"catalog-invoke")}function Rt(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 Zn(){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&&Rt(n))return n}return null}function qn(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Zn();return n&&Rt(n)?new URL(t,n).toString():Xn(e,t)}function Kn(e){return qn(e,"/.decofile")}function eo(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function it(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function to(e,t){const n=de(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=eo(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:nn(s.content)}}async function no(e,t){const n=await to(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function vr(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){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function oo(e){return on(e)?.metadata?.runtime?.path??null}class xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function mr(e){return e instanceof D&&e.code===S.Conflict}function Pt(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 Fe extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Qe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function pr(e,t){return(t instanceof Fe||t instanceof Qe)&&(t.message=$t(e,t,"github")),t}function $t(e,t,n){if(t instanceof Fe)return e("siteEditor.save.draftUnread");if(t instanceof Qe)return e("siteEditor.save.keptChanging");if(t instanceof je)return t.message;if(n==="local")return so(e,t);if(t instanceof D)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ro(e,t){if(t==="local"||e instanceof je||e instanceof Fe||e instanceof Qe)return null;if(e instanceof D){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function so(e,t){if(t instanceof xt)return e("decoServe.save.serverGone");if(t instanceof D)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Pt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function io(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ao(e,t){const[n,o]=j.useState(e),r=j.useRef(null);return e&&!n&&o(!0),j.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=io(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const co="decocms:content-writes",Oe=new Set;let H;function At(){if(H!==void 0)return H;H=null;try{typeof BroadcastChannel=="function"&&(H=new BroadcastChannel(co),H.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Oe])n(t)}))}catch{H=null}return H}function lo(e){try{At()?.postMessage({cacheKey:e})}catch{}}function uo(e){return At(),Oe.add(e),()=>{Oe.delete(e)}}const Lt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},fo=15e3,ae=new Map;function J(e,t){return`${e}/${t}`}function Q(e){let t=ae.get(e);return t||(t={state:Lt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ae.set(e,t)),t}function B(e,t){const n=Q(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function he(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Be(e){return ae.get(e)?.state??Lt}function ho(e,t){const n=Q(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function br(e){const t=Q(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(he(t),B(e,{phase:"idle"}))}}function wr(e){const t=ae.get(e);!t||t.state.phase!=="reloading"||(he(t),B(e,{phase:"idle"}))}function jt(e){const t=Q(e);he(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function oe(e,t){const n=Q(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Ut(e,t.navigates,o)}function Ut(e,t,n=0){const o=Q(e);he(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},fo),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function go(e){return e?.kind==="protocol"&&e.source==="github"}async function re(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:h.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?h.protocolDraftRead(o,r,s):null,u=c?JSON.stringify(n.getQueryData(c)??null):null,d=l?[l]:[];if(a&&t.reread&&d.push(n.invalidateQueries({queryKey:h.decofile(a)})),a&&!t.adopted&&d.push(n.invalidateQueries({queryKey:h.contentChanges(a)})),s&&i.source==="sandbox"&&d.push(n.invalidateQueries({queryKey:cn(o,r,s)})),go(i)&&c&&!t.adopted&&d.push(n.invalidateQueries({queryKey:c})),await Promise.all(d),t.kind!=="edit"){const v=J(o,r);B(v,{epoch:Be(v).epoch+1})}const g=c?JSON.stringify(n.getQueryData(c)??null):null,f=u!==g;return f&&await new Promise(v=>ut.schedule(v)),{navigates:f}}async function vo(e,t){return jt(J(e.orgSlug,e.virtualMcpId)),Mt(e,t)}function at(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(h.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Mt(e,t){const n=J(e.orgSlug,e.virtualMcpId),o=t.adopted?at(e):null;let r;try{r=await t.write()}catch(i){throw oe(n,{ok:!1,navigates:!1}),t.refreshOnError&&re(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&lo(e.cacheKey),t.adopted){const i=at(e)!==o;return i&&await new Promise(a=>ut.schedule(a)),oe(n,{ok:!0,navigates:i}),t.reread&&re(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await re(e,t))}catch{}finally{oe(n,{ok:!0,navigates:s})}return r}function Sr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=J(o,r),a=new Set(t.blockKeys);for(const u of[...Q(i).discardListeners])u(a);jt(i);let l=!1;const c=()=>(l=!0,Mt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:fe(o,r,s),scope:Un(o,r,s),mutationFn:c}).execute(void 0).catch(u=>{throw l||oe(i,{ok:!1,navigates:!1}),u}):c()}function yr(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=J(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=Q(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],j.useEffect(i,a)}function mo(e){const t=J(e.orgSlug,e.virtualMcpId);Be(t).inFlight>0||re(e,{kind:"external"}).then(({navigates:n})=>{const o=Q(t);o.previews>0&&o.state.inFlight===0&&Ut(t,n)}).catch(()=>{})}function po(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=J(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>ho(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Be(r),n[5]=r,n[6]=a):a=n[6];const l=a;return j.useSyncExternalStore(i,l,l)}const bo=500;function Er(e,t){const{phase:n}=po(e,t);return ao(n!=="idle",bo)}function wo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function So(e,t){return h.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function kr(e,t,n,o){if(o?.source==="github")return yo(e,t,n);const r=e.getQueryData(h.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(h.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function K(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(r=>F(r)===n);return o===void 0?void 0:e.changes[o]}function yo(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(o)return Ft(o,ge(e,t),n)}function Ft(e,t,n){const o=K(e,n);return o?.kind==="delete"?o.version??we:o?o.version:t.has(F(n))?we:null}function Or(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(!o)return!1;const r=K(o,n);return r?r.kind==="set"&&r.baseVersion===null:ge(e,t).has(F(n))}function Dr(e,t){const n=e.getQueryData(h.decofile(t)),o=e.getQueryData(h.contentChanges(t));if(!n||!o)return null;const r=ge(e,t);return{blocks:n,versionOf:s=>Ft(o,r,s)}}function ge(e,t){return new Set(e.getQueryData(h.contentDraftTombstones(t)))}function ce(e,t,n,o){const r=F(n),s=ge(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),ee(e),e.setQueryData(h.contentDraftTombstones(t),[...s]))}function Eo(e,t,n,o){const r=He(o.revision),s=e.getQueryData(h.contentRevision(n))?.revision,i=s?He(s):null,a=r&&!r.main&&i?en(i.main,r.draft):o.revision,l=e.getQueryData(h.contentVersions(n)),c=Object.entries(o.versions??{}).map(([f,v])=>[f,v===we?null:v]),u=e.getQueryData(h.contentChanges(n)),d=new Set(c.flatMap(([f])=>{const v=u?K(u,f):void 0;return(v?v.baseVersion:l?.[f]??null)===null?[f]:[]})),g=new Set(c.flatMap(([f,v])=>v===null?[]:[F(f)]));e.setQueryData(h.contentChanges(n),f=>{if(!f)return f;const v={...f.changes};for(const[b,w]of c){const I=K(f,b),T=I?I.baseVersion:l?.[b]??null;w!==null?v[b]={kind:"set",version:w,baseVersion:T}:T!==null?v[b]={kind:"delete",version:null,baseVersion:T}:delete v[b]}return{...f,changes:v,edited:!0}});for(const[f,v]of c)v!==null?ce(e,n,f,!1):!g.has(F(f))&&d.has(f)&&ce(e,n,f,!0);return r&&r.draft!=="none"&&e.setQueryData(h.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),f=>f&&{...f,version:r.draft}),a}function Ve(e,t,n){ee(e),e.setQueryData(h.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function ko(e,t){const n=e.getMutationCache().findAll({mutationKey:fe(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>yn(o.state.variables)))}function De(e,t){e.resetQueries({queryKey:h.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function le(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof D);throw t.source==="local"&&s?(De(e,n),new xt(r)):(t.source==="local"&&Pe(r)&&De(e,n),r)}}const se=new Map;function Qt(e,t,n,o){const r=se.get(o);if(r)return r;const s=Bt(e,t,n,o,!0);return se.set(o,s),s.finally(()=>se.delete(o))}const me=new Set;function Oo(e,t,n){const o=P.c(8),r=z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const u={orgSlug:s,virtualMcpId:i,branch:a};return uo(d=>{d===n&&(me.has(n)||(me.add(n),To(r,e,u,n).catch(Do).finally(()=>me.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),j.useEffect(l,c)}function Do(){}async function To(e,t,n,o){const r=se.get(o);return r&&await r.catch(()=>{}),Qt(e,t,n,o)}async function Bt(e,t,n,o,r){ee(e);const s=h.decofile(o),i=So(n,t),a=h.contentRevision(o),l=h.contentVersions(o),c=e.getQueryData(s),u=e.getQueryData(l),d=e.getQueryData(i),g=e.getQueryData(a)??void 0,f=t.source==="github"&&!d?lt(e,n.orgSlug,n.virtualMcpId):void 0,v=f?.isV8&&f.schema&&f.version?f:void 0,b=d??v?.schema,w=v?{...g,schemaVersion:v.version}:g,I=r&&c&&u?w?.revision:void 0,T=r&&b?w?.schemaVersion:void 0,x=h.contentChanges(o),_=e.getQueryData(x),[C,E,k]=await le(e,t,n,()=>t.client.batch([{method:"blocks.list",params:I?{ifNoneMatch:I}:{}},{method:"schema.get",params:T?{ifNoneMatch:T}:{}},{method:"changes.list",params:vt(_)}])),N=e.getQueryData(a)?.revision,p=N!==void 0&&N!==w?.revision;if(k?.ok){const X=p?null:Ee(_,k.result);X&&e.setQueryData(x,X)}else k&&t.source==="local"&&Pe(k.error)&&De(e,n);if(!C?.ok)throw C?.error??new Error("no blocks.list");if(!E)throw new Error("no schema.get");const O=C.result,$=Ot(E),y=E.ok&&!$?E.result:null;if(O.notModified&&(!c||!u)||y?.notModified&&!b)return Bt(e,t,n,o,!1);const R=O.notModified?new Set:ko(e,n),A=O.notModified?c:Sn(O.blocks,c,R),U=$?En():y?y.notModified?b:y.schema:E.error;if(e.setQueryData(a,{revision:p?N:O.notModified?w?.revision:O.revision,schemaVersion:y?y.notModified?w?.schemaVersion:y.version??void 0:void 0}),e.setQueryData(s,A),!O.notModified){const X=e.getQueryData(l),V={...O.versions};for(const L of R){const W=X?.[L];W!==void 0?V[L]=W:delete V[L]}e.setQueryData(l,V)}return U instanceof D||e.setQueryData(i,U),!p&&!O.notModified&&c&&w?.revision&&O.revision!==w.revision&&mo({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:U}}async function Tr(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(l=>!s||!Object.hasOwn(s,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`)}return vo({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=await le(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));ee(e);const a=t.source==="github"?Eo(e,n,o,i):i.revision;e.setQueryData(h.contentRevision(o),c=>({...c,revision:a}));const l=i.versions??{};return Ve(e,o,l),{revision:a,versions:l}}})}function Vt(e,t){if(!(e instanceof D))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 Ht(e,t,n){if(!(n instanceof D))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&ce(e,t,r,!1)}function Gt(e,t,n,o){ee(e);const r=o.block===null,s=e.getQueryData(h.contentVersions(t)),i=e.getQueryData(h.contentChanges(t)),a=i?K(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=F(n),u=Object.fromEntries(Object.entries(i.changes).filter(([d])=>F(d)!==c));r?l!==null&&(u[n]={kind:"delete",version:null,baseVersion:l}):u[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(h.contentChanges(t),{...i,changes:u,edited:!0})}ce(e,t,n,r&&l===null),e.setQueryData(h.decofile(t),c=>{const u={...c};return r?delete u[n]:u[n]=o.block,u}),Ve(e,t,{[n]:r?null:o.version})}function Ir(e,t,n,o){if(t.source!=="github"||!(o instanceof D))return!1;Ht(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>Vt(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:h.decofile(n)}),s.forEach((a,l)=>{Gt(e,n,a,i[l])}),!0)}async function Cr(e,t,n,o,r,s){t.source==="github"&&Ht(e,o,s);const i=t.source==="github"?Vt(s,r):void 0;if(i)return e.cancelQueries({queryKey:h.decofile(o)}),Gt(e,o,r,i),!0;await e.invalidateQueries({queryKey:h.decofile(o)});let a;try{const c=(await le(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(h.contentChanges(o),u=>{if(!u)return u;const d={...u.changes};return c?.kind?d[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete d[r],{...u,changes:d,edited:!0}})}catch{const l=await le(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(h.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ve(e,o,{[r]:a.version}),!1}function Io(e){const t=P.c(15),n=z();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=h.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const f=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ue("v8")});if(await _e(f))throw Ce(n,e.orgSlug,e.virtualMcpId),new Ne;if(!f.ok)throw new Error(`draft pointer read failed: ${f.status}`);return await f.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:l,isError:c}=M(i),u=!!e&&l&&!c;if(!e||!a?.draft||!a.version){let f;return t[11]!==u?(f={pointer:null,pending:u},t[11]=u,t[12]=f):f=t[12],f}const d=`${a.draft}@${a.version}`;let g;return t[13]!==d?(g={pointer:d,pending:!1},t[13]=d,t[14]=g):g=t[14],g}function _r(e){return Io(e).pointer}function Nr(e){const t=P.c(4);let n;t[0]!==e?(n=h.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Co,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r?.revision}async function Co(){throw new Error("content revisions are set by reads and writes")}function Te(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Rr(e,t){return Te({...e,protocolSuffix:t.cacheKeySuffix})}function _o(e,t){const n=P.c(6),{url:o}=It(e?.virtualMcpId),r=Tt(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Te({...e,protocolSuffix:r.cacheKeySuffix}):Te({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function xr(e,t){const n=P.c(39),{url:o,undecided:r}=It(e?.virtualMcpId),s=!!o,i=Tt(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,l=_o(e),c=t?.fetchEnabled??!0,u=oo(e?.virtualMcpId),d=dt(e?.virtualMcpId).runtime==="cms",g=z();let f;n[0]!==l?(f=h.decofile(l),n[0]=l,n[1]=f):f=n[1];const v=f;Oo(a,a&&e?e:null,l);let b;n[2]!==e||n[3]!==g||n[4]!==v?(b=()=>{if(!e||g.isMutating({mutationKey:fe(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const p=g.getQueryState(v);return p?.fetchStatus==="fetching"||Date.now()-(p?.dataUpdatedAt??0)<Ct/2},n[2]=e,n[3]=g,n[4]=v,n[5]=b):b=n[5];let w;n[6]!==d||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==g||n[11]!==v?(w=async()=>{if(e){if(!a&&d&&!s){const p=Qn(g,e)?.version;if(p&&!await Bn(e,p))return}await g.refetchQueries({queryKey:v,exact:!0},{cancelRefetch:!1})}},n[6]=d,n[7]=s,n[8]=e,n[9]=a,n[10]=g,n[11]=v,n[12]=w):w=n[12];let I;n[13]!==b||n[14]!==w?(I={skip:b,read:w},n[13]=b,n[14]=w,n[15]=I):I=n[15],zn(!!t?.pollWhile&&!!e,I);let T;n[16]!==i.kind||n[17]!==d||n[18]!==c||n[19]!==l||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==g?(T=async()=>{if(a)return(await Qt(g,a,e,l)).blocks;if(i.kind==="unavailable")throw wo("decofile");if(s){const y=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(xo),R=y?.ok?rt(await y.text()):null;if(R)return R;const A=new Error("decofile unavailable (local tunnel unreachable)");throw A.status=502,A}if(d)return Hn(g,e);const p=()=>no(e,jn(u,".deco/blocks.gen.json"));if(c){const y=await fetch(Kn(e),{cache:"no-store"}).catch(Ro);if(y?.ok){const U=rt(await y.text());if(U)return U}const R=await p();if(R.kind==="data")return R.data;const A=new Error(`Failed to fetch decofile: ${y?.status??"network error"}`);throw A.status=it({liveOk:!!y?.ok,liveStatus:y?.status,committedAbsent:R.kind==="absent"}),A}const O=await p();if(O.kind==="data")return O.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=it({liveOk:!1,committedAbsent:O.kind==="absent"}),$},n[16]=i.kind,n[17]=d,n[18]=c,n[19]=l,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=g,n[26]=T):T=n[26];const x=!!e&&i.kind!=="pending"&&!r,_=a?0:3e4,C=a?.describe.pollIntervalMs,E=a?"always":void 0;let k;n[27]!==d||n[28]!==s||n[29]!==a?(k=(p,O)=>{if(a||d||s)return p<3;const $=O.status;return $!==502&&$!==404&&p<2},n[27]=d,n[28]=s,n[29]=a,n[30]=k):k=n[30];let N;return n[31]!==v||n[32]!==T||n[33]!==x||n[34]!==_||n[35]!==C||n[36]!==E||n[37]!==k?(N={queryKey:v,queryFn:T,enabled:x,staleTime:_,refetchInterval:C,refetchIntervalInBackground:!1,refetchOnWindowFocus:E,retry:k,retryDelay:No},n[31]=v,n[32]=T,n[33]=x,n[34]=_,n[35]=C,n[36]=E,n[37]=k,n[38]=N):N=n[38],M(N)}function No(e){return ln(5e3,1e3,e,2,0)}function Ro(){return null}function xo(){return null}const Po="site-editor-save",Jt={id:Po,description:void 0,action:void 0,cancel:void 0},Pr="site-editor-undo",Ie="site-editor-publish";function $o(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=G.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=G.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=G.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Wt(e,t){return t?G.jsx($o,{label:e("siteEditor.details"),detail:t}):void 0}function $r(e,t,n){q.error($t(e,t,n),{...Jt,description:Wt(e,ro(t,n))})}function Ar(e,t,n=!1){q.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Jt,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Yt={action:void 0,duration:void 0};function Lr(e,t){q.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Yt,id:Ie,description:void 0})}function jr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Wt(e,o??null);q[i](t,{id:Ie,description:n&&a?G.jsxs(G.Fragment,{children:[G.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),q.loading(s??e("thread.publishPopover.publishing"),{...Yt,id:Ie,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Ur(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Dr as $,br as A,po as B,wr as C,_o as D,Nr as E,Un as F,fe as G,vo as H,to as I,Mn as J,Ar as K,Or as L,pr as M,je as N,mr as O,To as P,Fe as Q,Tr as R,er as S,yt as T,Cr as U,$r as V,kr as W,So as X,Fn as Y,fr as Z,yr as _,nr as a,rr as a0,lr as a1,Ke as a2,et as a3,ur as a4,tr as a5,qn as a6,ar as a7,Rr as a8,gn as a9,S as aA,gr as aB,Wt as aa,Ur as ab,Lr as ac,Sr as ad,Jo as ae,Wo as af,Pe as ag,zo as ah,dn as ai,$o as aj,Yo as ak,Qt as al,wo as am,vr as an,no as ao,Qe as ap,Ir as aq,dr as ar,_r as as,jr as at,Ie as au,Yt as av,Pr as aw,Jt as ax,ko as ay,D as az,mn as b,It as c,hn as d,Ko as e,vn as f,Le as g,xe as h,pt as i,hr as j,Xn as k,xr as l,or as m,cr as n,oo as o,Xo as p,jn as q,qo as r,Zo as s,Et as t,Tt as u,ir as v,Er as w,sr as x,Io as y,J as z};
1
+ import{c as P,q as z,m as M,K as h,eP as ct,aK as zt,aL as Xt,r as j,a as Zt,az as pe,a4 as qt,eQ as lt,eR as Ce,bh as be,eS as ue,eT as _e,eU as Ne,ax as Kt,bq as ut,eV as F,eW as ee,eX as we,eY as He,eZ as en,t as q,j as G}from"./index-C4tYnNih.js";import{u as dt}from"./use-session-runtime-CtTWKH1c.js";import{s as Ge}from"./thread-intent-B9ceQWmI.js";import{u as Re,b as tn}from"./experiments-tab-choice-pVOiMOWe.js";import{b as de}from"./sandbox-url-D3mC8qhT.js";import{s as nn}from"./utils-wTX1Gyo-.js";import{a as on}from"./repository-binding-C7GXruB1.js";import{u as rn}from"./chat-context-CIOqAIIy.js";import{i as sn,u as an}from"./use-sandbox-events-C6ionJ0p.js";import{a as cn}from"./sandbox-git-api-CH_-QFpD.js";import{e as ln}from"./backoff-CrEUbyZT.js";const S={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class D 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 D(t.code,t.message,t.data)}}const Z="deco-content",Se={major:1},ft=1;async function un(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 ye={major:Se.major,minor:ft},ht=`the endpoint speaks an older ${Z} than this client needs (${ye.major}.${ye.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ne(e,t,n){const o={reason:t,required:{...ye}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new D(S.Unsupported,e,o)}function gt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==Z)throw ne(`the endpoint speaks ${JSON.stringify(n)}, not ${Z}`,"protocol",t);if(o?.major!==Se.major)throw ne(`the endpoint speaks ${Z} ${String(o?.major)}.x; this client speaks ${Se.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ft)throw ne(ht,"outdated",t);return e}function Je(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?ne(ht,"outdated"):D.from(t)}function xe(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){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(s)}));let l;try{l=await un(a)}catch{throw new D(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?D.from(c):new D(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw Je(s,l.error);return l.result};return{call:r,describe:async()=>gt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,u)=>({jsonrpc:"2.0",id:i[u],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,u)=>{const d=l.get(c);return d?d.error?{ok:!1,error:Je(s[u].method,d.error)}:{ok:!0,result:d.result}:{ok:!1,error:new D(S.InternalError,"no response for this call")}})}}}function vt(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const We=20,Ye=5,ze=500;function Pe(e){return e instanceof D?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function Ee(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function dn(e,t,n){const o=h.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(vt(r)),i=Ee(r,s);if(i)return i;const a=await t.changesList({});return Ee(void 0,a)}async function fn(e,t){const n=[];for(let s=0;s<t.length;s+=We)n.push(t.slice(s,s+We));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Ye){const i=await e.batch(n.slice(s,s+Ye).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Jo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=ze){const r=t.slice(o,o+ze),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Wo(e){return e instanceof D&&e.code===S.Conflict}function mt(e){return e?.kind==="protocol"?e:null}function Yo(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=z();let a;o[2]!==e?(a=mt(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=h.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let d;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(d=c?()=>dn(i,l.client,t):ct,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=d):d=o[10];let g;return o[11]!==u||o[12]!==d?(g={queryKey:u,queryFn:d,staleTime:0},o[11]=u,o[12]=d,o[13]=g):g=o[13],M(g)}function zo(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=mt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=h.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let u;o[7]!==l||o[8]!==a||o[9]!==s?(u=l?()=>fn(s.client,a):ct,o[7]=l,o[8]=a,o[9]=s,o[10]=u):u=o[10];let d;return o[11]!==c||o[12]!==u?(d={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=u,o[13]=d):d=o[13],M(d)}function pt(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 ie(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 bt=zt({endpoint:Xt().max(2048).refine(e=>pt(e)&&new URL(e).pathname==="/rpc").transform(ie)});function Xo(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=bt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function wt(e){const t=bt.safeParse(e);return t.success?t.data:null}const St="studio:deco-serve-last";function Zo(e){try{localStorage.setItem(St,JSON.stringify(e))}catch{}}function qo(){try{const e=localStorage.getItem(St);return e?wt(JSON.parse(e)):null}catch{return null}}function Ko(e){try{return new URL(ie(e)).host}catch{return e}}function hn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const gn="http://localhost:4545/rpc",er="npx @decocms/blocks serve",tr="npx @decocms/blocks schema";class $e extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function vn(e){if(e instanceof $e)return{reason:"not-deco-serve"};if(!(e instanceof D))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Pe(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.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 nr(e,t){if(e)return[ie(e.endpoint)];const n=[t?.endpoint,gn].filter(o=>!!o).map(ie);return[...new Set(n)]}const yt=j.createContext(null);function mn(e){const t=P.c(27),n=j.useContext(yt),o=Re(n?null:e),{data:r}=Zt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?pe.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=Ze(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?pe.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[d,g]=Ze(u);if(n)return n;let f;t[8]!==l||t[9]!==i?(f=i?wt(l):null,t[8]=l,t[9]=i,t[10]=f):f=t[10];const v=f,b=!!v;let w;t[11]!==o||t[12]!==b?(w=pn(o,b),t[11]=o,t[12]=b,t[13]=w):w=t[13];const{applies:I,undecided:T}=w,x=I?v:null,_=i&&o==="v8"&&typeof d=="string"?d:null;let C;t[14]!==g||t[15]!==c||t[16]!==i?(C=N=>{i&&(c(N),g(N.endpoint))},t[14]=g,t[15]=c,t[16]=i,t[17]=C):C=t[17];let E;t[18]!==c||t[19]!==i?(E=()=>{i&&c(null)},t[18]=c,t[19]=i,t[20]=E):E=t[20];let k;return t[21]!==x||t[22]!==_||t[23]!==C||t[24]!==E||t[25]!==T?(k={connection:x,undecided:T,lastEndpoint:_,set:C,clear:E},t[21]=x,t[22]=_,t[23]=C,t[24]=E,t[25]=T,t[26]=k):k=t[26],k}function pn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Xe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ze(e){const t=P.c(17),n=z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Xe(e):null,a=()=>e?Xe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:u}=M(c);let d;t[10]!==e||t[11]!==n||t[12]!==s?(d=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(s,b)}},t[10]=e,t[11]=n,t[12]=s,t[13]=d):d=t[13];const g=d,f=e?u??null:null;let v;return t[14]!==g||t[15]!==f?(v=[f,g],t[14]=g,t[15]=f,t[16]=v):v=t[16],v}function or(e){return e.kind==="protocol"||e.kind==="unavailable"}function rr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function sr(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function ir(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&pt(t)?t:null}function ar(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Et(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bn(e){if(!e.hasProject)return"legacy";const t=Et(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function wn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function qe(e){return e.isError||e.errorUpdateCount>0}function Sn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function yn(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 kt="__noSchema";function En(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[kt]:!0}}function cr(e){return!!e&&e[kt]===!0}function Ot(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function kn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const On=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function lr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:kn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(On)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:Ke(n.resolveType).localeCompare(Ke(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function Ke(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function et(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=et(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?et(s[a],r,n):s[a];return i}return e}function ur(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class tt extends Error{}class nt extends Error{}const Dt="site-not-owned";async function Dn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Tn(e,t=r=>fetch(r),n,o){const r=xe({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[l,c]of Object.entries(ue("v8")))i.headers.set(l,c);const a=await t(i);if(await Dn(a))throw new nt;if(await _e(a))throw n?.(),new Ne;return a}});try{const s=await Le(r,be(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof nt)return Dt;throw s}}const Ae=5e3;function In(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function Cn(e){return new URL(de(e,"rpc"),window.location.origin).href}async function Le(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==Z)throw new $e;const s=gt(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:be(t.schema)};if(!o)throw new Error("no schema.get");if(Ot(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:be(i?.schema)}}throw o.error}async function _n(e,t=n=>fetch(n)){const n=xe({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new tt;return r}});try{const o=await Le(n);return o.v8Schema?o:null}catch(o){if(o instanceof tt)return null;throw o}}function Tt(e,t){const n=P.c(53),{org:o}=qt(),{connection:r,undecided:s}=mn(e),{runtime:i}=dt(e),a=j.useContext(yt),l=Re(a?null:e),c=tn(e),u=Et({hasServeConnection:!!r,runtime:i}),d=rn()?.taskId??null,g=sn(an().lifecycle.phase),f=z(),v=wn({mode:u,mainSchema:l,workingTreeReady:g}),b=v.github&&!!o.slug&&!!e&&!!t;let w;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(w=()=>Tn(In({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ce(f,o.slug,e),lt(f,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=w):w=n[4];const I=M({queryKey:h.contentBackend(o.slug,e??"",t??"","github"),queryFn:w,enabled:b,staleTime:Number.POSITIVE_INFINITY,...ot}),T=v.sandbox&&!!o.slug&&!!e&&!!t;let x;n[5]!==t||n[6]!==o.slug||n[7]!==d||n[8]!==e?(x=async()=>_n(Cn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:d})),n[5]=t,n[6]=o.slug,n[7]=d,n[8]=e,n[9]=x):x=n[9];const _=M({queryKey:h.contentBackend(o.slug,e??"",t??"","sandbox",d??""),queryFn:x,enabled:T,staleTime:Number.POSITIVE_INFINITY,...ot}),C=!!r;let E;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(E=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=E):E=n[13];let k;n[14]!==r?(k=()=>Le(xe({endpoint:r.endpoint})),n[14]=r,n[15]=k):k=n[15];let N;n[16]!==C||n[17]!==E||n[18]!==k?(N={queryKey:E,queryFn:k,enabled:C,staleTime:Number.POSITIVE_INFINITY,retry:xn,retryDelay:Rn,refetchInterval:Nn},n[16]=C,n[17]=E,n[18]=k,n[19]=N):N=n[19];const p=M(N);let O;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(O=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=O):O=n[23];const $=O;let y;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(y=h.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=y):y=n[27];let R;n[28]!==p.data||n[29]!==$||n[30]!==f?(R=async()=>{try{return await p.data.client.describe()}catch(m){const Y=m;throw f.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),Y}},n[28]=p.data,n[29]=$,n[30]=f,n[31]=R):R=n[31];const A=!!p.data&&!a;let U;n[32]!==y||n[33]!==R||n[34]!==A?(U={queryKey:y,queryFn:R,enabled:A,refetchInterval:Ae,retry:!1},n[32]=y,n[33]=R,n[34]=A,n[35]=U):U=n[35];const V=M(U).data??p.data?.describe,L=bn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:l,githubSite:I.data===Dt?"not-owned":I.data?"v8":I.data===null?"v7":qe(I)?"error":"loading",sandboxSite:Pn({data:_.data,isError:qe(_),workingTreeReady:g}),markedV8:c});if(L==="pending"){let m;return n[36]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[36]=m):m=n[36],m}if(L==="retrying-github"){let m;return n[37]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"github"},n[37]=m):m=n[37],m}if(L==="retrying-sandbox"){let m;return n[38]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[38]=m):m=n[38],m}if(L==="legacy"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[39]=m):m=n[39],m}if(L==="protocol-github"){const m=I.data;let Y;return n[40]!==m?(Y=ke("github",m,""),n[40]=m,n[41]=Y):Y=n[41],Y}if(L==="site-not-owned-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=m):m=n[42],m}if(L==="protocol-sandbox"){let m;return n[43]!==_.data?(m=ke("sandbox",_.data,":sandbox"),n[43]=_.data,n[44]=m):m=n[44],m}if(L==="unavailable-github"){let m;return n[45]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[45]=m):m=n[45],m}const W=p.error??p.failureReason,ve=r?.endpoint??"";let te;return n[46]!==V||n[47]!==p.data||n[48]!==p.failureCount||n[49]!==p.isError||n[50]!==W||n[51]!==ve?(te=An({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:W,describe:V,endpoint:ve}),n[46]=V,n[47]=p.data,n[48]=p.failureCount,n[49]=p.isError,n[50]=W,n[51]=ve,n[52]=te):te=n[52],te}function Nn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Ae:!1}function Rn(e){return hn(e+1)}function xn(e,t){return!(t instanceof D)&&!(t instanceof $e)}function Pn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $n=3;function An(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ke("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<$n?t:{kind:"unavailable",source:"local",problem:vn(e.failure)}:t??{kind:"pending"}}const ot={retry:2,refetchInterval:e=>e.state.status==="error"?Ae:!1};function ke(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function It(e){const t=P.c(13);let n;t[0]!==e?(n=pe.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Kt(o,null),i=Re(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const g=e?Ge(r):null;a=Ln({saved:g,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const l=a;let c,u;t[6]!==s?(c=g=>s(Ge(g)),u=()=>s(null),t[6]=s,t[7]=c,t[8]=u):(c=t[7],u=t[8]);let d;return t[9]!==l||t[10]!==c||t[11]!==u?(d={...l,setUrl:c,clear:u},t[9]=l,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function Ln(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function jn(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}class je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function Ue(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function fe(e,t,n){return["decofile-write",e,t,n]}function Un(e,t,n){return{id:fe(e,t,n).join(":")}}function Me(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Mn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Fn(e,t,n){e.setQueryData(h.decofileDraft(Ue(t)),n)}function Qn(e,t){return e.getQueryData(h.decofileDraft(Ue(t)))??null}async function Bn(e,t){const n=await fetch(Me(e),{cache:"no-store",headers:{...ue("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function dr(e){const t=P.c(4);let n;t[0]!==e?(n=h.decofileDraft(e?Ue(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Vn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r??null}async function Vn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Hn(e,t){const n=await fetch(Me(t),{cache:"no-store",headers:ue("v7")});if(await _e(n))throw Ce(e,t.orgSlug,t.virtualMcpId),new Ne;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Fn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function fr(e,t){const n=await fetch(Me(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Mn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ct=3e3,Gn=15e3,Jn=2*6e4,_t={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Wn(e){return e<Jn?Ct:Gn}function Yn(e,t=_t){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Wn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let u;try{u=l()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const st=()=>0;function zn(e,t,n=_t){const o=j.useRef(t);o.current=t;const[r]=j.useState(()=>({polling:()=>Yn(()=>o.current,n),idle:()=>()=>{}}));j.useSyncExternalStore(e?r.polling:r.idle,st,st)}function Nt(e,t){return de(e,t)}function Xn(e,t){return de(e,"preview-fetch",{path:t})}function hr(e){return Nt(e,"preview-invoke")}function gr(e){return Nt(e,"catalog-invoke")}function Rt(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 Zn(){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&&Rt(n))return n}return null}function qn(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Zn();return n&&Rt(n)?new URL(t,n).toString():Xn(e,t)}function Kn(e){return qn(e,"/.decofile")}function eo(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function it(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function to(e,t){const n=de(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=eo(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:nn(s.content)}}async function no(e,t){const n=await to(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function vr(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){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function oo(e){return on(e)?.metadata?.runtime?.path??null}class xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function mr(e){return e instanceof D&&e.code===S.Conflict}function Pt(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 Fe extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Qe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function pr(e,t){return(t instanceof Fe||t instanceof Qe)&&(t.message=$t(e,t,"github")),t}function $t(e,t,n){if(t instanceof Fe)return e("siteEditor.save.draftUnread");if(t instanceof Qe)return e("siteEditor.save.keptChanging");if(t instanceof je)return t.message;if(n==="local")return so(e,t);if(t instanceof D)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ro(e,t){if(t==="local"||e instanceof je||e instanceof Fe||e instanceof Qe)return null;if(e instanceof D){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function so(e,t){if(t instanceof xt)return e("decoServe.save.serverGone");if(t instanceof D)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Pt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function io(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ao(e,t){const[n,o]=j.useState(e),r=j.useRef(null);return e&&!n&&o(!0),j.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=io(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const co="decocms:content-writes",Oe=new Set;let H;function At(){if(H!==void 0)return H;H=null;try{typeof BroadcastChannel=="function"&&(H=new BroadcastChannel(co),H.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Oe])n(t)}))}catch{H=null}return H}function lo(e){try{At()?.postMessage({cacheKey:e})}catch{}}function uo(e){return At(),Oe.add(e),()=>{Oe.delete(e)}}const Lt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},fo=15e3,ae=new Map;function J(e,t){return`${e}/${t}`}function Q(e){let t=ae.get(e);return t||(t={state:Lt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ae.set(e,t)),t}function B(e,t){const n=Q(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function he(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Be(e){return ae.get(e)?.state??Lt}function ho(e,t){const n=Q(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function br(e){const t=Q(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(he(t),B(e,{phase:"idle"}))}}function wr(e){const t=ae.get(e);!t||t.state.phase!=="reloading"||(he(t),B(e,{phase:"idle"}))}function jt(e){const t=Q(e);he(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function oe(e,t){const n=Q(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Ut(e,t.navigates,o)}function Ut(e,t,n=0){const o=Q(e);he(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},fo),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function go(e){return e?.kind==="protocol"&&e.source==="github"}async function re(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:h.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?h.protocolDraftRead(o,r,s):null,u=c?JSON.stringify(n.getQueryData(c)??null):null,d=l?[l]:[];if(a&&t.reread&&d.push(n.invalidateQueries({queryKey:h.decofile(a)})),a&&!t.adopted&&d.push(n.invalidateQueries({queryKey:h.contentChanges(a)})),s&&i.source==="sandbox"&&d.push(n.invalidateQueries({queryKey:cn(o,r,s)})),go(i)&&c&&!t.adopted&&d.push(n.invalidateQueries({queryKey:c})),await Promise.all(d),t.kind!=="edit"){const v=J(o,r);B(v,{epoch:Be(v).epoch+1})}const g=c?JSON.stringify(n.getQueryData(c)??null):null,f=u!==g;return f&&await new Promise(v=>ut.schedule(v)),{navigates:f}}async function vo(e,t){return jt(J(e.orgSlug,e.virtualMcpId)),Mt(e,t)}function at(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(h.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Mt(e,t){const n=J(e.orgSlug,e.virtualMcpId),o=t.adopted?at(e):null;let r;try{r=await t.write()}catch(i){throw oe(n,{ok:!1,navigates:!1}),t.refreshOnError&&re(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&lo(e.cacheKey),t.adopted){const i=at(e)!==o;return i&&await new Promise(a=>ut.schedule(a)),oe(n,{ok:!0,navigates:i}),t.reread&&re(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await re(e,t))}catch{}finally{oe(n,{ok:!0,navigates:s})}return r}function Sr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=J(o,r),a=new Set(t.blockKeys);for(const u of[...Q(i).discardListeners])u(a);jt(i);let l=!1;const c=()=>(l=!0,Mt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:fe(o,r,s),scope:Un(o,r,s),mutationFn:c}).execute(void 0).catch(u=>{throw l||oe(i,{ok:!1,navigates:!1}),u}):c()}function yr(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=J(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=Q(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],j.useEffect(i,a)}function mo(e){const t=J(e.orgSlug,e.virtualMcpId);Be(t).inFlight>0||re(e,{kind:"external"}).then(({navigates:n})=>{const o=Q(t);o.previews>0&&o.state.inFlight===0&&Ut(t,n)}).catch(()=>{})}function po(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=J(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>ho(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Be(r),n[5]=r,n[6]=a):a=n[6];const l=a;return j.useSyncExternalStore(i,l,l)}const bo=500;function Er(e,t){const{phase:n}=po(e,t);return ao(n!=="idle",bo)}function wo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function So(e,t){return h.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function kr(e,t,n,o){if(o?.source==="github")return yo(e,t,n);const r=e.getQueryData(h.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(h.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function K(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(r=>F(r)===n);return o===void 0?void 0:e.changes[o]}function yo(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(o)return Ft(o,ge(e,t),n)}function Ft(e,t,n){const o=K(e,n);return o?.kind==="delete"?o.version??we:o?o.version:t.has(F(n))?we:null}function Or(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(!o)return!1;const r=K(o,n);return r?r.kind==="set"&&r.baseVersion===null:ge(e,t).has(F(n))}function Dr(e,t){const n=e.getQueryData(h.decofile(t)),o=e.getQueryData(h.contentChanges(t));if(!n||!o)return null;const r=ge(e,t);return{blocks:n,versionOf:s=>Ft(o,r,s)}}function ge(e,t){return new Set(e.getQueryData(h.contentDraftTombstones(t)))}function ce(e,t,n,o){const r=F(n),s=ge(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),ee(e),e.setQueryData(h.contentDraftTombstones(t),[...s]))}function Eo(e,t,n,o){const r=He(o.revision),s=e.getQueryData(h.contentRevision(n))?.revision,i=s?He(s):null,a=r&&!r.main&&i?en(i.main,r.draft):o.revision,l=e.getQueryData(h.contentVersions(n)),c=Object.entries(o.versions??{}).map(([f,v])=>[f,v===we?null:v]),u=e.getQueryData(h.contentChanges(n)),d=new Set(c.flatMap(([f])=>{const v=u?K(u,f):void 0;return(v?v.baseVersion:l?.[f]??null)===null?[f]:[]})),g=new Set(c.flatMap(([f,v])=>v===null?[]:[F(f)]));e.setQueryData(h.contentChanges(n),f=>{if(!f)return f;const v={...f.changes};for(const[b,w]of c){const I=K(f,b),T=I?I.baseVersion:l?.[b]??null;w!==null?v[b]={kind:"set",version:w,baseVersion:T}:T!==null?v[b]={kind:"delete",version:null,baseVersion:T}:delete v[b]}return{...f,changes:v,edited:!0}});for(const[f,v]of c)v!==null?ce(e,n,f,!1):!g.has(F(f))&&d.has(f)&&ce(e,n,f,!0);return r&&r.draft!=="none"&&e.setQueryData(h.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),f=>f&&{...f,version:r.draft}),a}function Ve(e,t,n){ee(e),e.setQueryData(h.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function ko(e,t){const n=e.getMutationCache().findAll({mutationKey:fe(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>yn(o.state.variables)))}function De(e,t){e.resetQueries({queryKey:h.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function le(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof D);throw t.source==="local"&&s?(De(e,n),new xt(r)):(t.source==="local"&&Pe(r)&&De(e,n),r)}}const se=new Map;function Qt(e,t,n,o){const r=se.get(o);if(r)return r;const s=Bt(e,t,n,o,!0);return se.set(o,s),s.finally(()=>se.delete(o))}const me=new Set;function Oo(e,t,n){const o=P.c(8),r=z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const u={orgSlug:s,virtualMcpId:i,branch:a};return uo(d=>{d===n&&(me.has(n)||(me.add(n),To(r,e,u,n).catch(Do).finally(()=>me.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),j.useEffect(l,c)}function Do(){}async function To(e,t,n,o){const r=se.get(o);return r&&await r.catch(()=>{}),Qt(e,t,n,o)}async function Bt(e,t,n,o,r){ee(e);const s=h.decofile(o),i=So(n,t),a=h.contentRevision(o),l=h.contentVersions(o),c=e.getQueryData(s),u=e.getQueryData(l),d=e.getQueryData(i),g=e.getQueryData(a)??void 0,f=t.source==="github"&&!d?lt(e,n.orgSlug,n.virtualMcpId):void 0,v=f?.isV8&&f.schema&&f.version?f:void 0,b=d??v?.schema,w=v?{...g,schemaVersion:v.version}:g,I=r&&c&&u?w?.revision:void 0,T=r&&b?w?.schemaVersion:void 0,x=h.contentChanges(o),_=e.getQueryData(x),[C,E,k]=await le(e,t,n,()=>t.client.batch([{method:"blocks.list",params:I?{ifNoneMatch:I}:{}},{method:"schema.get",params:T?{ifNoneMatch:T}:{}},{method:"changes.list",params:vt(_)}])),N=e.getQueryData(a)?.revision,p=N!==void 0&&N!==w?.revision;if(k?.ok){const X=p?null:Ee(_,k.result);X&&e.setQueryData(x,X)}else k&&t.source==="local"&&Pe(k.error)&&De(e,n);if(!C?.ok)throw C?.error??new Error("no blocks.list");if(!E)throw new Error("no schema.get");const O=C.result,$=Ot(E),y=E.ok&&!$?E.result:null;if(O.notModified&&(!c||!u)||y?.notModified&&!b)return Bt(e,t,n,o,!1);const R=O.notModified?new Set:ko(e,n),A=O.notModified?c:Sn(O.blocks,c,R),U=$?En():y?y.notModified?b:y.schema:E.error;if(e.setQueryData(a,{revision:p?N:O.notModified?w?.revision:O.revision,schemaVersion:y?y.notModified?w?.schemaVersion:y.version??void 0:void 0}),e.setQueryData(s,A),!O.notModified){const X=e.getQueryData(l),V={...O.versions};for(const L of R){const W=X?.[L];W!==void 0?V[L]=W:delete V[L]}e.setQueryData(l,V)}return U instanceof D||e.setQueryData(i,U),!p&&!O.notModified&&c&&w?.revision&&O.revision!==w.revision&&mo({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:U}}async function Tr(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(l=>!s||!Object.hasOwn(s,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`)}return vo({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=await le(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));ee(e);const a=t.source==="github"?Eo(e,n,o,i):i.revision;e.setQueryData(h.contentRevision(o),c=>({...c,revision:a}));const l=i.versions??{};return Ve(e,o,l),{revision:a,versions:l}}})}function Vt(e,t){if(!(e instanceof D))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 Ht(e,t,n){if(!(n instanceof D))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&ce(e,t,r,!1)}function Gt(e,t,n,o){ee(e);const r=o.block===null,s=e.getQueryData(h.contentVersions(t)),i=e.getQueryData(h.contentChanges(t)),a=i?K(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=F(n),u=Object.fromEntries(Object.entries(i.changes).filter(([d])=>F(d)!==c));r?l!==null&&(u[n]={kind:"delete",version:null,baseVersion:l}):u[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(h.contentChanges(t),{...i,changes:u,edited:!0})}ce(e,t,n,r&&l===null),e.setQueryData(h.decofile(t),c=>{const u={...c};return r?delete u[n]:u[n]=o.block,u}),Ve(e,t,{[n]:r?null:o.version})}function Ir(e,t,n,o){if(t.source!=="github"||!(o instanceof D))return!1;Ht(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>Vt(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:h.decofile(n)}),s.forEach((a,l)=>{Gt(e,n,a,i[l])}),!0)}async function Cr(e,t,n,o,r,s){t.source==="github"&&Ht(e,o,s);const i=t.source==="github"?Vt(s,r):void 0;if(i)return e.cancelQueries({queryKey:h.decofile(o)}),Gt(e,o,r,i),!0;await e.invalidateQueries({queryKey:h.decofile(o)});let a;try{const c=(await le(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(h.contentChanges(o),u=>{if(!u)return u;const d={...u.changes};return c?.kind?d[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete d[r],{...u,changes:d,edited:!0}})}catch{const l=await le(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(h.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ve(e,o,{[r]:a.version}),!1}function Io(e){const t=P.c(15),n=z();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=h.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const f=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ue("v8")});if(await _e(f))throw Ce(n,e.orgSlug,e.virtualMcpId),new Ne;if(!f.ok)throw new Error(`draft pointer read failed: ${f.status}`);return await f.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:l,isError:c}=M(i),u=!!e&&l&&!c;if(!e||!a?.draft||!a.version){let f;return t[11]!==u?(f={pointer:null,pending:u},t[11]=u,t[12]=f):f=t[12],f}const d=`${a.draft}@${a.version}`;let g;return t[13]!==d?(g={pointer:d,pending:!1},t[13]=d,t[14]=g):g=t[14],g}function _r(e){return Io(e).pointer}function Nr(e){const t=P.c(4);let n;t[0]!==e?(n=h.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Co,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r?.revision}async function Co(){throw new Error("content revisions are set by reads and writes")}function Te(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Rr(e,t){return Te({...e,protocolSuffix:t.cacheKeySuffix})}function _o(e,t){const n=P.c(6),{url:o}=It(e?.virtualMcpId),r=Tt(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Te({...e,protocolSuffix:r.cacheKeySuffix}):Te({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function xr(e,t){const n=P.c(39),{url:o,undecided:r}=It(e?.virtualMcpId),s=!!o,i=Tt(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,l=_o(e),c=t?.fetchEnabled??!0,u=oo(e?.virtualMcpId),d=dt(e?.virtualMcpId).runtime==="cms",g=z();let f;n[0]!==l?(f=h.decofile(l),n[0]=l,n[1]=f):f=n[1];const v=f;Oo(a,a&&e?e:null,l);let b;n[2]!==e||n[3]!==g||n[4]!==v?(b=()=>{if(!e||g.isMutating({mutationKey:fe(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const p=g.getQueryState(v);return p?.fetchStatus==="fetching"||Date.now()-(p?.dataUpdatedAt??0)<Ct/2},n[2]=e,n[3]=g,n[4]=v,n[5]=b):b=n[5];let w;n[6]!==d||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==g||n[11]!==v?(w=async()=>{if(e){if(!a&&d&&!s){const p=Qn(g,e)?.version;if(p&&!await Bn(e,p))return}await g.refetchQueries({queryKey:v,exact:!0},{cancelRefetch:!1})}},n[6]=d,n[7]=s,n[8]=e,n[9]=a,n[10]=g,n[11]=v,n[12]=w):w=n[12];let I;n[13]!==b||n[14]!==w?(I={skip:b,read:w},n[13]=b,n[14]=w,n[15]=I):I=n[15],zn(!!t?.pollWhile&&!!e,I);let T;n[16]!==i.kind||n[17]!==d||n[18]!==c||n[19]!==l||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==g?(T=async()=>{if(a)return(await Qt(g,a,e,l)).blocks;if(i.kind==="unavailable")throw wo("decofile");if(s){const y=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(xo),R=y?.ok?rt(await y.text()):null;if(R)return R;const A=new Error("decofile unavailable (local tunnel unreachable)");throw A.status=502,A}if(d)return Hn(g,e);const p=()=>no(e,jn(u,".deco/blocks.gen.json"));if(c){const y=await fetch(Kn(e),{cache:"no-store"}).catch(Ro);if(y?.ok){const U=rt(await y.text());if(U)return U}const R=await p();if(R.kind==="data")return R.data;const A=new Error(`Failed to fetch decofile: ${y?.status??"network error"}`);throw A.status=it({liveOk:!!y?.ok,liveStatus:y?.status,committedAbsent:R.kind==="absent"}),A}const O=await p();if(O.kind==="data")return O.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=it({liveOk:!1,committedAbsent:O.kind==="absent"}),$},n[16]=i.kind,n[17]=d,n[18]=c,n[19]=l,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=g,n[26]=T):T=n[26];const x=!!e&&i.kind!=="pending"&&!r,_=a?0:3e4,C=a?.describe.pollIntervalMs,E=a?"always":void 0;let k;n[27]!==d||n[28]!==s||n[29]!==a?(k=(p,O)=>{if(a||d||s)return p<3;const $=O.status;return $!==502&&$!==404&&p<2},n[27]=d,n[28]=s,n[29]=a,n[30]=k):k=n[30];let N;return n[31]!==v||n[32]!==T||n[33]!==x||n[34]!==_||n[35]!==C||n[36]!==E||n[37]!==k?(N={queryKey:v,queryFn:T,enabled:x,staleTime:_,refetchInterval:C,refetchIntervalInBackground:!1,refetchOnWindowFocus:E,retry:k,retryDelay:No},n[31]=v,n[32]=T,n[33]=x,n[34]=_,n[35]=C,n[36]=E,n[37]=k,n[38]=N):N=n[38],M(N)}function No(e){return ln(5e3,1e3,e,2,0)}function Ro(){return null}function xo(){return null}const Po="site-editor-save",Jt={id:Po,description:void 0,action:void 0,cancel:void 0},Pr="site-editor-undo",Ie="site-editor-publish";function $o(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=G.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=G.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=G.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Wt(e,t){return t?G.jsx($o,{label:e("siteEditor.details"),detail:t}):void 0}function $r(e,t,n){q.error($t(e,t,n),{...Jt,description:Wt(e,ro(t,n))})}function Ar(e,t,n=!1){q.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Jt,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Yt={action:void 0,duration:void 0};function Lr(e,t){q.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Yt,id:Ie,description:void 0})}function jr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Wt(e,o??null);q[i](t,{id:Ie,description:n&&a?G.jsxs(G.Fragment,{children:[G.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),q.loading(s??e("thread.publishPopover.publishing"),{...Yt,id:Ie,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Ur(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Dr as $,br as A,po as B,wr as C,_o as D,Nr as E,Un as F,fe as G,vo as H,to as I,Mn as J,Ar as K,Or as L,pr as M,je as N,mr as O,To as P,Fe as Q,Tr as R,er as S,yt as T,Cr as U,$r as V,kr as W,So as X,Fn as Y,fr as Z,yr as _,nr as a,rr as a0,lr as a1,Ke as a2,et as a3,ur as a4,tr as a5,qn as a6,ar as a7,Rr as a8,gn as a9,S as aA,gr as aB,Wt as aa,Ur as ab,Lr as ac,Sr as ad,Jo as ae,Wo as af,Pe as ag,zo as ah,dn as ai,$o as aj,Yo as ak,Qt as al,wo as am,vr as an,no as ao,Qe as ap,Ir as aq,dr as ar,_r as as,jr as at,Ie as au,Yt as av,Pr as aw,Jt as ax,ko as ay,D as az,mn as b,It as c,hn as d,Ko as e,vn as f,Le as g,xe as h,pt as i,hr as j,Xn as k,xr as l,or as m,cr as n,oo as o,Xo as p,jn as q,qo as r,Zo as s,Et as t,Tt as u,ir as v,Er as w,sr as x,Io as y,J as z};
@@ -1 +1 @@
1
- import{b as te,a4 as se,q as ae,r as M,ad as ce,j as t,B as H,n as $,bA as de,a5 as me,aS as ue,aR as pe,aO as ge,aM as fe,aN as he,aQ as xe,aP as je,bl as ke,t as D,aD as ve,c as ie,l as ye,Z as Se,V as be,Y as we,X as Ce,K as q,gn as De}from"./index-BNmzMNlZ.js";import{i as Ne}from"./DotsVertical-qUaZHjqd.js";import{i as le,a as Pe}from"./ZoomOut-B1U_CHeD.js";import{s as Ae}from"./Trash01-cH2tYIUn.js";import{i as Ee}from"./Upload01-Bo60o4T6.js";import{S as Me}from"./search-input-DBKkXR0y.js";import{S as Te}from"./search-toggle-CzYTwp_L.js";import{E as V}from"./empty-state-Cc_qF1X6.js";import{C as Oe}from"./collection-tabs-m2567Q_Z.js";import{p as Ie,S as Re,F as ze}from"./folder-icon-DREaQWIx.js";import{h as Fe,i as $e,r as _e}from"./use-org-fs-BcT14y41.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-JUAl7Zv6.js";import"./icon-button-TQkFyvqB.js";import"./tooltip-DibJz0Jl.js";import"./index-CaH8ekvn.js";import"./badge-DeNt4-FX.js";import"./markdown-P8cO0xLZ.js";import"./use-copy-Dpm_jhm-.js";import"./Copy01-Tog1jA1S.js";import"./use-mobile-nW9hYb6L.js";import"./use-panel-navigate-BrjENNrA.js";import"./thread-route-D01w_vQB.js";import"./use-project-scope-DryffHrf.js";import"./repository-binding-BZ7FmJ0X.js";import"./use-mcp-client-ClU7gdfw.js";import"./auth-CEIITB7d.js";import"./file-preview-DFHvVsCR.js";import"./utils-DeFulDMz.js";import"./Image01-CW7Pcq-W.js";import"./editor-B7sIq_vQ.js";import"./file-type-icon-may_hs3N.js";import"./useInfiniteQuery-DWVaUM2t.js";import"./infiniteQueryObserver-ClGIthQz.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Qe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function He(s,e){const l=new Map;for(const r of s){const c=G(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function Ge(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ue(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ve:Pe}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:T,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const z=I,R=r?"opacity-60":"hover:bg-accent";let u;e[5]!==R?(u=ye("relative transition-colors group overflow-hidden flex flex-col h-full",R),e[5]=R,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=z?"default":"system",N=!z;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(ze,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(Se,{children:[t.jsx(be,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(Ne,{size:16})})}),t.jsx(we,{align:"end",children:t.jsxs(Ce,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ae,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==T||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):T,e[34]=T,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=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:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(De,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function At(){const s=te(),{org:e}=se(),l=Fe(),{remove:r,upload:c}=$e("home"),a=ae(),o=M.useRef(null),[m,S]=M.useState(""),T=ce(),[O,I]=M.useState(L),[z,R]=M.useState(!1),[u,f]=M.useState(null),[b,N]=M.useState(null),[w,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=i=>a.setQueryData(q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const Q=A.split("/")[0]??"",_=n.filter(Qe),X=_.find(E=>G(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const F=qe(Q),W=`skills/${F}`;let Y=!1;R(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:F}));return}Y=!0;const E=Ue(F,await X.text());j(oe=>[E,...oe]),h(E.id),await Ge(He(_,F),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:F}))}catch(E){Y&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(Q=>Q.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},U=t.jsxs(H,{size:"sm",disabled:z,onClick:()=>o.current?.click(),children:[t.jsx(Ee,{size:14}),s(z?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[T?t.jsx($.Actions,{secondary:t.jsx(Te,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:U}):t.jsx($.Title,{actions:U,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!T&&t.jsx(Me,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(Re,{skillPath:u,onClose:()=>f(null)},u),t.jsx(ue,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(pe,{children:[t.jsxs(ge,{children:[t.jsx(fe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(he,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(xe,{children:[t.jsx(je,{children:s("settings.skills.cancel")}),t.jsx(ke,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{At as default};
1
+ import{b as te,a4 as se,q as ae,r as M,ad as ce,j as t,B as H,n as $,bA as de,a5 as me,aS as ue,aR as pe,aO as ge,aM as fe,aN as he,aQ as xe,aP as je,bl as ke,t as D,aD as ve,c as ie,l as ye,Z as Se,V as be,Y as we,X as Ce,K as q,gn as De}from"./index-C4tYnNih.js";import{i as Ne}from"./DotsVertical-D9231JAc.js";import{i as le,a as Pe}from"./ZoomOut-CnbxUNSo.js";import{s as Ae}from"./Trash01-C9E8l_mI.js";import{i as Ee}from"./Upload01-mlw10ZK-.js";import{S as Me}from"./search-input-CM9T7koR.js";import{S as Te}from"./search-toggle-BA_oiAdj.js";import{E as V}from"./empty-state-D86P1Giw.js";import{C as Oe}from"./collection-tabs-x8ccQUAC.js";import{p as Ie,S as Re,F as ze}from"./folder-icon-C25vLo5g.js";import{h as Fe,i as $e,r as _e}from"./use-org-fs-Dt6mQNyr.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-5lGv5a5H.js";import"./icon-button-5JlhYc9R.js";import"./tooltip-B1eS9Khq.js";import"./index-B0Hb2bUK.js";import"./badge-Ckz5LqgP.js";import"./markdown-C-J5-sTt.js";import"./use-copy-C9NYM8DB.js";import"./Copy01-B9x501ud.js";import"./use-mobile-BADuLdb7.js";import"./use-panel-navigate-DZO4-0o6.js";import"./thread-route-_-Jo9yAq.js";import"./use-project-scope-CKNjz3VB.js";import"./repository-binding-C7GXruB1.js";import"./use-mcp-client-BkBWhGyj.js";import"./auth-Dqt9menC.js";import"./file-preview-CX5xfaHR.js";import"./utils-wTX1Gyo-.js";import"./Image01-ClayPF_a.js";import"./editor-BTovmEAS.js";import"./file-type-icon-tAeiI9_2.js";import"./useInfiniteQuery-CtWUiDbh.js";import"./infiniteQueryObserver-CyNcT3qz.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Qe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function He(s,e){const l=new Map;for(const r of s){const c=G(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function Ge(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ue(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ve:Pe}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:T,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const z=I,R=r?"opacity-60":"hover:bg-accent";let u;e[5]!==R?(u=ye("relative transition-colors group overflow-hidden flex flex-col h-full",R),e[5]=R,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=z?"default":"system",N=!z;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(ze,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(Se,{children:[t.jsx(be,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(Ne,{size:16})})}),t.jsx(we,{align:"end",children:t.jsxs(Ce,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ae,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==T||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):T,e[34]=T,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=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:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(De,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function At(){const s=te(),{org:e}=se(),l=Fe(),{remove:r,upload:c}=$e("home"),a=ae(),o=M.useRef(null),[m,S]=M.useState(""),T=ce(),[O,I]=M.useState(L),[z,R]=M.useState(!1),[u,f]=M.useState(null),[b,N]=M.useState(null),[w,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=i=>a.setQueryData(q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const Q=A.split("/")[0]??"",_=n.filter(Qe),X=_.find(E=>G(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const F=qe(Q),W=`skills/${F}`;let Y=!1;R(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:F}));return}Y=!0;const E=Ue(F,await X.text());j(oe=>[E,...oe]),h(E.id),await Ge(He(_,F),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:F}))}catch(E){Y&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(Q=>Q.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},U=t.jsxs(H,{size:"sm",disabled:z,onClick:()=>o.current?.click(),children:[t.jsx(Ee,{size:14}),s(z?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[T?t.jsx($.Actions,{secondary:t.jsx(Te,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:U}):t.jsx($.Title,{actions:U,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!T&&t.jsx(Me,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(Re,{skillPath:u,onClose:()=>f(null)},u),t.jsx(ue,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(pe,{children:[t.jsxs(ge,{children:[t.jsx(fe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(he,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(xe,{children:[t.jsx(je,{children:s("settings.skills.cancel")}),t.jsx(ke,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{At as default};
@@ -1 +1 @@
1
- import{c as _,l as N,j}from"./index-BNmzMNlZ.js";import{T as k,R as z,a as D,b as S}from"./index-C6_m0mjP.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 _,l as N,j}from"./index-C4tYnNih.js";import{T as k,R as z,a as D,b as S}from"./index-B8bCJ3Gm.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,fd as K}from"./index-BNmzMNlZ.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-BYOMVmVh.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,fd as K}from"./index-C4tYnNih.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-B2cbbV3O.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,hd as k,fT as E,fU as y,fV as a,hL as D,B as m,I as d,aS as z,aR as T,aO as O,aM as R,aQ as F,aP as M,bl as U,C,t as c,c as q}from"./index-BNmzMNlZ.js";import{D as $}from"./domain-settings-Cj-cRa8T.js";import{S as H}from"./switch-nUFQi60k.js";import{a as Q,b as V,c as G,d as J}from"./use-org-sso-DdzTjSOo.js";import{s as K}from"./Trash01-cH2tYIUn.js";import{R as W}from"./require-capability-Bm5pde_M.js";import"./badge-DeNt4-FX.js";import"./select-CTAm_W2d.js";import"./index-BdQq_4o_.js";import"./index-CaH8ekvn.js";import"./ChevronUp-4EkxqYyz.js";import"./access-gate-CGDwkzkf.js";import"./capability-load-error-juzFeQ-_.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:P}=Q(o.id,o.slug),f=V(o.id,o.slug),S=G(o.id,o.slug),b=J(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[g,p]=v.useState(!1),[I,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 b.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($,{}),P?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!g&&e.jsx(E,{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(H,{checked:n.enforced,onCheckedChange:N,disabled:b.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(K,{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||g)&&e.jsx(E,{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(d,{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(d,{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:g&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(d,{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(d,{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(d,{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(d,{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:[g&&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(g?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:I,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(U,{onClick:L,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function ge(){const s=q.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{ge as default};
1
+ import{b as A,a4 as B,r as v,j as e,n as x,hd as k,fT as E,fU as y,fV as a,hL as D,B as m,I as d,aS as z,aR as T,aO as O,aM as R,aQ as F,aP as M,bl as U,C,t as c,c as q}from"./index-C4tYnNih.js";import{D as $}from"./domain-settings-Cu3Pj63v.js";import{S as H}from"./switch-B3v6apDN.js";import{a as Q,b as V,c as G,d as J}from"./use-org-sso-CWvWEDQk.js";import{s as K}from"./Trash01-C9E8l_mI.js";import{R as W}from"./require-capability-DSeRbn1u.js";import"./badge-Ckz5LqgP.js";import"./select-BZ2tKCpr.js";import"./index-BdQq_4o_.js";import"./index-B0Hb2bUK.js";import"./ChevronUp-RlBkcpdd.js";import"./access-gate-BNOWXoYR.js";import"./capability-load-error-CRB9otZt.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:P}=Q(o.id,o.slug),f=V(o.id,o.slug),S=G(o.id,o.slug),b=J(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[g,p]=v.useState(!1),[I,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 b.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($,{}),P?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!g&&e.jsx(E,{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(H,{checked:n.enforced,onCheckedChange:N,disabled:b.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(K,{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||g)&&e.jsx(E,{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(d,{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(d,{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:g&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(d,{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(d,{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(d,{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(d,{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:[g&&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(g?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:I,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(U,{onClick:L,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function ge(){const s=q.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{ge as default};