decocms 3.83.4 → 3.83.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/client/assets/{AlertCircle-DImAh5xx.js → AlertCircle-C0MMJCns.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CLNttwfX.js → ArrowUpRight-gVE5kRlQ.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DZ5kpKko.js → CheckCircle-B40vdc2l.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-C4bbhLP1.js → ChevronDown-QQWh1U0r.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-f9gCC8R-.js → ChevronLeft-CRDrddT9.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DqTj9CMD.js → ChevronRight-CWp0460U.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CE8xPbXg.js → ChevronUp-B0iQd-AD.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CDhL1XVd.js → DotsVertical-BBNwX5J5.js} +1 -1
  9. package/dist/client/assets/{Eye-CqvLLx1D.js → Eye-bN0xnD-o.js} +1 -1
  10. package/dist/client/assets/{FilterLines-B7Og5mSP.js → FilterLines-DttJL6KD.js} +1 -1
  11. package/dist/client/assets/{Globe01-D-fiRZyN.js → Globe01-DTi3Gxq3.js} +1 -1
  12. package/dist/client/assets/{Globe04-B5OvaFwZ.js → Globe04-n0f96BbD.js} +1 -1
  13. package/dist/client/assets/{HardDrive-D8eAcCyZ.js → HardDrive-D5-uOHw9.js} +1 -1
  14. package/dist/client/assets/{Key01-CN4p3Jpn.js → Key01-DAsg8mdj.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BmSdmc8T.js → LayoutLeft-D2ad_kHx.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-DTyP5pnl.js → LinkExternal01-D6izDWZT.js} +1 -1
  17. package/dist/client/assets/{Monitor01-BCm8_9yi.js → Monitor01-CaUMTT8S.js} +1 -1
  18. package/dist/client/assets/{Palette-C9yLJPGq.js → Palette-ceW3H3uT.js} +1 -1
  19. package/dist/client/assets/{Play-BHmWm_Cq.js → Play-VLn5ww3u.js} +1 -1
  20. package/dist/client/assets/{Plus-DX9vjN_e.js → Plus-BmqFkgYT.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BfuDIY64.js → SearchMd-rJiOFJwK.js} +1 -1
  22. package/dist/client/assets/{Settings02-yVlBTWGE.js → Settings02-DG5mJ_xI.js} +1 -1
  23. package/dist/client/assets/{Shield01-DMxZAMki.js → Shield01-C7ZT-QsW.js} +1 -1
  24. package/dist/client/assets/{Star01-CXg49Qay.js → Star01-DPkaqbS_.js} +1 -1
  25. package/dist/client/assets/{Stars01-DxmQMnMe.js → Stars01-BM2OfAMq.js} +1 -1
  26. package/dist/client/assets/{Stars02-Ca0l5158.js → Stars02-CbFOXGiR.js} +1 -1
  27. package/dist/client/assets/{Sun-Djuca5Zz.js → Sun-D9AuRcRz.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BrwHUlrw.js → SwitchHorizontal01-dm0C0Tjx.js} +1 -1
  29. package/dist/client/assets/{Tool01-Dn8TsjT0.js → Tool01-BXc8J6xZ.js} +1 -1
  30. package/dist/client/assets/{Trash01-BnpofYvX.js → Trash01-D1DmT9Mr.js} +1 -1
  31. package/dist/client/assets/{Upload01-W_HvCxeO.js → Upload01-BpkBrNfw.js} +1 -1
  32. package/dist/client/assets/{User01-7UlK3gvI.js → User01-DhqtO0lv.js} +1 -1
  33. package/dist/client/assets/{Users01-BVS-5f_g.js → Users01-DScwWUp0.js} +1 -1
  34. package/dist/client/assets/{Users03-Bgoxad2r.js → Users03-BhaYLgGW.js} +1 -1
  35. package/dist/client/assets/{X-DqLFKEyW.js → X-Dqpx-r1T.js} +1 -1
  36. package/dist/client/assets/{XCircle-ONuap0eY.js → XCircle-D9qm_1Ut.js} +1 -1
  37. package/dist/client/assets/{XClose-CdVAlar3.js → XClose-BvKJTTlt.js} +1 -1
  38. package/dist/client/assets/{Zap-BjHBtonC.js → Zap-C6SkRgFu.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-B0Gjx95e.js → ZapSquare-CL6VANDT.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-daHLLhI1.js → ZoomOut-wqR_bKeR.js} +1 -1
  41. package/dist/client/assets/{access-gate-DOT0lHlX.js → access-gate-DATyJxs9.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-BqmjLmQc.js → add-section-modal-DFnJjqFv.js} +1 -1
  43. package/dist/client/assets/{agent-icon-D_Vdiy4L.js → agent-icon-BHjJxJmC.js} +1 -1
  44. package/dist/client/assets/{agents-list-D7D7_pRY.js → agents-list-2Gq7Icxm.js} +1 -1
  45. package/dist/client/assets/{ai-providers-BngwzsL_.js → ai-providers-COV0MWUn.js} +1 -1
  46. package/dist/client/assets/{alert-H1WTtdrU.js → alert-BQLAuYif.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-BWgxKtuP.js → alert-dialog-Cz6L6NXK.js} +1 -1
  48. package/dist/client/assets/{app-editor-B_C9AZjG.js → app-editor-6TH-Brv5.js} +1 -1
  49. package/dist/client/assets/{auth-GGtOrpqj.js → auth-C19hiZia.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-D1DeLYzF.js → auth-catchall-Dw6lQ3Pv.js} +1 -1
  51. package/dist/client/assets/{auth-entry-35utbAV0.js → auth-entry-DGjXLiVY.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-rKcYBPWO.js → auth-split-layout-Dmg3NIiT.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DWtyomTf.js → authenticate-and-persist-oauth-B1-SzA6A.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-DVmKFJzZ.js → automation-list-row-BYkbwrNr.js} +1 -1
  55. package/dist/client/assets/{automation-runs-BiY1d-bQ.js → automation-runs-CFBKS4y-.js} +1 -1
  56. package/dist/client/assets/{automations-BSXLUV4u.js → automations-OYmLeyhx.js} +1 -1
  57. package/dist/client/assets/{avatar-0IOP-dk8.js → avatar-Bbvs8iIt.js} +1 -1
  58. package/dist/client/assets/{badge-CHwQMCeI.js → badge-C3IXjCX0.js} +1 -1
  59. package/dist/client/assets/{block-document-C1fUiKaM.js → block-document-C3ZQBAYM.js} +1 -1
  60. package/dist/client/assets/{brand-context-DGzAbThM.js → brand-context-BFvQ7Sbj.js} +1 -1
  61. package/dist/client/assets/{buckets-D7A9Wcuu.js → buckets-D1zQNpYB.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-B37QgztH.js → capability-load-error-DP8VgCQ8.js} +1 -1
  63. package/dist/client/assets/{card-DtfzHq7s.js → card-RkuQTlVn.js} +1 -1
  64. package/dist/client/assets/category-editor-CBWEnxiL.js +1 -0
  65. package/dist/client/assets/{chat-context-b71f8ijF.js → chat-context-D45ePksk.js} +1 -1
  66. package/dist/client/assets/{checkbox-CdDqKBw3.js → checkbox-yMsno3zH.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-bmRR1zbA.js → cli-auth-success-Dd0r_nul.js} +1 -1
  68. package/dist/client/assets/{collection-detail-Cdgp93Au.js → collection-detail-MmIgTfSJ.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-GXGtXzaA.js → collection-display-button-BRBXcU18.js} +1 -1
  70. package/dist/client/assets/{collection-search-tJOk7ccb.js → collection-search-EReXMo3F.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-9571vcR8.js → collection-tabs-C3OblNuX.js} +1 -1
  72. package/dist/client/assets/{command-HsX7KJby.js → command-BsaV9rjm.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-laYAzQ1w.js → commerce-onboarding-BPDYtCVh.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-UF-B_tPh.js → connect-desktop-dialog-DuJwJvdQ.js} +1 -1
  75. package/dist/client/assets/{connection-card-yNaf3-jg.js → connection-card-uZjILvOr.js} +1 -1
  76. package/dist/client/assets/{connection-detail-CMqqr4l-.js → connection-detail-sXXukvA0.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-q9qm1gX9.js → connection-form-helpers-DV9ppnRP.js} +1 -1
  78. package/dist/client/assets/{connections-L313-VVG.js → connections-CUxM11Rz.js} +1 -1
  79. package/dist/client/assets/{context-menu-ChK_59DR.js → context-menu-DmgM_UZR.js} +1 -1
  80. package/dist/client/assets/{decopilot-CnVOFmNc.js → decopilot-CxoZlpZn.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-DtIjJlnZ.js → decopilot-sse-pool-BH11VGHE.js} +1 -1
  82. package/dist/client/assets/{dialog-BHS2ptj9.js → dialog-CHU--T7-.js} +1 -1
  83. package/dist/client/assets/{domain-settings-CLs9pMtT.js → domain-settings-MLZvo-1a.js} +1 -1
  84. package/dist/client/assets/{drawer-D9v4s9v6.js → drawer-D4XkXj4V.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-DaCZ2Y5P.js → dropdown-menu-D2HxaMPU.js} +1 -1
  86. package/dist/client/assets/{empty-state-CthrAqip.js → empty-state-DA37X_xl.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-DFvYpCky.js → extract-connection-data-Ws_H4ap3.js} +1 -1
  88. package/dist/client/assets/{file-explorer-_LJoKffG.js → file-explorer-BfmNHW6W.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-stn5MWg0.js → file-type-icon-CVukPbEL.js} +1 -1
  90. package/dist/client/assets/{files-0_EsijuW.js → files-DcKK79mn.js} +1 -1
  91. package/dist/client/assets/{form-2YHmbPN6.js → form-Bxj0TUqV.js} +1 -1
  92. package/dist/client/assets/{general-Dn6AsXsu.js → general-CYWDm58h.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-BigBhPO3.js → github-repo-picker-nQicPdJf.js} +1 -1
  94. package/dist/client/assets/{hooks-DKMYmfW_.js → hooks-C9iWb2N3.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-RJ6pQKOR.js → import-from-deco-dialog-C6saVWDH.js} +1 -1
  96. package/dist/client/assets/{index-8ANhSNnu.js → index-BFqTOqSJ.js} +1 -1
  97. package/dist/client/assets/{index-CsZmUyDH.js → index-BO0QV1fb.js} +5 -5
  98. package/dist/client/assets/{index-DBRZyXss.js → index-BddhVtBs.js} +1 -1
  99. package/dist/client/assets/{index-DEQy1QF9.js → index-BoDi6OBc.js} +3 -3
  100. package/dist/client/assets/{index-BvBr4oVI.js → index-C1iIfW5c.js} +1 -1
  101. package/dist/client/assets/{index-BaNpSkfS.js → index-C7XT3JN9.js} +1 -1
  102. package/dist/client/assets/{index-CfhbNXKP.js → index-CprKTf1O.js} +1 -1
  103. package/dist/client/assets/{index-DjlwmrL7.js → index-DzHbeUkj.js} +1 -1
  104. package/dist/client/assets/{index-XFREcpwR.js → index-HQC4CGFu.js} +1 -1
  105. package/dist/client/assets/{index-DGuHidOE.js → index-NjN7v_96.js} +1 -1
  106. package/dist/client/assets/{index-BzwQkJpG.js → index-YYxzAkAN.js} +1 -1
  107. package/dist/client/assets/{index-_hCieckH.js → index-akCm1VRq.js} +1 -1
  108. package/dist/client/assets/{index-D85IkMSK.js → index-bmV9L0o4.js} +1 -1
  109. package/dist/client/assets/{index-DqWQnlXx.js → index-ktUKbMYA.js} +1 -1
  110. package/dist/client/assets/{index-redirect-BM3BzQPM.js → index-redirect-DowDbKLD.js} +1 -1
  111. package/dist/client/assets/{input-A0PPw-XD.js → input-DJV4VNka.js} +1 -1
  112. package/dist/client/assets/{integration-icon-CttCAlQh.js → integration-icon-BpZ3OsA4.js} +1 -1
  113. package/dist/client/assets/{label-B5PiQoOe.js → label-7phVZ6ZM.js} +1 -1
  114. package/dist/client/assets/{login-BMe6adUd.js → login-B4rCGJ9Y.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-ByjG93DP.js → mcp-oauth-BGRbdqPD.js} +1 -1
  116. package/dist/client/assets/{members-BWqrKWbw.js → members-C5-ie2FC.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-B9YXKdtw.js → monaco-editor-Cqq2xAH1.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-go1fgNuV.js → monitoring-stats-row-C-saq1Fk.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-xeKd-lmx.js → oauth-callback-7tCvDUJs.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-Dx1uUqYA.js → oauth-callback-ai-provider-k9CmEopW.js} +1 -1
  121. package/dist/client/assets/{onboarding-DQDmxwy8.js → onboarding-D7HThXnZ.js} +1 -1
  122. package/dist/client/assets/{org-install-kZlTO2A7.js → org-install-BBNmxhuK.js} +1 -1
  123. package/dist/client/assets/{org-layout-B3IYTTij.js → org-layout-uMJB-zBX.js} +1 -1
  124. package/dist/client/assets/{organization-choice-5oa32Yz_.js → organization-choice-3XngO70I.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-c9ni0Iqb.js → page-seo-form-Bp1CNfZX.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-DAfXAXRM.js +1 -0
  127. package/dist/client/assets/{popover-iXf752Ba.js → popover-Bo_sL62z.js} +1 -1
  128. package/dist/client/assets/{post-editor-DUslv19b.js → post-editor-Dh7W93cU.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-ML2U3uqb.js → preview-dialog-B9gUDoJJ.js} +3 -3
  130. package/dist/client/assets/{primitives-BUItslvg.js → primitives-Ch1GQ4pf.js} +1 -1
  131. package/dist/client/assets/{profile-B3oy65ld.js → profile-2A5eHa2X.js} +1 -1
  132. package/dist/client/assets/project-app-view-C3Xp90Nk.js +1 -0
  133. package/dist/client/assets/record-editor-Bmb0mb5Z.js +1 -0
  134. package/dist/client/assets/registry-C0CXy020.js +2 -0
  135. package/dist/client/assets/{registry-layout-Cl6u3zpc.js → registry-layout-BYi_5V3p.js} +1 -1
  136. package/dist/client/assets/{require-capability-BKgT-boo.js → require-capability-Bnt0ZBRa.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-BuHVBqYX.js → required-auth-layout-BolsfPYi.js} +1 -1
  138. package/dist/client/assets/{reset-password-BPGkImgK.js → reset-password-CpukUOwJ.js} +1 -1
  139. package/dist/client/assets/{roles-bPnq1TJI.js → roles-PAp6Oo_Q.js} +1 -1
  140. package/dist/client/assets/{save-status-8ZjmQm9b.js → save-status-HMD0mFgw.js} +1 -1
  141. package/dist/client/assets/{scroll-area-DEdbIcur.js → scroll-area-B1cpZQna.js} +1 -1
  142. package/dist/client/assets/{search-input-DVVX8had.js → search-input-H6T5GrKJ.js} +1 -1
  143. package/dist/client/assets/{secrets-Cf4CHWBN.js → secrets-BGVscZvv.js} +1 -1
  144. package/dist/client/assets/{sections-editor-ooW6BZHt.js → sections-editor-DQxu6nDY.js} +1 -1
  145. package/dist/client/assets/{select-Bgy43JNh.js → select-DlsRm0pM.js} +1 -1
  146. package/dist/client/assets/{select-model-BUsHC84U.js → select-model-jVluH6Ea.js} +1 -1
  147. package/dist/client/assets/{seo-editor-D9CTMLvs.js → seo-editor-DAvYGMob.js} +1 -1
  148. package/dist/client/assets/{settings-layout-BR1aQK-n.js → settings-layout-D1AOhck8.js} +1 -1
  149. package/dist/client/assets/{settings-section-ZkI0flok.js → settings-section-CAKwpEKX.js} +1 -1
  150. package/dist/client/assets/{sheet-BEjNQdHx.js → sheet-BDdFViUD.js} +1 -1
  151. package/dist/client/assets/{shell-controls-B8RPTMT4.js → shell-controls-CiuZpo9F.js} +1 -1
  152. package/dist/client/assets/{shell-layout-DM81wLO_.js → shell-layout-BFU4WLoP.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-Og9D167G.js → shell-route-loading-P7c6nIb-.js} +1 -1
  154. package/dist/client/assets/{sidebar-XUbgVLh0.js → sidebar-DoXfrWOj.js} +1 -1
  155. package/dist/client/assets/{skeleton-BbcdUjup.js → skeleton-DpU2T6Js.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-BiL2pp-a.js → sortable.esm-JwRAHi44.js} +1 -1
  157. package/dist/client/assets/{sso-C0b2EsW3.js → sso-BV0gs8-C.js} +1 -1
  158. package/dist/client/assets/{store-DdiQ1n0M.js → store-B7yfmn2A.js} +1 -1
  159. package/dist/client/assets/store-registry-PU_3Djb3.js +2 -0
  160. package/dist/client/assets/{studio-tools-x1ZC7d2e.js → studio-tools-Lqif47iD.js} +1 -1
  161. package/dist/client/assets/{switch-Blv3b1bg.js → switch-CzdCn_lr.js} +1 -1
  162. package/dist/client/assets/{table-Go72ywso.js → table-CLXzS61A.js} +1 -1
  163. package/dist/client/assets/{tabs-Dv1zkwLM.js → tabs-DoKlXPZO.js} +1 -1
  164. package/dist/client/assets/{task-status-LO5yhQ-O.js → task-status-DPcnbZIP.js} +1 -1
  165. package/dist/client/assets/{textarea-DPEBOr90.js → textarea-BjequYD7.js} +1 -1
  166. package/dist/client/assets/{toggle-group-DcVxtclJ.js → toggle-group-DCz7F7cJ.js} +1 -1
  167. package/dist/client/assets/{toolbar-BPixQtYQ.js → toolbar-DMerIIuJ.js} +1 -1
  168. package/dist/client/assets/{tooltip-BL0mePCu.js → tooltip-qf4kMmAF.js} +1 -1
  169. package/dist/client/assets/{types-BwxhOKtO.js → types-BV8aIt26.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BDxDex3s.js → use-ai-providers-DuFfPCpZ.js} +1 -1
  171. package/dist/client/assets/{use-automations-B7NuCrVE.js → use-automations-CauJKNE9.js} +1 -1
  172. package/dist/client/assets/{use-capability-zpQR1fHL.js → use-capability-DLjX445R.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-B3Fjfv6y.js → use-clock-tick-aakwXYCP.js} +1 -1
  174. package/dist/client/assets/{use-collections-DWEsKi5E.js → use-collections-D4X4_zKE.js} +1 -1
  175. package/dist/client/assets/{use-connection-BnlHTQYf.js → use-connection-CyHDjrsh.js} +1 -1
  176. package/dist/client/assets/{use-copy-BL-vn6lS.js → use-copy-V0KcMVib.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-C7QdDzUX.js → use-create-virtual-mcp-CEKhGxvf.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-B5_gmWws.js → use-debounced-autosave-C-eVH4yR.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-Clvrlbbx.js → use-delete-connection-CV3l3-SB.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-yrHFSV1E.js → use-file-configs-BG_rDJRo.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-DO2LKcjb.js → use-infinite-scroll-4IJEWhiu.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-CbVz8jLw.js → use-join-requests-Cab0xxnE.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-D0QIY1G5.js → use-mcp-client-DuJQA2rV.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-CSTqxsI2.js → use-mcp-prompts-CmUaiuB7.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-pEWZCPwb.js → use-mcp-tools-D715CcxL.js} +1 -1
  186. package/dist/client/assets/{use-members-C-glWs3e.js → use-members-DIDnJkLY.js} +1 -1
  187. package/dist/client/assets/{use-navigate-to-agent-BWkZSw4H.js → use-navigate-to-agent-BNMv1Neu.js} +1 -1
  188. package/dist/client/assets/{use-org-auth-client-CGl19dLl.js → use-org-auth-client-DtHGY2-t.js} +1 -1
  189. package/dist/client/assets/{use-org-sso-DZuC4bDu.js → use-org-sso-BzsvKCfF.js} +1 -1
  190. package/dist/client/assets/{use-organization-roles-UJmQ-Dr8.js → use-organization-roles-BiPQEnrH.js} +1 -1
  191. package/dist/client/assets/{use-organization-settings-QLyvShp_.js → use-organization-settings-nc8QZXyP.js} +1 -1
  192. package/dist/client/assets/{use-registry-connections-1TEskNFX.js → use-registry-connections-CJhKWnft.js} +1 -1
  193. package/dist/client/assets/{use-secrets-CJD7qwqO.js → use-secrets-CxFfyxif.js} +1 -1
  194. package/dist/client/assets/{use-status-sounds-0ebRKUpL.js → use-status-sounds-DaofAwGt.js} +1 -1
  195. package/dist/client/assets/{use-view-mode-cPGu1Tz-.js → use-view-mode-m8F-CboW.js} +1 -1
  196. package/dist/client/assets/{use-virtual-mcp-DnSX_CfH.js → use-virtual-mcp-BdsGMQZL.js} +1 -1
  197. package/dist/client/assets/useInfiniteQuery-CkJOjicq.js +1 -0
  198. package/dist/client/assets/useSuspenseInfiniteQuery-n6ZCdGbO.js +1 -0
  199. package/dist/client/assets/variant-calendar-YykiGxU4.js +1 -0
  200. package/dist/client/assets/{view-mode-toggle-BhMi663K.js → view-mode-toggle-C9q5ISiT.js} +1 -1
  201. package/dist/client/index.html +1 -1
  202. package/dist/server/cli.js +334 -334
  203. package/dist/server/server.js +228 -228
  204. package/package.json +1 -1
  205. package/dist/client/assets/category-editor-BPAwsbjb.js +0 -1
  206. package/dist/client/assets/page-seo-sheet-BvhjK1Ju.js +0 -1
  207. package/dist/client/assets/project-app-view-BUpWAb3M.js +0 -1
  208. package/dist/client/assets/record-editor-DK045WpE.js +0 -1
  209. package/dist/client/assets/registry-Qgwwmgd5.js +0 -2
  210. package/dist/client/assets/store-registry-CA1sd5H5.js +0 -2
  211. package/dist/client/assets/useInfiniteQuery-DWPf0AR5.js +0 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-DuwVVj2V.js +0 -1
  213. package/dist/client/assets/variant-calendar-oUUW4T2n.js +0 -1
@@ -1 +1 @@
1
- import{c as p,j as t,E as P,r as j,af as w,B as S,t as y}from"./index-DEQy1QF9.js";import{i as k}from"./AlertCircle-DImAh5xx.js";import{s as z}from"./Plus-DX9vjN_e.js";import{s as E}from"./User01-7UlK3gvI.js";import{t as F}from"./Users01-BVS-5f_g.js";import{d as $,c as I,D as O,a as A,b as R,e as T}from"./dialog-BHS2ptj9.js";import{I as N}from"./input-A0PPw-XD.js";import{L as g}from"./label-B5PiQoOe.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-Bgy43JNh.js";import{S as H}from"./skeleton-BbcdUjup.js";import{T as K}from"./textarea-DPEBOr90.js";import{P as b}from"./index-8ANhSNnu.js";import{c as W}from"./settings-section-ZkI0flok.js";import{u as Y,a as G}from"./use-secrets-CJD7qwqO.js";import{R as J}from"./require-capability-BKgT-boo.js";import"./X-DqLFKEyW.js";import"./tooltip-BL0mePCu.js";import"./ChevronUp-CE8xPbXg.js";import"./ChevronDown-C4bbhLP1.js";import"./sidebar-XUbgVLh0.js";import"./LayoutLeft-BmSdmc8T.js";import"./sheet-BEjNQdHx.js";import"./card-DtfzHq7s.js";import"./ArrowUpRight-CLNttwfX.js";import"./studio-tools-x1ZC7d2e.js";import"./use-capability-zpQR1fHL.js";import"./access-gate-DOT0lHlX.js";import"./capability-load-error-B37QgztH.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function $e(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{$e as default};
1
+ import{c as p,j as t,E as P,r as j,af as w,B as S,t as y}from"./index-BoDi6OBc.js";import{i as k}from"./AlertCircle-C0MMJCns.js";import{s as z}from"./Plus-BmqFkgYT.js";import{s as E}from"./User01-DhqtO0lv.js";import{t as F}from"./Users01-DScwWUp0.js";import{d as $,c as I,D as O,a as A,b as R,e as T}from"./dialog-CHU--T7-.js";import{I as N}from"./input-DJV4VNka.js";import{L as g}from"./label-7phVZ6ZM.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-DlsRm0pM.js";import{S as H}from"./skeleton-DpU2T6Js.js";import{T as K}from"./textarea-BjequYD7.js";import{P as b}from"./index-BFqTOqSJ.js";import{c as W}from"./settings-section-CAKwpEKX.js";import{u as Y,a as G}from"./use-secrets-CxFfyxif.js";import{R as J}from"./require-capability-Bnt0ZBRa.js";import"./X-Dqpx-r1T.js";import"./tooltip-qf4kMmAF.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronDown-QQWh1U0r.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./sheet-BDdFViUD.js";import"./card-RkuQTlVn.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./studio-tools-Lqif47iD.js";import"./use-capability-DLjX445R.js";import"./access-gate-DATyJxs9.js";import"./capability-load-error-DP8VgCQ8.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function $e(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{$e as default};
@@ -1,2 +1,2 @@
1
- import{c as ze,r as w,l as Ce,j as n,B as Ue,i as Dn,m as Ys,t as fe,K as Js}from"./index-DEQy1QF9.js";import{r as Qs,a as Xs,s as Zs,i as Tn,c as Gs,b as ea,G as ta,V as na,d as sa,e as jt,f as aa,g as ra,h as oa,j as ia,k as la,l as ca,m as ua,n as da,o as ma,p as xt,q as bt,t as fa,v as et,w as Lt,x as pa,y as Xe,z as gn,S as ha,M as vn,A as tt,B as Sn,C as ga,D as xn,P as va,E as Bt,F as Sa,H as xa,I as ba,J as ya,K as ja,L as _a,N as ka,O as dt,Q as wa,R as Na,T as Ra,U as Ca,W as Da,X as Ta,Y as Pa,Z as Va,_ as bn,$ as Ft,a0 as Aa,a1 as Ma,a2 as zt,a3 as Ea,a4 as yn,a5 as $a,a6 as Ka,a7 as Oa,a8 as It,a9 as La,aa as Ba,ab as Pn,ac as jn}from"./index-CsZmUyDH.js";import{t as Fa}from"./ChevronDown-C4bbhLP1.js";import{n as za}from"./ChevronLeft-f9gCC8R-.js";import{i as Vn}from"./ChevronRight-DqTj9CMD.js";import{n as Ia}from"./ChevronUp-CE8xPbXg.js";import{K as Ut,D as An,W as Mn,l as Ha,L as Ua,M as Wa}from"./agent-icon-D_Vdiy4L.js";import{i as qa}from"./Globe01-D-fiRZyN.js";import{S as yt}from"./scroll-area-DEdbIcur.js";import{b as st,T as at,a as rt}from"./tooltip-BL0mePCu.js";import{a as Ya,D as Ja,b as Qa,e as Xa,c as Za,d as Ga}from"./dialog-BHS2ptj9.js";import{I as er}from"./input-A0PPw-XD.js";import{s as tr,a as nr}from"./Eye-CqvLLx1D.js";import{c as sr}from"./ZoomOut-daHLLhI1.js";import{b as ar}from"./Settings02-yVlBTWGE.js";import{s as Wt}from"./Plus-DX9vjN_e.js";import{s as En}from"./Trash01-BnpofYvX.js";import{i as rr}from"./Zap-BjHBtonC.js";import{c as nt,a as $n,D as Kn,b as On,g as or}from"./dropdown-menu-DaCZ2Y5P.js";import{b as Ln,c as _t,K as Bn,P as Fn,e as zn,C as In,s as Hn,l as mt,D as Un,d as Wn,S as qn,v as ir,k as Yn,p as lr}from"./sortable.esm-BiL2pp-a.js";import{r as _n,u as cr,d as ur,a as dr,i as mr,f as fr,P as pr,b as hr,S as gr}from"./page-seo-form-c9ni0Iqb.js";import{b as vr}from"./Tool01-Dn8TsjT0.js";import{A as Sr}from"./add-section-modal-BqmjLmQc.js";import"./index-BzwQkJpG.js";import"./chat-context-b71f8ijF.js";import"./hooks-DKMYmfW_.js";import"./use-mcp-client-D0QIY1G5.js";import"./auth-GGtOrpqj.js";import"./decopilot-sse-pool-DtIjJlnZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DnSX_CfH.js";import"./use-collections-DWEsKi5E.js";import"./use-ai-providers-BDxDex3s.js";import"./studio-tools-x1ZC7d2e.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-QLyvShp_.js";import"./drawer-D9v4s9v6.js";import"./collection-search-tJOk7ccb.js";import"./SearchMd-BfuDIY64.js";import"./use-mcp-prompts-CSTqxsI2.js";import"./X-DqLFKEyW.js";import"./shell-layout-DM81wLO_.js";import"./avatar-0IOP-dk8.js";import"./User01-7UlK3gvI.js";import"./Users03-Bgoxad2r.js";import"./Stars02-Ca0l5158.js";import"./XClose-CdVAlar3.js";import"./CheckCircle-DZ5kpKko.js";import"./FilterLines-B7Og5mSP.js";import"./required-auth-layout-BuHVBqYX.js";import"./use-org-sso-DZuC4bDu.js";import"./SwitchHorizontal01-BrwHUlrw.js";import"./ZapSquare-B0Gjx95e.js";import"./Star01-CXg49Qay.js";import"./Upload01-W_HvCxeO.js";import"./AlertCircle-DImAh5xx.js";import"./form-2YHmbPN6.js";import"./label-B5PiQoOe.js";import"./select-Bgy43JNh.js";import"./XCircle-ONuap0eY.js";import"./tabs-Dv1zkwLM.js";import"./toggle-group-DcVxtclJ.js";import"./Monitor01-BCm8_9yi.js";import"./connect-desktop-dialog-UF-B_tPh.js";import"./decopilot-CnVOFmNc.js";import"./checkbox-CdDqKBw3.js";import"./skeleton-BbcdUjup.js";import"./Key01-CN4p3Jpn.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ZkI0flok.js";import"./card-DtfzHq7s.js";import"./ArrowUpRight-CLNttwfX.js";import"./Stars01-DxmQMnMe.js";import"./popover-iXf752Ba.js";import"./command-HsX7KJby.js";import"./index-DGuHidOE.js";import"./useInfiniteQuery-DWPf0AR5.js";import"./use-infinite-scroll-DO2LKcjb.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-CttCAlQh.js";import"./use-status-sounds-0ebRKUpL.js";import"./empty-state-CthrAqip.js";import"./toolbar-BPixQtYQ.js";import"./preview-dialog-ML2U3uqb.js";import"./LinkExternal01-DTyP5pnl.js";import"./index-CfhbNXKP.js";import"./file-type-icon-stn5MWg0.js";import"./LayoutLeft-BmSdmc8T.js";import"./use-connection-BnlHTQYf.js";import"./use-mcp-tools-pEWZCPwb.js";import"./types-BwxhOKtO.js";import"./use-capability-zpQR1fHL.js";import"./textarea-DPEBOr90.js";import"./shell-route-loading-Og9D167G.js";import"./extract-connection-data-DFvYpCky.js";import"./index-D85IkMSK.js";import"./mcp-oauth-ByjG93DP.js";import"./badge-CHwQMCeI.js";import"./connection-slug-eyAPH6o3.js";import"./alert-dialog-BWgxKtuP.js";import"./switch-Blv3b1bg.js";import"./Play-BHmWm_Cq.js";import"./use-debounced-autosave-B5_gmWws.js";import"./index-8ANhSNnu.js";import"./sidebar-XUbgVLh0.js";import"./sheet-BEjNQdHx.js";import"./search-input-DVVX8had.js";import"./collection-tabs-9571vcR8.js";import"./github-repo-picker-BigBhPO3.js";import"./authenticate-and-persist-oauth-DWtyomTf.js";import"./use-navigate-to-agent-BWkZSw4H.js";import"./Users01-BVS-5f_g.js";import"./use-secrets-CJD7qwqO.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-BhMi663K.js";import"./DotsVertical-CDhL1XVd.js";import"./automation-runs-BiY1d-bQ.js";import"./table-Go72ywso.js";import"./use-members-C-glWs3e.js";import"./use-org-auth-client-CGl19dLl.js";import"./task-status-LO5yhQ-O.js";import"./use-automations-B7NuCrVE.js";import"./useSuspenseInfiniteQuery-DuwVVj2V.js";import"./use-file-configs-yrHFSV1E.js";import"./monaco-editor-B9YXKdtw.js";import"./select-model-BUsHC84U.js";import"./automation-list-row-DVmKFJzZ.js";import"./Globe04-B5OvaFwZ.js";import"./HardDrive-D8eAcCyZ.js";import"./Sun-Djuca5Zz.js";import"./Palette-C9yLJPGq.js";import"./Shield01-DMxZAMki.js";import"./use-clock-tick-B3Fjfv6y.js";import"./use-copy-BL-vn6lS.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-yNaf3-jg.js";import"./use-registry-connections-1TEskNFX.js";import"./connection-form-helpers-q9qm1gX9.js";function xr(d){return d.schema?.definitions??d.schema?.$defs??{}}function br(d,e){const r=xr(e),c=r[btoa(d)];if(!c)return;let u=typeof c.image=="string"?c.image:void 0;if(!u&&Array.isArray(c.allOf)){const h=c.allOf.find(v=>typeof v.$ref=="string")?.$ref;if(typeof h=="string"){const v=h.replace("#/definitions/",""),f=r[v];u=typeof f?.image=="string"?f.image:void 0}}if(u?.includes("{{{"))return u}function yr(d,e){if(!e)return;const r=Qs(d);if(!r)return;const c=br(r.resolveType,e);if(!c)return;const u=Xs(c,r.data);if(u)return Zs(u)}const jr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_r="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function kn(d){return Array.from({length:d},(e,r)=>({id:crypto.randomUUID(),index:r}))}function Jn(d){return d.map((e,r)=>({...e,index:r}))}function kr(d,e){if(e===d.length)return d;if(e<d.length)return Jn(d.slice(0,e));const r=Array.from({length:e-d.length},(c,u)=>({id:crypto.randomUUID(),index:d.length+u}));return[...d,...r]}function Qn(d){const e=ze.c(20),{section:r,raw:c,meta:u}=d,h=r.isSavedBlock===!0,v=r.isMultivariate===!0;let f;e[0]!==u||e[1]!==c?(f=c&&u?yr(c,u):void 0,e[0]=u,e[1]=c,e[2]=f):f=e[2];const g=f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(sr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=S):S=e[3];let x;e[4]!==g?(x=g&&n.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=g,e[5]=x):x=e[5];let D;e[6]!==v||e[7]!==h?(D=h?{color:ta}:v?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=v,e[7]=h,e[8]=D):D=e[8];let N;e[9]!==D?(N=n.jsx(Ut,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=N):N=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ce("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let b;return e[16]!==x||e[17]!==N||e[18]!==o?(b=n.jsxs(n.Fragment,{children:[S,x,N,o]}),e[16]=x,e[17]=N,e[18]=o,e[19]=b):b=e[19],b}function Xn(d,e){const r=d.isSavedBlock===!0,c=d.isMultivariate===!0;return Ce("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?jr:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(d){const e=ze.c(64),{section:r,raw:c,meta:u,sortableId:h,selected:v,onSelect:f,onDelete:g,onDuplicate:S,onMakeReusable:x,onToggleHidden:D,onToggleLazy:N,onAddVariant:_,onDetach:k}=d,o=c?Tn(c.__resolveType??""):!1;let b;e[0]!==r?(b=Gs(r),e[0]=r,e[1]=b):b=e[1];const m=b;let U;e[2]!==h?(U={id:h,animateLayoutChanges:Tr},e[2]=h,e[3]=U):U=e[3];const{attributes:J,listeners:L,setNodeRef:l,transform:C,isDragging:le}=zn(U);let T;e[4]!==C?(T=In.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=T):T=e[5];const ue=le?0:void 0;let P;e[6]!==T||e[7]!==ue?(P={transform:T,opacity:ue},e[6]=T,e[7]=ue,e[8]=P):P=e[8];const Z=P;let B;e[9]!==r?(B=ea(r),e[9]=r,e[10]=B):B=e[10];const ae=B,re="button",Se=0;let G;e[11]!==f?(G=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),f())},e[11]=f,e[12]=G):G=e[12];const z=le?"cursor-grabbing":"cursor-pointer";let ee;e[13]!==r||e[14]!==v||e[15]!==z?(ee=Ce("touch-none transition-colors",z,Xn(r,v)),e[13]=r,e[14]=v,e[15]=z,e[16]=ee):ee=e[16];let Q;e[17]!==u||e[18]!==c||e[19]!==r?(Q=n.jsx(Qn,{section:r,raw:c,meta:u}),e[17]=u,e[18]=c,e[19]=r,e[20]=Q):Q=e[20];const A=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ce("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),N()},onPointerDown:Dr,children:n.jsx(rr,{className:Ce("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(rt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let oe;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(oe=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ce("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),D()},onPointerDown:Cr,children:r.isHidden?n.jsx(ar,{className:"h-3.5 w-3.5"}):n.jsx(tr,{className:"h-3.5 w-3.5"})})}),n.jsx(rt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=oe):oe=e[24];let q;e[25]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx($n,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Rr,onPointerDown:Nr,children:n.jsx(An,{className:"h-3.5 w-3.5"})})}),e[25]=q):q=e[25];let X;e[26]!==S?(X=$=>{$.stopPropagation(),S()},e[26]=S,e[27]=X):X=e[27];let te;e[28]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(nr,{className:"h-4 w-4"}),e[28]=te):te=e[28];let F;e[29]!==X?(F=n.jsxs(nt,{onClick:X,children:[te,"Duplicate"]}),e[29]=X,e[30]=F):F=e[30];let M;e[31]!==m||e[32]!==_?(M=m&&n.jsxs(nt,{className:na,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(Mn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=m,e[32]=_,e[33]=M):M=e[33];let E;e[34]!==ae||e[35]!==x?(E=ae&&n.jsxs(nt,{className:_r,onClick:$=>{$.stopPropagation(),x()},children:[n.jsx(Ut,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=ae,e[35]=x,e[36]=E):E=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(nt,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(Ut,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let pe;e[41]!==g?(pe=$=>{$.stopPropagation(),g()},e[41]=g,e[42]=pe):pe=e[42];let he;e[43]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(En,{className:"h-4 w-4"}),e[43]=he):he=e[43];let de;e[44]!==pe?(de=n.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:pe,children:[he,"Delete"]}),e[44]=pe,e[45]=de):de=e[45];let ie;e[46]!==F||e[47]!==M||e[48]!==E||e[49]!==ne||e[50]!==de?(ie=n.jsxs(Kn,{children:[q,n.jsxs(On,{align:"end",className:"w-44",children:[F,M,E,ne,de]})]}),e[46]=F,e[47]=M,e[48]=E,e[49]=ne,e[50]=de,e[51]=ie):ie=e[51];let I;return e[52]!==J||e[53]!==L||e[54]!==f||e[55]!==l||e[56]!==Z||e[57]!==ee||e[58]!==Q||e[59]!==A||e[60]!==oe||e[61]!==ie||e[62]!==G?(I=n.jsxs("div",{ref:l,style:Z,...J,...L,role:re,tabIndex:Se,onClick:f,onKeyDown:G,className:ee,children:[Q,A,oe,ie]}),e[52]=J,e[53]=L,e[54]=f,e[55]=l,e[56]=Z,e[57]=ee,e[58]=Q,e[59]=A,e[60]=oe,e[61]=ie,e[62]=G,e[63]=I):I=e[63],I}function Nr(d){return d.stopPropagation()}function Rr(d){return d.stopPropagation()}function Cr(d){return d.stopPropagation()}function Dr(d){return d.stopPropagation()}function Tr(){return!1}function Pr(d){const e=ze.c(90),{listKey:r,rawSections:c,sections:u,meta:h,selectedIndex:v,onSelect:f,onReorder:g,onDelete:S,onDuplicate:x,onMakeReusable:D,onToggleHidden:N,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:b,canAddSection:m}=d,U=m===void 0?!0:m;let J;e[0]!==u.length?(J=()=>kn(u.length),e[0]=u.length,e[1]=J):J=e[1];const[L,l]=w.useState(J),[C,le]=w.useState(null),[T,ue]=w.useState(r),[P,Z]=w.useState(u.length),B=w.useRef(!1);T!==r?(ue(r),Z(u.length),l(kn(u.length))):P!==u.length&&(Z(u.length),l(V=>kr(V,u.length)));let ae;e[2]===Symbol.for("react.memo_cache_sentinel")?(ae={activationConstraint:{distance:8}},e[2]=ae):ae=e[2];let re;e[3]===Symbol.for("react.memo_cache_sentinel")?(re={coordinateGetter:Hn},e[3]=re):re=e[3];const Se=Ln(_t(Fn,ae),_t(Bn,re));let G;e[4]!==L?(G=L.map(Vr),e[4]=L,e[5]=G):G=e[5];const z=G;let ee;e[6]===Symbol.for("react.memo_cache_sentinel")?(ee=V=>{le(String(V.active.id))},e[6]=ee):ee=e[6];const Q=ee;let A;e[7]!==z||e[8]!==g?(A=V=>{le(null);const{active:K,over:W}=V;if(!W||K.id===W.id)return;const Be=z.indexOf(String(K.id)),Ie=z.indexOf(String(W.id));Be===-1||Ie===-1||(l(We=>Jn(mt([...We],Be,Ie))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),g?.(Be,Ie))},e[7]=z,e[8]=g,e[9]=A):A=e[9];const oe=A;let q;e[10]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{le(null)},e[10]=q):q=e[10];const X=q;let te,F,M,E,ne,pe,he,de,ie,I,$,De,ke,Ee,we;if(e[11]!==C||e[12]!==U||e[13]!==L||e[14]!==z||e[15]!==oe||e[16]!==h||e[17]!==b||e[18]!==k||e[19]!==S||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==N||e[25]!==_||e[26]!==c||e[27]!==u||e[28]!==v||e[29]!==Se){Ee=Symbol.for("react.early_return_sentinel");e:{const V=K=>{B.current||f(K)};if(e[45]!==C||e[46]!==U||e[47]!==L||e[48]!==b||e[49]!==c||e[50]!==u){const K=C?L.find(W=>W.id===C):null;if(E=K!=null?u[K.index]:null,M=K!=null?c[K.index]:void 0,L.length===0){let W;e[54]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=W):W=e[54];const Be=!U;let Ie;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(Wt,{size:14}),e[55]=Ie):Ie=e[55];let We;e[56]!==b||e[57]!==Be?(We=n.jsxs("div",{className:"space-y-2",children:[W,n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:b,children:[Ie,"Add section"]})]}),e[56]=b,e[57]=Be,e[58]=We):We=e[58],Ee=We;break e}ke=Ce(K&&"cursor-grabbing"),e[45]=C,e[46]=U,e[47]=L,e[48]=b,e[49]=c,e[50]=u,e[51]=M,e[52]=E,e[53]=ke}else M=e[51],E=e[52],ke=e[53];F=Un,de=Se,ie=Wn,I=Q,$=oe,De=X,te=qn,pe=z,he=ir,we="space-y-1",ne=L.map(K=>{const W=u[K.index];return W?n.jsx(wr,{sortableId:K.id,section:W,raw:c[K.index],meta:h,selected:v===K.index,onSelect:()=>V(K.index),onDelete:()=>S(K.index),onDuplicate:()=>x(K.index),onMakeReusable:()=>D(K.index),onToggleHidden:()=>N(K.index),onToggleLazy:()=>_(K.index),onAddVariant:()=>k(K.index),onDetach:()=>o(K.index)},K.id):null})}e[11]=C,e[12]=U,e[13]=L,e[14]=z,e[15]=oe,e[16]=h,e[17]=b,e[18]=k,e[19]=S,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=N,e[25]=_,e[26]=c,e[27]=u,e[28]=v,e[29]=Se,e[30]=te,e[31]=F,e[32]=M,e[33]=E,e[34]=ne,e[35]=pe,e[36]=he,e[37]=de,e[38]=ie,e[39]=I,e[40]=$,e[41]=De,e[42]=ke,e[43]=Ee,e[44]=we}else te=e[30],F=e[31],M=e[32],E=e[33],ne=e[34],pe=e[35],he=e[36],de=e[37],ie=e[38],I=e[39],$=e[40],De=e[41],ke=e[42],Ee=e[43],we=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Te;e[59]!==ne||e[60]!==we?(Te=n.jsx("div",{className:we,children:ne}),e[59]=ne,e[60]=we,e[61]=Te):Te=e[61];let $e;e[62]!==te||e[63]!==pe||e[64]!==he||e[65]!==Te?($e=n.jsx(te,{items:pe,strategy:he,children:Te}),e[62]=te,e[63]=pe,e[64]=he,e[65]=Te,e[66]=$e):$e=e[66];let Ke;e[67]!==M||e[68]!==E||e[69]!==h?(Ke=E?n.jsx("div",{className:Ce("cursor-grabbing shadow-lg ring-1 ring-border/60",Xn(E,!1)),children:n.jsx(Qn,{section:E,raw:M,meta:h})}):null,e[67]=M,e[68]=E,e[69]=h,e[70]=Ke):Ke=e[70];let xe;e[71]!==Ke?(xe=n.jsx(Yn,{dropAnimation:null,children:Ke}),e[71]=Ke,e[72]=xe):xe=e[72];let Oe;e[73]!==F||e[74]!==de||e[75]!==ie||e[76]!==I||e[77]!==$||e[78]!==De||e[79]!==$e||e[80]!==xe?(Oe=n.jsxs(F,{sensors:de,collisionDetection:ie,onDragStart:I,onDragEnd:$,onDragCancel:De,children:[$e,xe]}),e[73]=F,e[74]=de,e[75]=ie,e[76]=I,e[77]=$,e[78]=De,e[79]=$e,e[80]=xe,e[81]=Oe):Oe=e[81];const Pe=!U;let ce;e[82]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(Wt,{size:14}),e[82]=ce):ce=e[82];let se;e[83]!==b||e[84]!==Pe?(se=n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Pe,onClick:b,children:[ce,"Add section"]}),e[83]=b,e[84]=Pe,e[85]=se):se=e[85];let Ne;return e[86]!==ke||e[87]!==Oe||e[88]!==se?(Ne=n.jsxs("div",{className:ke,children:[Oe,se]}),e[86]=ke,e[87]=Oe,e[88]=se,e[89]=Ne):Ne=e[89],Ne}function Vr(d){return d.id}function Ar(d){const e=ze.c(38),{open:r,initialName:c,autoLabel:u,isPending:h,onSubmit:v,onOpenChange:f}=d,g=h===void 0?!1:h,[S,x]=w.useState(c),[D,N]=w.useState(r);r!==D&&(N(r),r&&x(c));let _;e[0]!==g||e[1]!==f?(_=re=>{!re&&!g&&f(!1)},e[0]=g,e[1]=f,e[2]=_):_=e[2];const k=_;let o;e[3]!==g||e[4]!==S||e[5]!==v?(o=async re=>{re.preventDefault(),!g&&await v(S.trim())},e[3]=g,e[4]=S,e[5]=v,e[6]=o):o=e[6];const b=o;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ya,{children:"Rename variant"}),e[7]=m):m=e[7];const U=u||"the rule";let J;e[8]!==U?(J=n.jsxs(Ja,{children:[m,n.jsxs(Qa,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:U}),"."]})]}),e[8]=U,e[9]=J):J=e[9];let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=L):L=e[10];let l;e[11]===Symbol.for("react.memo_cache_sentinel")?(l=re=>x(re.target.value),e[11]=l):l=e[11];let C;e[12]!==u||e[13]!==g||e[14]!==S?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[L,n.jsx(er,{id:"variant-rename-name",value:S,onChange:l,placeholder:u,autoFocus:!0,disabled:g})]}),e[12]=u,e[13]=g,e[14]=S,e[15]=C):C=e[15];let le;e[16]!==f?(le=()=>f(!1),e[16]=f,e[17]=le):le=e[17];let T;e[18]!==g||e[19]!==le?(T=n.jsx(Ue,{type:"button",variant:"outline",onClick:le,disabled:g,children:"Cancel"}),e[18]=g,e[19]=le,e[20]=T):T=e[20];let ue;e[21]!==g?(ue=g?n.jsxs(n.Fragment,{children:[n.jsx(Dn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=g,e[22]=ue):ue=e[22];let P;e[23]!==g||e[24]!==ue?(P=n.jsx(Ue,{type:"submit",disabled:g,children:ue}),e[23]=g,e[24]=ue,e[25]=P):P=e[25];let Z;e[26]!==T||e[27]!==P?(Z=n.jsxs(Xa,{children:[T,P]}),e[26]=T,e[27]=P,e[28]=Z):Z=e[28];let B;e[29]!==b||e[30]!==Z||e[31]!==J||e[32]!==C?(B=n.jsx(Za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:b,children:[J,C,Z]})}),e[29]=b,e[30]=Z,e[31]=J,e[32]=C,e[33]=B):B=e[33];let ae;return e[34]!==k||e[35]!==r||e[36]!==B?(ae=n.jsx(Ga,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=ae):ae=e[37],ae}const Mr="oklch(0.65 0.15 160)",Zn="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function qt(d){const e=ze.c(5),{rule:r,matchers:c}=d,u=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==u){const S=c.find(x=>x.resolveType===u)?.iconName??sa(u);h=Ha(S),e[0]=c,e[1]=u,e[2]=h}else h=e[2];const v=h;if(!v)return null;let f;return e[3]!==v?(f=n.jsx(v,{size:14,className:"shrink-0"}),e[3]=v,e[4]=f):f=e[4],f}function wn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{c as ze,r as w,l as Ce,j as n,B as Ue,i as Dn,m as Ys,t as fe,K as Js}from"./index-BoDi6OBc.js";import{r as Qs,a as Xs,s as Zs,i as Tn,c as Gs,b as ea,G as ta,V as na,d as sa,e as jt,f as aa,g as ra,h as oa,j as ia,k as la,l as ca,m as ua,n as da,o as ma,p as xt,q as bt,t as fa,v as et,w as Lt,x as pa,y as Xe,z as gn,S as ha,M as vn,A as tt,B as Sn,C as ga,D as xn,P as va,E as Bt,F as Sa,H as xa,I as ba,J as ya,K as ja,L as _a,N as ka,O as dt,Q as wa,R as Na,T as Ra,U as Ca,W as Da,X as Ta,Y as Pa,Z as Va,_ as bn,$ as Ft,a0 as Aa,a1 as Ma,a2 as zt,a3 as Ea,a4 as yn,a5 as $a,a6 as Ka,a7 as Oa,a8 as It,a9 as La,aa as Ba,ab as Pn,ac as jn}from"./index-BO0QV1fb.js";import{t as Fa}from"./ChevronDown-QQWh1U0r.js";import{n as za}from"./ChevronLeft-CRDrddT9.js";import{i as Vn}from"./ChevronRight-CWp0460U.js";import{n as Ia}from"./ChevronUp-B0iQd-AD.js";import{K as Ut,D as An,W as Mn,l as Ha,L as Ua,M as Wa}from"./agent-icon-BHjJxJmC.js";import{i as qa}from"./Globe01-DTi3Gxq3.js";import{S as yt}from"./scroll-area-B1cpZQna.js";import{b as st,T as at,a as rt}from"./tooltip-qf4kMmAF.js";import{a as Ya,D as Ja,b as Qa,e as Xa,c as Za,d as Ga}from"./dialog-CHU--T7-.js";import{I as er}from"./input-DJV4VNka.js";import{s as tr,a as nr}from"./Eye-bN0xnD-o.js";import{c as sr}from"./ZoomOut-wqR_bKeR.js";import{b as ar}from"./Settings02-DG5mJ_xI.js";import{s as Wt}from"./Plus-BmqFkgYT.js";import{s as En}from"./Trash01-D1DmT9Mr.js";import{i as rr}from"./Zap-C6SkRgFu.js";import{c as nt,a as $n,D as Kn,b as On,g as or}from"./dropdown-menu-D2HxaMPU.js";import{b as Ln,c as _t,K as Bn,P as Fn,e as zn,C as In,s as Hn,l as mt,D as Un,d as Wn,S as qn,v as ir,k as Yn,p as lr}from"./sortable.esm-JwRAHi44.js";import{r as _n,u as cr,d as ur,a as dr,i as mr,f as fr,P as pr,b as hr,S as gr}from"./page-seo-form-Bp1CNfZX.js";import{b as vr}from"./Tool01-BXc8J6xZ.js";import{A as Sr}from"./add-section-modal-DFnJjqFv.js";import"./index-YYxzAkAN.js";import"./chat-context-D45ePksk.js";import"./hooks-C9iWb2N3.js";import"./use-mcp-client-DuJQA2rV.js";import"./auth-C19hiZia.js";import"./decopilot-sse-pool-BH11VGHE.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BdsGMQZL.js";import"./use-collections-D4X4_zKE.js";import"./use-ai-providers-DuFfPCpZ.js";import"./studio-tools-Lqif47iD.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-nc8QZXyP.js";import"./drawer-D4XkXj4V.js";import"./collection-search-EReXMo3F.js";import"./SearchMd-rJiOFJwK.js";import"./use-mcp-prompts-CmUaiuB7.js";import"./X-Dqpx-r1T.js";import"./shell-layout-BFU4WLoP.js";import"./avatar-Bbvs8iIt.js";import"./User01-DhqtO0lv.js";import"./Users03-BhaYLgGW.js";import"./Stars02-CbFOXGiR.js";import"./XClose-BvKJTTlt.js";import"./CheckCircle-B40vdc2l.js";import"./FilterLines-DttJL6KD.js";import"./required-auth-layout-BolsfPYi.js";import"./use-org-sso-BzsvKCfF.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./ZapSquare-CL6VANDT.js";import"./Star01-DPkaqbS_.js";import"./Upload01-BpkBrNfw.js";import"./AlertCircle-C0MMJCns.js";import"./form-Bxj0TUqV.js";import"./label-7phVZ6ZM.js";import"./select-DlsRm0pM.js";import"./XCircle-D9qm_1Ut.js";import"./tabs-DoKlXPZO.js";import"./toggle-group-DCz7F7cJ.js";import"./Monitor01-CaUMTT8S.js";import"./connect-desktop-dialog-DuJwJvdQ.js";import"./decopilot-CxoZlpZn.js";import"./checkbox-yMsno3zH.js";import"./skeleton-DpU2T6Js.js";import"./Key01-DAsg8mdj.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CAKwpEKX.js";import"./card-RkuQTlVn.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./Stars01-BM2OfAMq.js";import"./popover-Bo_sL62z.js";import"./command-BsaV9rjm.js";import"./index-NjN7v_96.js";import"./useInfiniteQuery-CkJOjicq.js";import"./use-infinite-scroll-4IJEWhiu.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-BpZ3OsA4.js";import"./use-status-sounds-DaofAwGt.js";import"./empty-state-DA37X_xl.js";import"./toolbar-DMerIIuJ.js";import"./preview-dialog-B9gUDoJJ.js";import"./LinkExternal01-D6izDWZT.js";import"./index-CprKTf1O.js";import"./file-type-icon-CVukPbEL.js";import"./LayoutLeft-D2ad_kHx.js";import"./use-connection-CyHDjrsh.js";import"./use-mcp-tools-D715CcxL.js";import"./types-BV8aIt26.js";import"./use-capability-DLjX445R.js";import"./textarea-BjequYD7.js";import"./shell-route-loading-P7c6nIb-.js";import"./extract-connection-data-Ws_H4ap3.js";import"./index-bmV9L0o4.js";import"./mcp-oauth-BGRbdqPD.js";import"./badge-C3IXjCX0.js";import"./connection-slug-eyAPH6o3.js";import"./alert-dialog-Cz6L6NXK.js";import"./switch-CzdCn_lr.js";import"./Play-VLn5ww3u.js";import"./use-debounced-autosave-C-eVH4yR.js";import"./index-BFqTOqSJ.js";import"./sidebar-DoXfrWOj.js";import"./sheet-BDdFViUD.js";import"./search-input-H6T5GrKJ.js";import"./collection-tabs-C3OblNuX.js";import"./github-repo-picker-nQicPdJf.js";import"./authenticate-and-persist-oauth-B1-SzA6A.js";import"./use-navigate-to-agent-BNMv1Neu.js";import"./Users01-DScwWUp0.js";import"./use-secrets-CxFfyxif.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-C9q5ISiT.js";import"./DotsVertical-BBNwX5J5.js";import"./automation-runs-CFBKS4y-.js";import"./table-CLXzS61A.js";import"./use-members-DIDnJkLY.js";import"./use-org-auth-client-DtHGY2-t.js";import"./task-status-DPcnbZIP.js";import"./use-automations-CauJKNE9.js";import"./useSuspenseInfiniteQuery-n6ZCdGbO.js";import"./use-file-configs-BG_rDJRo.js";import"./monaco-editor-Cqq2xAH1.js";import"./select-model-jVluH6Ea.js";import"./automation-list-row-BYkbwrNr.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Shield01-C7ZT-QsW.js";import"./use-clock-tick-aakwXYCP.js";import"./use-copy-V0KcMVib.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-uZjILvOr.js";import"./use-registry-connections-CJhKWnft.js";import"./connection-form-helpers-DV9ppnRP.js";function xr(d){return d.schema?.definitions??d.schema?.$defs??{}}function br(d,e){const r=xr(e),c=r[btoa(d)];if(!c)return;let u=typeof c.image=="string"?c.image:void 0;if(!u&&Array.isArray(c.allOf)){const h=c.allOf.find(v=>typeof v.$ref=="string")?.$ref;if(typeof h=="string"){const v=h.replace("#/definitions/",""),f=r[v];u=typeof f?.image=="string"?f.image:void 0}}if(u?.includes("{{{"))return u}function yr(d,e){if(!e)return;const r=Qs(d);if(!r)return;const c=br(r.resolveType,e);if(!c)return;const u=Xs(c,r.data);if(u)return Zs(u)}const jr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_r="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function kn(d){return Array.from({length:d},(e,r)=>({id:crypto.randomUUID(),index:r}))}function Jn(d){return d.map((e,r)=>({...e,index:r}))}function kr(d,e){if(e===d.length)return d;if(e<d.length)return Jn(d.slice(0,e));const r=Array.from({length:e-d.length},(c,u)=>({id:crypto.randomUUID(),index:d.length+u}));return[...d,...r]}function Qn(d){const e=ze.c(20),{section:r,raw:c,meta:u}=d,h=r.isSavedBlock===!0,v=r.isMultivariate===!0;let f;e[0]!==u||e[1]!==c?(f=c&&u?yr(c,u):void 0,e[0]=u,e[1]=c,e[2]=f):f=e[2];const g=f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(sr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=S):S=e[3];let x;e[4]!==g?(x=g&&n.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=g,e[5]=x):x=e[5];let D;e[6]!==v||e[7]!==h?(D=h?{color:ta}:v?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=v,e[7]=h,e[8]=D):D=e[8];let N;e[9]!==D?(N=n.jsx(Ut,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=N):N=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ce("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let b;return e[16]!==x||e[17]!==N||e[18]!==o?(b=n.jsxs(n.Fragment,{children:[S,x,N,o]}),e[16]=x,e[17]=N,e[18]=o,e[19]=b):b=e[19],b}function Xn(d,e){const r=d.isSavedBlock===!0,c=d.isMultivariate===!0;return Ce("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?jr:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(d){const e=ze.c(64),{section:r,raw:c,meta:u,sortableId:h,selected:v,onSelect:f,onDelete:g,onDuplicate:S,onMakeReusable:x,onToggleHidden:D,onToggleLazy:N,onAddVariant:_,onDetach:k}=d,o=c?Tn(c.__resolveType??""):!1;let b;e[0]!==r?(b=Gs(r),e[0]=r,e[1]=b):b=e[1];const m=b;let U;e[2]!==h?(U={id:h,animateLayoutChanges:Tr},e[2]=h,e[3]=U):U=e[3];const{attributes:J,listeners:L,setNodeRef:l,transform:C,isDragging:le}=zn(U);let T;e[4]!==C?(T=In.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=T):T=e[5];const ue=le?0:void 0;let P;e[6]!==T||e[7]!==ue?(P={transform:T,opacity:ue},e[6]=T,e[7]=ue,e[8]=P):P=e[8];const Z=P;let B;e[9]!==r?(B=ea(r),e[9]=r,e[10]=B):B=e[10];const ae=B,re="button",Se=0;let G;e[11]!==f?(G=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),f())},e[11]=f,e[12]=G):G=e[12];const z=le?"cursor-grabbing":"cursor-pointer";let ee;e[13]!==r||e[14]!==v||e[15]!==z?(ee=Ce("touch-none transition-colors",z,Xn(r,v)),e[13]=r,e[14]=v,e[15]=z,e[16]=ee):ee=e[16];let Q;e[17]!==u||e[18]!==c||e[19]!==r?(Q=n.jsx(Qn,{section:r,raw:c,meta:u}),e[17]=u,e[18]=c,e[19]=r,e[20]=Q):Q=e[20];const A=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ce("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),N()},onPointerDown:Dr,children:n.jsx(rr,{className:Ce("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(rt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let oe;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(oe=!r.isMultivariate&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ce("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),D()},onPointerDown:Cr,children:r.isHidden?n.jsx(ar,{className:"h-3.5 w-3.5"}):n.jsx(tr,{className:"h-3.5 w-3.5"})})}),n.jsx(rt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=oe):oe=e[24];let q;e[25]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx($n,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Rr,onPointerDown:Nr,children:n.jsx(An,{className:"h-3.5 w-3.5"})})}),e[25]=q):q=e[25];let X;e[26]!==S?(X=$=>{$.stopPropagation(),S()},e[26]=S,e[27]=X):X=e[27];let te;e[28]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(nr,{className:"h-4 w-4"}),e[28]=te):te=e[28];let F;e[29]!==X?(F=n.jsxs(nt,{onClick:X,children:[te,"Duplicate"]}),e[29]=X,e[30]=F):F=e[30];let M;e[31]!==m||e[32]!==_?(M=m&&n.jsxs(nt,{className:na,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(Mn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=m,e[32]=_,e[33]=M):M=e[33];let E;e[34]!==ae||e[35]!==x?(E=ae&&n.jsxs(nt,{className:_r,onClick:$=>{$.stopPropagation(),x()},children:[n.jsx(Ut,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=ae,e[35]=x,e[36]=E):E=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(nt,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(Ut,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let pe;e[41]!==g?(pe=$=>{$.stopPropagation(),g()},e[41]=g,e[42]=pe):pe=e[42];let he;e[43]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(En,{className:"h-4 w-4"}),e[43]=he):he=e[43];let de;e[44]!==pe?(de=n.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:pe,children:[he,"Delete"]}),e[44]=pe,e[45]=de):de=e[45];let ie;e[46]!==F||e[47]!==M||e[48]!==E||e[49]!==ne||e[50]!==de?(ie=n.jsxs(Kn,{children:[q,n.jsxs(On,{align:"end",className:"w-44",children:[F,M,E,ne,de]})]}),e[46]=F,e[47]=M,e[48]=E,e[49]=ne,e[50]=de,e[51]=ie):ie=e[51];let I;return e[52]!==J||e[53]!==L||e[54]!==f||e[55]!==l||e[56]!==Z||e[57]!==ee||e[58]!==Q||e[59]!==A||e[60]!==oe||e[61]!==ie||e[62]!==G?(I=n.jsxs("div",{ref:l,style:Z,...J,...L,role:re,tabIndex:Se,onClick:f,onKeyDown:G,className:ee,children:[Q,A,oe,ie]}),e[52]=J,e[53]=L,e[54]=f,e[55]=l,e[56]=Z,e[57]=ee,e[58]=Q,e[59]=A,e[60]=oe,e[61]=ie,e[62]=G,e[63]=I):I=e[63],I}function Nr(d){return d.stopPropagation()}function Rr(d){return d.stopPropagation()}function Cr(d){return d.stopPropagation()}function Dr(d){return d.stopPropagation()}function Tr(){return!1}function Pr(d){const e=ze.c(90),{listKey:r,rawSections:c,sections:u,meta:h,selectedIndex:v,onSelect:f,onReorder:g,onDelete:S,onDuplicate:x,onMakeReusable:D,onToggleHidden:N,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:b,canAddSection:m}=d,U=m===void 0?!0:m;let J;e[0]!==u.length?(J=()=>kn(u.length),e[0]=u.length,e[1]=J):J=e[1];const[L,l]=w.useState(J),[C,le]=w.useState(null),[T,ue]=w.useState(r),[P,Z]=w.useState(u.length),B=w.useRef(!1);T!==r?(ue(r),Z(u.length),l(kn(u.length))):P!==u.length&&(Z(u.length),l(V=>kr(V,u.length)));let ae;e[2]===Symbol.for("react.memo_cache_sentinel")?(ae={activationConstraint:{distance:8}},e[2]=ae):ae=e[2];let re;e[3]===Symbol.for("react.memo_cache_sentinel")?(re={coordinateGetter:Hn},e[3]=re):re=e[3];const Se=Ln(_t(Fn,ae),_t(Bn,re));let G;e[4]!==L?(G=L.map(Vr),e[4]=L,e[5]=G):G=e[5];const z=G;let ee;e[6]===Symbol.for("react.memo_cache_sentinel")?(ee=V=>{le(String(V.active.id))},e[6]=ee):ee=e[6];const Q=ee;let A;e[7]!==z||e[8]!==g?(A=V=>{le(null);const{active:K,over:W}=V;if(!W||K.id===W.id)return;const Be=z.indexOf(String(K.id)),Ie=z.indexOf(String(W.id));Be===-1||Ie===-1||(l(We=>Jn(mt([...We],Be,Ie))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),g?.(Be,Ie))},e[7]=z,e[8]=g,e[9]=A):A=e[9];const oe=A;let q;e[10]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{le(null)},e[10]=q):q=e[10];const X=q;let te,F,M,E,ne,pe,he,de,ie,I,$,De,ke,Ee,we;if(e[11]!==C||e[12]!==U||e[13]!==L||e[14]!==z||e[15]!==oe||e[16]!==h||e[17]!==b||e[18]!==k||e[19]!==S||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==N||e[25]!==_||e[26]!==c||e[27]!==u||e[28]!==v||e[29]!==Se){Ee=Symbol.for("react.early_return_sentinel");e:{const V=K=>{B.current||f(K)};if(e[45]!==C||e[46]!==U||e[47]!==L||e[48]!==b||e[49]!==c||e[50]!==u){const K=C?L.find(W=>W.id===C):null;if(E=K!=null?u[K.index]:null,M=K!=null?c[K.index]:void 0,L.length===0){let W;e[54]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=W):W=e[54];const Be=!U;let Ie;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(Wt,{size:14}),e[55]=Ie):Ie=e[55];let We;e[56]!==b||e[57]!==Be?(We=n.jsxs("div",{className:"space-y-2",children:[W,n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:b,children:[Ie,"Add section"]})]}),e[56]=b,e[57]=Be,e[58]=We):We=e[58],Ee=We;break e}ke=Ce(K&&"cursor-grabbing"),e[45]=C,e[46]=U,e[47]=L,e[48]=b,e[49]=c,e[50]=u,e[51]=M,e[52]=E,e[53]=ke}else M=e[51],E=e[52],ke=e[53];F=Un,de=Se,ie=Wn,I=Q,$=oe,De=X,te=qn,pe=z,he=ir,we="space-y-1",ne=L.map(K=>{const W=u[K.index];return W?n.jsx(wr,{sortableId:K.id,section:W,raw:c[K.index],meta:h,selected:v===K.index,onSelect:()=>V(K.index),onDelete:()=>S(K.index),onDuplicate:()=>x(K.index),onMakeReusable:()=>D(K.index),onToggleHidden:()=>N(K.index),onToggleLazy:()=>_(K.index),onAddVariant:()=>k(K.index),onDetach:()=>o(K.index)},K.id):null})}e[11]=C,e[12]=U,e[13]=L,e[14]=z,e[15]=oe,e[16]=h,e[17]=b,e[18]=k,e[19]=S,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=N,e[25]=_,e[26]=c,e[27]=u,e[28]=v,e[29]=Se,e[30]=te,e[31]=F,e[32]=M,e[33]=E,e[34]=ne,e[35]=pe,e[36]=he,e[37]=de,e[38]=ie,e[39]=I,e[40]=$,e[41]=De,e[42]=ke,e[43]=Ee,e[44]=we}else te=e[30],F=e[31],M=e[32],E=e[33],ne=e[34],pe=e[35],he=e[36],de=e[37],ie=e[38],I=e[39],$=e[40],De=e[41],ke=e[42],Ee=e[43],we=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Te;e[59]!==ne||e[60]!==we?(Te=n.jsx("div",{className:we,children:ne}),e[59]=ne,e[60]=we,e[61]=Te):Te=e[61];let $e;e[62]!==te||e[63]!==pe||e[64]!==he||e[65]!==Te?($e=n.jsx(te,{items:pe,strategy:he,children:Te}),e[62]=te,e[63]=pe,e[64]=he,e[65]=Te,e[66]=$e):$e=e[66];let Ke;e[67]!==M||e[68]!==E||e[69]!==h?(Ke=E?n.jsx("div",{className:Ce("cursor-grabbing shadow-lg ring-1 ring-border/60",Xn(E,!1)),children:n.jsx(Qn,{section:E,raw:M,meta:h})}):null,e[67]=M,e[68]=E,e[69]=h,e[70]=Ke):Ke=e[70];let xe;e[71]!==Ke?(xe=n.jsx(Yn,{dropAnimation:null,children:Ke}),e[71]=Ke,e[72]=xe):xe=e[72];let Oe;e[73]!==F||e[74]!==de||e[75]!==ie||e[76]!==I||e[77]!==$||e[78]!==De||e[79]!==$e||e[80]!==xe?(Oe=n.jsxs(F,{sensors:de,collisionDetection:ie,onDragStart:I,onDragEnd:$,onDragCancel:De,children:[$e,xe]}),e[73]=F,e[74]=de,e[75]=ie,e[76]=I,e[77]=$,e[78]=De,e[79]=$e,e[80]=xe,e[81]=Oe):Oe=e[81];const Pe=!U;let ce;e[82]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(Wt,{size:14}),e[82]=ce):ce=e[82];let se;e[83]!==b||e[84]!==Pe?(se=n.jsxs(Ue,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Pe,onClick:b,children:[ce,"Add section"]}),e[83]=b,e[84]=Pe,e[85]=se):se=e[85];let Ne;return e[86]!==ke||e[87]!==Oe||e[88]!==se?(Ne=n.jsxs("div",{className:ke,children:[Oe,se]}),e[86]=ke,e[87]=Oe,e[88]=se,e[89]=Ne):Ne=e[89],Ne}function Vr(d){return d.id}function Ar(d){const e=ze.c(38),{open:r,initialName:c,autoLabel:u,isPending:h,onSubmit:v,onOpenChange:f}=d,g=h===void 0?!1:h,[S,x]=w.useState(c),[D,N]=w.useState(r);r!==D&&(N(r),r&&x(c));let _;e[0]!==g||e[1]!==f?(_=re=>{!re&&!g&&f(!1)},e[0]=g,e[1]=f,e[2]=_):_=e[2];const k=_;let o;e[3]!==g||e[4]!==S||e[5]!==v?(o=async re=>{re.preventDefault(),!g&&await v(S.trim())},e[3]=g,e[4]=S,e[5]=v,e[6]=o):o=e[6];const b=o;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ya,{children:"Rename variant"}),e[7]=m):m=e[7];const U=u||"the rule";let J;e[8]!==U?(J=n.jsxs(Ja,{children:[m,n.jsxs(Qa,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:U}),"."]})]}),e[8]=U,e[9]=J):J=e[9];let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=L):L=e[10];let l;e[11]===Symbol.for("react.memo_cache_sentinel")?(l=re=>x(re.target.value),e[11]=l):l=e[11];let C;e[12]!==u||e[13]!==g||e[14]!==S?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[L,n.jsx(er,{id:"variant-rename-name",value:S,onChange:l,placeholder:u,autoFocus:!0,disabled:g})]}),e[12]=u,e[13]=g,e[14]=S,e[15]=C):C=e[15];let le;e[16]!==f?(le=()=>f(!1),e[16]=f,e[17]=le):le=e[17];let T;e[18]!==g||e[19]!==le?(T=n.jsx(Ue,{type:"button",variant:"outline",onClick:le,disabled:g,children:"Cancel"}),e[18]=g,e[19]=le,e[20]=T):T=e[20];let ue;e[21]!==g?(ue=g?n.jsxs(n.Fragment,{children:[n.jsx(Dn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=g,e[22]=ue):ue=e[22];let P;e[23]!==g||e[24]!==ue?(P=n.jsx(Ue,{type:"submit",disabled:g,children:ue}),e[23]=g,e[24]=ue,e[25]=P):P=e[25];let Z;e[26]!==T||e[27]!==P?(Z=n.jsxs(Xa,{children:[T,P]}),e[26]=T,e[27]=P,e[28]=Z):Z=e[28];let B;e[29]!==b||e[30]!==Z||e[31]!==J||e[32]!==C?(B=n.jsx(Za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:b,children:[J,C,Z]})}),e[29]=b,e[30]=Z,e[31]=J,e[32]=C,e[33]=B):B=e[33];let ae;return e[34]!==k||e[35]!==r||e[36]!==B?(ae=n.jsx(Ga,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=ae):ae=e[37],ae}const Mr="oklch(0.65 0.15 160)",Zn="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function qt(d){const e=ze.c(5),{rule:r,matchers:c}=d,u=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==u){const S=c.find(x=>x.resolveType===u)?.iconName??sa(u);h=Ha(S),e[0]=c,e[1]=u,e[2]=h}else h=e[2];const v=h;if(!v)return null;let f;return e[3]!==v?(f=n.jsx(v,{size:14,className:"shrink-0"}),e[3]=v,e[4]=f):f=e[4],f}function wn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function Ht(d){return d.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Er(d){return d.map((e,r)=>({...e,index:r}))}function $r(d){const e=ze.c(51),{entry:r,sortableId:c,isActive:u,canDelete:h,decofile:v,meta:f,matchers:g,onSelect:S,onRename:x,onDelete:D}=d;let N;e[0]!==c?(N={id:c,animateLayoutChanges:Lr},e[0]=c,e[1]=N):N=e[1];const{attributes:_,listeners:k,setNodeRef:o,transform:b,isDragging:m}=zn(N);let U;e[2]!==b?(U=In.Transform.toString(b?{...b,y:0}:null),e[2]=b,e[3]=U):U=e[3];const J=m?0:void 0;let L;e[4]!==U||e[5]!==J?(L={transform:U,opacity:J},e[4]=U,e[5]=J,e[6]=L):L=e[6];const l=L,C=f??void 0;let le;e[7]!==v||e[8]!==r.variant.rule||e[9]!==C?(le=jt(r.variant.rule,v,C),e[7]=v,e[8]=r.variant.rule,e[9]=C,e[10]=le):le=e[10];const T=le,ue=u?Zn:"text-muted-foreground hover:bg-muted hover:text-foreground",P=m?"cursor-grabbing":"cursor-grab";let Z;e[11]!==ue||e[12]!==P?(Z=Ce("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",ue,P),e[11]=ue,e[12]=P,e[13]=Z):Z=e[13];let B;e[14]!==T||e[15]!==g?(B=n.jsx(qt,{rule:T,matchers:g}),e[14]=T,e[15]=g,e[16]=B):B=e[16];let ae;e[17]!==r.variant.label?(ae=n.jsx("span",{className:"truncate",children:r.variant.label}),e[17]=r.variant.label,e[18]=ae):ae=e[18];let re;e[19]!==_||e[20]!==k||e[21]!==S||e[22]!==B||e[23]!==ae?(re=n.jsxs("button",{type:"button",..._,...k,onClick:S,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[B,ae]}),e[19]=_,e[20]=k,e[21]=S,e[22]=B,e[23]=ae,e[24]=re):re=e[24];const Se=`Actions for ${r.variant.label}`,G=u&&"opacity-100";let z;e[25]!==G?(z=Ce("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",G),e[25]=G,e[26]=z):z=e[26];let ee;e[27]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(An,{size:12}),e[27]=ee):ee=e[27];let Q;e[28]!==Se||e[29]!==z?(Q=n.jsx($n,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":Se,onClick:Or,onPointerDown:Kr,className:z,children:ee})}),e[28]=Se,e[29]=z,e[30]=Q):Q=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(vr,{size:14}),e[31]=A):A=e[31];let oe;e[32]!==x?(oe=n.jsxs(nt,{onClick:x,children:[A,"Rename"]}),e[32]=x,e[33]=oe):oe=e[33];let q;e[34]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(or,{}),e[34]=q):q=e[34];const X=!h;let te;e[35]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(En,{size:14}),e[35]=te):te=e[35];let F;e[36]!==D||e[37]!==X?(F=n.jsxs(nt,{variant:"destructive",disabled:X,onClick:D,children:[te,"Delete"]}),e[36]=D,e[37]=X,e[38]=F):F=e[38];let M;e[39]!==oe||e[40]!==F?(M=n.jsxs(On,{align:"start",className:"w-36",children:[oe,q,F]}),e[39]=oe,e[40]=F,e[41]=M):M=e[41];let E;e[42]!==Q||e[43]!==M?(E=n.jsxs(Kn,{children:[Q,M]}),e[42]=Q,e[43]=M,e[44]=E):E=e[44];let ne;return e[45]!==o||e[46]!==l||e[47]!==re||e[48]!==E||e[49]!==Z?(ne=n.jsxs("div",{ref:o,style:l,className:Z,children:[re,E]}),e[45]=o,e[46]=l,e[47]=re,e[48]=E,e[49]=Z,e[50]=ne):ne=e[50],ne}function Kr(d){return d.stopPropagation()}function Or(d){return d.stopPropagation()}function Lr(){return!1}function Br(d){const e=ze.c(13),{variant:r,decofile:c,meta:u,matchers:h}=d,v=u??void 0;let f;e[0]!==c||e[1]!==v||e[2]!==r.rule?(f=jt(r.rule,c,v),e[0]=c,e[1]=v,e[2]=r.rule,e[3]=f):f=e[3];const g=f;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=Ce("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",Zn),e[4]=S):S=e[4];let x;e[5]!==g||e[6]!==h?(x=n.jsx(qt,{rule:g,matchers:h}),e[5]=g,e[6]=h,e[7]=x):x=e[7];let D;e[8]!==r.label?(D=n.jsx("span",{className:"truncate",children:r.label}),e[8]=r.label,e[9]=D):D=e[9];let N;return e[10]!==x||e[11]!==D?(N=n.jsxs("div",{className:S,children:[x,D]}),e[10]=x,e[11]=D,e[12]=N):N=e[12],N}function Fr(d){const e=ze.c(77),{listKey:r,variants:c,activeIndex:u,decofile:h,meta:v,matchers:f,onSelect:g,onReorder:S,onRename:x,onDelete:D,onAdd:N}=d;let _;e[0]!==c?(_=()=>Ht(c),e[0]=c,e[1]=_):_=e[1];const[k,o]=w.useState(_),[b,m]=w.useState(null),[U,J]=w.useState(r),[L,l]=w.useState(c.length);let C;e[2]!==c?(C=()=>wn(c),e[2]=c,e[3]=C):C=e[3];const[le,T]=w.useState(C),ue=w.useRef(!1),P=wn(c);U!==r?(J(r),l(c.length),T(P),o(Ht(c))):L!==c.length?(l(c.length),T(P),o(Ht(c))):le!==P&&(T(P),o(se=>c.map((Ne,V)=>({id:se[V]?.id??crypto.randomUUID(),index:V,variant:Ne}))));let Z;e[4]===Symbol.for("react.memo_cache_sentinel")?(Z={activationConstraint:{distance:8}},e[4]=Z):Z=e[4];let B;e[5]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:Hn},e[5]=B):B=e[5];const ae=Ln(_t(Fn,Z),_t(Bn,B));let re;e[6]!==k?(re=k.map(zr),e[6]=k,e[7]=re):re=e[7];const Se=re,G=c.length>1;let z;e[8]!==k?(z=se=>{const Ne=String(se.active.id);m(k.find(V=>V.id===Ne)??null)},e[8]=k,e[9]=z):z=e[9];const ee=z;let Q;e[10]!==Se||e[11]!==S?(Q=se=>{m(null);const{active:Ne,over:V}=se;if(!V||Ne.id===V.id)return;const K=Se.indexOf(String(Ne.id)),W=Se.indexOf(String(V.id));K===-1||W===-1||(o(Be=>Er(mt([...Be],K,W))),ue.current=!0,requestAnimationFrame(()=>{ue.current=!1}),S(K,W))},e[10]=Se,e[11]=S,e[12]=Q):Q=e[12];const A=Q;let oe;e[13]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{m(null)},e[13]=oe):oe=e[13];const q=oe;let X,te,F,M,E,ne,pe,he,de,ie,I,$;if(e[14]!==b||e[15]!==u||e[16]!==G||e[17]!==h||e[18]!==k||e[19]!==Se||e[20]!==A||e[21]!==ee||e[22]!==f||e[23]!==v||e[24]!==D||e[25]!==x||e[26]!==g||e[27]!==ae){const se=V=>{ue.current||g(V)};I="flex items-center border-b shrink-0";const Ne=b&&"cursor-grabbing";e[40]!==Ne?(ie=Ce("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",Ne),e[40]=Ne,e[41]=ie):ie=e[41],te=Un,E=ae,ne=Wn,pe=ee,he=A,de=q,X=qn,$=Se,F=lr,M=k.map(V=>n.jsx($r,{sortableId:V.id,entry:V,isActive:V.index===u,canDelete:G,decofile:h,meta:v,matchers:f,onSelect:()=>se(V.index),onRename:()=>x(V.index),onDelete:()=>D(V.index)},V.id)),e[14]=b,e[15]=u,e[16]=G,e[17]=h,e[18]=k,e[19]=Se,e[20]=A,e[21]=ee,e[22]=f,e[23]=v,e[24]=D,e[25]=x,e[26]=g,e[27]=ae,e[28]=X,e[29]=te,e[30]=F,e[31]=M,e[32]=E,e[33]=ne,e[34]=pe,e[35]=he,e[36]=de,e[37]=ie,e[38]=I,e[39]=$}else X=e[28],te=e[29],F=e[30],M=e[31],E=e[32],ne=e[33],pe=e[34],he=e[35],de=e[36],ie=e[37],I=e[38],$=e[39];let De;e[42]!==X||e[43]!==F||e[44]!==M||e[45]!==$?(De=n.jsx(X,{items:$,strategy:F,children:M}),e[42]=X,e[43]=F,e[44]=M,e[45]=$,e[46]=De):De=e[46];let ke;e[47]!==b||e[48]!==h||e[49]!==f||e[50]!==v?(ke=b?n.jsx(Br,{variant:b.variant,decofile:h,meta:v,matchers:f}):null,e[47]=b,e[48]=h,e[49]=f,e[50]=v,e[51]=ke):ke=e[51];let Ee;e[52]!==ke?(Ee=n.jsx(Yn,{dropAnimation:null,children:ke}),e[52]=ke,e[53]=Ee):Ee=e[53];let we;e[54]!==te||e[55]!==E||e[56]!==ne||e[57]!==pe||e[58]!==he||e[59]!==de||e[60]!==De||e[61]!==Ee?(we=n.jsxs(te,{sensors:E,collisionDetection:ne,onDragStart:pe,onDragEnd:he,onDragCancel:de,children:[De,Ee]}),e[54]=te,e[55]=E,e[56]=ne,e[57]=pe,e[58]=he,e[59]=de,e[60]=De,e[61]=Ee,e[62]=we):we=e[62];let Te;e[63]!==ie||e[64]!==we?(Te=n.jsx("div",{className:ie,children:we}),e[63]=ie,e[64]=we,e[65]=Te):Te=e[65];let $e;e[66]===Symbol.for("react.memo_cache_sentinel")?($e={color:Mr},e[66]=$e):$e=e[66];let Ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ke=n.jsx(Wt,{size:14}),e[67]=Ke):Ke=e[67];let xe;e[68]!==N?(xe=n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:$e,onClick:N,children:Ke})}),e[68]=N,e[69]=xe):xe=e[69];let Oe;e[70]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(rt,{side:"bottom",children:"Add variant"}),e[70]=Oe):Oe=e[70];let Pe;e[71]!==xe?(Pe=n.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:n.jsxs(st,{children:[xe,Oe]})}),e[71]=xe,e[72]=Pe):Pe=e[72];let ce;return e[73]!==I||e[74]!==Te||e[75]!==Pe?(ce=n.jsxs("div",{className:I,children:[Te,Pe]}),e[73]=I,e[74]=Te,e[75]=Pe,e[76]=ce):ce=e[76],ce}function zr(d){return d.id}function Nn(d){const e=ze.c(15),{schema:r,value:c,onChange:u,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:g}=d;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[0]=S):S=e[0];const[x,D]=w.useState(S);let N;e[1]!==x?(N=x.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(za,{className:"size-3.5"})}),x.map((o,b)=>{const m=b===x.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[b>0&&n.jsx(Vn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(x.slice(0,b+1)),title:o,className:Ce("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",m?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${b}`)})]}),e[1]=x,e[2]=N):N=e[2];let _;e[3]!==x||e[4]!==v||e[5]!==h||e[6]!==u||e[7]!==f||e[8]!==g||e[9]!==r||e[10]!==c?(_=n.jsx(Pn,{schema:r,value:c,onChange:u,basePath:"",breadcrumbPath:x,onBreadcrumbChange:D,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:g}),e[3]=x,e[4]=v,e[5]=h,e[6]=u,e[7]=f,e[8]=g,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==N||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[N,_]}),e[12]=N,e[13]=_,e[14]=k):k=e[14],k}function Rn(d){const e=ze.c(21),{activeSchema:r,formValue:c,formResetKey:u,onFormChange:h,onBreadcrumbChange:v,breadcrumbPath:f,emptyMessage:g,beforeForm:S,seoResolveType:x,siteDefaultSeo:D,meta:N,decofile:_,onSaveReferencedBlock:k,sandbox:o}=d;let b;e[0]!==f?(b=f===void 0?[]:f,e[0]=f,e[1]=b):b=e[1];const m=b;let U;e[2]!==r||e[3]!==m||e[4]!==_||e[5]!==u||e[6]!==c||e[7]!==N||e[8]!==v||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==x||e[13]!==D?(U=r&&c?x?n.jsx(gr,{schema:r,resolveType:x,value:c,formResetKey:u,onChange:h,onBreadcrumbChange:v,siteDefaultSeo:D}):n.jsx(Pn,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:m,onBreadcrumbChange:v,meta:N,decofile:_,onSaveReferencedBlock:k,sandbox:o},u):null,e[2]=r,e[3]=m,e[4]=_,e[5]=u,e[6]=c,e[7]=N,e[8]=v,e[9]=h,e[10]=k,e[11]=o,e[12]=x,e[13]=D,e[14]=U):U=e[14];const J=U;let L;e[15]!==g||e[16]!==J?(L=J??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:g}),e[15]=g,e[16]=J,e[17]=L):L=e[17];let l;return e[18]!==S||e[19]!==L?(l=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[S,L]})}),e[18]=S,e[19]=L,e[20]=l):l=e[20],l}const Ir="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Hr(d,e){return Sa(d,e,tt)}function Ur(d){const e=ze.c(13),{pageKey:r,initialName:c,initialPath:u,onFieldChange:h}=d,[v,f]=w.useState(c),[g,S]=w.useState(u),[x,D]=w.useState(r);x!==r&&(D(r),f(c),S(u));let N;e[0]!==h?(N=m=>{f(m.target.value),h("name",m.target.value)},e[0]=h,e[1]=N):N=e[1];let _;e[2]!==v||e[3]!==N?(_=n.jsx("input",{type:"text",value:v,onChange:N,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=v,e[3]=N,e[4]=_):_=e[4];let k;e[5]!==h?(k=m=>{S(m.target.value),h("path",m.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==g||e[8]!==k?(o=n.jsx("input",{type:"text",value:g,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=g,e[8]=k,e[9]=o):o=e[9];let b;return e[10]!==_||e[11]!==o?(b=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=b):b=e[12],b}function Cn(d){const e=ze.c(6),{onClick:r}=d;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Mn,{size:14}),e[0]=c):c=e[0];let u;e[1]!==r?(u=n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=u):u=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(rt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let v;return e[4]!==u?(v=n.jsxs(st,{children:[u,h]}),e[4]=u,e[5]=v):v=e[5],v}function wl({orgSlug:d,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:u,currentPath:h,activePageBlockKey:v=null,activeGlobalBlockKey:f=null,externalSelectedIndex:g,onSaved:S,initialEditSeo:x=!1,onExitSeo:D,onViewJsonFile:N,onVariantPreviewOverride:_}){const k=c?{orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:b}=aa(k),{data:m,isLoading:U}=ra(k),J=oa(),L=J?.entity?.id===e?J.entity.metadata?.siteSlug??null:null,[l,C]=w.useState(null),[le,T]=w.useState(null),[ue,P]=w.useState(null),[Z,B]=w.useState(0),[ae,re]=w.useState(void 0),[Se,G]=w.useState(null),[z,ee]=w.useState(null),[Q,A]=w.useState([]),[oe,q]=w.useState(0),[X,te]=w.useState(null),[F,M]=w.useState(null),[E,ne]=w.useState(!0),[pe,he]=w.useState(!1),[de,ie]=w.useState(!1),[I,$]=w.useState(x),[De,ke]=w.useState(x);x&&!De&&(ke(!0),$(!0),C(null),T(null),P(null),A([])),!x&&De&&ke(!1);const[Ee,we]=w.useState(null),[Te,$e]=w.useState(void 0),[Ke,xe]=w.useState([]),[Oe,Pe]=w.useState(0),[ce,se]=w.useState(0),[Ne,V]=w.useState(null),[K,W]=w.useState(null),[Be,Ie]=w.useState(null),We=Ys(),Gn=`${d}/${e}/${r}`,kt=ia({orgSlug:d,virtualMcpId:e,branch:r}),[es,ts]=w.useState(h),[ns,ss]=w.useState(v),[as,rs]=w.useState(f);(es!==h||ns!==v||as!==f)&&(queueMicrotask(()=>kt.flush()),ts(h),ss(v),rs(f),C(null),T(null),P(null),B(0),G(null),ee(null),se(0),V(null),W(null),A([]),q(t=>t+1),$(!1),we(null),$e(void 0),xe([]),Pe(t=>t+1));const Ve=la({orgSlug:d,virtualMcpId:e,branch:r}),ft=Ca((t,s)=>{Ve.mutate({blockKey:t,data:s},{onSuccess:()=>S?.(),onError:a=>fe.error(`Save failed: ${a.message}`)})}),Yt=ca({orgSlug:d,virtualMcpId:e,branch:r}),[wt,Jt]=w.useState(!1),Nt=w.useRef(null),ot=w.useRef(null),it=w.useRef(null),Rt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||b||U)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Dn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!m)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const os=ua(o),ve=!!f,Le=ve?null:da(os,h,v),y=ve?f:Le?.key??null,Ct=ve&&f?o[f]:void 0,Qt=ve&&f&&Ct?ma(f,Ct):ve&&f?f:"",pt=!ve&&y&&o[y]?o[y]:null,Dt=I&&o&&m&&y&&Le?_n(o,{kind:"page",pageKey:y,pageName:String(Le.name??""),path:String(Le.path??"")},m):null,is=I?pt?.seo:void 0,Tt=Te!==void 0?Te:is,ls=I?cr(Tt):void 0,cs=Dt?.seoTypeOptions??[],us=I&&m?ur(m):"",Xt=Ee??ls??{},Pt=I&&Dt?dr(Xt,Dt):null,ds=I&&Pt&&mr(Tt)?xt(Pt,m):null,ms=I?fr(o,m)?.seoData:void 0,Ae=ve?[{label:"Default",sections:[{__resolveType:f}]}]:Hr(pt?.sections,o??{}),ht=Ae.length>1,_e=Math.min(Z,Ae.length-1),Ze=Ae[_e],H=Ze?.sections??[],Re=bt(H,o),Zt=!ve&&fa(pt?.sections);if(ve&&f&&Be!==f){Ie(f);const t=H[0],s=Re[0];if(t&&s){C(0),se(0),A([]);const a=et(t,s,o);a&&(T(a.data),P(a.resolveType),W(null),V(null))}}!ve&&Be!==null&&Ie(null),qe.current={rawSections:H,parsedSections:Re,decofile:o??{},activePageKey:y,pageVariants:Ae,variantIndex:_e,sectionVariantIndex:ce,selectedSectionIndex:l};const fs=()=>({multivariate:Zt,index:_e,variants:Ae.map(t=>({rule:t.rule}))}),Gt=(t,s)=>{if(!_)return;if(!y||!Zt||t.length<=1){_(null);return}const a=yn(y,{multivariate:!0,index:s,variants:t},o,m);_(a.length>0?a:null)},lt=(t,s,a)=>{if(!_)return;if(!y){_(null);return}const i=fs(),p=yn(y,i,o,m);if(!t||s<0){_(p.length>0?p:null);return}const R=$a({pageKey:y,page:i,sectionIndex:s,sectionLazy:Re[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:o,meta:m}),j=[...p,...R];_(j.length>0?j:null)},Ye=(t,s,a,i=l??-1,p=!1)=>{const R=Xe(t,s);if(!R){T(null),P(null),W(null),V(null),p&&lt(null,i,a);return}const O=gn(R,tt)[a];if(!O){T(null),P(null),W(null),V(null),p&&lt(null,i,a);return}const ge=xa(O.value,o);T(ge?.data??null),P(ge?.resolveType??null);const{resolveType:Y,formValue:me}=Lt(O.rule,o,m??void 0);W(Y),V(me),p&&lt(R,i,a)};if(g!==void 0&&g!==ae&&(re(g??null),typeof g=="number")){const t=H[g],s=Re[g];if(t&&s)if(C(g),se(0),A([]),q(a=>a+1),s.isMultivariate)Ye(t,s,0,g);else{const a=et(t,s,o);a?(T(a.data),P(a.resolveType)):(T(null),P(null)),W(null),V(null)}}const gt={orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:L},Vt=ue&&m?xt(ue,m):null,Fe=(t,s)=>{if(!y)return;const a=Ft(o,y,t,_e,Ae);Ve.mutate({blockKey:y,data:a},{onSuccess:()=>s?.onSuccess?.()??S?.(),onError:i=>fe.error(`Save failed: ${i.message}`)})},ct=()=>{C(null),T(null),P(null),se(0),V(null),W(null),A([]),q(t=>t+1)},ps=(t,s)=>{Nt.current&&clearTimeout(Nt.current);const a=qe.current.sectionVariantIndex;Nt.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:R,activePageKey:j,pageVariants:O,variantIndex:ge}=qe.current,Y=i[s];if(!Y)return;const me=p[s];if(!me)return;if(me.isSavedBlock){const ye=me.isLazy?Y.section?.__resolveType??Y.__resolveType:Y.__resolveType;Ve.mutate({blockKey:ye,data:t},{onSuccess:()=>S?.(),onError:je=>fe.error(`Save failed: ${je.message}`)});return}if(!j)return;const be={...R[j]},Me=[...i];if(me.isMultivariate){const ye=Xe(Y,me);if(!ye||!j)return;const je=La(ye,a,t);Me[s]=dt(Y,me,je)}else if(me.isHidden){const ye=Tn(Y.__resolveType),je=ye?{...Y.section}:{...Y},He=Array.isArray(je.variants)?[...je.variants]:[];He[0]&&(He[0]={...He[0],value:t}),je.variants=He,ye?Me[s]={...Y,section:je}:Me[s]=je}else me.isLazy?Me[s]={...Y,section:t}:Me[s]=t;if(O.length>1){const ye=be.sections,je=[...ye?.variants??[]];je[ge]&&(je[ge]={...je[ge],value:Me}),be.sections={...ye,variants:je}}else be.sections=Me;Ve.mutate({blockKey:j,data:be},{onSuccess:()=>S?.(),onError:ye=>fe.error(`Save failed: ${ye.message}`)})},It)},hs=t=>{C(t),se(0),A([]),q(p=>p+1);const s=H[t],a=Re[t];if(!s||!a)return;if(a.isMultivariate){Ye(s,a,0,t);return}const i=et(s,a,o);if(!i){T(null),P(null),W(null),V(null),lt(null,t,0);return}T(i.data),P(i.resolveType),W(null),V(null),lt(null,t,0)},en=t=>{const s=t;T(s),l!==null&&ps(s,l)},At=t=>{if(!y||!o||!m||!Le)return;const s={kind:"page",pageKey:y,pageName:String(Le.name??""),path:String(Le.path??"")},a=_n(o,s,m);a&&kt.save(y,()=>{const i=We.getQueryData(Js.decofile(Gn))?.[y];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const p={...i,...Rt.current};return Rt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?hr(s,a,p,t.inner):p})},gs=(t,s)=>{y&&(Rt.current[t]=s,At())},vs=(t,s)=>{if(!y)return;const a=mt([...H],t,s);l!==null&&(l===t?C(s):t<l&&s>=l?C(l-1):t>l&&s<=l&&C(l+1)),Fe(a)},Ss=t=>{if(!y)return;const s=H.filter((a,i)=>i!==t);l===t?ct():l!==null&&l>t&&C(l-1),Fe(s)},xs=t=>{if(!y)return;const s=H[t];if(!s)return;const a=[...H];a.splice(t+1,0,Va(s)),l!==null&&l>t&&C(l+1),Fe(a)},bs=t=>{if(!y)return;const s=H[t],a=Re[t];if(!s||!a||a.isMultivariate)return;const i=a.isHidden?Ta(s):Pa(s);if(!i)return;const p=[...H];p[t]=i,l===t&&ct(),Fe(p)},ys=t=>{if(!y)return;const s=H[t],a=Re[t];if(!s||!a||a.isMultivariate)return;const i=Da(s);if(!i)return;const p=[...H];p[t]=i,l===t&&ct(),Fe(p)},js=t=>{if(!y)return;const s=H[t],a=Re[t];if(!s||!a?.isSavedBlock)return;const i=et(s,a,o);if(!i?.data)return;const{name:p,...R}=i.data,j=[...H];a.isLazy?j[t]={...s,section:R}:j[t]=R,l===t&&ct(),Fe(j)},_s=t=>{if(!y)return;const s=[...H,{__resolveType:t.resolveType}],a=s.length-1;Fe(s,{onSuccess:()=>{he(!1),C(a),se(0),A([]),q(j=>j+1);const i=s[a],p=bt(s,o)[a];if(!i||!p)return;if(p.isMultivariate){Ye(i,p,0);return}const R=et(i,p,o);if(!R){T(null),P(null),W(null),V(null);return}T(R.data),P(R.resolveType),W(null),V(null)}})},ks=t=>{if(l===null)return;const s=H[l],a=Re[l];!s||!a?.isMultivariate||(se(t),A([]),q(i=>i+1),Ye(s,a,t,l,!0))},ws=t=>{if(l===null||!y)return;const s=H[l],a=Re[l];if(!s||!a?.isMultivariate)return;const i=Xe(s,a);if(!i)return;const p=Na(i,t);if(!p){fe.error("Cannot delete the only variant.");return}const R=[...H];R[l]=dt(s,a,p);const j=p.variants;let O=ce;t===ce?O=Math.min(t,j.length-1):t<ce&&(O=ce-1),se(O),A([]),q(ge=>ge+1),Ye(R[l],a,O),Fe(R)},Ns=t=>{if(l===null||!y)return;const s=H[l],a=Re[l];if(!s||!a?.isMultivariate)return;const i=Xe(s,a);if(!i)return;const p=Ra(i,t),R=[...H];R[l]=dt(s,a,p);const j=t+1;se(j),A([]),q(O=>O+1),Ye(R[l],a,j),Fe(R)},Rs=(t,s)=>{if(l===null||!y||t===s)return;const a=H[l],i=Re[l];if(!a||!i?.isMultivariate)return;const p=Xe(a,i);if(!p)return;const R=ka(p,t,s),j=[...H];j[l]=dt(a,i,R);let O=ce;ce===t?O=s:t<ce&&s>=ce?O=ce-1:t>ce&&s<=ce&&(O=ce+1),se(O),Ye(j[l],i,O),Fe(j)},Mt=t=>{const s=t??l;if(s===null||!y)return;const a=H[s],i=Re[s];if(!a||!i)return;const p=ba(a,i);if(!p){fe.error("This section cannot have variants.");return}const R=[...H];R[s]=p.section;const j=bt(R,o)[s];if(!j?.isMultivariate){fe.error("Could not add variant.");return}C(s),se(p.newVariantIndex),A([]),q(O=>O+1),Ye(p.section,j,p.newVariantIndex,s),Fe(R)},Cs=()=>{if(l===null||!y)return;const t=H[l],s=Re[l];if(!t||!s?.isMultivariate)return;const a=Xe(t,s);if(!a)return;const i=wa(t,s,a);if(!i){fe.error("Could not remove variants.");return}const p=[...H];p[l]=i;const R=bt(p,o)[l];if(!R)return;se(0),W(null),V(null),A([]),q(O=>O+1);const j=et(i,R,o);j?(T(j.data),P(j.resolveType)):(T(null),P(null)),lt(null,l,0),Fe(p)},Ds=async t=>{if(X===null||!y)return;const s=bn(t,o);if(s){fe.error(s);return}const a=H[X],i=Re[X];if(!a||!i)return;const p=et(a,i,o);if(!p){fe.error("This section cannot be saved as global.");return}const R={...p.data,name:t};try{await Ve.mutateAsync({blockKey:t,data:R});const j=[...H];j[X]={__resolveType:t},await Ve.mutateAsync({blockKey:y,data:Ft(o,y,j,_e,Ae)}),l===X&&ct(),te(null),fe.success(`Saved global block "${t}"`),S?.()}catch(j){fe.error(j instanceof Error?j.message:"Failed to save global block")}},tn=Ze?.rule;if(ht&&l===null&&z===null&&tn){const{resolveType:t,formValue:s}=Lt(tn,o??{},m??void 0);ee(t),G(s)}const vt=m?pa(m):[],Ts=!ve&&!!(u&&m&&o),nn=z&&m?xt(z,m):null,Ps=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),it.current&&(clearTimeout(it.current),it.current=null)},sn=async(t,s)=>{if(!(Ba(s,t,m)>0))try{await Yt.mutateAsync({blockKey:t})}catch(a){fe.error(a instanceof Error?a.message:"Could not delete matcher block")}},an=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:i}=qe.current;if(!s)return;const p={...a[s]},R={...p.sections},j=[...R.variants??[]],O=j[i],ge=O?.rule;if(Bt(ge,a,m)){const Y=ge?.__resolveType??"",me=a[Y],be=typeof me?.name=="string"?me.name:Y,{__resolveType:Me,...ye}=t;Ve.mutate({blockKey:Y,data:zt(Me??"",ye,be)},{onSuccess:()=>S?.(),onError:je=>fe.error(`Save failed: ${je.message}`)});return}O&&(j[i]={...O,rule:t}),p.sections={...R,variants:j},Ve.mutate({blockKey:s,data:p},{onSuccess:()=>S?.(),onError:Y=>fe.error(`Save failed: ${Y.message}`)})},It)},Vs=t=>{ee(t);const s=t?{__resolveType:t}:{__resolveType:jn};G({}),an(s)},As=t=>{const s=t;G(s);const a=z?{__resolveType:z,...s}:{...s};an(a)},rn=t=>{it.current&&clearTimeout(it.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=qe.current;s!==null&&(it.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:R,activePageKey:j,pageVariants:O,variantIndex:ge}=qe.current;if(!j)return;const Y=i[s],me=p[s];if(!Y||!me?.isMultivariate)return;const be=Xe(Y,me);if(!be)return;const Me=Oa(be,a,t),ye=[...i];ye[s]=dt(Y,me,Me);const je=Ft(R,j,ye,ge,O);Ve.mutate({blockKey:j,data:je},{onSuccess:()=>S?.(),onError:He=>fe.error(`Save failed: ${He.message}`)})},It))},Ms=t=>{W(t),V({}),rn(t?{__resolveType:t}:{__resolveType:jn})},Es=t=>{const s=t;V(s);const a=K?{__resolveType:K,...s}:{...s};rn(a)};if(!ve&&!Le)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(ve&&!Ct)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Je=l!==null?Re[l]??null:null,on=l!==null?H[l]:null,ln=on&&Je?.isMultivariate?Xe(on,Je):null,St=ln?gn(ln,tt):[],Et=Math.min(ce,Math.max(St.length-1,0)),$t=St[Et]??null,Ge=Je?.isMultivariate===!0,cn=l!==null&&Je!==null,ut=cn&&(Ge||!!(Vt&&le)),$s=ut&&!ve&&Je?.isSavedBlock===!0,Qe=ve||$s,Ks=ve?Qt:Je?.label??"",un=K&&m?xt(K,m):null,Kt=ut&&(!ve||Q.length>0)?ve?[Qt,...Q]:[Le.name,Je.label,...Ge&&$t?[$t.label]:[],...Q]:[],Os=I&&Le?[Le.name,"SEO",...Ke]:[],dn=I?Os:Qe?Kt.length>0?Kt:[Ks]:Kt,mn=()=>{if(!y)return;const t=o[y],s=ya(t.sections,H);if(!s)return;const a=ja(s);Ve.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{B(a),C(null),T(null),P(null),A([]),G(null),ee(null)},onError:i=>fe.error(`Save failed: ${i.message}`)})},fn=(t,s,a)=>{if(!y)return;const i=o[y],p=i.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const R=p;if(!Array.isArray(R.variants))return;const j=t([...R.variants]);if(!j)return;const O=Ka(R,j),ge={...o,[y]:{...i,sections:O}};Ve.mutate({blockKey:y,data:ge[y]},{onSuccess:()=>{s?.(),a&&sn(a,ge)},onError:Y=>fe.error(`Save failed: ${Y.message}`)})},Ls=t=>{M(null),B(t),C(null),T(null),P(null),A([]);const s=Ae[t]?.rule,{resolveType:a,formValue:i}=Lt(s,o??{},m??void 0);ee(a),G(i),Gt(Ae.map(p=>({rule:p.rule})),t)},Bs=(t,s)=>{if(t===s)return;let a=_e;_e===t?a=s:t<_e&&s>=_e?a=_e-1:t>_e&&s<=_e&&(a=_e+1),B(a);const i=mt(Ae.map(p=>({rule:p.rule})),t,s);Gt(i,a),fn(p=>mt(p,t,s))},Fs=t=>{const s=Ae[t]?.rule,a=_a(s,o??{},m??void 0);fn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Ae.length-1===1?B(0):t<_e?B(_e-1):t===_e&&B(Math.max(0,t-1)),C(null),T(null),P(null),A([]),G(null),ee(null)},a)},zs=async(t,s)=>{Ps();const a=qe.current.activePageKey,i=qe.current.decofile;if(!a)return;const p=i[a],R=p.sections;if(!R||typeof R!="object"||Array.isArray(R))return;const j=R;if(!Array.isArray(j.variants))return;const O=[...j.variants],ge=O[t];if(!ge?.rule||typeof ge.rule!="object"){fe.error("This variant has no matcher rule to rename.");return}const Y=ge.rule,me=s.trim();Jt(!0);try{if(!me){if(!Bt(Y,i,m)){M(null);return}const Ot=Y.__resolveType??"";O[t]={...ge,rule:Aa(Y,i,m)};const hn={...i,[a]:{...p,sections:{...j,variants:O}}};await Ve.mutateAsync({blockKey:a,data:hn[a]}),await sn(Ot,hn),M(null),S?.();return}const be=Ma(Y,i,m);if(!be){fe.error("Could not read this variant's matcher rule.");return}if(be.blockKey){await Ve.mutateAsync({blockKey:be.blockKey,data:zt(be.resolveType,be.data,me)}),M(null),S?.();return}const Me=xn(me),ye=bn(Me,i);if(ye){fe.error(ye);return}const je=zt(be.resolveType,be.data,me);let He=null;try{await Ve.mutateAsync({blockKey:Me,data:je}),He=Me,O[t]={...ge,rule:Ea(Me)},await Ve.mutateAsync({blockKey:a,data:{...p,sections:{...j,variants:O}}}),He=null}catch(Ot){throw He&&await Yt.mutateAsync({blockKey:He}).catch(()=>{}),Ot}M(null),fe.success(`Saved matcher as global block "${me}"`),S?.()}catch(be){fe.error(be instanceof Error?be.message:"Failed to rename variant")}finally{Jt(!1)}},pn=()=>{ct()},Is=t=>{we(t),At({inner:t})},Hs=t=>{$e(t),At({raw:t})},Us=()=>{we(null),xe([])},Ws=()=>Pe(t=>t+1),qs=t=>{if(I){if(t===0){kt.flush(),$(!1),we(null),$e(void 0),xe([]),Pe(a=>a+1),D?.();return}if(t===1){xe([]),Pe(a=>a+1);return}xe(Ke.slice(0,t-1)),Pe(a=>a+1);return}if(ve){A(Q.slice(0,t)),q(a=>a+1);return}if(t===0){pn();return}if(t===1){A([]),q(a=>a+1);return}if(Ge&&t===2){A([]),q(a=>a+1);return}const s=Ge?2:1;A(Q.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Qe||ut||I?n.jsxs("div",{className:Ce("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ve&&ht&&Ze&&n.jsxs("button",{type:"button",onClick:pn,title:`Editing in variant: ${Ze.label}`,className:Ce("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ir),children:[n.jsx(qt,{rule:jt(Ze.rule,o??{},m??void 0),matchers:vt}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ze.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:dn.map((t,s)=>{const a=s===dn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Vn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>qs(s),title:t,className:Ce("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?Qe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Qe?"text-foreground/80":"text-muted-foreground",Qe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),Qe&&n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(qa,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(rt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),cn&&!Ge&&!Je?.isHidden&&y&&n.jsx(Cn,{onClick:()=>Mt()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(Ur,{pageKey:y,initialName:Le.name,initialPath:Le.path,onFieldChange:gs})}),n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>$(!0),children:n.jsx(Ua,{size:14})})}),n.jsx(rt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(st,{children:[n.jsx(at,{asChild:!0,children:n.jsx(Ue,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>N&&y?N(y):ie(!0),children:n.jsx(Wa,{size:14})})}),n.jsx(rt,{side:"bottom",children:"View JSON"})]}),n.jsx(Cn,{onClick:mn})]})}),ht&&!ut&&!I&&y&&n.jsx(Fr,{listKey:y,variants:Ae,activeIndex:_e,decofile:o??{},meta:m,matchers:vt,onSelect:Ls,onReorder:Bs,onRename:M,onDelete:Fs,onAdd:mn}),I?n.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:pt&&y?n.jsx(pr,{rawSeo:Tt,innerSeo:Xt,defaultResolveType:us,seoSchema:ds,activeResolveType:Pt,seoTypeOptions:cs,formResetKey:Oe,siteDefaultSeo:ms,onBreadcrumbChange:xe,onPersistRaw:Hs,onInnerChange:Is,onClearForm:Us,onBumpFormKey:Ws}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ut?n.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ge&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(ha,{listKey:`${y??""}:${l??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:Et,onSelect:ks,onDuplicate:Ns,onDelete:ws,onRemoveAll:Cs,onReorder:Rs,onAdd:()=>Mt()}),Ge&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(vn,{currentRt:K??"",currentLabel:tt($t?.rule),matchers:vt,onSelect:Ms}),un&&Ne&&n.jsx("div",{className:"pt-1",children:n.jsx(Nn,{schema:un,value:Ne,onChange:Es,meta:m??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${l??"none"}:${Et}:${K??""}`)})]})]}),n.jsx(Rn,{activeSchema:Vt,formValue:le,formResetKey:oe,onFormChange:en,onBreadcrumbChange:A,breadcrumbPath:Q,emptyMessage:"No editable fields for this variant.",meta:m,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})]}):ve?n.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Rn,{activeSchema:Vt,formValue:le,formResetKey:oe,onFormChange:en,onBreadcrumbChange:A,breadcrumbPath:Q,emptyMessage:"No editable fields for this global block.",meta:m,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})}):n.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ht&&z!==null&&n.jsxs("div",{className:Ce("px-3 border-b",E?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ne(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":E,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),E?n.jsx(Ia,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Fa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),E&&n.jsxs("div",{className:Ce("space-y-3",wt&&"pointer-events-none opacity-50"),children:[n.jsx(vn,{currentRt:z,currentLabel:Sn(Ze?.rule,o??{},tt,m??void 0),matchers:vt,onSelect:Vs}),nn&&Se&&n.jsx("div",{className:"space-y-3",children:n.jsx(Nn,{schema:nn,value:Se,onChange:As,meta:m??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${_e}:${z??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Pr,{listKey:`${y??""}-${_e}`,rawSections:H,sections:Re,meta:m,selectedIndex:l,onSelect:hs,onReorder:vs,onDelete:Ss,onDuplicate:xs,onMakeReusable:te,onToggleHidden:bs,onToggleLazy:ys,onAddVariant:Mt,onDetach:js,onAddSection:()=>he(!0),canAddSection:Ts})})]}),n.jsx(ga,{open:X!==null,onOpenChange:t=>{t||te(null)},defaultBlockId:X!==null?xn(Re[X]?.label??""):"",isPending:Ve.isPending,onSubmit:Ds}),u&&n.jsx(Sr,{open:pe,onOpenChange:he,meta:m,decofile:o,previewBaseUrl:u,onSelect:_s}),de&&y&&o&&n.jsx(va,{open:de,onOpenChange:ie,pageKey:y,decofile:o}),F!==null&&n.jsx(Ar,{open:!0,initialName:Bt(Ae[F]?.rule,o??{},m??void 0)?Sn(Ae[F]?.rule,o??{},tt,m??void 0):"",autoLabel:tt(jt(Ae[F]?.rule,o??{},m??void 0)),isPending:wt,onSubmit:async t=>{await zs(F,t)},onOpenChange:t=>{!t&&!wt&&M(null)}})]})}export{wl as SectionsEditor};
@@ -1 +1 @@
1
- import{r as c,ai as nt,a2 as Pe,j as d,a3 as rt,aj as be,Z as k,T as st,U as j,V as _,bP as $,a1 as lt,aP as Ne,W as Ee,ah as at,bK as it,bR as ct,dz as dt,dC as ut,dA as pt,dD as ft,_ as mt,X as ht,dB as vt,$ as gt,a0 as xt,c as ee,l as oe}from"./index-DEQy1QF9.js";import{V as St}from"./tooltip-BL0mePCu.js";import{i as wt,n as Ct}from"./ChevronUp-CE8xPbXg.js";import{t as Re}from"./ChevronDown-C4bbhLP1.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Nt="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),N=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,N=>h(N)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const N=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{fo as S,mo as a,po as b,uo as c,co as d,_e as e};
1
+ import{r as c,ai as nt,a2 as Pe,j as d,a3 as rt,aj as be,Z as k,T as st,U as j,V as _,bP as $,a1 as lt,aP as Ne,W as Ee,ah as at,bK as it,bR as ct,dz as dt,dC as ut,dA as pt,dD as ft,_ as mt,X as ht,dB as vt,$ as gt,a0 as xt,c as ee,l as oe}from"./index-BoDi6OBc.js";import{V as St}from"./tooltip-qf4kMmAF.js";import{i as wt,n as Ct}from"./ChevronUp-B0iQd-AD.js";import{t as Re}from"./ChevronDown-QQWh1U0r.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Nt="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),N=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,N=>h(N)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const N=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{fo as S,mo as a,po as b,uo as c,co as d,_e as e};
@@ -1 +1 @@
1
- import{c as D,j as o,l as R,r as $,B as H}from"./index-DEQy1QF9.js";import{i as Q,a as W,c as J,d as K}from"./dialog-BHS2ptj9.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-D9v4s9v6.js";import{u as oe}from"./tooltip-BL0mePCu.js";import{b as A}from"./chat-context-b71f8ijF.js";import{D as te,b as le,S as U,M as se}from"./decopilot-CnVOFmNc.js";import{a as G,b as z}from"./connect-desktop-dialog-UF-B_tPh.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
1
+ import{c as D,j as o,l as R,r as $,B as H}from"./index-BoDi6OBc.js";import{i as Q,a as W,c as J,d as K}from"./dialog-CHU--T7-.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-D4XkXj4V.js";import{u as oe}from"./tooltip-qf4kMmAF.js";import{b as A}from"./chat-context-D45ePksk.js";import{D as te,b as le,S as U,M as se}from"./decopilot-CxoZlpZn.js";import{a as G,b as z}from"./connect-desktop-dialog-DuJwJvdQ.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
@@ -1 +1 @@
1
- import{c as T,j as t,r as Q,B as je,i as Se}from"./index-DEQy1QF9.js";import{i as be}from"./ChevronRight-DqTj9CMD.js";import{L as fe}from"./agent-icon-D_Vdiy4L.js";import{S as ue}from"./scroll-area-DEdbIcur.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-c9ni0Iqb.js";import{s as xe,p as ze}from"./index-CsZmUyDH.js";import{a as ge}from"./Tool01-Dn8TsjT0.js";import"./AlertCircle-DImAh5xx.js";import"./SwitchHorizontal01-BrwHUlrw.js";import"./Settings02-yVlBTWGE.js";import"./XCircle-ONuap0eY.js";import"./ArrowUpRight-CLNttwfX.js";import"./ZapSquare-B0Gjx95e.js";import"./Users03-Bgoxad2r.js";import"./CheckCircle-DZ5kpKko.js";import"./ChevronUp-CE8xPbXg.js";import"./ChevronDown-C4bbhLP1.js";import"./ChevronLeft-f9gCC8R-.js";import"./DotsVertical-CDhL1XVd.js";import"./Stars02-Ca0l5158.js";import"./Eye-CqvLLx1D.js";import"./ZoomOut-daHLLhI1.js";import"./Globe01-D-fiRZyN.js";import"./FilterLines-B7Og5mSP.js";import"./Star01-CXg49Qay.js";import"./Globe04-B5OvaFwZ.js";import"./HardDrive-D8eAcCyZ.js";import"./Key01-CN4p3Jpn.js";import"./LayoutLeft-BmSdmc8T.js";import"./LinkExternal01-DTyP5pnl.js";import"./Monitor01-BCm8_9yi.js";import"./Sun-Djuca5Zz.js";import"./Palette-C9yLJPGq.js";import"./Play-BHmWm_Cq.js";import"./Plus-DX9vjN_e.js";import"./SearchMd-BfuDIY64.js";import"./Shield01-DMxZAMki.js";import"./Stars01-DxmQMnMe.js";import"./Trash01-BnpofYvX.js";import"./Upload01-W_HvCxeO.js";import"./User01-7UlK3gvI.js";import"./Users01-BVS-5f_g.js";import"./XClose-CdVAlar3.js";import"./X-DqLFKEyW.js";import"./Zap-BjHBtonC.js";import"./use-clock-tick-B3Fjfv6y.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BL-vn6lS.js";import"./tooltip-BL0mePCu.js";import"./file-type-icon-stn5MWg0.js";import"./dialog-BHS2ptj9.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BwxhOKtO.js";import"./use-mcp-client-D0QIY1G5.js";import"./auth-GGtOrpqj.js";import"./chat-context-b71f8ijF.js";import"./hooks-DKMYmfW_.js";import"./decopilot-sse-pool-DtIjJlnZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DnSX_CfH.js";import"./use-collections-DWEsKi5E.js";import"./use-ai-providers-BDxDex3s.js";import"./studio-tools-x1ZC7d2e.js";import"./use-organization-settings-QLyvShp_.js";import"./shell-layout-DM81wLO_.js";import"./avatar-0IOP-dk8.js";import"./required-auth-layout-BuHVBqYX.js";import"./use-org-sso-DZuC4bDu.js";import"./sheet-BEjNQdHx.js";import"./integration-icon-CttCAlQh.js";import"./use-navigate-to-agent-BWkZSw4H.js";import"./use-connection-BnlHTQYf.js";import"./use-mcp-prompts-CSTqxsI2.js";import"./form-2YHmbPN6.js";import"./label-B5PiQoOe.js";import"./input-A0PPw-XD.js";import"./select-Bgy43JNh.js";import"./switch-Blv3b1bg.js";import"./index-BzwQkJpG.js";import"./drawer-D9v4s9v6.js";import"./collection-search-tJOk7ccb.js";import"./tabs-Dv1zkwLM.js";import"./toggle-group-DcVxtclJ.js";import"./sortable.esm-BiL2pp-a.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-yNaf3-jg.js";import"./use-registry-connections-1TEskNFX.js";import"./useInfiniteQuery-DWPf0AR5.js";import"./use-infinite-scroll-DO2LKcjb.js";import"./extract-connection-data-DFvYpCky.js";import"./card-DtfzHq7s.js";import"./collection-tabs-9571vcR8.js";import"./badge-CHwQMCeI.js";import"./textarea-DPEBOr90.js";import"./connection-form-helpers-q9qm1gX9.js";import"./authenticate-and-persist-oauth-DWtyomTf.js";import"./mcp-oauth-ByjG93DP.js";import"./useSuspenseInfiniteQuery-DuwVVj2V.js";import"./connect-desktop-dialog-UF-B_tPh.js";import"./decopilot-CnVOFmNc.js";import"./checkbox-CdDqKBw3.js";import"./skeleton-BbcdUjup.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ZkI0flok.js";import"./popover-iXf752Ba.js";import"./command-HsX7KJby.js";import"./index-DGuHidOE.js";import"./dropdown-menu-DaCZ2Y5P.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-0ebRKUpL.js";import"./empty-state-CthrAqip.js";import"./toolbar-BPixQtYQ.js";import"./preview-dialog-ML2U3uqb.js";import"./index-CfhbNXKP.js";import"./use-mcp-tools-pEWZCPwb.js";import"./use-capability-zpQR1fHL.js";import"./shell-route-loading-Og9D167G.js";import"./index-D85IkMSK.js";import"./alert-dialog-BWgxKtuP.js";import"./use-debounced-autosave-B5_gmWws.js";import"./index-8ANhSNnu.js";import"./sidebar-XUbgVLh0.js";import"./search-input-DVVX8had.js";import"./github-repo-picker-BigBhPO3.js";import"./use-secrets-CJD7qwqO.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-BhMi663K.js";import"./automation-runs-BiY1d-bQ.js";import"./table-Go72ywso.js";import"./use-members-C-glWs3e.js";import"./use-org-auth-client-CGl19dLl.js";import"./task-status-LO5yhQ-O.js";import"./use-automations-B7NuCrVE.js";import"./use-file-configs-yrHFSV1E.js";import"./monaco-editor-B9YXKdtw.js";import"./select-model-BUsHC84U.js";import"./automation-list-row-DVmKFJzZ.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function ki(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{ki as SeoEditor};
1
+ import{c as T,j as t,r as Q,B as je,i as Se}from"./index-BoDi6OBc.js";import{i as be}from"./ChevronRight-CWp0460U.js";import{L as fe}from"./agent-icon-BHjJxJmC.js";import{S as ue}from"./scroll-area-B1cpZQna.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-Bp1CNfZX.js";import{s as xe,p as ze}from"./index-BO0QV1fb.js";import{a as ge}from"./Tool01-BXc8J6xZ.js";import"./AlertCircle-C0MMJCns.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./Settings02-DG5mJ_xI.js";import"./XCircle-D9qm_1Ut.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./Users03-BhaYLgGW.js";import"./CheckCircle-B40vdc2l.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./DotsVertical-BBNwX5J5.js";import"./Stars02-CbFOXGiR.js";import"./Eye-bN0xnD-o.js";import"./ZoomOut-wqR_bKeR.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Star01-DPkaqbS_.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Key01-DAsg8mdj.js";import"./LayoutLeft-D2ad_kHx.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Play-VLn5ww3u.js";import"./Plus-BmqFkgYT.js";import"./SearchMd-rJiOFJwK.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Trash01-D1DmT9Mr.js";import"./Upload01-BpkBrNfw.js";import"./User01-DhqtO0lv.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./X-Dqpx-r1T.js";import"./Zap-C6SkRgFu.js";import"./use-clock-tick-aakwXYCP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-V0KcMVib.js";import"./tooltip-qf4kMmAF.js";import"./file-type-icon-CVukPbEL.js";import"./dialog-CHU--T7-.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BV8aIt26.js";import"./use-mcp-client-DuJQA2rV.js";import"./auth-C19hiZia.js";import"./chat-context-D45ePksk.js";import"./hooks-C9iWb2N3.js";import"./decopilot-sse-pool-BH11VGHE.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BdsGMQZL.js";import"./use-collections-D4X4_zKE.js";import"./use-ai-providers-DuFfPCpZ.js";import"./studio-tools-Lqif47iD.js";import"./use-organization-settings-nc8QZXyP.js";import"./shell-layout-BFU4WLoP.js";import"./avatar-Bbvs8iIt.js";import"./required-auth-layout-BolsfPYi.js";import"./use-org-sso-BzsvKCfF.js";import"./sheet-BDdFViUD.js";import"./integration-icon-BpZ3OsA4.js";import"./use-navigate-to-agent-BNMv1Neu.js";import"./use-connection-CyHDjrsh.js";import"./use-mcp-prompts-CmUaiuB7.js";import"./form-Bxj0TUqV.js";import"./label-7phVZ6ZM.js";import"./input-DJV4VNka.js";import"./select-DlsRm0pM.js";import"./switch-CzdCn_lr.js";import"./index-YYxzAkAN.js";import"./drawer-D4XkXj4V.js";import"./collection-search-EReXMo3F.js";import"./tabs-DoKlXPZO.js";import"./toggle-group-DCz7F7cJ.js";import"./sortable.esm-JwRAHi44.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-uZjILvOr.js";import"./use-registry-connections-CJhKWnft.js";import"./useInfiniteQuery-CkJOjicq.js";import"./use-infinite-scroll-4IJEWhiu.js";import"./extract-connection-data-Ws_H4ap3.js";import"./card-RkuQTlVn.js";import"./collection-tabs-C3OblNuX.js";import"./badge-C3IXjCX0.js";import"./textarea-BjequYD7.js";import"./connection-form-helpers-DV9ppnRP.js";import"./authenticate-and-persist-oauth-B1-SzA6A.js";import"./mcp-oauth-BGRbdqPD.js";import"./useSuspenseInfiniteQuery-n6ZCdGbO.js";import"./connect-desktop-dialog-DuJwJvdQ.js";import"./decopilot-CxoZlpZn.js";import"./checkbox-yMsno3zH.js";import"./skeleton-DpU2T6Js.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CAKwpEKX.js";import"./popover-Bo_sL62z.js";import"./command-BsaV9rjm.js";import"./index-NjN7v_96.js";import"./dropdown-menu-D2HxaMPU.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DaofAwGt.js";import"./empty-state-DA37X_xl.js";import"./toolbar-DMerIIuJ.js";import"./preview-dialog-B9gUDoJJ.js";import"./index-CprKTf1O.js";import"./use-mcp-tools-D715CcxL.js";import"./use-capability-DLjX445R.js";import"./shell-route-loading-P7c6nIb-.js";import"./index-bmV9L0o4.js";import"./alert-dialog-Cz6L6NXK.js";import"./use-debounced-autosave-C-eVH4yR.js";import"./index-BFqTOqSJ.js";import"./sidebar-DoXfrWOj.js";import"./search-input-H6T5GrKJ.js";import"./github-repo-picker-nQicPdJf.js";import"./use-secrets-CxFfyxif.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-C9q5ISiT.js";import"./automation-runs-CFBKS4y-.js";import"./table-CLXzS61A.js";import"./use-members-DIDnJkLY.js";import"./use-org-auth-client-DtHGY2-t.js";import"./task-status-DPcnbZIP.js";import"./use-automations-CauJKNE9.js";import"./use-file-configs-BG_rDJRo.js";import"./monaco-editor-Cqq2xAH1.js";import"./select-model-jVluH6Ea.js";import"./automation-list-row-BYkbwrNr.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function ki(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{ki as SeoEditor};