decocms 4.562.2 → 4.563.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/dist/client/assets/{AlertCircle-BPGyk76P.js → AlertCircle-CzNhPAKr.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Dwi8bZZ1.js → AreaChart-jXN8ob1W.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DRdw9Nza.js → ArrowLeft-BZrvcUxe.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BJTv4ddc.js → ArrowUp-BmvC0gDN.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-DHyrpR7F.js → CartesianChart-Dr9bA6s0.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-CVu6TY4_.js → CategoricalChart-Db8BeNXp.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-y3P873c6.js → CheckCircle-BfgWRJx4.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-TIONA5Zl.js → ChevronSelectorVertical-Dk3Ic8_G.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CDe5Gfov.js → ChevronUp-CslLufEI.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-abk_vBBR.js → CreditCard01-DKR27XQP.js} +1 -1
  11. package/dist/client/assets/{Globe04-Dr1jk8eS.js → Globe04-DD-_PtpP.js} +1 -1
  12. package/dist/client/assets/{Key01-DzZgIVqE.js → Key01-CNesFlbK.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-4j6Z2AOF.js → LinkBroken01-K7vV_sRk.js} +1 -1
  14. package/dist/client/assets/{Minus-B2u_zm0f.js → Minus-DeqVl1Xe.js} +1 -1
  15. package/dist/client/assets/{Monitor01-DWylBoOJ.js → Monitor01-Bx36gCte.js} +1 -1
  16. package/dist/client/assets/{Play-CV8_Sy8a.js → Play-CkRBFbju.js} +1 -1
  17. package/dist/client/assets/{Plus-BtfY7EHX.js → Plus-DtM4w8bA.js} +1 -1
  18. package/dist/client/assets/ReferenceLine-38pFjaQt.js +1 -0
  19. package/dist/client/assets/{SearchMd-DD6kw-fs.js → SearchMd-Bbg1gFfR.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-CY137tVP.js → ShoppingBag01-DW9ACSlI.js} +1 -1
  21. package/dist/client/assets/{Sun-CyYLfv8E.js → Sun-DUSHragw.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-C3qdjyVX.js → SwitchHorizontal01-BCe-gFOc.js} +1 -1
  23. package/dist/client/assets/{Tool01-CyX9Nllj.js → Tool01-snML4pPn.js} +1 -1
  24. package/dist/client/assets/{Tooltip-DVBICxdG.js → Tooltip-CNZGI5Tv.js} +1 -1
  25. package/dist/client/assets/{Trash01-DSJ1LUhI.js → Trash01-DPGVoVI0.js} +1 -1
  26. package/dist/client/assets/{Upload01-DC0joCKG.js → Upload01-B1K1jpRL.js} +1 -1
  27. package/dist/client/assets/{UserSquare-DmeGszKa.js → UserSquare-DgIYcYhA.js} +1 -1
  28. package/dist/client/assets/{Users01-B-OacssU.js → Users01-DeK6IcUy.js} +1 -1
  29. package/dist/client/assets/{XClose-avSrIpAi.js → XClose-B40NOWtA.js} +1 -1
  30. package/dist/client/assets/{Zap--C2rij07.js → Zap-PrQtyQ4u.js} +1 -1
  31. package/dist/client/assets/{access-gate-Bd3vMxaX.js → access-gate-Czwg28Aa.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-uIVnUFji.js → add-connection-dialog-CvoK8CuD.js} +1 -1
  33. package/dist/client/assets/agent-app-CIdQoDEi.js +1 -0
  34. package/dist/client/assets/agent-assets-BJMuyqMN.js +1 -0
  35. package/dist/client/assets/{agent-automation-BgD0bRSV.js → agent-automation-CC8RZvdz.js} +3 -3
  36. package/dist/client/assets/{agent-automations-DfordlM0.js → agent-automations-Cv89ZDoQ.js} +1 -1
  37. package/dist/client/assets/agent-calendar-DWLtrh5a.js +1 -0
  38. package/dist/client/assets/agent-capabilities-DYSIvwwC.js +1 -0
  39. package/dist/client/assets/{agent-connect-sources-C33PwxBc.js → agent-connect-sources-dcz4ghlO.js} +1 -1
  40. package/dist/client/assets/agent-deck-79ukGlaD.js +1 -0
  41. package/dist/client/assets/agent-e2e-BecV8iK7.js +1 -0
  42. package/dist/client/assets/agent-experiments-0rDHUtoa.js +1 -0
  43. package/dist/client/assets/agent-file-CcRMmQIR.js +1 -0
  44. package/dist/client/assets/agent-hosting-Bp7-sUtV.js +1 -0
  45. package/dist/client/assets/{agent-icon-Nkid6y9z.js → agent-icon-_Y5eusMw.js} +1 -1
  46. package/dist/client/assets/agent-library-CGgf7yTT.js +1 -0
  47. package/dist/client/assets/agent-library-file-A_6ZSStB.js +1 -0
  48. package/dist/client/assets/agent-overview-CcczGeFG.js +1 -0
  49. package/dist/client/assets/agent-releases-Kc5s36Dn.js +2 -0
  50. package/dist/client/assets/agent-settings-BrQ-Mnfr.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-CVSVIfgT.js → agent-site-editor-DcjkqLR_.js} +2 -2
  52. package/dist/client/assets/agent-site-editor-code-C9Vac5kP.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-BK40eFw4.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-BmrJe1z-.js +1 -0
  55. package/dist/client/assets/agent-view-CwNNidpp.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-BkTiwrL7.js → agent-view-guard-coqrNjXy.js} +1 -1
  57. package/dist/client/assets/{ai-providers-C77po6hX.js → ai-providers-D_h0GcaP.js} +1 -1
  58. package/dist/client/assets/{alert-8ZKgnOi9.js → alert-h8V4X8Ql.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-D2pjEazH.js → analytics-sections-BBSHBKo9.js} +1 -1
  60. package/dist/client/assets/{api-keys-CalFVYGL.js → api-keys-BZ1sBCY5.js} +1 -1
  61. package/dist/client/assets/api-keys-Clz5-Ffr.js +1 -0
  62. package/dist/client/assets/app-editor-CYkeSh8v.js +1 -0
  63. package/dist/client/assets/{asset-utils-CwwYcMA6.js → asset-utils-0I7CXwnB.js} +1 -1
  64. package/dist/client/assets/{auth-xvjttF9D.js → auth-BFbUp7Gk.js} +1 -1
  65. package/dist/client/assets/{auth-catchall--6gbNuLd.js → auth-catchall-Ciz3QLIw.js} +1 -1
  66. package/dist/client/assets/{auth-entry-CsdiTapN.js → auth-entry-CIbESaRU.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-BqtGBv-Q.js → auth-split-layout-DXGPO57q.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-DdntocF2.js → authenticate-and-persist-oauth-CDOOyhvF.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-DtkMgEsK.js → automation-list-row-cqG8j4NI.js} +1 -1
  70. package/dist/client/assets/{automation-runs-DxsRwY7z.js → automation-runs-CJPBgcyt.js} +1 -1
  71. package/dist/client/assets/automations-CUnI1LGP.js +1 -0
  72. package/dist/client/assets/{autosend-DbfDzqlB.js → autosend-hIWj1gzu.js} +1 -1
  73. package/dist/client/assets/{badge-BLk85LCv.js → badge-DccxBHlR.js} +1 -1
  74. package/dist/client/assets/{block-document-CSsqtozZ.js → block-document-DQqooS8Z.js} +2 -2
  75. package/dist/client/assets/{blocks-preview-workspace-context-C59bKt9w.js → blocks-preview-workspace-context-DHaN_ngV.js} +1 -1
  76. package/dist/client/assets/blocks-tab-states-CXVOpcLP.js +1 -0
  77. package/dist/client/assets/{blog-schema-B65cUy5G.js → blog-schema-DZRuLzaf.js} +1 -1
  78. package/dist/client/assets/{buckets-CNCQh0A_.js → buckets-CF13tBzF.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-DUmEW7kR.js → build-improve-prompt-doc-Csewa1WB.js} +1 -1
  80. package/dist/client/assets/{calendar-CDcnOKeY.js → calendar-CUq9MxZD.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-BZMPli2s.js → capability-load-error-PMRTSYzm.js} +1 -1
  82. package/dist/client/assets/category-editor-f0PbIiVt.js +1 -0
  83. package/dist/client/assets/chart-DHsiNcHK.js +13 -0
  84. package/dist/client/assets/{chat-context-yHOaM07v.js → chat-context-zQ-qHQlQ.js} +2 -2
  85. package/dist/client/assets/{chat-draft-BKLG-IxC.js → chat-draft-DnX_-WHk.js} +1 -1
  86. package/dist/client/assets/{checkbox-Dv6iFznu.js → checkbox-DNUaBZYX.js} +1 -1
  87. package/dist/client/assets/{choose-editor-BbaXuEWm.js → choose-editor-Bre429IU.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-CINmtrn-.js → cli-auth-success-xdbDz12_.js} +1 -1
  89. package/dist/client/assets/{client-icons-CRCSqe4B.js → client-icons-DbvjRooY.js} +1 -1
  90. package/dist/client/assets/cms-settings-editor-B3_YVdwE.js +1 -0
  91. package/dist/client/assets/cms-store-drafts-BL8-fLzg.js +1 -0
  92. package/dist/client/assets/{collapsible-WPiOb2df.js → collapsible-DEQoVVA9.js} +1 -1
  93. package/dist/client/assets/{collection-detail-DeLh0iGu.js → collection-detail-Dl6n3nUb.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-X03nm1ka.js → collection-display-button-BgO5nlf5.js} +1 -1
  95. package/dist/client/assets/{collection-search-CPadQqKp.js → collection-search-BKCnDfDh.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-DbE8PRZm.js → collection-table-wrapper-BiwEx8lf.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-B05-I-04.js → collection-tabs-CLJwpk3w.js} +1 -1
  98. package/dist/client/assets/{combobox-AFeNX90_.js → combobox-BLt_NngQ.js} +1 -1
  99. package/dist/client/assets/{command-CSFENWMV.js → command-CnM6TkoO.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-DByl9EP4.js → companion-mcps-section-DDgSYTAO.js} +1 -1
  101. package/dist/client/assets/{config-BuNaSsQb.js → config-CTbwXMPm.js} +1 -1
  102. package/dist/client/assets/{connect-B5ODvCMk.js → connect-BzaGqaBY.js} +3 -3
  103. package/dist/client/assets/{connect-layout-CrQKfs54.js → connect-layout-BZ1xoFNF.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-dT9CEaaL.js → connect-source-dialog-BPQ5BKOR.js} +1 -1
  105. package/dist/client/assets/{connection-9Wtillpb.js → connection-BWV5QLFO.js} +1 -1
  106. package/dist/client/assets/{connection-card-B7mEOoWU.js → connection-card-xMr1YFzW.js} +1 -1
  107. package/dist/client/assets/{connection-detail-CVkLDsqd.js → connection-detail-CGUXC9hw.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-ZOfZ5xVa.js → connection-form-helpers-CaRBbMf9.js} +1 -1
  109. package/dist/client/assets/{connection-slug-BCjSI_lE.js → connection-slug-Ygf3Xiz0.js} +1 -1
  110. package/dist/client/assets/{connections-B2Pjgwb4.js → connections-wIdj6C4c.js} +1 -1
  111. package/dist/client/assets/content-tab-D6UWTBDG.js +25 -0
  112. package/dist/client/assets/context-B_HaMwVa.js +1 -0
  113. package/dist/client/assets/{context-menu-Cgl4PGwR.js → context-menu-BOlWz_az.js} +1 -1
  114. package/dist/client/assets/{context-shell-xJwj29nG.js → context-shell-Cdw9KYb9.js} +3 -3
  115. package/dist/client/assets/{core.esm-C3kzKmQL.js → core.esm-BbSbwofB.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-C6jgiT68.js → create-organization-dialog-Dzeh0MX0.js} +1 -1
  117. package/dist/client/assets/device-hint-D3M6OFi8.js +1 -0
  118. package/dist/client/assets/discover-DCcWfC01.js +1 -0
  119. package/dist/client/assets/{domain-settings-CUR5XLBa.js → domain-settings-Ce2bhWej.js} +1 -1
  120. package/dist/client/assets/{drawer-1kqkgpFK.js → drawer-D4DxFGqN.js} +1 -1
  121. package/dist/client/assets/{editor-CrG4V3zO.js → editor-DKoVU6S3.js} +1 -1
  122. package/dist/client/assets/{editor-classes-LBX4QjrW.js → editor-classes-DEInI3IT.js} +1 -1
  123. package/dist/client/assets/{empty-state-CbRq3C3n.js → empty-state-CiXq08R1.js} +1 -1
  124. package/dist/client/assets/{empty-state-CVOGmYU9.js → empty-state-DMIzfRid.js} +1 -1
  125. package/dist/client/assets/experiments-tab-choice-DtHr55-O.js +1 -0
  126. package/dist/client/assets/{extract-connection-data-C6MDLhDM.js → extract-connection-data-m9qRk70G.js} +1 -1
  127. package/dist/client/assets/{feature-gate-Uh4gtHbP.js → feature-gate-CbZSFCGe.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-BVXAF3Vl.js → feature-paywall-BorE2qu6.js} +1 -1
  129. package/dist/client/assets/{feedback-Bx6uae5t.js → feedback-DM7ibKhA.js} +1 -1
  130. package/dist/client/assets/{file-explorer-B33pnQXI.js → file-explorer-DgsYJwlc.js} +2 -2
  131. package/dist/client/assets/{file-preview-DifPTXD4.js → file-preview-ClFQiMsH.js} +1 -1
  132. package/dist/client/assets/{file-share-button-OD6j_Xmo.js → file-share-button-oASYWaTp.js} +2 -2
  133. package/dist/client/assets/{file-type-icon-jLU7FJUL.js → file-type-icon-BgsOvG37.js} +1 -1
  134. package/dist/client/assets/{folder-icon-Bk-fEOJa.js → folder-icon-CjXRQ1u4.js} +1 -1
  135. package/dist/client/assets/{form-DE5X7SPR.js → form-BV9LGfdZ.js} +1 -1
  136. package/dist/client/assets/{general-DxPCrqDE.js → general-BOq7h34V.js} +1 -1
  137. package/dist/client/assets/{github-icon-Bvc_Uep-.js → github-icon-BoZFAAoR.js} +1 -1
  138. package/dist/client/assets/home-Y-BAzROz.js +1 -0
  139. package/dist/client/assets/{home-overview-3LLMJPVW.js → home-overview-ztctpGGy.js} +1 -1
  140. package/dist/client/assets/hosted-reconcile-DgpDwrI2.js +1 -0
  141. package/dist/client/assets/{icon-button-1xC_JQLB.js → icon-button-DeiyuWHW.js} +1 -1
  142. package/dist/client/assets/{index-KGPpyCdi.js → index-2dSYni92.js} +1 -1
  143. package/dist/client/assets/{index-eKAZ8rFQ.js → index-5iKTkoGz.js} +2 -2
  144. package/dist/client/assets/{index-BJKjGJrF.js → index-BEm4jG3I.js} +1 -1
  145. package/dist/client/assets/{index-xAQMjVHe.js → index-BFUInOpF.js} +1 -1
  146. package/dist/client/assets/{index-Czm9RrRY.js → index-CDlOTJSg.js} +1 -1
  147. package/dist/client/assets/index-CK6jFdOD.js +4 -0
  148. package/dist/client/assets/index-CKcY9sA2.js +1 -0
  149. package/dist/client/assets/{index-pqEXXiDC.js → index-CxYhsN0K.js} +1 -1
  150. package/dist/client/assets/{index-J6dVRDZu.js → index-DFF-_wih.js} +1 -1
  151. package/dist/client/assets/{index-DOaDUx72.js → index-DHdEN2_u.js} +1 -1
  152. package/dist/client/assets/{index-Wodin-tK.js → index-DSp2YJxk.js} +1 -1
  153. package/dist/client/assets/{index-DyoVCnKR.js → index-DYiWplV5.js} +1 -1
  154. package/dist/client/assets/{index-C1iaIX-s.js → index-DbAn_rcU.js} +6 -6
  155. package/dist/client/assets/{index-BHtZ5LOo.js → index-Dh9YHhq0.js} +1 -1
  156. package/dist/client/assets/{index-DWvRfTwV.js → index-DxGCPS5f.js} +53 -53
  157. package/dist/client/assets/{index-L3rSytXD.js → index-DzoENFz8.js} +1 -1
  158. package/dist/client/assets/index-SmuiYnIl.css +1 -0
  159. package/dist/client/assets/{index-redirect-D52J_8O4.js → index-redirect-rsQ177qk.js} +1 -1
  160. package/dist/client/assets/{infiniteQueryObserver-O1nZgTsK.js → infiniteQueryObserver-BRbF_8wg.js} +1 -1
  161. package/dist/client/assets/{infra-billing-CsrcHH3z.js → infra-billing-CskAuVtU.js} +1 -1
  162. package/dist/client/assets/input-BznJkJE1.js +17 -0
  163. package/dist/client/assets/{input-Z4x7UYYS.js → input-CYN8nGNA.js} +1 -1
  164. package/dist/client/assets/{integration-icon-BCp7DD7C.js → integration-icon-CivNYrxB.js} +1 -1
  165. package/dist/client/assets/{jira-icon-Cgp_nHIG.js → jira-icon-EhOwRLcu.js} +1 -1
  166. package/dist/client/assets/{label-BkzEUDUr.js → label-Co3RnKjI.js} +1 -1
  167. package/dist/client/assets/{layout-pqxzJsxG.js → layout-ChuRSl3A.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-C88GLYmw.js → legacy-agents-deep-D0c9eotJ.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-DcmC8SjE.js → legacy-main-redirect-B6HagH9j.js} +1 -1
  170. package/dist/client/assets/library-P47bCY92.js +1 -0
  171. package/dist/client/assets/{library-tab-DI44ELWs.js → library-tab-QNwTrF2z.js} +3 -3
  172. package/dist/client/assets/{login-DQICOGIE.js → login-G4MQMu-X.js} +1 -1
  173. package/dist/client/assets/{markdown-DkmjrNqn.js → markdown-BkKuf5yA.js} +1 -1
  174. package/dist/client/assets/{mcp-app-renderer-CIky1nBi.js → mcp-app-renderer-AZxi3AlX.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-CNMWqwMp.js → mcp-oauth-C-lvxcK7.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-SAUpfbwO.js → mcp-oauth-C3sBEl47.js} +1 -1
  177. package/dist/client/assets/{members-BT1BIG15.js → members-fyMprese.js} +1 -1
  178. package/dist/client/assets/{memory-BDRH6Og0.js → memory-0qhTiXOS.js} +1 -1
  179. package/dist/client/assets/{mock-board-BF-mAr4y.js → mock-board-B5Lo4WRg.js} +4 -4
  180. package/dist/client/assets/{monaco-editor-Dff4ZjU3.js → monaco-editor-03CuhEOx.js} +1 -1
  181. package/dist/client/assets/monitoring-BWMV-UnG.js +2 -0
  182. package/dist/client/assets/{monitoring-stats-row-ZCTbL6bH.js → monitoring-stats-row-BHB7ML9p.js} +1 -1
  183. package/dist/client/assets/{multi-select-B4WkKxx8.js → multi-select-BvRkhFxR.js} +1 -1
  184. package/dist/client/assets/mustache-BRZEXzlS.js +4 -0
  185. package/dist/client/assets/named-rule-view-NWkI621l.js +1 -0
  186. package/dist/client/assets/{new-project-dialog-Kvs8XyHN.js → new-project-dialog-B_Izhfc6.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-CIFexUJN.js → oauth-callback-C3qf7NWs.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-3-_RChJi.js → oauth-callback-ai-provider-BOCoomMC.js} +1 -1
  189. package/dist/client/assets/{oauth-consent-vlJReqsl.js → oauth-consent-kRuFuPRq.js} +1 -1
  190. package/dist/client/assets/{onboarding-CC0xFJ-5.js → onboarding-C9TuarYv.js} +1 -1
  191. package/dist/client/assets/openai-conversation-C1V_CQca.js +3 -0
  192. package/dist/client/assets/{optimistic-project-sidebar-views-BmsZ-Me-.js → optimistic-project-sidebar-views-Ms5q90dF.js} +1 -1
  193. package/dist/client/assets/{order-monitor-day-Cxsz6w2q.js → order-monitor-day-B8IwQXNk.js} +1 -1
  194. package/dist/client/assets/{organization-choice-4fOAxXZj.js → organization-choice-IdTamlIL.js} +1 -1
  195. package/dist/client/assets/{orgs-nKU8niHO.js → orgs-D6Y9NZAy.js} +1 -1
  196. package/dist/client/assets/{own-accounts-section-B2chKMQ0.js → own-accounts-section-CX4xOba8.js} +1 -1
  197. package/dist/client/assets/{pair-BwCxrq_f.js → pair-BzWauPYd.js} +7 -7
  198. package/dist/client/assets/{parse-sections-CK6AHU3E.js → parse-sections-DE8GWmV_.js} +7 -7
  199. package/dist/client/assets/{plan-C4kJq3a0.js → plan-CANZ8MES.js} +1 -1
  200. package/dist/client/assets/{plan-ladder-wSfhs4No.js → plan-ladder-CAL4h1RI.js} +1 -1
  201. package/dist/client/assets/{plan-usage-card-CBlBUX6I.js → plan-usage-card-B0E1Mqx-.js} +2 -2
  202. package/dist/client/assets/{popover-CpDRMXBS.js → popover-cnXo99rU.js} +1 -1
  203. package/dist/client/assets/post-calendar-CR_baRyF.js +1 -0
  204. package/dist/client/assets/{post-editor-BHEvn_Zz.js → post-editor-DuGV7g7L.js} +2 -2
  205. package/dist/client/assets/{preview-content-C4WlFzcj.js → preview-content-Cspo-rar.js} +1 -1
  206. package/dist/client/assets/{preview-dialog-CSGQDL5A.js → preview-dialog-sM6fzUlE.js} +1 -1
  207. package/dist/client/assets/{preview-panel-BMN_Ysm9.js → preview-panel-vDb65VC_.js} +1 -1
  208. package/dist/client/assets/preview-tab-BjhtYZTR.js +551 -0
  209. package/dist/client/assets/{product-picker-dialog-DzFQlf9n.js → product-picker-dialog-DL4criSm.js} +1 -1
  210. package/dist/client/assets/{profile-DGzRd8vX.js → profile-D0f8KwpQ.js} +1 -1
  211. package/dist/client/assets/project-app-view-BAfcj1IV.js +1 -0
  212. package/dist/client/assets/project-apps-DoVt9kS_.js +1 -0
  213. package/dist/client/assets/{project-icon-DTA6ZXhl.js → project-icon-BnHxv46u.js} +1 -1
  214. package/dist/client/assets/{project-index-BmalKoU9.js → project-index-WJ4tXHCM.js} +1 -1
  215. package/dist/client/assets/project-reports-DYL24PFI.js +1 -0
  216. package/dist/client/assets/project-sidebar-views-CLVZ96mT.js +1 -0
  217. package/dist/client/assets/project-tasks-C0N1MlNa.js +1 -0
  218. package/dist/client/assets/{projects-BIj_kuAC.js → projects-LpPdlGF4.js} +1 -1
  219. package/dist/client/assets/{projects-empty-state-DVir8yX9.js → projects-empty-state-iR6Zz5-N.js} +1 -1
  220. package/dist/client/assets/{prompts-BmgauEg8.js → prompts-XgZrzKUE.js} +1 -1
  221. package/dist/client/assets/record-editor-B9sjj4Iw.js +1 -0
  222. package/dist/client/assets/redirect-editor-D2q-6Lz4.js +1 -0
  223. package/dist/client/assets/{reports-7rmI992n.js → reports-5E4FVu6v.js} +1 -1
  224. package/dist/client/assets/reports-D1yzySzc.js +1 -0
  225. package/dist/client/assets/{reports-onboarding-DPzdd7qa.js → reports-onboarding-DC_5ahpO.js} +1 -1
  226. package/dist/client/assets/{reports-tab-C_NZHfzv.js → reports-tab-CJb3-7vP.js} +2 -2
  227. package/dist/client/assets/{repositories-D3yxw4y-.js → repositories-7NE-Y-fP.js} +1 -1
  228. package/dist/client/assets/repositories-B2vK4Cqr.js +1 -0
  229. package/dist/client/assets/{repository-binding-CeErFm4l.js → repository-binding-C4_xIShf.js} +1 -1
  230. package/dist/client/assets/{repository-picker-C3C3_E5g.js → repository-picker-CX0VOapR.js} +1 -1
  231. package/dist/client/assets/{require-capability-BOrIzed0.js → require-capability-1AcS0xbn.js} +1 -1
  232. package/dist/client/assets/{required-auth-layout-nGThcCwM.js → required-auth-layout-lwAsP7t-.js} +1 -1
  233. package/dist/client/assets/{reset-password-xu4Q0lXY.js → reset-password-DRB8IWFN.js} +1 -1
  234. package/dist/client/assets/{resizable-gNSqe3KZ.js → resizable-CZ6UntWr.js} +1 -1
  235. package/dist/client/assets/resolve-tab-icon-JlFD9Ttu.js +1 -0
  236. package/dist/client/assets/{review-settings-CjrtYBLa.js → review-settings-DpoAEk87.js} +1 -1
  237. package/dist/client/assets/{role-color-DQHx1mqZ.js → role-color-CAgewKmr.js} +1 -1
  238. package/dist/client/assets/{roles-C_hPZ63M.js → roles-D-1qXwgE.js} +1 -1
  239. package/dist/client/assets/route-BM3UxPQb.js +1 -0
  240. package/dist/client/assets/route-CAQmwL3B.js +1 -0
  241. package/dist/client/assets/route-DVYYyJNN.js +1 -0
  242. package/dist/client/assets/sandbox-lifecycle-context-ByyfF0kL.js +1 -0
  243. package/dist/client/assets/{schema-DvxWNZKz.js → schema-DyY5h7Rx.js} +1 -1
  244. package/dist/client/assets/{schema-DiUKA_SL.js → schema-STdjEbAK.js} +1 -1
  245. package/dist/client/assets/{scroll-area-CUevVS4T.js → scroll-area-DJvIk_1i.js} +1 -1
  246. package/dist/client/assets/{search-input-DWWqDlal.js → search-input-BRZEiJxt.js} +1 -1
  247. package/dist/client/assets/{search-toggle-Z6tLdJtz.js → search-toggle-BW-nCNIt.js} +1 -1
  248. package/dist/client/assets/{secret-picker-BK4dq3ip.js → secret-picker-DvJbV8kU.js} +1 -1
  249. package/dist/client/assets/{secrets-DrGLagdz.js → secrets-CQ4fmQqK.js} +1 -1
  250. package/dist/client/assets/section-array-field-CzG_jptj.js +1 -0
  251. package/dist/client/assets/{sections-CC9QneUq.js → sections-CHxeuMKy.js} +1 -1
  252. package/dist/client/assets/sections-editor-B_kNIbOe.js +1 -0
  253. package/dist/client/assets/{select-gJgQvQZg.js → select-C30nxii2.js} +1 -1
  254. package/dist/client/assets/{select-model-ivosxEc9.js → select-model-DRBYpCaL.js} +1 -1
  255. package/dist/client/assets/seo-editor-DazAHwbK.js +1 -0
  256. package/dist/client/assets/{separator-PY5RFBB-.js → separator-vR8karC8.js} +1 -1
  257. package/dist/client/assets/settings-tab-Bvb5mnr2.js +1 -0
  258. package/dist/client/assets/{sheet-BKUVqko3.js → sheet-ClaqVLRv.js} +1 -1
  259. package/dist/client/assets/{shell-layout-Bx4AZ_YV.js → shell-layout-dHGD2tyJ.js} +1 -1
  260. package/dist/client/assets/site-draft-actions-BIA6lR1g.js +3 -0
  261. package/dist/client/assets/site-draft-view-Ci2I7i9g.js +1 -0
  262. package/dist/client/assets/site-editor-CmjAnts6.js +1 -0
  263. package/dist/client/assets/site-editor-toast-CgoUJTSW.js +1 -0
  264. package/dist/client/assets/{skills-CZlPyCDI.js → skills-D1-DQBAA.js} +1 -1
  265. package/dist/client/assets/{slider-CnnTZZH8.js → slider-B_ZUvu11.js} +1 -1
  266. package/dist/client/assets/{sortable.esm-YReNzob1.js → sortable.esm-BqKBxgnm.js} +1 -1
  267. package/dist/client/assets/{sso-B0Izx2rk.js → sso-DFYqPjQF.js} +1 -1
  268. package/dist/client/assets/{suggestion-D-YZpsQl.js → suggestion-B-tT_3Ba.js} +1 -1
  269. package/dist/client/assets/{switch-UpbwlQtZ.js → switch-BhYC-gsU.js} +1 -1
  270. package/dist/client/assets/{synced-repos-DJZhlM-5.js → synced-repos-CNpviR6w.js} +1 -1
  271. package/dist/client/assets/{tab-icon-glyph-BA8eumIA.js → tab-icon-glyph-BrdbQUjH.js} +1 -1
  272. package/dist/client/assets/{table-D9nZzqmf.js → table-Dioc_TQV.js} +1 -1
  273. package/dist/client/assets/{tabs-BFXzZPNk.js → tabs-t_453qON.js} +1 -1
  274. package/dist/client/assets/{task-board-CzrPT-OZ.js → task-board-T7oS4tjE.js} +1 -1
  275. package/dist/client/assets/{task-route-DrqrKj8M.js → task-route-BABnfdht.js} +1 -1
  276. package/dist/client/assets/{task-status-B5fYlW4s.js → task-status-B5yaN2e9.js} +1 -1
  277. package/dist/client/assets/{taskboard-analytics-Bo8Bxm9q.js → taskboard-analytics-CEOCzjed.js} +1 -1
  278. package/dist/client/assets/{tasks-BFPPo49C.js → tasks-CPtiTkqv.js} +3 -3
  279. package/dist/client/assets/tasks-DmeEepcP.js +1 -0
  280. package/dist/client/assets/{textarea-BVq0fBVJ.js → textarea-CHZQytvO.js} +1 -1
  281. package/dist/client/assets/{thread-analytics-j4C-4XbM.js → thread-analytics-w3Kn_9QO.js} +1 -1
  282. package/dist/client/assets/{thread-intent-BONVdhUb.js → thread-intent-DckhqhKt.js} +2 -2
  283. package/dist/client/assets/{thread-route-DMWye38f.js → thread-route-CIVmQ-Bx.js} +1 -1
  284. package/dist/client/assets/{thread-route-CDlnAMQ3.js → thread-route-DyG_eSJM.js} +1 -1
  285. package/dist/client/assets/{thread-sheet-body-C1Yi4Tsp.js → thread-sheet-body-C7OutFPd.js} +1 -1
  286. package/dist/client/assets/{time-range-picker-DuQ-XfqJ.js → time-range-picker-Dg1tvNlk.js} +1 -1
  287. package/dist/client/assets/{toggle-group-Bw4R79dp.js → toggle-group-CC2qDSue.js} +1 -1
  288. package/dist/client/assets/{tool-namespace-CmEhPnkj.js → tool-namespace-WdIPTHBa.js} +1 -1
  289. package/dist/client/assets/{tool-set-selector-DAvZ69Ky.js → tool-set-selector-By0-LDtv.js} +1 -1
  290. package/dist/client/assets/{toolbar-icon-button-CRZySHtx.js → toolbar-icon-button-CjbxTTYr.js} +1 -1
  291. package/dist/client/assets/{tooltip-BVv5wAeF.js → tooltip-xj6ZnC0s.js} +1 -1
  292. package/dist/client/assets/{tooltipContext-DwFHeBjZ.js → tooltipContext-BPLu0XDW.js} +1 -1
  293. package/dist/client/assets/{track-CHjUqURA.js → track-Ba7_Ntbn.js} +1 -1
  294. package/dist/client/assets/{types-7R44AYrk.js → types-B8snWcBI.js} +1 -1
  295. package/dist/client/assets/{url-slug-CoT8zovb.js → url-slug-Dv3zxns9.js} +1 -1
  296. package/dist/client/assets/{usage-stats-qZh3WQDj.js → usage-stats-hNAp_EX0.js} +2 -2
  297. package/dist/client/assets/{use-ai-providers-CCcuLCZt.js → use-ai-providers-8QFj-dPT.js} +1 -1
  298. package/dist/client/assets/{use-apply-named-rule-BRjLBznN.js → use-apply-named-rule-BKcXT1e9.js} +1 -1
  299. package/dist/client/assets/use-ask-in-chat-C5fM3Bv6.js +1 -0
  300. package/dist/client/assets/{use-automations-jhigzQzP.js → use-automations-CTbTqBX7.js} +1 -1
  301. package/dist/client/assets/{use-autosave--xoi8yhU.js → use-autosave-CiyRV4I8.js} +1 -1
  302. package/dist/client/assets/use-blocks-v8-project-Oxne65-_.js +1 -0
  303. package/dist/client/assets/{use-chat-layout-state-Dnl_7DMo.js → use-chat-layout-state-D-U8t0kV.js} +1 -1
  304. package/dist/client/assets/{use-cms-publish-actions-CgLBJwXN.js → use-cms-publish-actions-DmkL-hz5.js} +5 -5
  305. package/dist/client/assets/{use-connect-companion-BVtzi_36.js → use-connect-companion-Bwtrfh-M.js} +1 -1
  306. package/dist/client/assets/{use-connection-BQpfU6u4.js → use-connection-B3EvPXuJ.js} +1 -1
  307. package/dist/client/assets/{use-content-sync-DjDHeqFk.js → use-content-sync-C8Ux_RZ8.js} +1 -1
  308. package/dist/client/assets/{use-copy-CMfnyhoo.js → use-copy-O-MML7rC.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-CRoKnCN9.js → use-date-fns-locale-CP8lOmDn.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-D1fE_-TK.js → use-debounced-autosave-BXwcTWeY.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-DiJ2aJN8.js → use-debounced-value-DDir1rWd.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-D1bpdE32.js → use-deco-credits-Dy_Hg4i-.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-CZSx1Itd.js → use-decopilot-events-BAXWzGGN.js} +1 -1
  314. package/dist/client/assets/{use-delete-connection-BFOvb9ed.js → use-delete-connection-ZbJPfKIZ.js} +1 -1
  315. package/dist/client/assets/{use-deployment-admin-DQ5wNSYp.js → use-deployment-admin-DNwohGK9.js} +1 -1
  316. package/dist/client/assets/{use-entitlements-BChYmsyZ.js → use-entitlements-SlWYl1h3.js} +1 -1
  317. package/dist/client/assets/use-fast-preview-draft-url-DB6fawwn.js +1 -0
  318. package/dist/client/assets/{use-file-configs-DRzFKzj4.js → use-file-configs-BiPsjSp0.js} +1 -1
  319. package/dist/client/assets/{use-id-selection-DexUoI58.js → use-id-selection-CQGXhZf9.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-BvqULLI3.js → use-inbox-feed-G78cFBlF.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-C7IQ9e5j.js → use-infinite-scroll-CuJmRWs3.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-Dr_qAJ4N.js → use-join-requests-BtFDzITE.js} +1 -1
  323. package/dist/client/assets/use-main-panel-tabs-D_s_t2hY.js +1 -0
  324. package/dist/client/assets/use-mcp-auth-status-C4Vaxyeo.js +1 -0
  325. package/dist/client/assets/{use-mcp-client-Z8a6jg-w.js → use-mcp-client-BFuEikBh.js} +1 -1
  326. package/dist/client/assets/{use-mcp-prompts-KWx0e75o.js → use-mcp-prompts-W7_z0mx2.js} +1 -1
  327. package/dist/client/assets/{use-mcp-tools-C4Fqpw4S.js → use-mcp-tools-Fkw183dy.js} +1 -1
  328. package/dist/client/assets/{use-mobile-B7UqukPG.js → use-mobile-COmq9TQM.js} +1 -1
  329. package/dist/client/assets/use-move-blocks-DtAEvUrz.js +1 -0
  330. package/dist/client/assets/{use-navigate-to-agent-9BOtBFjV.js → use-navigate-to-agent-RGucqDuO.js} +1 -1
  331. package/dist/client/assets/{use-org-fs-DU8c86TB.js → use-org-fs-B1VEI_Er.js} +1 -1
  332. package/dist/client/assets/{use-org-repo-syncs-DGuZeud_.js → use-org-repo-syncs-DE87oI9s.js} +1 -1
  333. package/dist/client/assets/{use-org-sso-nKgxHjqa.js → use-org-sso-RIE_JSyT.js} +1 -1
  334. package/dist/client/assets/{use-organization-settings-DqaBVcmT.js → use-organization-settings-DqmiRW0D.js} +1 -1
  335. package/dist/client/assets/{use-project-scope-B4B7p1mj.js → use-project-scope-CYZ0mCfQ.js} +1 -1
  336. package/dist/client/assets/{use-recent-apps-CQ2MLxK5.js → use-recent-apps-D1NSRmBo.js} +1 -1
  337. package/dist/client/assets/use-reports-diagnostic-DGd4jOlT.js +1 -0
  338. package/dist/client/assets/use-sandbox-events-nFpLHv9o.js +2 -0
  339. package/dist/client/assets/{use-secrets-DP80TxaK.js → use-secrets-B3RSCdMi.js} +1 -1
  340. package/dist/client/assets/use-section-preview-base-CvJ34UxX.js +1 -0
  341. package/dist/client/assets/use-sidebar-collapsed-DXX9If3C.js +1 -0
  342. package/dist/client/assets/{use-tags-BMj-zonr.js → use-tags-BjaNX9ld.js} +1 -1
  343. package/dist/client/assets/{use-task-board-analytics-Bxag-9wC.js → use-task-board-analytics--QCcKCkA.js} +1 -1
  344. package/dist/client/assets/{use-task-board-events-B8bEY6A0.js → use-task-board-events-p-Cj7F6A.js} +1 -1
  345. package/dist/client/assets/{use-task-board-item-prs-JXA8OC5C.js → use-task-board-item-prs-DRcN9Nsr.js} +1 -1
  346. package/dist/client/assets/{use-task-board-items-DFDnaPnO.js → use-task-board-items-tdp7palw.js} +1 -1
  347. package/dist/client/assets/{use-task-board-prompts-CeCaGQl-.js → use-task-board-prompts-CPvlYwGk.js} +1 -1
  348. package/dist/client/assets/{use-task-metadata-D6_-qyJw.js → use-task-metadata-D1snlV6w.js} +1 -1
  349. package/dist/client/assets/{use-thread-outputs-DIlmUcwz.js → use-thread-outputs-bD7oL4Tg.js} +1 -1
  350. package/dist/client/assets/use-voice-input-CZ-OU5Nk.js +1 -0
  351. package/dist/client/assets/useInfiniteQuery-ByQLYXMe.js +1 -0
  352. package/dist/client/assets/{useQueries-DlmzJSx8.js → useQueries-DSvnP38O.js} +1 -1
  353. package/dist/client/assets/useSuspenseInfiniteQuery-ClUlWmLx.js +1 -0
  354. package/dist/client/assets/{users-BIMbDMRH.js → users-Bqa3Dwe4.js} +1 -1
  355. package/dist/client/assets/{utils-B-ZZ1C4f.js → utils-Dk3SKS5y.js} +3 -3
  356. package/dist/client/assets/{variant-calendar-CPbvwCiJ.js → variant-calendar-CD4VQuq0.js} +1 -1
  357. package/dist/client/assets/{variant-matcher-override-BDeSqmx4.js → variant-matcher-override-NriuY-7n.js} +1 -1
  358. package/dist/client/assets/{view-header-BTUnAkrc.js → view-header-B6CnFcfB.js} +1 -1
  359. package/dist/client/assets/{virtual-mcp-D-xL-K_P.js → virtual-mcp-D5NkkvKn.js} +1 -1
  360. package/dist/client/assets/{watch-sse-pool-B6ObjuCT.js → watch-sse-pool-BKRouklE.js} +1 -1
  361. package/dist/client/index.html +2 -2
  362. package/dist/server/server.js +1 -1
  363. package/package.json +1 -1
  364. package/dist/client/assets/ReferenceLine-DN9gAkkU.js +0 -1
  365. package/dist/client/assets/agent-app-BkJxaBM5.js +0 -1
  366. package/dist/client/assets/agent-assets-CWN2kTtA.js +0 -1
  367. package/dist/client/assets/agent-calendar-z2j3yA6d.js +0 -1
  368. package/dist/client/assets/agent-capabilities-4Kae1N0E.js +0 -1
  369. package/dist/client/assets/agent-deck-Lf3f7IO8.js +0 -1
  370. package/dist/client/assets/agent-e2e-C44IfVz9.js +0 -1
  371. package/dist/client/assets/agent-file-D8S6ohDB.js +0 -1
  372. package/dist/client/assets/agent-hosting-D6CnE5uR.js +0 -1
  373. package/dist/client/assets/agent-library-Co5WQMIF.js +0 -1
  374. package/dist/client/assets/agent-library-file-BPJi6RfX.js +0 -1
  375. package/dist/client/assets/agent-overview-D73rnnSU.js +0 -1
  376. package/dist/client/assets/agent-releases-WO1DzowK.js +0 -2
  377. package/dist/client/assets/agent-settings-DK2xDr1_.js +0 -1
  378. package/dist/client/assets/agent-site-editor-code-21UDx-VP.js +0 -2
  379. package/dist/client/assets/agent-site-editor-content-ycS9Pz-a.js +0 -1
  380. package/dist/client/assets/agent-site-editor-preview-CM8uT3ZM.js +0 -1
  381. package/dist/client/assets/agent-view-CnIONLQC.js +0 -1
  382. package/dist/client/assets/api-keys-CJdXbN4c.js +0 -1
  383. package/dist/client/assets/app-editor--cZ0paPb.js +0 -1
  384. package/dist/client/assets/automations-DXGl5rDB.js +0 -1
  385. package/dist/client/assets/blocks-tab-states-DP3rjaHt.js +0 -1
  386. package/dist/client/assets/category-editor-BFW4v6Zt.js +0 -1
  387. package/dist/client/assets/chart-W6WUctG8.js +0 -13
  388. package/dist/client/assets/cms-settings-editor-BKSzHFaJ.js +0 -1
  389. package/dist/client/assets/cms-store-drafts-BRph2qKQ.js +0 -1
  390. package/dist/client/assets/content-tab-D6POg5eV.js +0 -25
  391. package/dist/client/assets/context-D9Jnu7vN.js +0 -1
  392. package/dist/client/assets/device-hint-B0gKGTHi.js +0 -1
  393. package/dist/client/assets/discover-hzv5-quf.js +0 -1
  394. package/dist/client/assets/home-z2EXALAZ.js +0 -1
  395. package/dist/client/assets/hosted-reconcile-gHkwH1BF.js +0 -1
  396. package/dist/client/assets/index-BtlZo3IV.js +0 -2
  397. package/dist/client/assets/index-Chg--78J.js +0 -4
  398. package/dist/client/assets/index-ug7KC70Z.css +0 -1
  399. package/dist/client/assets/input-Lv9puCyJ.js +0 -17
  400. package/dist/client/assets/library-D4o0AtWq.js +0 -1
  401. package/dist/client/assets/monitoring-BPV_CuUX.js +0 -2
  402. package/dist/client/assets/mustache-DCgM4RQC.js +0 -4
  403. package/dist/client/assets/named-rule-view-D8WSLrw8.js +0 -1
  404. package/dist/client/assets/openai-conversation-D9tyQTXT.js +0 -3
  405. package/dist/client/assets/post-calendar-C4WCdLXl.js +0 -1
  406. package/dist/client/assets/preview-tab-sRIuk4Ej.js +0 -551
  407. package/dist/client/assets/project-app-view-ByacUDvM.js +0 -1
  408. package/dist/client/assets/project-apps-DzbYoXyd.js +0 -1
  409. package/dist/client/assets/project-reports-DPgVezio.js +0 -1
  410. package/dist/client/assets/project-sidebar-views-BxNR4pgO.js +0 -1
  411. package/dist/client/assets/project-tasks-C8oeh0BH.js +0 -1
  412. package/dist/client/assets/record-editor-BZSwvkut.js +0 -1
  413. package/dist/client/assets/redirect-editor-BxlqORGw.js +0 -1
  414. package/dist/client/assets/reports-Be7TvXFw.js +0 -1
  415. package/dist/client/assets/repositories-DFHveJlo.js +0 -1
  416. package/dist/client/assets/resolve-tab-icon-D4I4sh6v.js +0 -1
  417. package/dist/client/assets/route-04y-cUhL.js +0 -1
  418. package/dist/client/assets/route-CijJVC7q.js +0 -1
  419. package/dist/client/assets/route-D7Ke7Nww.js +0 -1
  420. package/dist/client/assets/sandbox-lifecycle-context-CuiD9fGV.js +0 -1
  421. package/dist/client/assets/sections-editor-CEHFL2VN.js +0 -1
  422. package/dist/client/assets/seo-editor-CaLY6KkG.js +0 -1
  423. package/dist/client/assets/settings-tab-DeCOk8kh.js +0 -1
  424. package/dist/client/assets/site-draft-view-B8TmuovZ.js +0 -3
  425. package/dist/client/assets/site-editor-BeO4XfO2.js +0 -1
  426. package/dist/client/assets/site-editor-toast-B-FxlfJP.js +0 -1
  427. package/dist/client/assets/tasks-CI7wGKXW.js +0 -1
  428. package/dist/client/assets/use-ask-in-chat-DQs0YHUB.js +0 -1
  429. package/dist/client/assets/use-fast-preview-draft-url-CO3Nwa6o.js +0 -1
  430. package/dist/client/assets/use-main-panel-tabs-DZKpYMQg.js +0 -1
  431. package/dist/client/assets/use-mcp-auth-status-D0-JLgq9.js +0 -1
  432. package/dist/client/assets/use-move-blocks-DqXCo5PB.js +0 -1
  433. package/dist/client/assets/use-reports-diagnostic-MABLwKiU.js +0 -1
  434. package/dist/client/assets/use-section-preview-base-C7kw5vsr.js +0 -1
  435. package/dist/client/assets/use-sidebar-collapsed-Dz5RfxtZ.js +0 -1
  436. package/dist/client/assets/useInfiniteQuery-DAm-dYuC.js +0 -1
  437. package/dist/client/assets/useSuspenseInfiniteQuery-BTqieOpO.js +0 -1
@@ -1 +0,0 @@
1
- import{c as N,a5 as Y,m as L,j as s,B as $e,a6 as js,b as O,a as ze,d as Re,a7 as vs,J as Nt,r as ee,t as Ce,o as De,a8 as _t,a9 as Ss,aa as ys,C as wt,E as fe,ab as Ct,ac as ks,ad as Ns,L as Je,ae as $t,$ as re,af as ae,ag as Xe,e as It,D as Ze,v as et,w as tt,x as st,y as Pt,ah as _s,ai as ws,aj as Cs,q as nt,K as Me,i as it,ak as ot,al as $s,_ as rt,X as lt,am as at,Z as ct,Y as pe,an as Is,ao as Ps,ap as Ts,I as zs,aq as Fs,ar as As,as as Tt,at as Os,au as Es,av as Ds,aw as Ms,ax as Rs,ay as Ls,az as Us,f as Bs,l as qs,aA as Ks,R as Vs,u as Hs,O as Ws}from"./index-DWvRfTwV.js";import{I as Qs,L as qe}from"./index-DOaDUx72.js";import{u as Gs,L as ke,i as zt}from"./shell-layout-Bx4AZ_YV.js";import{S as Ie,a as se,b as Ne,u as dt,c as mt,d as Ft,e as At,f as Ys,g as Js,h as Ot}from"./use-sidebar-collapsed-Dz5RfxtZ.js";import{P as Et,a as Dt,b as Mt}from"./popover-CpDRMXBS.js";import{D as Xs,a as Zs,b as en}from"./drawer-1kqkgpFK.js";import{T as tn,a as sn,b as nn,c as on}from"./tooltip-BVv5wAeF.js";import{u as rn}from"./use-mobile-B7UqukPG.js";import{t as ln,i as We,a as an,b as cn,c as dn,d as mn,e as un,f as fn,g as Rt,s as Lt,h as pn,j as xn,n as Ut,k as hn,l as bn,m as Bt,o as gn,p as jn,q as qt,r as vn,u as Sn,v as yn,w as kn,x as Kt,y as Nn}from"./agent-icon-Nkid6y9z.js";import{i as Vt}from"./Monitor01-DWylBoOJ.js";import{n as _n,a as wn}from"./Sun-CyYLfv8E.js";import{a as Ht,b as Cn,i as $n}from"./Tool01-CyX9Nllj.js";import{u as In}from"./use-deployment-admin-DQ5wNSYp.js";import{u as Pn}from"./use-deco-credits-D1bpdE32.js";import{u as Tn,a as Wt}from"./use-entitlements-BChYmsyZ.js";import{u as zn,P as Fn}from"./plan-ladder-wSfhs4No.js";import{u as An}from"./use-organization-settings-DqaBVcmT.js";import{S as On}from"./scroll-area-CUevVS4T.js";import{u as Qt}from"./use-inbox-feed-BvqULLI3.js";import{t as Gt}from"./task-key-BCHdFiOO.js";import{S as En,F as Dn,a as Ke,b as Mn,c as Yt}from"./feedback-Bx6uae5t.js";import{B as Rn}from"./badge-BLk85LCv.js";import{i as Jt}from"./ArrowLeft-DRdw9Nza.js";import{u as Xt,a as Le}from"./use-project-scope-B4B7p1mj.js";import{P as Ln}from"./ai-providers-logos-DD3qZ33J.js";import{u as Un,O as Bn}from"./own-accounts-section-B2chKMQ0.js";import{s as qn}from"./XClose-avSrIpAi.js";import{T as Kn}from"./textarea-BVq0fBVJ.js";import{T as Zt}from"./toolbar-icon-button-CRZySHtx.js";import{u as Vn}from"./thread-route-DMWye38f.js";import{P as Hn}from"./project-apps-DzbYoXyd.js";import{u as Wn}from"./autosend-DbfDzqlB.js";import{a as Qn}from"./agent-capabilities-4Kae1N0E.js";import{k as Gn,p as Yn}from"./use-recent-apps-CQ2MLxK5.js";import{u as es}from"./use-navigate-to-agent-9BOtBFjV.js";import{u as Jn,r as Xn,s as Zn,o as ei,p as ti,P as si}from"./project-sidebar-views-BxNR4pgO.js";import{u as ni}from"./optimistic-project-sidebar-views-BmsZ-Me-.js";import{r as ii}from"./resolve-tab-icon-D4I4sh6v.js";import{T as oi}from"./tab-icon-glyph-BA8eumIA.js";import{t as ts}from"./ChevronUp-CDe5Gfov.js";import{s as Qe}from"./Plus-BtfY7EHX.js";import{C as ue,a as ri,b as li,c as ai,d as Ve,e as ci,f as di,g as mi}from"./context-menu-Cgl4PGwR.js";import{t as ui,a as fi}from"./use-task-board-items-DFDnaPnO.js";import{o as ss}from"./new-project-dialog-Kvs8XyHN.js";import{P as ns}from"./project-icon-DTA6ZXhl.js";import{E as pi,p as xi,P as hi}from"./watch-sse-pool-B6ObjuCT.js";import{b as bi,p as gi}from"./project-index-BmalKoU9.js";import{C as ji}from"./checkbox-Dv6iFznu.js";import{I as Ge}from"./icon-button-1xC_JQLB.js";import{S as vi}from"./switch-UpbwlQtZ.js";import{t as Si}from"./Globe04-Dr1jk8eS.js";import{i as yi}from"./CreditCard01-abk_vBBR.js";import{i as ki}from"./Key01-DzZgIVqE.js";import{i as Ni}from"./Zap--C2rij07.js";import{u as _i}from"./use-join-requests-Dr_qAJ4N.js";import{p as wi,q as Ci}from"./question-004-sINsf4GQ.js";import{u as $i}from"./use-decopilot-events-CZSx1Itd.js";import"./sheet-BKUVqko3.js";import"./core.esm-C3kzKmQL.js";import"./sortable.esm-YReNzob1.js";import"./create-organization-dialog-C6jgiT68.js";import"./form-DE5X7SPR.js";import"./label-BkzEUDUr.js";import"./UserSquare-DmeGszKa.js";import"./command-CSFENWMV.js";import"./index-Czm9RrRY.js";import"./SearchMd-DD6kw-fs.js";import"./use-debounced-value-DiJ2aJN8.js";import"./admin-fetch-BhTJlAsX.js";import"./CheckCircle-y3P873c6.js";import"./integration-icon-BCp7DD7C.js";import"./LinkBroken01-4j6Z2AOF.js";import"./use-mcp-client-Z8a6jg-w.js";import"./auth-xvjttF9D.js";import"./thread-intent-BONVdhUb.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-nGThcCwM.js";import"./use-org-sso-nKgxHjqa.js";import"./use-chat-layout-state-Dnl_7DMo.js";import"./index-J6dVRDZu.js";import"./AlertCircle-BPGyk76P.js";import"./ArrowUp-BJTv4ddc.js";import"./ShoppingBag01-CY137tVP.js";import"./ChevronSelectorVertical-TIONA5Zl.js";import"./SwitchHorizontal01-C3qdjyVX.js";import"./Minus-B2u_zm0f.js";import"./Play-CV8_Sy8a.js";import"./Trash01-DSJ1LUhI.js";import"./Upload01-DC0joCKG.js";import"./Users01-B-OacssU.js";import"./use-ai-providers-CCcuLCZt.js";import"./schema-DvxWNZKz.js";import"./task-board-CzrPT-OZ.js";import"./index-BdQq_4o_.js";import"./useInfiniteQuery-DAm-dYuC.js";import"./infiniteQueryObserver-O1nZgTsK.js";import"./repository-binding-CeErFm4l.js";import"./github-icon-Bvc_Uep-.js";import"./use-date-fns-locale-CRoKnCN9.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-DRzFKzj4.js";import"./config-BuNaSsQb.js";import"./use-task-board-events-B8bEY6A0.js";import"./repository-picker-C3C3_E5g.js";import"./collection-search-CPadQqKp.js";function Ii(){const t=N.c(19),{org:e}=Y(),{data:i}=Gs(e.slug);if(!i)return null;const n=i.severity==="block",o=n?"border-destructive/25 bg-destructive/5 text-destructive":"border-warning/40 bg-warning/10 text-foreground";let r;t[0]!==o?(r=L("flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-2 text-sm",o),t[0]=o,t[1]=r):r=t[1];const l=n?void 0:"text-warning";let a;t[2]!==l?(a=L("size-4 shrink-0",l),t[2]=l,t[3]=a):a=t[3];let c;t[4]!==a?(c=s.jsx(js,{className:a}),t[4]=a,t[5]=c):c=t[5];let u;t[6]!==i.title?(u=s.jsx("span",{className:"font-medium",children:i.title}),t[6]=i.title,t[7]=u):u=t[7];let m;t[8]!==i.message?(m=s.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:i.message}),t[8]=i.message,t[9]=m):m=t[9];let d;t[10]!==i.ctaLabel||t[11]!==i.ctaUrl?(d=i.ctaUrl&&i.ctaLabel?s.jsx($e,{size:"sm",variant:"outline",asChild:!0,children:s.jsx("a",{href:i.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:i.ctaLabel})}):null,t[10]=i.ctaLabel,t[11]=i.ctaUrl,t[12]=d):d=t[12];let p;return t[13]!==r||t[14]!==c||t[15]!==u||t[16]!==m||t[17]!==d?(p=s.jsxs("div",{role:"alert",className:r,children:[c,u,m,d]}),t[13]=r,t[14]=c,t[15]=u,t[16]=m,t[17]=d,t[18]=p):p=t[18],p}const Ye="size-4 shrink-0";function Ue(t){const e=N.c(5),{children:i,className:n}=t;let o;e[0]!==n?(o=L("flex w-4 shrink-0 items-center justify-center",n),e[0]=n,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=s.jsx("span",{className:o,children:i}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Te(t){const e=N.c(26),{item:i,onClose:n}=t;let o;e[0]!==i.className?(o=L("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",i.className),e[0]=i.className,e[1]=o):o=e[1];const r=o;if(i.href){const m=i.external?"_blank":void 0,d=i.external?"noopener noreferrer":void 0;let p;e[2]!==i.icon?(p=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:i.icon}),e[2]=i.icon,e[3]=p):p=e[3];let f;e[4]!==i.label?(f=s.jsx("span",{className:"flex-1",children:i.label}),e[4]=i.label,e[5]=f):f=e[5];let x;return e[6]!==r||e[7]!==i.href||e[8]!==n||e[9]!==m||e[10]!==d||e[11]!==p||e[12]!==f?(x=s.jsxs("a",{href:i.href,target:m,rel:d,className:r,onClick:n,children:[p,f]}),e[6]=r,e[7]=i.href,e[8]=n,e[9]=m,e[10]=d,e[11]=p,e[12]=f,e[13]=x):x=e[13],x}let l;e[14]!==i||e[15]!==n?(l=()=>{i.onClick?.(),n()},e[14]=i,e[15]=n,e[16]=l):l=e[16];let a;e[17]!==i.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:i.icon}),e[17]=i.icon,e[18]=a):a=e[18];let c;e[19]!==i.label?(c=s.jsx("span",{className:"flex-1",children:i.label}),e[19]=i.label,e[20]=c):c=e[20];let u;return e[21]!==r||e[22]!==l||e[23]!==a||e[24]!==c?(u=s.jsxs("button",{type:"button",onClick:l,className:r,children:[a,c]}),e[21]=r,e[22]=l,e[23]=a,e[24]=c,e[25]=u):u=e[25],u}function Pi(){const t=N.c(4),e=O();let i;t[0]!==e?(i=e("common.accountPopover.impersonating"),t[0]=e,t[1]=i):i=t[1];let n;return t[2]!==i?(n=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-2xs font-medium text-warning",children:i}),t[2]=i,t[3]=n):n=t[3],n}function ht(t){const e=N.c(38),{user:i,userImage:n,isImpersonating:o,isMobile:r}=t,l=O(),a=r?"py-4 border-b border-border":"py-3 mx-1 mt-1";let c;e[0]!==a?(c=L("flex items-center gap-3 px-4",a),e[0]=a,e[1]=c):c=e[1];const u=i?.name??"U";let m;e[2]!==u||e[3]!==n?(m=s.jsx(De,{url:n,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=u,e[3]=n,e[4]=m):m=e[4];let d;e[5]!==l||e[6]!==i?.name?(d=i?.name??l("common.accountPopover.defaultUserName"),e[5]=l,e[6]=i?.name,e[7]=d):d=e[7];let p;e[8]!==d?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:d}),e[8]=d,e[9]=p):p=e[9];let f;e[10]!==o?(f=o&&s.jsx(Pi,{}),e[10]=o,e[11]=f):f=e[11];let x;e[12]!==p||e[13]!==f?(x=s.jsxs("div",{className:"flex items-center gap-2",children:[p,f]}),e[12]=p,e[13]=f,e[14]=x):x=e[14];const g=i?.email;let j;e[15]!==g?(j=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=j):j=e[16];let h;e[17]!==j||e[18]!==x?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,j]}),e[17]=j,e[18]=x,e[19]=h):h=e[19];let v;e[20]!==l||e[21]!==i?(v=()=>{i?.id&&navigator.clipboard.writeText(i.id).then(()=>{Ce.success(l("common.accountPopover.userIdCopied"))})},e[20]=l,e[21]=i,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(un,{size:14}),e[23]=b):b=e[23];let y;e[24]!==v?(y=s.jsx(tn,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:b})}),e[24]=v,e[25]=y):y=e[25];let S;e[26]!==l?(S=l("common.accountPopover.copyUserId"),e[26]=l,e[27]=S):S=e[27];let k;e[28]!==S?(k=s.jsx(sn,{side:"right",children:s.jsx("p",{className:"text-xs",children:S})}),e[28]=S,e[29]=k):k=e[29];let w;e[30]!==y||e[31]!==k?(w=s.jsx(nn,{delayDuration:300,children:s.jsxs(on,{children:[y,k]})}),e[30]=y,e[31]=k,e[32]=w):w=e[32];let C;return e[33]!==h||e[34]!==w||e[35]!==c||e[36]!==m?(C=s.jsxs("div",{className:c,children:[m,h,w]}),e[33]=h,e[34]=w,e[35]=c,e[36]=m,e[37]=C):C=e[37],C}function bt(t){const e=N.c(35),{themeOptions:i,preferences:n,setPreferences:o,isMobile:r}=t,l=O(),a=r?"size-8":"size-7",c=r?"px-3 py-3":"px-2 py-1.5";let u;e[0]!==c?(u=L("flex items-center justify-between border-t border-border/50",c),e[0]=c,e[1]=u):u=e[1];let m;if(e[2]!==a||e[3]!==n.theme||e[4]!==o||e[5]!==i){let S;e[7]!==a||e[8]!==n.theme||e[9]!==o?(S=k=>{const{value:w,icon:C,label:_}=k;return s.jsx("button",{type:"button","aria-label":_,onClick:()=>o($=>({...$,theme:w})),className:L(a,"rounded-lg flex items-center justify-center transition-colors",n.theme===w?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent hover:text-foreground"),children:C},w)},e[7]=a,e[8]=n.theme,e[9]=o,e[10]=S):S=e[10],m=i.map(S),e[2]=a,e[3]=n.theme,e[4]=o,e[5]=i,e[6]=m}else m=e[6];let d;e[11]!==m?(d=s.jsx("div",{className:"flex items-center gap-0.5",children:m}),e[11]=m,e[12]=d):d=e[12];let p;e[13]!==n.enableSounds||e[14]!==l?(p=n.enableSounds?l("common.accountPopover.disableSounds"):l("common.accountPopover.enableSounds"),e[13]=n.enableSounds,e[14]=l,e[15]=p):p=e[15];let f;e[16]!==o?(f=()=>o(Ti),e[16]=o,e[17]=f):f=e[17];const x=n.enableSounds?"text-foreground hover:bg-sidebar-accent":"text-muted-foreground hover:bg-sidebar-accent hover:text-foreground";let g;e[18]!==a||e[19]!==x?(g=L(a,"rounded-lg flex items-center justify-center transition-colors",x),e[18]=a,e[19]=x,e[20]=g):g=e[20];let j;e[21]!==n.enableSounds?(j=n.enableSounds?s.jsx(dn,{size:14}):s.jsx(mn,{size:14}),e[21]=n.enableSounds,e[22]=j):j=e[22];let h;e[23]!==p||e[24]!==f||e[25]!==g||e[26]!==j?(h=s.jsx("button",{type:"button","aria-label":p,onClick:f,className:g,children:j}),e[23]=p,e[24]=f,e[25]=g,e[26]=j,e[27]=h):h=e[27];let v;e[28]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.562.2"]}),e[28]=v):v=e[28];let b;e[29]!==h?(b=s.jsxs("div",{className:"flex items-center gap-2",children:[h,v]}),e[29]=h,e[30]=b):b=e[30];let y;return e[31]!==b||e[32]!==u||e[33]!==d?(y=s.jsxs("div",{className:u,children:[d,b]}),e[31]=b,e[32]=u,e[33]=d,e[34]=y):y=e[34],y}function Ti(t){return{...t,enableSounds:!t.enableSounds}}function gt(t){const e=N.c(54),{user:i,userImage:n,menuItems:o,signOutItem:r,stopImpersonatingItem:l,isImpersonating:a,themeOptions:c,preferences:u,setPreferences:m,close:d,isMobile:p}=t;if(p){let y;e[0]!==a||e[1]!==i||e[2]!==n?(y=s.jsx(ht,{user:i,userImage:n,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=i,e[2]=n,e[3]=y):y=e[3];let S;if(e[4]!==d||e[5]!==o){let I;e[7]!==d?(I=F=>s.jsx(Te,{item:F,onClose:d},F.key),e[7]=d,e[8]=I):I=e[8],S=o.map(I),e[4]=d,e[5]=o,e[6]=S}else S=e[6];let k;e[9]!==d||e[10]!==l?(k=l&&s.jsx(Te,{item:l,onClose:d}),e[9]=d,e[10]=l,e[11]=k):k=e[11];let w;e[12]!==d||e[13]!==r?(w=s.jsx(Te,{item:r,onClose:d}),e[12]=d,e[13]=r,e[14]=w):w=e[14];let C;e[15]!==S||e[16]!==k||e[17]!==w?(C=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[S,k,w]})}),e[15]=S,e[16]=k,e[17]=w,e[18]=C):C=e[18];let _;e[19]!==u||e[20]!==m||e[21]!==c?(_=s.jsx(bt,{themeOptions:c,preferences:u,setPreferences:m,isMobile:!0}),e[19]=u,e[20]=m,e[21]=c,e[22]=_):_=e[22];let $;return e[23]!==y||e[24]!==C||e[25]!==_?($=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,C,_]}),e[23]=y,e[24]=C,e[25]=_,e[26]=$):$=e[26],$}let f;e[27]!==a||e[28]!==i||e[29]!==n?(f=s.jsx(ht,{user:i,userImage:n,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=i,e[29]=n,e[30]=f):f=e[30];let x;if(e[31]!==d||e[32]!==o){let y;e[34]!==d?(y=S=>s.jsx(Te,{item:S,onClose:d},S.key),e[34]=d,e[35]=y):y=e[35],x=o.map(y),e[31]=d,e[32]=o,e[33]=x}else x=e[33];let g;e[36]!==d||e[37]!==l?(g=l&&s.jsx(Te,{item:l,onClose:d}),e[36]=d,e[37]=l,e[38]=g):g=e[38];let j;e[39]!==d||e[40]!==r?(j=s.jsx(Te,{item:r,onClose:d}),e[39]=d,e[40]=r,e[41]=j):j=e[41];let h;e[42]!==x||e[43]!==g||e[44]!==j?(h=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[x,g,j]}),e[42]=x,e[43]=g,e[44]=j,e[45]=h):h=e[45];let v;e[46]!==u||e[47]!==m||e[48]!==c?(v=s.jsx(bt,{themeOptions:c,preferences:u,setPreferences:m,isMobile:!1}),e[46]=u,e[47]=m,e[48]=c,e[49]=v):v=e[49];let b;return e[50]!==f||e[51]!==h||e[52]!==v?(b=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[f,h,v]})}),e[50]=f,e[51]=h,e[52]=v,e[53]=b):b=e[53],b}function is(){const t=N.c(98),e=O(),{data:i}=ze.useSession(),{org:n}=Y(),o=Re();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const a=vs(r)?.params.org,[c,u]=Nt(),m=rn(),{isAdmin:d}=In(),[p,f]=ee.useState(!1),x=i?.user,g=x?.image,j=!!i?.session?.impersonatedBy;let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=()=>f(!1),t[1]=h):h=t[1];const v=h;let b;t[2]!==e?(b=e("common.accountPopover.preferences"),t[2]=e,t[3]=b):b=t[3];let y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ht,{size:16}),t[4]=y):y=t[4];let S;t[5]!==o||t[6]!==a?(S=()=>{o({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=o,t[6]=a,t[7]=S):S=t[7];let k;t[8]!==b||t[9]!==S?(k={key:"preferences",label:b,icon:y,onClick:S},t[8]=b,t[9]=S,t[10]=k):k=t[10];let w;t[11]!==n||t[12]!==o?(w=n?[{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(_t,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:n.slug}})}}]:[],t[11]=n,t[12]=o,t[13]=w):w=t[13];let C;t[14]!==e?(C=e("common.accountPopover.termsOfUse"),t[14]=e,t[15]=C):C=t[15];let _;t[16]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(an,{size:16}),t[16]=_):_=t[16];let $;t[17]!==C?($={key:"terms",label:C,icon:_,href:"https://www.decocms.com/terms-of-use",external:!0},t[17]=C,t[18]=$):$=t[18];let I;t[19]!==e?(I=e("common.accountPopover.privacyPolicy"),t[19]=e,t[20]=I):I=t[20];let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ss,{size:16}),t[21]=F):F=t[21];let U;t[22]!==I?(U={key:"privacy",label:I,icon:F,href:"https://www.decocms.com/privacy-policy",external:!0},t[22]=I,t[23]=U):U=t[23];let B;t[24]!==e?(B=e("common.accountPopover.repository"),t[24]=e,t[25]=B):B=t[25];let J;t[26]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(ys,{className:"w-4 h-4"}),t[26]=J):J=t[26];let G;t[27]!==B?(G={key:"github",label:B,icon:J,href:"https://github.com/decocms/studio",external:!0},t[27]=B,t[28]=G):G=t[28];let K;t[29]!==e?(K=e("common.accountPopover.community"),t[29]=e,t[30]=K):K=t[30];let te;t[31]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(wt,{size:16}),t[31]=te):te=t[31];let W;t[32]!==K?(W={key:"community",label:K,icon:te,href:"https://decocms.com/discord",external:!0},t[32]=K,t[33]=W):W=t[33];let V;t[34]!==e?(V=e("common.accountPopover.homepage"),t[34]=e,t[35]=V):V=t[35];let X;t[36]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(cn,{size:16}),t[36]=X):X=t[36];let q;t[37]!==V?(q={key:"homepage",label:V,icon:X,href:"https://decocms.com",external:!0},t[37]=V,t[38]=q):q=t[38];let Q;t[39]!==d||t[40]!==o||t[41]!==e?(Q=d?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(ln,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[39]=d,t[40]=o,t[41]=e,t[42]=Q):Q=t[42];let Z;t[43]!==U||t[44]!==G||t[45]!==W||t[46]!==q||t[47]!==Q||t[48]!==k||t[49]!==w||t[50]!==$?(Z=[k,...w,$,U,G,W,q,...Q],t[43]=U,t[44]=G,t[45]=W,t[46]=q,t[47]=Q,t[48]=k,t[49]=w,t[50]=$,t[51]=Z):Z=t[51];const z=Z;let R;t[52]!==e?(R=e("common.accountPopover.signOut"),t[52]=e,t[53]=R):R=t[53];let P;t[54]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(We,{size:16}),t[54]=P):P=t[54];let E;t[55]!==R?(E={key:"logout",label:R,icon:P,onClick:Fi},t[55]=R,t[56]=E):E=t[56];const D=E;let H;t[57]!==j||t[58]!==e?(H=j?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(We,{size:16}),onClick:async()=>{const{error:we}=await ze.admin.stopImpersonating();if(we){Ce.error(we.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[57]=j,t[58]=e,t[59]=H):H=t[59];const Se=H;let ce;t[60]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(_n,{size:14}),t[60]=ce):ce=t[60];let ne;t[61]!==e?(ne=e("common.accountPopover.lightTheme"),t[61]=e,t[62]=ne):ne=t[62];let ie;t[63]!==ne?(ie={value:"light",icon:ce,label:ne},t[63]=ne,t[64]=ie):ie=t[64];let xe;t[65]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(wn,{size:14}),t[65]=xe):xe=t[65];let M;t[66]!==e?(M=e("common.accountPopover.darkTheme"),t[66]=e,t[67]=M):M=t[67];let oe;t[68]!==M?(oe={value:"dark",icon:xe,label:M},t[68]=M,t[69]=oe):oe=t[69];let he;t[70]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(Vt,{size:14}),t[70]=he):he=t[70];let de;t[71]!==e?(de=e("common.accountPopover.systemTheme"),t[71]=e,t[72]=de):de=t[72];let me;t[73]!==de?(me={value:"system",icon:he,label:de},t[73]=de,t[74]=me):me=t[74];let be;t[75]!==ie||t[76]!==oe||t[77]!==me?(be=[ie,oe,me],t[75]=ie,t[76]=oe,t[77]=me,t[78]=be):be=t[78];const ye=be;let ge;t[79]!==j||t[80]!==m||t[81]!==z||t[82]!==c||t[83]!==u||t[84]!==D||t[85]!==Se||t[86]!==ye||t[87]!==x||t[88]!==g?(ge={user:x,userImage:g,menuItems:z,signOutItem:D,stopImpersonatingItem:Se,isImpersonating:j,themeOptions:ye,preferences:c,setPreferences:u,close:v,isMobile:m},t[79]=j,t[80]=m,t[81]=z,t[82]=c,t[83]=u,t[84]=D,t[85]=Se,t[86]=ye,t[87]=x,t[88]=g,t[89]=ge):ge=t[89];const je=ge;let ve;return t[90]!==j||t[91]!==m||t[92]!==p||t[93]!==je||t[94]!==e||t[95]!==x?.name||t[96]!==g?(ve=m?s.jsxs(Xs,{open:p,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:L("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",j&&"border-2 border-dashed border-warning"),children:[s.jsx(De,{url:g,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(Zs,{className:"h-[80dvh] p-0",children:[s.jsx(en,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx(gt,{...je})]})]}):s.jsxs(Et,{open:p,onOpenChange:f,children:[s.jsx(Dt,{asChild:!0,children:s.jsxs(Ie,{"data-tour":ke.account,tooltip:x?.name??e("common.accountPopover.defaultAccountLabel"),className:L(j&&"border-2 border-dashed border-warning"),children:[s.jsx(Ue,{children:s.jsx(De,{url:g,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"size-[18px] shrink-0"})}),s.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(Mt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:zi,children:s.jsx(gt,{...je})})]}),t[90]=j,t[91]=m,t[92]=p,t[93]=je,t[94]=e,t[95]=x?.name,t[96]=g,t[97]=ve):ve=t[97],ve}function zi(t){return t.preventDefault()}function Fi(){fe("signed_out",{source:"account_popover"}),Ct(),ze.signOut()}class Ai extends ee.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,i){}render(){return this.state.hasError?null:this.props.children}}function Oi(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Ei(){const t=N.c(17),e=Re(),{org:i}=Y(),{hasDecoKey:n,balanceDollars:o}=Pn();if(!n)return null;let r;t[0]!==o?(r=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=r):r=t[1];let l;t[2]!==o?(l=L(o!=null&&Oi(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==i.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:i.slug}}),t[4]=e,t[5]=i.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(fn,{}),t[7]=c):c=t[7];let u;t[8]!==o?(u=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=u):u=t[9];let m;t[10]!==u?(m=s.jsx("span",{children:u}),t[10]=u,t[11]=m):m=t[11];let d;return t[12]!==r||t[13]!==l||t[14]!==a||t[15]!==m?(d=s.jsx(se,{children:s.jsx(Ne,{children:s.jsxs(Ie,{tooltip:r,className:l,onClick:a,children:[c,m]})})}),t[12]=r,t[13]=l,t[14]=a,t[15]=m,t[16]=d):d=t[16],d}const Di={ok:"bg-brand-purple",warn:"bg-warning",exhausted:"bg-destructive"};function Mi(){const t=N.c(32),e=O(),i=Re(),{org:n}=Y(),{data:o}=Wt();if(!o?.usage||!o.features.chat)return null;let r,l;if(t[0]!==o.usage.percent?(r=Math.round(o.usage.percent*100),l=Number.isFinite(r),t[0]=o.usage.percent,t[1]=r,t[2]=l):(r=t[1],l=t[2]),!l)return null;const a=Math.min(100,Math.max(0,r)),c=o.plan.name;let u;t[3]!==e?(u=e("settings.planUsage.aiUsage"),t[3]=e,t[4]=u):u=t[4];const m=`${c} · ${u} ${a}%`;let d;t[5]!==i||t[6]!==n.slug?(d=()=>i({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[5]=i,t[6]=n.slug,t[7]=d):d=t[7];let p;t[8]!==o.plan.id?(p=s.jsx(Ue,{className:"-ml-px",children:s.jsx(Ri,{planId:o.plan.id})}),t[8]=o.plan.id,t[9]=p):p=t[9];let f;t[10]!==o.plan.name?(f=s.jsx("span",{className:"truncate font-medium",children:o.plan.name}),t[10]=o.plan.name,t[11]=f):f=t[11];let x;t[12]!==a?(x=s.jsxs("span",{className:"tabular-nums text-xs text-muted-foreground",children:[a,"%"]}),t[12]=a,t[13]=x):x=t[13];let g;t[14]!==f||t[15]!==x?(g=s.jsxs("span",{className:"flex items-baseline justify-between gap-2",children:[f,x]}),t[14]=f,t[15]=x,t[16]=g):g=t[16];const j=Di[o.usage.state];let h;t[17]!==j?(h=L("block h-full rounded-full",j),t[17]=j,t[18]=h):h=t[18];const v=`${a}%`;let b;t[19]!==v?(b={width:v},t[19]=v,t[20]=b):b=t[20];let y;t[21]!==h||t[22]!==b?(y=s.jsx("span",{className:"block h-1 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:h,style:b})}),t[21]=h,t[22]=b,t[23]=y):y=t[23];let S;t[24]!==y||t[25]!==g?(S=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[g,y]}),t[24]=y,t[25]=g,t[26]=S):S=t[26];let k;return t[27]!==S||t[28]!==m||t[29]!==d||t[30]!==p?(k=s.jsx(se,{children:s.jsx(Ne,{children:s.jsxs(Ie,{tooltip:m,className:"h-auto! rounded-lg border border-border bg-card px-2 py-2 [&_svg]:opacity-100!",onClick:d,children:[p,S]})})}),t[27]=S,t[28]=m,t[29]=d,t[30]=p,t[31]=k):k=t[31],k}function Ri(t){const e=N.c(6),{planId:i}=t,{data:n}=zn();let o;e[0]!==i||e[1]!==n?(o=n?.findIndex(a=>a.id===i)??-1,e[0]=i,e[1]=n,e[2]=o):o=e[2];const r=o;if(r<0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Rt,{className:Ye}),e[3]=a):a=e[3],a}let l;return e[4]!==r?(l=s.jsx(Fn,{index:r,className:Ye}),e[4]=r,e[5]=l):l=e[5],l}function Li(){return Tn()?s.jsx(Mi,{}):s.jsx(Ei,{})}function Ui(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ai,{children:s.jsx(ee.Suspense,{fallback:null,children:s.jsx(Li,{})})}),t[0]=e):e=t[0],e}function Bi(t){switch(t){case"mentioned":case"review_requested":return"font-medium text-foreground";case"merge_failed":case"review_changes_requested":case"order_incident":return"font-medium text-destructive";case"review_approved":return"font-medium text-success";default:return""}}function qi(t,e){switch(t.action){case"commented":return e("sidebar.inbox.actionCommented");case"mentioned":return e("sidebar.inbox.actionMentioned");case"created":return e("sidebar.inbox.actionCreated");case"status_changed":return e("sidebar.inbox.actionStatusChanged");case"assignee_changed":return e("sidebar.inbox.actionAssigneeChanged");case"review_requested":return e("sidebar.inbox.actionReviewRequested");case"review_approved":return e("sidebar.inbox.actionReviewApproved");case"review_changes_requested":return e("sidebar.inbox.actionReviewChangesRequested");case"merge_failed":return e("sidebar.inbox.actionMergeFailed");case"order_incident":return e("sidebar.inbox.actionOrderIncident");default:{const i=t.action;return String(i)}}}function Ki(t){const e=N.c(36),{update:i,orgSlug:n,onSelect:o}=t,r=O();let l;e[0]!==n||e[1]!==i.taskKeySeq?(l=Gt(n,i.taskKeySeq),e[0]=n,e[1]=i.taskKeySeq,e[2]=l):l=e[2];const a=l,c=!i.actorName;let u;e[3]!==c||e[4]!==i.actorImage||e[5]!==i.actorName?(u=s.jsx("span",{className:"mt-0.5 shrink-0",children:c?s.jsx(En,{size:24}):s.jsx(De,{url:i.actorImage??void 0,fallback:i.actorName??"?",shape:"circle",size:"xs"})}),e[3]=c,e[4]=i.actorImage,e[5]=i.actorName,e[6]=u):u=e[6];let m;e[7]!==i.taskTitle?(m=s.jsx("p",{className:"min-w-0 flex-1 line-clamp-2 break-words text-sm font-medium text-foreground",children:i.taskTitle}),e[7]=i.taskTitle,e[8]=m):m=e[8];let d;e[9]!==i.occurredAt?(d=ks(new Date(i.occurredAt)),e[9]=i.occurredAt,e[10]=d):d=e[10];let p;e[11]!==d?(p=s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground/70",children:d}),e[11]=d,e[12]=p):p=e[12];let f;e[13]!==m||e[14]!==p?(f=s.jsxs("div",{className:"flex items-baseline gap-2",children:[m,p]}),e[13]=m,e[14]=p,e[15]=f):f=e[15];let x;e[16]!==a?(x=a&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:a})," · "]}),e[16]=a,e[17]=x):x=e[17];let g;e[18]!==i.action?(g=L(Bi(i.action)),e[18]=i.action,e[19]=g):g=e[19];let j;e[20]!==r||e[21]!==i?(j=qi(i,r),e[20]=r,e[21]=i,e[22]=j):j=e[22];let h;e[23]!==g||e[24]!==j?(h=s.jsx("span",{className:g,children:j}),e[23]=g,e[24]=j,e[25]=h):h=e[25];let v;e[26]!==h||e[27]!==x?(v=s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[x,h]}),e[26]=h,e[27]=x,e[28]=v):v=e[28];let b;e[29]!==v||e[30]!==f?(b=s.jsxs("div",{className:"min-w-0 flex-1",children:[f,v]}),e[29]=v,e[30]=f,e[31]=b):b=e[31];let y;return e[32]!==o||e[33]!==b||e[34]!==u?(y=s.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-start gap-3 border-b border-border px-4 py-3 text-left transition-colors last:border-0 hover:bg-accent",children:[u,b]}),e[32]=o,e[33]=b,e[34]=u,e[35]=y):y=e[35],y}function os(){const t=ee.useContext(Ns),{data:e,refetch:i}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>i?.()}}function Vi(t){const e=N.c(2),{onReach:i}=t;let n;return e[0]!==i?(n=s.jsx("div",{className:"h-8 shrink-0",ref:o=>{if(!o)return;const r=new IntersectionObserver(l=>{l.some(Hi)&&i()});return r.observe(o),()=>r.disconnect()}}),e[0]=i,e[1]=n):n=e[1],n}function Hi(t){return t.isIntersecting}function Wi(t){const e=N.c(28),{onClose:i}=t,n=O(),o=Re(),{org:r}=Y(),{updates:l,markAllRead:a,markRead:c,hasMore:u,fetchMore:m}=Qt(),d=os(),p=d.invitations,f=d.refetch;let x;e[0]!==n?(x=n("sidebar.inbox.title"),e[0]=n,e[1]=x):x=e[1];let g;e[2]!==x?(g=s.jsx("h3",{className:"text-sm font-medium",children:x}),e[2]=x,e[3]=g):g=e[3];let j;e[4]!==a||e[5]!==n||e[6]!==l.length?(j=l.length>0&&s.jsx($e,{size:"sm",variant:"ghost",className:"text-muted-foreground",onClick:a,children:n("sidebar.inbox.markAllRead")}),e[4]=a,e[5]=n,e[6]=l.length,e[7]=j):j=e[7];let h;e[8]!==g||e[9]!==j?(h=s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[g,j]}),e[8]=g,e[9]=j,e[10]=h):h=e[10];let v;e[11]!==p||e[12]!==f?(v=p.length>0&&s.jsx("div",{className:"shrink-0 border-border border-b p-2",children:p.map(S=>s.jsx(Qs,{invitation:S,onChanged:f},S.id))}),e[11]=p,e[12]=f,e[13]=v):v=e[13];let b;e[14]!==m||e[15]!==u||e[16]!==p.length||e[17]!==c||e[18]!==o||e[19]!==i||e[20]!==r||e[21]!==n||e[22]!==l?(b=l.length===0&&p.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[s.jsx(Lt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:n("sidebar.inbox.emptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n("sidebar.inbox.emptyBody")})]}):s.jsxs(On,{className:"min-h-0 flex-1",children:[l.map(S=>{const k=Gt(r.slug,S.taskKeySeq);return s.jsx(Ki,{update:S,orgSlug:r.slug,onSelect:()=>{c(S.id),i(),k&&o({to:"/$org/tasks/{-$taskKey}",params:{org:r.slug,taskKey:k}})}},S.id)}),u&&s.jsx(Vi,{onReach:m})]}),e[14]=m,e[15]=u,e[16]=p.length,e[17]=c,e[18]=o,e[19]=i,e[20]=r,e[21]=n,e[22]=l,e[23]=b):b=e[23];let y;return e[24]!==h||e[25]!==v||e[26]!==b?(y=s.jsxs(s.Fragment,{children:[h,v,b]}),e[24]=h,e[25]=v,e[26]=b,e[27]=y):y=e[27],y}function Qi(){const t=N.c(1),{redDotCount:e}=Qt(),{invitations:i}=os();if(e===0&&i.length===0)return null;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=n):n=t[0],n}function Gi(t){const e=N.c(10),{open:i,onOpenChange:n,children:o}=t;let r;e[0]!==n||e[1]!==i?(r=i&&s.jsx(Wi,{onClose:()=>n(!1)}),e[0]=n,e[1]=i,e[2]=r):r=e[2];let l;e[3]!==r?(l=s.jsx(Mt,{side:"right",align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(460px,calc(100vw-2rem))] flex-col p-0",children:r}),e[3]=r,e[4]=l):l=e[4];let a;return e[5]!==o||e[6]!==n||e[7]!==i||e[8]!==l?(a=s.jsxs(Et,{open:i,onOpenChange:n,children:[o,l]}),e[5]=o,e[6]=n,e[7]=i,e[8]=l,e[9]=a):a=e[9],a}function rs(){const t=N.c(9),e=O(),[i,n]=ee.useState(!1);let o;t[0]!==e?(o=e("sidebar.inbox.title"),t[0]=e,t[1]=o):o=t[1];let r,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{size:15}),l=s.jsx(Qi,{}),t[2]=r,t[3]=l):(r=t[2],l=t[3]);let a;t[4]!==o?(a=s.jsx(Dt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-lg text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[r,l]})}),t[4]=o,t[5]=a):a=t[5];let c;return t[6]!==i||t[7]!==a?(c=s.jsx(Gi,{open:i,onOpenChange:n,children:a}),t[6]=i,t[7]=a,t[8]=c):c=t[8],c}function _e(t){const e=N.c(35),{icon:i,label:n,isActive:o,link:r,onSelect:l,ariaLabel:a,className:c,dataTour:u,children:m,trailing:d,contextId:p}=t,f=o===void 0?!1:o,x=dt(),g=a??n,j=x?g:void 0;let h;e[0]!==c||e[1]!==u||e[2]!==f||e[3]!==j?(h={isActive:f,tooltip:j,className:c,"data-tour":u},e[0]=c,e[1]=u,e[2]=f,e[3]=j,e[4]=h):h=e[4];const v=h;let b;e[5]!==d?(b=d&&s.jsx("span",{className:"order-last ml-auto flex shrink-0 items-center group-data-[state=collapsed]/sidebar:hidden",children:d}),e[5]=d,e[6]=b):b=e[6];let y;e[7]!==n?(y=s.jsx("span",{className:"truncate",children:n}),e[7]=n,e[8]=y):y=e[8];let S;e[9]!==i||e[10]!==b||e[11]!==y?(S=s.jsxs(s.Fragment,{children:[i,b,y]}),e[9]=i,e[10]=b,e[11]=y,e[12]=S):S=e[12];const k=S;if(r){const _=f?"page":void 0;let $;e[13]!==k||e[14]!==r||e[15]!==g||e[16]!==l||e[17]!==_?($=s.jsx(Je,{...r,"aria-label":g,"aria-current":_,onClick:l,children:k}),e[13]=k,e[14]=r,e[15]=g,e[16]=l,e[17]=_,e[18]=$):$=e[18];let I;e[19]!==v||e[20]!==$?(I=s.jsx(Ie,{asChild:!0,...v,children:$}),e[19]=v,e[20]=$,e[21]=I):I=e[21];let F;return e[22]!==m||e[23]!==p||e[24]!==I?(F=s.jsxs(Ne,{"data-context-id":p,children:[I,m]}),e[22]=m,e[23]=p,e[24]=I,e[25]=F):F=e[25],F}let w;e[26]!==k||e[27]!==g||e[28]!==l||e[29]!==v?(w=s.jsx(Ie,{...v,"aria-label":g,onClick:l,children:k}),e[26]=k,e[27]=g,e[28]=l,e[29]=v,e[30]=w):w=e[30];let C;return e[31]!==m||e[32]!==p||e[33]!==w?(C=s.jsxs(Ne,{"data-context-id":p,children:[w,m]}),e[31]=m,e[32]=p,e[33]=w,e[34]=C):C=e[34],C}function Yi(t){const e=N.c(5),{label:i,link:n,onSelect:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Jt,{size:16}),e[0]=r):r=e[0];let l;return e[1]!==i||e[2]!==n||e[3]!==o?(l=s.jsx("div",{className:"contents",children:s.jsx(se,{className:"shrink-0",children:s.jsx(_e,{icon:r,label:i,className:"text-sidebar-foreground/70",link:n,onSelect:o})})}),e[1]=i,e[2]=n,e[3]=o,e[4]=l):l=e[4],l}function Ji(t){return t==="board"?"kanban":zt(t)?"cms":null}function ls(){const t=N.c(2),{data:e}=Wt();let i;return t[0]!==e?(i=n=>{const o=Ji(n);return!o||!e?!1:e.features[o]!==!0},t[0]=e,t[1]=i):i=t[1],i}const ut="settings",jt=["overview","files","monitor","plan","tasks"];function Xi(t){return t?[...jt,ut]:jt}function Zi(){const t=N.c(11),e=O(),{org:i}=Y(),n=$t(),o=Xt();let r;if(t[0]!==n||t[1]!==i.slug||t[2]!==o||t[3]!==e){let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(pn,{size:16}),t[5]=l):l=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xn,{size:16}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ut,{size:16}),t[7]=c):c=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(hn,{size:16}),t[8]=u):u=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(bn,{size:16}),t[9]=m):m=t[9];let d;t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Bt,{size:16}),t[10]=d):d=t[10];const p={overview:{key:"overview",label:e("sidebar.navDestinations.overview"),icon:l,isActive:o?n===re.root||n===`${re.root}/`:n===ae.home||n===ae.orgIndex,trackAs:"overview",link:o?{to:re.root,params:{org:i.slug,agentId:o}}:{to:ae.home,params:{org:i.slug}}},plan:{key:"plan",label:e("sidebar.navDestinations.plan"),icon:a,isActive:n===ae.plan||n===re.plan,trackAs:"plan",soon:!0,link:o?{to:re.plan,params:{org:i.slug,agentId:o}}:{to:ae.plan,params:{org:i.slug}}},tasks:{key:"tasks",label:e("sidebar.navDestinations.spineTasks"),icon:c,isActive:n===ae.tasks||n===re.tasks,trackAs:"board",link:o?{to:re.tasks,params:{org:i.slug,agentId:o,taskKey:void 0}}:{to:ae.tasks,params:{org:i.slug,taskKey:void 0}}},monitor:{key:"monitor",label:e("sidebar.navDestinations.monitor"),icon:u,isActive:n===ae.monitoring||n===re.monitoring,trackAs:"monitor",link:o?{to:re.monitoring,params:{org:i.slug,agentId:o}}:{to:ae.monitoring,params:{org:i.slug}}},settings:{key:"settings",label:e("sidebar.navDestinations.settings"),icon:m,isActive:n===re.settings,trackAs:ut,link:{to:re.settings,params:{org:i.slug,agentId:o??""}}},files:{key:"files",label:e("sidebar.navDestinations.context"),icon:d,isActive:n===ae.library||n===re.library,trackAs:"files",link:o?{to:re.library,params:{org:i.slug,agentId:o}}:{to:ae.library,params:{org:i.slug}}}};r=Xi(!!o).map(f=>p[f]),t[0]=n,t[1]=i.slug,t[2]=o,t[3]=e,t[4]=r}else r=t[4];return r}function eo(t){const e=N.c(11),{onNavigate:i}=t,n=O(),o=Zi(),r=ls();let l;if(e[0]!==o||e[1]!==r||e[2]!==i||e[3]!==n){let c;e[5]!==r||e[6]!==i||e[7]!==n?(c=u=>s.jsx(_e,{icon:u.icon,label:u.label,isActive:u.isActive,link:u.link,trailing:u.soon?s.jsx(Rn,{variant:"muted",children:n("common.soon")}):r(u.key)?s.jsx(Xe,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{fe("nav_destination_clicked",{destination:u.trackAs}),i?.()}},u.key),e[5]=r,e[6]=i,e[7]=n,e[8]=c):c=e[8],l=o.map(c),e[0]=o,e[1]=r,e[2]=i,e[3]=n,e[4]=l}else l=e[4];let a;return e[9]!==l?(a=s.jsx(se,{className:"gap-1",children:l}),e[9]=l,e[10]=a):a=e[10],a}function to(){const t=N.c(7),{org:e}=Y(),{setOpenMobile:i}=mt();let n;t[0]!==e.slug?(n={org:e.slug},t[0]=e.slug,t[1]=n):n=t[1];let o;t[2]!==i?(o=()=>{fe("nav_destination_clicked",{destination:ut,target:"org"}),i(!1)},t[2]=i,t[3]=o):o=t[3];let r;return t[4]!==n||t[5]!==o?(r={to:"/$org/settings",params:n,onClick:o},t[4]=n,t[5]=o,t[6]=r):r=t[6],r}function as(){const t=N.c(6),e=O(),i=to();let n;t[0]!==e?(n=e("sidebar.navDestinations.settings"),t[0]=e,t[1]=n):n=t[1];const o=n;let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ht,{size:15}),t[2]=r):r=t[2];let l;return t[3]!==o||t[4]!==i?(l=s.jsx(Je,{...i,"aria-label":o,title:o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-lg text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground","data-tour":ke.settings,children:r}),t[3]=o,t[4]=i,t[5]=l):l=t[5],l}function so(){const t=N.c(14),e=O(),{org:i}=Y(),{setOpenMobile:n}=mt(),{status:o,connected:r,expired:l}=Un();if(!o.isSuccess||r)return null;let a;t[0]!==l||t[1]!==e?(a=e(l?"sidebar.linkClaude.relink":"sidebar.linkClaude.button"),t[0]=l,t[1]=e,t[2]=a):a=t[2];const c=a;let u;t[3]!==i.slug?(u={org:i.slug},t[3]=i.slug,t[4]=u):u=t[4];let m;t[5]!==n?(m=()=>n(!1),t[5]=n,t[6]=m):m=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ue,{children:s.jsx("img",{src:Ln["claude-code"],alt:"",className:"size-4 object-contain"})}),t[7]=d):d=t[7];let p;t[8]!==c?(p=s.jsx("span",{children:c}),t[8]=c,t[9]=p):p=t[9];let f;return t[10]!==u||t[11]!==m||t[12]!==p?(f=s.jsx(Ne,{children:s.jsx(Ie,{asChild:!0,children:s.jsxs(Je,{to:"/$org/settings/ai-providers",params:u,hash:Bn,onClick:m,children:[d,p]})})}),t[10]=u,t[11]=m,t[12]=p,t[13]=f):f=t[13],f}const no=250;function io(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function vt(t,e,i){return new Promise(n=>t.toBlob(n,e,i))}async function oo(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(r=>setTimeout(r,no));const i=document.createElement("canvas");i.width=e.videoWidth,i.height=e.videoHeight,i.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let n=await vt(i,"image/png");if((!n||n.size>Yt)&&(n=await vt(i,"image/jpeg",.85)),!n)throw new Error("Could not encode the screenshot");const o=n.type==="image/png"?"png":"jpg";return new File([n],`screenshot.${o}`,{type:n.type})}finally{for(const e of t.getTracks())e.stop()}}function ro({open:t,onOpenChange:e}){const i=O(),{org:n}=Y(),[o,r]=ee.useState(""),[l,a]=ee.useState([]),[c,u]=ee.useState(!1),m=()=>{for(const h of l)URL.revokeObjectURL(h.previewUrl);a([]),r("")},d=h=>{const v=h.filter(S=>Mn.includes(S.type)?S.size>Yt?(Ce.error(i("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),b=Ke-l.length;v.length>b&&Ce.error(i("sidebar.feedback.tooManyScreenshots",{max:String(Ke)}));const y=v.slice(0,Math.max(b,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));y.length>0&&a(S=>[...S,...y])},p=h=>{URL.revokeObjectURL(h.previewUrl),a(v=>v.filter(b=>b!==h))},f=async()=>{u(!0);try{d([await oo()])}catch(h){h instanceof DOMException&&h.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",h),Ce.error(i("sidebar.feedback.screenshotFailed")))}finally{u(!1)}},x=h=>{const v=Array.from(h.clipboardData.files).filter(b=>b.type.startsWith("image/"));v.length!==0&&(h.preventDefault(),d(v))},g=It({mutationFn:async()=>{const h=new FormData;h.set("message",o.trim()),h.set("pageUrl",window.location.href);for(const b of l)h.append("screenshot",b.file);const v=await fetch(`/api/${encodeURIComponent(n.slug)}/feedback`,{method:"POST",body:h});if(!v.ok)throw new Error(`Feedback failed: ${v.status}`)},onSuccess:()=>{Ce.success(i("sidebar.feedback.sent")),m(),e(!1)},onError:()=>Ce.error(i("sidebar.feedback.failed"))}),j=o.trim().length>0&&!g.isPending;return s.jsx(Ze,{open:t&&!c,onOpenChange:e,children:s.jsxs(et,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(tt,{children:s.jsx(st,{children:i("sidebar.feedback.title")})}),s.jsx(Kn,{autoFocus:!0,value:o,onChange:h=>r(h.target.value),onPaste:x,onKeyDown:h=>{h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),j&&g.mutate())},placeholder:i("sidebar.feedback.placeholder"),className:"min-h-32 max-h-80",maxLength:Dn}),l.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:l.map((h,v)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:h.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:h.previewUrl,alt:i("sidebar.feedback.screenshotAlt",{n:String(v+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>p(h),"aria-label":i("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qn,{size:12})})]},h.previewUrl))}),s.jsxs(Pt,{className:"sm:justify-between",children:[io()?s.jsxs($e,{type:"button",variant:"outline",onClick:f,disabled:l.length>=Ke,children:[s.jsx(jn,{size:14}),i("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx($e,{type:"button",onClick:()=>g.mutate(),disabled:!j,children:g.isPending?i("sidebar.feedback.sending"):i("sidebar.feedback.send")})]})]})})}function lo(){const t=N.c(16),e=O(),[i,n]=ee.useState(!1);let o;t[0]!==e?(o=e("sidebar.feedback.button"),t[0]=e,t[1]=o):o=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>n(!0),t[2]=r):r=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ue,{children:s.jsx(gn,{className:Ye})}),t[3]=l):l=t[3];let a;t[4]!==e?(a=e("sidebar.feedback.button"),t[4]=e,t[5]=a):a=t[5];let c;t[6]!==a?(c=s.jsx("span",{children:a}),t[6]=a,t[7]=c):c=t[7];let u;t[8]!==o||t[9]!==c?(u=s.jsxs(Ie,{tooltip:o,onClick:r,children:[l,c]}),t[8]=o,t[9]=c,t[10]=u):u=t[10];let m;t[11]!==i?(m=s.jsx(ro,{open:i,onOpenChange:n}),t[11]=i,t[12]=m):m=t[12];let d;return t[13]!==u||t[14]!==m?(d=s.jsxs(Ne,{children:[u,m]}),t[13]=u,t[14]=m,t[15]=d):d=t[15],d}function ao(t){const e=N.c(5),{showLinkClaude:i}=t;let n;e[0]!==i?(n=i&&s.jsx(so,{}),e[0]=i,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(lo,{}),e[2]=o):o=e[2];let r;return e[3]!==n?(r=s.jsxs(se,{className:"gap-0.5",children:[n,o]}),e[3]=n,e[4]=r):r=e[4],r}function co(){const t=N.c(8),e=An(),i=!e;let n;t[0]!==i?(n=i&&s.jsx(Ui,{}),t[0]=i,t[1]=n):n=t[1];const o=!e;let r;t[2]!==o?(r=s.jsx(ao,{showLinkClaude:o}),t[2]=o,t[3]=r):r=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(se,{className:"gap-0.5",children:s.jsx(Ne,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(is,{})}),s.jsx(as,{}),s.jsx(rs,{})]})})}),t[4]=l):l=t[4];let a;return t[5]!==n||t[6]!==r?(a=s.jsxs(Ft,{className:"px-2 pb-3 gap-0.5",children:[n,r,l]}),t[5]=n,t[6]=r,t[7]=a):a=t[7],a}function mo(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ft,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(se,{children:s.jsx(Ne,{children:s.jsx(is,{})})})}),s.jsx(as,{}),s.jsx(rs,{})]})}),t[0]=e):e=t[0],e}function uo(){const t=N.c(3),{setScope:e}=Le(),i=Vn();let n;return t[0]!==i||t[1]!==e?(n=()=>{const o=i!==void 0?"route_resolves_scope":null;fe("scope_cleared",{relocated:o!==null,reason:o}),e(null)},t[0]=i,t[1]=e,t[2]=n):n=t[2],n}function fo(){const t=N.c(2),{org:e}=Y();let i;return t[0]!==e.name?(i=s.jsx("div",{className:"flex min-w-0 flex-1 items-center py-1.5 pr-1.5 pl-2 md:h-[34px] md:py-0","data-tour":ke.switcher,children:s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground text-sm",children:e.name})}),t[0]=e.name,t[1]=i):i=t[1],i}function cs(t){const e=N.c(14),{onNavigate:i}=t,n=O(),{org:o}=Y(),{project:r}=Le(),l=uo();if(!r){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(fo,{}),e[0]=f):f=e[0],f}let a;e[1]!==o.name||e[2]!==n?(a=n("sidebar.scope.backTo",{name:o.name}),e[1]=o.name,e[2]=n,e[3]=a):a=e[3];const c=a;let u;e[4]!==l||e[5]!==i?(u=()=>{l(),i?.()},e[4]=l,e[5]=i,e[6]=u):u=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Jt,{size:16,className:"shrink-0 text-muted-foreground"}),e[7]=m):m=e[7];let d;e[8]!==r.title?(d=s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground text-sm",children:r.title}),e[8]=r.title,e[9]=d):d=e[9];let p;return e[10]!==c||e[11]!==u||e[12]!==d?(p=s.jsxs("button",{type:"button",title:c,"aria-label":c,onClick:u,className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg py-1.5 pr-1.5 pl-2 text-left transition-colors hover:bg-sidebar-accent md:h-[34px] md:py-0",children:[m,d]}),e[10]=c,e[11]=u,e[12]=d,e[13]=p):p=e[13],p}const ds=16;function po(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs(s.Fragment,{children:[s.jsx(cs,{}),s.jsx(ho,{}),s.jsx(At,{})]}),t[0]=e):e=t[0],e}function xo(t){const e=N.c(12),{onClose:i}=t,n=O();let o;e[0]!==i?(o=s.jsx(cs,{onNavigate:i}),e[0]=i,e[1]=o):o=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(At,{}),e[2]=r):r=e[2];let l;e[3]!==n?(l=n("sidebar.header.closeSidebar"),e[3]=n,e[4]=l):l=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qt,{size:ds}),e[5]=a):a=e[5];let c;e[6]!==i||e[7]!==l?(c=s.jsx(Zt,{onClick:i,"aria-label":l,children:a}),e[6]=i,e[7]=l,e[8]=c):c=e[8];let u;return e[9]!==o||e[10]!==c?(u=s.jsxs(s.Fragment,{children:[o,r,c]}),e[9]=o,e[10]=c,e[11]=u):u=e[11],u}function ho(){const t=N.c(6),e=O(),{toggleSidebar:i}=mt();let n;t[0]!==e?(n=e("page.collapseSidebar"),t[0]=e,t[1]=n):n=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(qt,{size:ds}),t[2]=o):o=t[2];let r;return t[3]!==n||t[4]!==i?(r=s.jsx(Zt,{"aria-label":n,onClick:i,className:"shrink-0 size-7",children:o}),t[3]=n,t[4]=i,t[5]=r):r=t[5],r}function bo(t){const e=N.c(27),{onNavigate:i}=t,n=O(),{project:o}=Le(),r=es(),l=$t(),a=Wn(),c=Jn(o),u=ls(),m=ni(o?.id);if(!o)return null;let d;if(e[0]!==c.presence||e[1]!==m||e[2]!==o.metadata){const k=Qn(o.metadata),w=c.presence,C=m??Xn(o.metadata);d=new Set(Zn(C,ti(k,w),m!==void 0?1:o.metadata.sidebarViewsVersion,m!==void 0?[]:ei(o.metadata.sidebarViewsSeen,w.calendar))),e[0]=c.presence,e[1]=m,e[2]=o.metadata,e[3]=d}else d=e[3];const p=d;let f,x,g,j;if(e[4]!==a||e[5]!==u||e[6]!==l||e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==p||e[11]!==n){j=[],p.has("site-editor")&&j.push({key:"site-editor",label:n("sidebar.projectNav.siteEditor"),icon:s.jsx(Vt,{size:16}),panel:"site-editor",isActive:So,dataTour:ke.siteEditor});const k={assets:{label:n("common.mainPanelTabs.assets"),icon:s.jsx(Cn,{size:16})},releases:{label:n("common.mainPanelTabs.releases"),icon:s.jsx(kn,{size:16})},hosting:{label:n("common.mainPanelTabs.hosting"),icon:s.jsx(ws,{size:16})},e2e:{label:n("common.mainPanelTabs.e2e"),icon:s.jsx(yn,{size:16})},calendar:{label:n("common.mainPanelTabs.calendar"),icon:s.jsx(Sn,{size:16})}};for(const _ of si){if(!p.has(_))continue;const $=k[_];j.push({key:_,label:$.label,icon:$.icon,panel:_,isActive:I=>I===_})}for(const _ of Gn(Yn(o),(o.connections??[]).map(vo))){if(_.toolName==="fetch_assets")continue;const $=_s(_.connectionId,_.toolName),I=ii({tabId:$,kind:"expanded",iconUrl:_.icon,connections:[]}),F=_.label||_.toolName,{IconComp:U}=vn(F);j.push({key:`pinned:${_.connectionId}:${_.toolName}`,label:F,icon:I.kind==="fallback"?s.jsx(U,{size:16}):s.jsx(oi,{icon:I}),panel:$,isActive:B=>B===$})}p.has("automations")&&j.push({key:"automations",label:n("sidebar.projectNav.automations"),icon:s.jsx(Rt,{size:16}),panel:"automations",isActive:jo,dataTour:ke.automations});const w=l.startsWith(ae.projects),C=go;f=se,x="gap-1",g=j.map(_=>s.jsx(_e,{icon:C(_),label:_.label,dataTour:_.dataTour,isActive:w&&_.isActive(a),trailing:u(_.panel)?s.jsx(Xe,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{fe("project_nav_clicked",{surface:_.key}),r(o.id,{panel:_.panel}),i?.()}},_.key)),e[4]=a,e[5]=u,e[6]=l,e[7]=r,e[8]=i,e[9]=o,e[10]=p,e[11]=n,e[12]=f,e[13]=x,e[14]=g,e[15]=j}else f=e[12],x=e[13],g=e[14],j=e[15];let h;e[16]!==f||e[17]!==x||e[18]!==g?(h=s.jsx(f,{className:x,children:g}),e[16]=f,e[17]=x,e[18]=g,e[19]=h):h=e[19];const v=h;if(j.length===0)return null;let b;e[20]!==n?(b=n("sidebar.projectNav.apps"),e[20]=n,e[21]=b):b=e[21];let y;e[22]!==b?(y=s.jsx("div",{className:"flex h-6 items-center px-2 group-data-[state=collapsed]/sidebar:hidden",children:s.jsx("span",{className:"truncate font-medium text-xs text-muted-foreground",children:b})}),e[22]=b,e[23]=y):y=e[23];let S;return e[24]!==v||e[25]!==y?(S=s.jsxs("div",{className:"flex flex-col gap-1",children:[y,v]}),e[24]=v,e[25]=y,e[26]=S):S=e[26],S}function go(t){const e=Hn[t.panel];return s.jsx("span",{className:L("flex size-5 shrink-0 items-center justify-center rounded-md [&_svg]:size-3",e?e.tone:"bg-muted text-muted-foreground"),children:e?s.jsx(e.Icon,{size:12,className:"text-current"}):t.icon})}function jo(t){return t==="automations"||Cs(t)!==null}function vo(t){return t.connection_id}function So(t){return!!t&&zt(t)}const Ee={folders:[],preferences:pi,joinedAt:null};function yo(){const t=N.c(11),{org:e}=Y(),i=nt();let n;t[0]!==e.id?(n=Me.projectSidebar(e.id),t[0]=e.id,t[1]=n):n=t[1];const o=n;let r;t[2]!==e.slug||t[3]!==i||t[4]!==o?(r=u=>xi.subscribe(e.slug,()=>{i.invalidateQueries({queryKey:o}),u()},()=>i.invalidateQueries({queryKey:o})),t[2]=e.slug,t[3]=i,t[4]=o,t[5]=r):r=t[5],ee.useSyncExternalStore(r,No,ko);let l;t[6]!==e.slug?(l=async()=>await $s(e.slug,"SIDEBAR_GET",{}),t[6]=e.slug,t[7]=l):l=t[7];let a;t[8]!==o||t[9]!==l?(a={queryKey:o,queryFn:l,staleTime:6e4},t[8]=o,t[9]=l,t[10]=a):a=t[10];const{data:c}=it(a);return c??Ee}function ko(){return 0}function No(){return 0}function ms(t,e,i){const n=N.c(25),{org:o}=Y(),r=nt();let l,a,c,u;n[0]!==o.id||n[1]!==r?(l=Me.projectSidebar(o.id),a=()=>r.getQueryData(l)??Ee,u=It,c=[...l,"write"],n[0]=o.id,n[1]=r,n[2]=l,n[3]=a,n[4]=c,n[5]=u):(l=n[2],a=n[3],c=n[4],u=n[5]);let m;n[6]!==t||n[7]!==a||n[8]!==i?(m=async g=>i(t(a())),n[6]=t,n[7]=a,n[8]=i,n[9]=m):m=n[9];let d;n[10]!==l||n[11]!==t||n[12]!==e||n[13]!==r?(d=g=>{const j=r.getQueryData(l),h=j??Ee;return r.setQueryData(l,e(h,g(t(h)))),{prev:j}},n[10]=l,n[11]=t,n[12]=e,n[13]=r,n[14]=d):d=n[14];let p,f;n[15]!==l||n[16]!==r?(p=(g,j,h)=>{r.setQueryData(l,h?.prev??Ee)},f=()=>{r.isMutating({mutationKey:[...l,"write"]})===1&&r.invalidateQueries({queryKey:l})},n[15]=l,n[16]=r,n[17]=p,n[18]=f):(p=n[17],f=n[18]);let x;return n[19]!==c||n[20]!==m||n[21]!==d||n[22]!==p||n[23]!==f?(x={mutationKey:c,mutationFn:m,onMutate:d,onError:p,onSettled:f},n[19]=c,n[20]=m,n[21]=d,n[22]=p,n[23]=f,n[24]=x):x=n[24],u(x)}function _o(){const t=N.c(2),e=ot();let i;return t[0]!==e?(i=async n=>await e.call("SIDEBAR_PREFERENCES_SET",n),t[0]=e,t[1]=i):i=t[1],ms(Co,wo,i)}function wo(t,e){return{...t,preferences:e}}function Co(t){return t.preferences}function $o(){const t=N.c(2),e=ot();let i;return t[0]!==e?(i=async n=>(await e.call("PROJECT_FOLDERS_SET",{folders:n})).folders,t[0]=e,t[1]=i):i=t[1],ms(Po,Io,i)}function Io(t,e){return{...t,folders:e}}function Po(t){return t.folders}function To({projects:t,folders:e,preferences:i}){const n=new Map(t.map(f=>[f.id,f])),o=new Set(i.pinned),r=new Set(i.hidden),l=new Set(i.hiddenFolders),a=new Map;for(const f of e)for(const x of f.projectIds)a.set(x,f.id);const c=f=>f.map(x=>n.get(x)).filter(x=>!!x),u=c(i.pinned),m=f=>!o.has(f.id)&&!r.has(f.id),d=[],p=[];for(const f of e){const x=c(f.projectIds).filter(m);(l.has(f.id)?p:d).push({folder:f,projects:x})}return{pinned:u,folders:d,loose:t.filter(f=>!a.has(f.id)&&m(f)),hiddenFolders:p,hidden:t.filter(f=>r.has(f.id)&&!o.has(f.id))}}function St(t,e,i){const n=r=>r.filter(l=>l!==e),o={...t,pinned:n(t.pinned),hidden:n(t.hidden),dismissed:n(t.dismissed)};return i&&(o[i]=[...o[i],e]),o}function zo(t,e,i){const n=t.hiddenFolders.filter(o=>o!==e);return{...t,hiddenFolders:i?[...n,e]:n}}function Fo(t,e,i){return[...t,{id:e,name:i,projectIds:[]}]}function Ao(t,e,i){return t.map(n=>n.id===e?{...n,name:i}:n)}function He(t,e){return t.filter(i=>i.id!==e)}function yt(t,e,i){return t.map(n=>{const o=n.projectIds.filter(r=>r!==e);return{...n,projectIds:n.id===i?[...o,e]:o}})}function Oo(t){const e=N.c(97),{open:i,onOpenChange:n,projects:o,folders:r,preferences:l,canManage:a,onPin:c,onHide:u,onHideFolder:m,onMove:d,onRequestFolderName:p,onDeleteFolder:f}=t,x=O();let g,j,h,v,b,y,S,k,w,C;if(e[0]!==a||e[1]!==r||e[2]!==f||e[3]!==u||e[4]!==m||e[5]!==d||e[6]!==n||e[7]!==c||e[8]!==p||e[9]!==i||e[10]!==l.hidden||e[11]!==l.hiddenFolders||e[12]!==l.pinned||e[13]!==o||e[14]!==x){const F=new Map(o.map(Ro));let U;e[25]!==r?(U=new Set(r.flatMap(Mo)),e[25]=r,e[26]=U):U=e[26];const B=U;let J;e[27]!==l.pinned?(J=new Set(l.pinned),e[27]=l.pinned,e[28]=J):J=e[28];const G=J;let K;e[29]!==l.hidden?(K=new Set(l.hidden),e[29]=l.hidden,e[30]=K):K=e[30];const te=K;let W;e[31]!==l.hiddenFolders?(W=new Set(l.hiddenFolders),e[31]=l.hiddenFolders,e[32]=W):W=e[32];const V=W;let X;e[33]!==a||e[34]!==r||e[35]!==te||e[36]!==V||e[37]!==u||e[38]!==d||e[39]!==c||e[40]!==p||e[41]!==G||e[42]!==x?(X=(z,R)=>{const P=G.has(z.id),E=R!==null&&V.has(R.id)&&!P,D=!te.has(z.id)&&!E;return s.jsxs("li",{className:"group/row flex h-11 items-center gap-3 px-3 transition-colors hover:bg-accent",children:[s.jsx("span",{className:L("flex size-4 shrink-0 items-center justify-center",!D&&"opacity-50"),children:s.jsx(ns,{icon:z.icon,name:z.title})}),s.jsx("span",{className:L("min-w-0 flex-1 truncate text-sm",D?"text-foreground":"text-muted-foreground"),children:z.title}),a&&s.jsx("span",{className:"opacity-0 transition-opacity group-hover/row:opacity-100 has-[[data-state=open]]:opacity-100",children:s.jsx(Lo,{project:z,folder:R,folders:r,onMove:d,onRequestFolderName:p})}),s.jsx("span",{className:L("transition-opacity",!P&&"opacity-0 group-hover/row:opacity-100"),children:s.jsx(Ge,{label:x(P?"sidebar.projects.unpin":"sidebar.projects.pin"),variant:P?"secondary":"ghost","aria-pressed":P,onClick:()=>c(z.id,!P),children:P?s.jsx(Uo,{}):s.jsx(Kt,{size:14})})}),s.jsx(ji,{checked:D,disabled:E,"aria-label":`${x("sidebar.customize.showInSidebar")}: ${z.title}`,title:E?x("sidebar.customize.stateWithFolder"):void 0,onCheckedChange:H=>u(z.id,H!==!0)})]},z.id)},e[33]=a,e[34]=r,e[35]=te,e[36]=V,e[37]=u,e[38]=d,e[39]=c,e[40]=p,e[41]=G,e[42]=x,e[43]=X):X=e[43];const q=X;let Q;e[44]!==a||e[45]!==V||e[46]!==f||e[47]!==m||e[48]!==p||e[49]!==q||e[50]!==x?(Q=(z,R,P,E)=>{const D=P!==null&&V.has(P.id);return s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex h-7 items-center gap-2",children:[s.jsx("h3",{className:L("min-w-0 flex-1 truncate text-sm font-medium",D?"text-muted-foreground":"text-foreground"),children:R}),P&&s.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[x("sidebar.customize.showFolder"),s.jsx(vi,{checked:!D,onCheckedChange:H=>m(P.id,!H)})]}),P&&a&&s.jsxs(rt,{children:[s.jsx(lt,{asChild:!0,children:s.jsx(Ge,{label:x("sidebar.customize.folderOptions"),children:s.jsx(at,{size:14})})}),s.jsxs(ct,{align:"end",children:[s.jsx(pe,{onSelect:()=>p({kind:"rename",folderId:P.id,name:P.name}),children:x("sidebar.projects.renameFolder")}),s.jsx(pe,{variant:"destructive",onSelect:()=>f(P.id),children:x("sidebar.projects.deleteFolder")})]})]})]}),s.jsx("ul",{className:"flex flex-col divide-y divide-border overflow-hidden surface",children:E.length===0?s.jsx("li",{className:"flex h-11 items-center px-3 text-sm text-muted-foreground",children:x("sidebar.customize.empty")}):E.map(H=>q(H,P))})]},z)},e[44]=a,e[45]=V,e[46]=f,e[47]=m,e[48]=p,e[49]=q,e[50]=x,e[51]=Q):Q=e[51];const Z=Q;if(e[52]!==a||e[53]!==Z||e[54]!==n||e[55]!==p||e[56]!==i||e[57]!==B||e[58]!==o||e[59]!==x){let z;e[69]!==B?(z=H=>!B.has(H.id),e[69]=B,e[70]=z):z=e[70];const R=o.filter(z);j=Ze,w=i,C=n,g=et,y="flex max-h-[85vh] flex-col gap-5 sm:max-w-2xl",S=Do;let P;e[71]!==x?(P=x("sidebar.projects.customize"),e[71]=x,e[72]=P):P=e[72];let E;e[73]!==P?(E=s.jsx(st,{children:P}),e[73]=P,e[74]=E):E=e[74];let D;e[75]!==a||e[76]!==p||e[77]!==x?(D=a&&s.jsxs($e,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>p({kind:"create"}),children:[s.jsx(Qe,{size:14}),x("sidebar.projects.newFolder")]}),e[75]=a,e[76]=p,e[77]=x,e[78]=D):D=e[78],e[79]!==E||e[80]!==D?(k=s.jsxs(tt,{className:"flex-row items-center justify-between gap-4 pr-8",children:[E,D]}),e[79]=E,e[80]=D,e[81]=k):k=e[81],h="-mx-6 flex min-h-0 flex-col gap-6 overflow-y-auto px-6 pb-1",v=Z("loose",x("sidebar.projects.heading"),null,R),e[52]=a,e[53]=Z,e[54]=n,e[55]=p,e[56]=i,e[57]=B,e[58]=o,e[59]=x,e[60]=g,e[61]=j,e[62]=h,e[63]=v,e[64]=y,e[65]=S,e[66]=k,e[67]=w,e[68]=C}else g=e[60],j=e[61],h=e[62],v=e[63],y=e[64],S=e[65],k=e[66],w=e[67],C=e[68];b=r.map(z=>Z(z.id,z.name,z,z.projectIds.map(R=>F.get(R)).filter(Eo))),e[0]=a,e[1]=r,e[2]=f,e[3]=u,e[4]=m,e[5]=d,e[6]=n,e[7]=c,e[8]=p,e[9]=i,e[10]=l.hidden,e[11]=l.hiddenFolders,e[12]=l.pinned,e[13]=o,e[14]=x,e[15]=g,e[16]=j,e[17]=h,e[18]=v,e[19]=b,e[20]=y,e[21]=S,e[22]=k,e[23]=w,e[24]=C}else g=e[15],j=e[16],h=e[17],v=e[18],b=e[19],y=e[20],S=e[21],k=e[22],w=e[23],C=e[24];let _;e[82]!==h||e[83]!==v||e[84]!==b?(_=s.jsxs("div",{className:h,children:[v,b]}),e[82]=h,e[83]=v,e[84]=b,e[85]=_):_=e[85];let $;e[86]!==g||e[87]!==y||e[88]!==S||e[89]!==k||e[90]!==_?($=s.jsxs(g,{className:y,onOpenAutoFocus:S,children:[k,_]}),e[86]=g,e[87]=y,e[88]=S,e[89]=k,e[90]=_,e[91]=$):$=e[91];let I;return e[92]!==j||e[93]!==$||e[94]!==w||e[95]!==C?(I=s.jsx(j,{open:w,onOpenChange:C,children:$}),e[92]=j,e[93]=$,e[94]=w,e[95]=C,e[96]=I):I=e[96],I}function Eo(t){return!!t}function Do(t){return t.preventDefault()}function Mo(t){return t.projectIds}function Ro(t){return[t.id,t]}function Lo(t){const e=N.c(41),{project:i,folder:n,folders:o,onMove:r,onRequestFolderName:l}=t,a=O();let c;e[0]!==a?(c=a("sidebar.customize.projectOptions"),e[0]=a,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(at,{size:14}),e[2]=u):u=e[2];let m;e[3]!==c?(m=s.jsx(lt,{asChild:!0,children:s.jsx(Ge,{label:c,children:u})}),e[3]=c,e[4]=m):m=e[4];let d;e[5]!==a?(d=a("sidebar.projects.moveTo"),e[5]=a,e[6]=d):d=e[6];let p;e[7]!==d?(p=s.jsx(Is,{children:d}),e[7]=d,e[8]=p):p=e[8];let f;if(e[9]!==n?.id||e[10]!==o||e[11]!==r||e[12]!==i.id){let S;e[14]!==n?.id||e[15]!==r||e[16]!==i.id?(S=k=>s.jsx(pe,{disabled:k.id===n?.id,onSelect:()=>r(i.id,k.id),children:k.name},k.id),e[14]=n?.id,e[15]=r,e[16]=i.id,e[17]=S):S=e[17],f=o.map(S),e[9]=n?.id,e[10]=o,e[11]=r,e[12]=i.id,e[13]=f}else f=e[13];let x;e[18]!==n||e[19]!==r||e[20]!==i.id||e[21]!==a?(x=n&&s.jsx(pe,{onSelect:()=>r(i.id,null),children:a("sidebar.projects.noFolder")}),e[18]=n,e[19]=r,e[20]=i.id,e[21]=a,e[22]=x):x=e[22];let g;e[23]!==l||e[24]!==i.id?(g=()=>l({kind:"create",projectId:i.id}),e[23]=l,e[24]=i.id,e[25]=g):g=e[25];let j;e[26]!==a?(j=a("sidebar.projects.newFolder"),e[26]=a,e[27]=j):j=e[27];let h;e[28]!==g||e[29]!==j?(h=s.jsx(pe,{onSelect:g,children:j}),e[28]=g,e[29]=j,e[30]=h):h=e[30];let v;e[31]!==h||e[32]!==f||e[33]!==x?(v=s.jsxs(Ps,{children:[f,x,h]}),e[31]=h,e[32]=f,e[33]=x,e[34]=v):v=e[34];let b;e[35]!==v||e[36]!==p?(b=s.jsx(ct,{align:"end",children:s.jsxs(Ts,{children:[p,v]})}),e[35]=v,e[36]=p,e[37]=b):b=e[37];let y;return e[38]!==b||e[39]!==m?(y=s.jsxs(rt,{children:[m,b]}),e[38]=b,e[39]=m,e[40]=y):y=e[40],y}function Uo(){const t=N.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Kt,{size:14}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("span",{className:"relative flex size-3.5",children:[e,s.jsx("svg",{viewBox:"0 0 14 14",className:"absolute inset-0 size-3.5","aria-hidden":"true",children:s.jsx("line",{x1:"1.5",y1:"1.5",x2:"12.5",y2:"12.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})]}),t[1]=i):i=t[1],i}function Bo(t){const e=N.c(10),{request:i,onClose:n,onSave:o}=t,r=i!==null;let l;e[0]!==n?(l=u=>!u&&n(),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==n||e[3]!==o||e[4]!==i?(a=i&&s.jsx(qo,{request:i,onClose:n,onSave:o},i.kind==="rename"?i.folderId:"create"),e[2]=n,e[3]=o,e[4]=i,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=s.jsx(Ze,{open:r,onOpenChange:l,children:a}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function qo(t){const e=N.c(39),{request:i,onClose:n,onSave:o}=t,r=O(),[l,a]=ee.useState(i.kind==="rename"?i.name:"");let c;e[0]!==l?(c=l.trim(),e[0]=l,e[1]=c):c=e[1];const u=c;let m;e[2]!==n||e[3]!==o||e[4]!==i||e[5]!==u?(m=_=>{_.preventDefault(),u&&(o(i,u),n())},e[2]=n,e[3]=o,e[4]=i,e[5]=u,e[6]=m):m=e[6];const d=i.kind==="rename"?"sidebar.projects.renameFolder":"sidebar.projects.newFolder";let p;e[7]!==r||e[8]!==d?(p=r(d),e[7]=r,e[8]=d,e[9]=p):p=e[9];let f;e[10]!==p?(f=s.jsx(tt,{children:s.jsx(st,{children:p})}),e[10]=p,e[11]=f):f=e[11];let x;e[12]!==r?(x=r("sidebar.projects.folderName"),e[12]=r,e[13]=x):x=e[13];let g;e[14]!==r?(g=r("sidebar.projects.folderName"),e[14]=r,e[15]=g):g=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=_=>a(_.target.value),e[16]=j):j=e[16];let h;e[17]!==l||e[18]!==x||e[19]!==g?(h=s.jsx(zs,{autoFocus:!0,value:l,maxLength:hi,placeholder:x,"aria-label":g,onChange:j}),e[17]=l,e[18]=x,e[19]=g,e[20]=h):h=e[20];let v;e[21]!==r?(v=r("sidebar.projects.folderCancel"),e[21]=r,e[22]=v):v=e[22];let b;e[23]!==n||e[24]!==v?(b=s.jsx($e,{type:"button",variant:"ghost",onClick:n,children:v}),e[23]=n,e[24]=v,e[25]=b):b=e[25];const y=!u;let S;e[26]!==r?(S=r("sidebar.projects.folderSave"),e[26]=r,e[27]=S):S=e[27];let k;e[28]!==y||e[29]!==S?(k=s.jsx($e,{type:"submit",disabled:y,children:S}),e[28]=y,e[29]=S,e[30]=k):k=e[30];let w;e[31]!==b||e[32]!==k?(w=s.jsxs(Pt,{children:[b,k]}),e[31]=b,e[32]=k,e[33]=w):w=e[33];let C;return e[34]!==w||e[35]!==m||e[36]!==f||e[37]!==h?(C=s.jsx(et,{className:"sm:max-w-sm",children:s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:m,children:[f,h,w]})}),e[34]=w,e[35]=m,e[36]=f,e[37]=h,e[38]=C):C=e[38],C}function Ko(t){const e=t.target.closest("[data-context-id]")?.getAttribute("data-context-id");return e?.startsWith("project:")?{kind:"project",id:e.slice(8)}:e?.startsWith("folder:")?{kind:"folder",id:e.slice(7)}:{kind:"none"}}function Vo(t){const e=N.c(8),{locator:i}=Y(),n=ot(),{data:o}=ze.useSession();let r;e[0]!==i||e[1]!==n?(r=fi(i,n),e[0]=i,e[1]=n,e[2]=r):r=e[2];const{data:l}=it(r);let a,c;if(e[3]!==l||e[4]!==t||e[5]!==o?.user?.id){c=Symbol.for("react.early_return_sentinel");e:{if(a=new Map,!l){c=a;break e}const u=bi(t);for(const m of ui(l.items,o?.user?.id)){const d=gi(m,u);d&&a.set(d.id,(a.get(d.id)??0)+1)}}e[3]=l,e[4]=t,e[5]=o?.user?.id,e[6]=a,e[7]=c}else a=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:a}function Ho(t){const e=N.c(5),{label:i,action:n}=t;let o;e[0]!==i?(o=s.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=o):o=e[1];let r;return e[2]!==n||e[3]!==o?(r=s.jsxs("div",{className:"flex h-6 items-center justify-between gap-2 px-2",children:[o,n]}),e[2]=n,e[3]=o,e[4]=r):r=e[4],r}function us(t){const e=N.c(24),{project:i,onNavigate:n,waiting:o,trailing:r,children:l}=t,a=o===void 0?0:o,c=O(),u=es();let m;e[0]!==c||e[1]!==a?(m=a>0?c("sidebar.projects.waiting",{count:a}):null,e[0]=c,e[1]=a,e[2]=m):m=e[2];const d=m;let p;e[3]!==i.icon||e[4]!==i.title?(p=s.jsx(ns,{icon:i.icon,name:i.title}),e[3]=i.icon,e[4]=i.title,e[5]=p):p=e[5];const f=i.title,x=`project:${i.id}`;let g;e[6]!==r||e[7]!==d?(g=d?s.jsx("span",{title:d,className:"mr-1 size-2 rounded-full bg-warning group-hover/menu-item:invisible"}):r,e[6]=r,e[7]=d,e[8]=g):g=e[8];const j=d&&"font-semibold";let h;e[9]!==j?(h=L(j),e[9]=j,e[10]=h):h=e[10];const v=d?`${i.title}, ${d}`:void 0;let b;e[11]!==u||e[12]!==n||e[13]!==i.id?(b=()=>{fe("sidebar_project_clicked"),u(i.id),n?.()},e[11]=u,e[12]=n,e[13]=i.id,e[14]=b):b=e[14];let y;return e[15]!==l||e[16]!==i.title||e[17]!==b||e[18]!==p||e[19]!==x||e[20]!==g||e[21]!==h||e[22]!==v?(y=s.jsx(_e,{icon:p,label:f,contextId:x,trailing:g,className:h,ariaLabel:v,onSelect:b,children:l}),e[15]=l,e[16]=i.title,e[17]=b,e[18]=p,e[19]=x,e[20]=g,e[21]=h,e[22]=v,e[23]=y):y=e[23],y}function kt(t){const e=N.c(26),{label:i,contextId:n,folderId:o,projects:r,onNavigate:l,actions:a,waitingByProject:c}=t,{locator:u}=Y();let m;e[0]!==o||e[1]!==u?(m=Os.sidebarSectionOpen(u,o??"loose"),e[0]=o,e[1]=u,e[2]=m):m=e[2];const[d,p]=As(m,!0),f=d?ts:Tt;let x;e[3]!==p?(x=()=>p(Wo),e[3]=p,e[4]=x):x=e[4];let g;e[5]!==i?(g=s.jsx("span",{className:"truncate font-medium text-xs text-muted-foreground transition-colors group-hover/folder:text-sidebar-foreground",children:i}),e[5]=i,e[6]=g):g=e[6];let j;e[7]!==f?(j=s.jsx(f,{size:12,className:"shrink-0 text-muted-foreground"}),e[7]=f,e[8]=j):j=e[8];let h;e[9]!==d||e[10]!==x||e[11]!==g||e[12]!==j?(h=s.jsxs("button",{type:"button","aria-expanded":d,onClick:x,className:"group/folder flex min-w-0 items-center gap-1 rounded-md text-left",children:[g,j]}),e[9]=d,e[10]=x,e[11]=g,e[12]=j,e[13]=h):h=e[13];let v;e[14]!==a||e[15]!==h?(v=s.jsxs("div",{className:"flex h-6 items-center justify-between gap-2 px-2",children:[h,a]}),e[14]=a,e[15]=h,e[16]=v):v=e[16];let b;e[17]!==l||e[18]!==d||e[19]!==r||e[20]!==c?(b=d&&r.length>0&&s.jsx(se,{className:"gap-1",children:r.map(S=>s.jsx(us,{project:S,onNavigate:l,waiting:c.get(S.id)},S.id))}),e[17]=l,e[18]=d,e[19]=r,e[20]=c,e[21]=b):b=e[21];let y;return e[22]!==n||e[23]!==v||e[24]!==b?(y=s.jsxs("div",{className:"flex flex-col gap-1","data-context-id":n,children:[v,b]}),e[22]=n,e[23]=v,e[24]=b,e[25]=y):y=e[25],y}function Wo(t){return!t}function Qo(t){const e=N.c(141),{onNavigate:i}=t,n=O(),o=dt(),{granted:r}=Fs("agents:manage"),{projects:l}=Le(),a=Xt(),c=yo(),u=Vo(l),m=_o(),d=$o();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"none"},e[0]=p):p=e[0];const[f,x]=ee.useState(p),[g,j]=ee.useState(null),[h,v]=ee.useState(!1);if(a||l.length===0&&!r)return null;let b,y,S,k,w,C,_,$,I,F,U,B,J,G,K,te,W,V,X,q;if(e[1]!==r||e[2]!==o||e[3]!==i||e[4]!==l||e[5]!==c.folders||e[6]!==c.preferences||e[7]!==n||e[8]!==f.id||e[9]!==f.kind||e[10]!==d||e[11]!==m||e[12]!==u){const M=To({projects:l,folders:c.folders,preferences:c.preferences});w=M.hidden.length+M.hiddenFolders.reduce(Jo,0);let oe;e[33]!==m?(oe=(T,A)=>{fe(A?"sidebar_project_pinned":"sidebar_project_unpinned"),m.mutate(le=>St(le,T,A?"pinned":null))},e[33]=m,e[34]=oe):oe=e[34],F=oe;let he;e[35]!==m?(he=(T,A)=>{fe(A?"sidebar_project_hidden":"sidebar_project_shown"),m.mutate(le=>St(le,T,A?"hidden":null))},e[35]=m,e[36]=he):he=e[36],_=he;let de;e[37]!==m?(de=(T,A)=>m.mutate(le=>zo(le,T,A)),e[37]=m,e[38]=de):de=e[38],$=de;let me;e[39]!==d?(me=(T,A)=>d.mutate(le=>yt(le,T,A)),e[39]=d,e[40]=me):me=e[40],I=me;let be;e[41]!==d?(be=(T,A)=>{if(T.kind==="rename"){d.mutate(Be=>Ao(Be,T.folderId,A));return}const le=crypto.randomUUID();fe("sidebar_folder_created"),d.mutate(Be=>{const xt=Fo(Be,le,A);return T.projectId?yt(xt,T.projectId,le):xt})},e[41]=d,e[42]=be):be=e[42],B=be;let ye;e[43]!==c.preferences.pinned?(ye=new Set(c.preferences.pinned),e[43]=c.preferences.pinned,e[44]=ye):ye=e[44],U=ye;let ge;e[45]!==c.preferences.hidden?(ge=new Set(c.preferences.hidden),e[45]=c.preferences.hidden,e[46]=ge):ge=e[46],C=ge;let je;e[47]!==c.folders||e[48]!==f.id||e[49]!==f.kind?(je=f.kind==="project"?c.folders.find(T=>T.projectIds.includes(f.id))?.id:void 0,e[47]=c.folders,e[48]=f.id,e[49]=f.kind,e[50]=je):je=e[50],k=je;let ve;e[51]!==c.folders||e[52]!==f.id||e[53]!==f.kind?(ve=f.kind==="folder"?c.folders.find(T=>T.id===f.id):void 0,e[51]=c.folders,e[52]=f.id,e[53]=f.kind,e[54]=ve):ve=e[54],q=ve;let we;e[55]===Symbol.for("react.memo_cache_sentinel")?(we=()=>v(!0),e[55]=we):we=e[55];let Pe;e[56]!==n?(Pe=n("sidebar.projects.customize"),e[56]=n,e[57]=Pe):Pe=e[57];let Fe;e[58]!==Pe?(Fe=s.jsx(ue,{onSelect:we,children:Pe}),e[58]=Pe,e[59]=Fe):Fe=e[59],S=Fe;let Ae;e[60]!==r||e[61]!==$||e[62]!==I||e[63]!==n||e[64]!==d?(Ae=T=>s.jsxs("span",{className:"-mr-1 flex shrink-0 items-center gap-0.5",children:[s.jsxs(rt,{children:[s.jsx(lt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":n(T?"sidebar.customize.folderOptions":"sidebar.projects.more"),title:n(T?"sidebar.customize.folderOptions":"sidebar.projects.more"),className:"flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:s.jsx(at,{size:14})})}),s.jsxs(ct,{align:"start",children:[T&&s.jsx(pe,{onSelect:()=>$(T.id,!0),children:n("sidebar.projects.hideFolder")}),T&&r&&s.jsxs(s.Fragment,{children:[s.jsx(pe,{onSelect:()=>j({kind:"rename",folderId:T.id,name:T.name}),children:n("sidebar.projects.renameFolder")}),s.jsx(pe,{variant:"destructive",onSelect:()=>d.mutate(A=>He(A,T.id)),children:n("sidebar.projects.deleteFolder")})]}),T&&s.jsx(Es,{}),r&&s.jsx(pe,{onSelect:()=>j({kind:"create"}),children:n("sidebar.projects.newFolder")}),s.jsx(pe,{onSelect:()=>v(!0),children:n("sidebar.projects.customize")})]})]}),r&&s.jsx("button",{type:"button","aria-label":n("projects.home.newProject"),title:n("projects.home.newProject"),onClick:()=>ss("sidebar",T?{onCreated:A=>I(A,T.id)}:void 0),className:"flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:s.jsx(Qe,{size:14})})]}),e[60]=r,e[61]=$,e[62]=I,e[63]=n,e[64]=d,e[65]=Ae):Ae=e[65];const ft=Ae;let Oe;e[66]!==i||e[67]!==u?(Oe=T=>T.map(A=>s.jsx(us,{project:A,onNavigate:i,waiting:u.get(A.id)},A.id)),e[66]=i,e[67]=u,e[68]=Oe):Oe=e[68];const pt=Oe;y=ci,b=di,X=!0,J="flex flex-col gap-4",G=ke.projects,e[69]===Symbol.for("react.memo_cache_sentinel")?(K=T=>x(Ko(T)),e[69]=K):K=e[69],te=M.pinned.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[!o&&s.jsx(Ho,{label:n("sidebar.projects.pinned")}),s.jsx(se,{className:"gap-1",children:pt(M.pinned)})]}),W=o?s.jsxs(se,{className:"gap-1",children:[pt([...M.folders.flatMap(Yo),...M.loose]),r&&s.jsx(_e,{icon:s.jsx(Qe,{size:16}),label:n("projects.home.newProject"),onSelect:Go})]}):s.jsx(kt,{label:n("sidebar.projects.heading"),projects:M.loose,onNavigate:i,waitingByProject:u,actions:ft(null)}),V=!o&&M.folders.map(T=>{const{folder:A,projects:le}=T;return s.jsx(kt,{label:A.name,contextId:`folder:${A.id}`,folderId:A.id,projects:le,onNavigate:i,waitingByProject:u,actions:ft(A)},A.id)}),e[1]=r,e[2]=o,e[3]=i,e[4]=l,e[5]=c.folders,e[6]=c.preferences,e[7]=n,e[8]=f.id,e[9]=f.kind,e[10]=d,e[11]=m,e[12]=u,e[13]=b,e[14]=y,e[15]=S,e[16]=k,e[17]=w,e[18]=C,e[19]=_,e[20]=$,e[21]=I,e[22]=F,e[23]=U,e[24]=B,e[25]=J,e[26]=G,e[27]=K,e[28]=te,e[29]=W,e[30]=V,e[31]=X,e[32]=q}else b=e[13],y=e[14],S=e[15],k=e[16],w=e[17],C=e[18],_=e[19],$=e[20],I=e[21],F=e[22],U=e[23],B=e[24],J=e[25],G=e[26],K=e[27],te=e[28],W=e[29],V=e[30],X=e[31],q=e[32];let Q;e[70]!==o||e[71]!==w||e[72]!==n?(Q=w>0&&!o&&s.jsx(se,{children:s.jsx(_e,{icon:s.jsx($n,{size:16}),label:n("sidebar.projects.hiddenCount",{count:w}),className:"text-muted-foreground",onSelect:()=>v(!0)})}),e[70]=o,e[71]=w,e[72]=n,e[73]=Q):Q=e[73];let Z;e[74]!==J||e[75]!==G||e[76]!==K||e[77]!==te||e[78]!==W||e[79]!==V||e[80]!==Q?(Z=s.jsxs("div",{className:J,"data-tour":G,onContextMenu:K,children:[te,W,V,Q]}),e[74]=J,e[75]=G,e[76]=K,e[77]=te,e[78]=W,e[79]=V,e[80]=Q,e[81]=Z):Z=e[81];let z;e[82]!==b||e[83]!==Z||e[84]!==X?(z=s.jsx(b,{asChild:X,children:Z}),e[82]=b,e[83]=Z,e[84]=X,e[85]=z):z=e[85];let R;e[86]!==r||e[87]!==S||e[88]!==k||e[89]!==C||e[90]!==_||e[91]!==I||e[92]!==F||e[93]!==U||e[94]!==c.folders||e[95]!==n||e[96]!==f.id||e[97]!==f.kind?(R=f.kind==="project"&&s.jsxs(s.Fragment,{children:[s.jsx(ue,{onSelect:()=>F(f.id,!U.has(f.id)),children:n(U.has(f.id)?"sidebar.projects.unpin":"sidebar.projects.pin")}),s.jsx(ue,{onSelect:()=>_(f.id,!C.has(f.id)),children:n(C.has(f.id)?"sidebar.projects.show":"sidebar.projects.hide")}),r&&s.jsxs(ri,{children:[s.jsx(li,{children:n("sidebar.projects.moveTo")}),s.jsxs(ai,{className:"w-48",children:[c.folders.map(M=>s.jsx(ue,{disabled:M.id===k,onSelect:()=>I(f.id,M.id),children:M.name},M.id)),k&&s.jsx(ue,{onSelect:()=>I(f.id,null),children:n("sidebar.projects.noFolder")}),c.folders.length>0&&s.jsx(Ve,{}),s.jsx(ue,{onSelect:()=>j({kind:"create",projectId:f.id}),children:n("sidebar.projects.newFolder")})]})]}),s.jsx(Ve,{}),S]}),e[86]=r,e[87]=S,e[88]=k,e[89]=C,e[90]=_,e[91]=I,e[92]=F,e[93]=U,e[94]=c.folders,e[95]=n,e[96]=f.id,e[97]=f.kind,e[98]=R):R=e[98];let P;e[99]!==r||e[100]!==S||e[101]!==$||e[102]!==n||e[103]!==f.kind||e[104]!==q||e[105]!==d?(P=f.kind==="folder"&&q&&s.jsxs(s.Fragment,{children:[s.jsx(ue,{onSelect:()=>$(q.id,!0),children:n("sidebar.projects.hideFolder")}),r&&s.jsxs(s.Fragment,{children:[s.jsx(ue,{onSelect:()=>j({kind:"rename",folderId:q.id,name:q.name}),children:n("sidebar.projects.renameFolder")}),s.jsx(ue,{variant:"destructive",onSelect:()=>d.mutate(M=>He(M,q.id)),children:n("sidebar.projects.deleteFolder")})]}),s.jsx(Ve,{}),r&&s.jsx(ue,{onSelect:()=>j({kind:"create"}),children:n("sidebar.projects.newFolder")}),S]}),e[99]=r,e[100]=S,e[101]=$,e[102]=n,e[103]=f.kind,e[104]=q,e[105]=d,e[106]=P):P=e[106];let E;e[107]!==r||e[108]!==S||e[109]!==n||e[110]!==f.kind?(E=f.kind==="none"&&s.jsxs(s.Fragment,{children:[r&&s.jsx(ue,{onSelect:()=>j({kind:"create"}),children:n("sidebar.projects.newFolder")}),S]}),e[107]=r,e[108]=S,e[109]=n,e[110]=f.kind,e[111]=E):E=e[111];let D;e[112]!==R||e[113]!==P||e[114]!==E?(D=s.jsxs(mi,{className:"w-52",children:[R,P,E]}),e[112]=R,e[113]=P,e[114]=E,e[115]=D):D=e[115];let H;e[116]!==y||e[117]!==z||e[118]!==D?(H=s.jsxs(y,{children:[z,D]}),e[116]=y,e[117]=z,e[118]=D,e[119]=H):H=e[119];let Se;e[120]===Symbol.for("react.memo_cache_sentinel")?(Se=()=>j(null),e[120]=Se):Se=e[120];let ce;e[121]!==g||e[122]!==B?(ce=s.jsx(Bo,{request:g,onClose:Se,onSave:B}),e[121]=g,e[122]=B,e[123]=ce):ce=e[123];let ne;e[124]!==d?(ne=M=>d.mutate(oe=>He(oe,M)),e[124]=d,e[125]=ne):ne=e[125];let ie;e[126]!==r||e[127]!==h||e[128]!==_||e[129]!==$||e[130]!==I||e[131]!==F||e[132]!==l||e[133]!==c.folders||e[134]!==c.preferences||e[135]!==ne?(ie=s.jsx(Oo,{open:h,onOpenChange:v,projects:l,folders:c.folders,preferences:c.preferences,canManage:r,onPin:F,onHide:_,onHideFolder:$,onMove:I,onRequestFolderName:j,onDeleteFolder:ne}),e[126]=r,e[127]=h,e[128]=_,e[129]=$,e[130]=I,e[131]=F,e[132]=l,e[133]=c.folders,e[134]=c.preferences,e[135]=ne,e[136]=ie):ie=e[136];let xe;return e[137]!==H||e[138]!==ce||e[139]!==ie?(xe=s.jsxs(s.Fragment,{children:[H,ce,ie]}),e[137]=H,e[138]=ce,e[139]=ie,e[140]=xe):xe=e[140],xe}function Go(){return ss("sidebar")}function Yo(t){return t.projects}function Jo(t,e){return t+e.projects.length}function Xo(){const t=N.c(8),e=O(),{capabilities:i,isPrivileged:n,loading:o,error:r}=Ds(),l=_i().length,a=Ms();let c;return t[0]!==i||t[1]!==r||t[2]!==n||t[3]!==l||t[4]!==o||t[5]!==e||t[6]!==a?(c=[{key:"account",label:"",items:[{key:"profile",label:e("settings.nav.profile"),icon:s.jsx(Rs,{size:14}),to:"/$org/settings/profile"}]},{key:"organization",label:e("settings.nav.organization"),items:[{key:"general",label:e("settings.nav.general"),icon:s.jsx(Si,{size:14}),to:"/$org/settings/general"},{key:"billing",label:e("settings.nav.billing"),icon:s.jsx(yi,{size:14}),to:"/$org/settings/ai-providers",group:"billing"},{key:"connect",label:e("settings.nav.connect"),icon:s.jsx(_t,{size:14}),to:"/$org/settings/connect",group:"connect"},{key:"tasks",label:e("settings.nav.tasks"),icon:s.jsx(Ut,{size:14}),to:"/$org/settings/task-board",requires:"org:manage"}]},{key:"build",label:e("settings.nav.build"),items:[{key:"projects",label:e("projects.settings.title"),icon:s.jsx(Bt,{size:14}),to:"/$org/settings/projects"},{key:"automations",label:e("settings.nav.automations"),icon:s.jsx(Ni,{size:14}),to:"/$org/settings/automations",requires:"automations:manage"}]},{key:"manage",label:e("settings.nav.manage"),items:[{key:"monitor",label:e("settings.nav.monitor"),icon:s.jsx(Nn,{size:14}),to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:e("settings.nav.members"),icon:s.jsx(wt,{size:14}),to:"/$org/settings/members",group:"members",badge:l}]},{key:"advanced",label:e("settings.nav.advanced"),collapsible:!0,items:[{key:"secrets",label:e("settings.nav.secrets"),icon:s.jsx(ki,{size:14}),to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"storage",label:e("settings.nav.storage"),icon:s.jsx(Ls,{size:14}),to:"/$org/settings/buckets",group:"storage"},{key:"sso",label:e("settings.nav.security"),icon:s.jsx(Xe,{size:14}),to:"/$org/settings/sso",requires:"org:manage"}]}].map(m=>({...m,items:m.items.flatMap(d=>{if(d.group){const[p]=a[d.group];return p?[{...d,to:p.to}]:Us(d.group)?[]:[d]}return o||r?[d]:d.privilegedOnly?n?[d]:[]:d.requires?n||i[d.requires]?[d]:[]:[d]})})).filter(Zo),t[0]=i,t[1]=r,t[2]=n,t[3]=l,t[4]=o,t[5]=e,t[6]=a,t[7]=c):c=t[7],c}function Zo(t){return t.items.length>0}function fs(){const t=N.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org"},t[0]=e):e=t[0];const{org:i}=Bs(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={select:er},t[1]=n):n=t[1];const o=qs(n);let r;if(t[2]!==i||t[3]!==o){const c=u=>{const m=u.replace("$org",i);return o===m||o.startsWith(`${m}/`)};r=u=>[u.to,...u.group?Ks(u.group):[]].some(c),t[2]=i,t[3]=o,t[4]=r}else r=t[4];const l=r;let a;return t[5]!==l||t[6]!==i?(a={org:i,isActive:l},t[5]=l,t[6]=i,t[7]=a):a=t[7],a}function er(t){return t.location.pathname}function tr(){const t=N.c(9),{isActive:e}=fs();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={},t[0]=i):i=t[0];const[n,o]=ee.useState(i);let r;t[1]!==e||t[2]!==n?(r=m=>n[m.key]??(!m.collapsible||m.items.some(e)),t[1]=e,t[2]=n,t[3]=r):r=t[3];const l=r;let a;t[4]!==l?(a=m=>o(d=>({...d,[m.key]:!l(m)})),t[4]=l,t[5]=a):a=t[5];const c=a;let u;return t[6]!==l||t[7]!==c?(u={isOpen:l,toggle:c},t[6]=l,t[7]=c,t[8]=u):u=t[8],u}function sr(t){const e=N.c(21),{group:i,open:n,onToggle:o,className:r}=t;let l,a,c,u,m;if(e[0]!==r||e[1]!==i.collapsible||e[2]!==i.label||e[3]!==o||e[4]!==n){m=Symbol.for("react.early_return_sentinel");e:{const x=L("text-xs font-medium text-muted-foreground/60 truncate",r);if(!i.collapsible){m=s.jsx("p",{className:x,children:i.label});break e}l="button",a=o,c=n,u=L("flex w-full items-center gap-1 rounded-lg hover:text-muted-foreground",x)}e[0]=r,e[1]=i.collapsible,e[2]=i.label,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=c,e[8]=u,e[9]=m}else l=e[5],a=e[6],c=e[7],u=e[8],m=e[9];if(m!==Symbol.for("react.early_return_sentinel"))return m;let d;e[10]!==n?(d=n?s.jsx(ts,{size:12}):s.jsx(Tt,{size:12}),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==i.label?(p=s.jsx("span",{className:"truncate",children:i.label}),e[12]=i.label,e[13]=p):p=e[13];let f;return e[14]!==l||e[15]!==a||e[16]!==c||e[17]!==u||e[18]!==d||e[19]!==p?(f=s.jsxs("button",{type:l,onClick:a,"aria-expanded":c,className:u,children:[d,p]}),e[14]=l,e[15]=a,e[16]=c,e[17]=u,e[18]=d,e[19]=p,e[20]=f):f=e[20],f}function nr(t){const e=N.c(5),{icon:i,badge:n}=t;let o;e[0]!==n?(o=n?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,e[0]=n,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=s.jsxs("span",{className:"relative shrink-0",children:[i,o]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function ps(t){const e=N.c(24),{onNavigate:i}=t,n=dt(),o=O(),r=Xo(),{org:l,isActive:a}=fs(),{isOpen:c,toggle:u}=tr();let m;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==c||e[4]!==i||e[5]!==l||e[6]!==u){let j;e[8]!==n||e[9]!==a||e[10]!==c||e[11]!==i||e[12]!==l||e[13]!==u?(j=(h,v)=>s.jsxs("div",{className:"flex flex-col",children:[h.label&&!n&&s.jsx(sr,{group:h,open:c(h),onToggle:()=>u(h),className:L("px-2 pt-1.5 pb-0.5",v>0&&"mt-3")}),(n||c(h))&&s.jsx(se,{className:"gap-0.5",children:h.items.map(b=>s.jsx(_e,{icon:s.jsx(nr,{icon:b.icon,badge:b.badge}),label:b.label,isActive:a(b),link:{to:b.to,params:{org:l}},className:"gap-2.5",onSelect:()=>{fe("settings_nav_clicked",{section_key:b.key,group_key:h.key}),i?.()}},b.key))})]},h.key),e[8]=n,e[9]=a,e[10]=c,e[11]=i,e[12]=l,e[13]=u,e[14]=j):j=e[14],m=r.map(j),e[0]=n,e[1]=r,e[2]=a,e[3]=c,e[4]=i,e[5]=l,e[6]=u,e[7]=m}else m=e[7];let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50 hidden"}),e[15]=d):d=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("span",{className:"shrink-0",children:s.jsx(We,{size:14})}),e[16]=p):p=e[16];let f;e[17]!==o?(f=o("settings.nav.signOut"),e[17]=o,e[18]=f):f=e[18];let x;e[19]!==f?(x=s.jsxs("div",{className:"mt-auto flex flex-col pt-4",children:[d,s.jsx(se,{className:"gap-0.5",children:s.jsx(_e,{icon:p,label:f,className:"gap-2.5",onSelect:ir})})]}),e[19]=f,e[20]=x):x=e[20];let g;return e[21]!==m||e[22]!==x?(g=s.jsxs(s.Fragment,{children:[m,x]}),e[21]=m,e[22]=x,e[23]=g):g=e[23],g}function ir(){fe("signed_out",{source:"settings_sidebar"}),Ct(),ze.signOut()}function xs(t){const e=N.c(8),{onNavigate:i}=t,n=O(),{org:o}=Y();let r;e[0]!==n?(r=n("settings.nav.backToHome"),e[0]=n,e[1]=r):r=e[1];let l;e[2]!==o.slug?(l={to:"/$org/home",params:{org:o.slug}},e[2]=o.slug,e[3]=l):l=e[3];let a;return e[4]!==i||e[5]!==r||e[6]!==l?(a=s.jsx(Yi,{label:r,link:l,onSelect:i}),e[4]=i,e[5]=r,e[6]=l,e[7]=a):a=e[7],a}function hs(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"px-4 pb-1 group-data-[state=collapsed]/sidebar:hidden",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.562.2"]})}),t[0]=e):e=t[0],e}const or="pt-1.5";function bs(t){const e=N.c(18),{header:i,back:n,body:o,footer:r,sheet:l}=t;let a;e[0]!==i?(a=i&&s.jsx("div",{"data-slot":"sidebar-picker-header",className:"flex h-12 shrink-0 flex-row items-center gap-1 px-2 group-data-[state=collapsed]/sidebar:h-auto group-data-[state=collapsed]/sidebar:flex-col group-data-[state=collapsed]/sidebar:gap-2 group-data-[state=collapsed]/sidebar:py-2",children:i}),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i&&s.jsx("div",{className:"hidden mt-1.5 h-px shrink-0 bg-sidebar-border"}),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==n?(u=n&&s.jsx("div",{className:"sticky top-0 z-10 hidden shrink-0 bg-sidebar pb-2 not-empty:block",children:n}),e[4]=n,e[5]=u):u=e[5];let m;e[6]!==o||e[7]!==u?(m=s.jsxs(Ys,{className:"gap-0 overflow-y-auto px-2 pt-3 pb-2 group-data-[state=collapsed]/sidebar:[scrollbar-width:none] group-data-[state=collapsed]/sidebar:[&::-webkit-scrollbar]:hidden",children:[u,o]}),e[6]=o,e[7]=u,e[8]=m):m=e[8];let d;e[9]!==r||e[10]!==a||e[11]!==c||e[12]!==m?(d=s.jsxs(s.Fragment,{children:[a,c,m,r]}),e[9]=r,e[10]=a,e[11]=c,e[12]=m,e[13]=d):d=e[13];const p=d;if(l){let x;return e[14]!==p?(x=s.jsx("div",{className:"group/sidebar flex h-full w-full flex-col bg-sidebar text-sidebar-foreground","data-sidebar":"sidebar","data-state":"expanded","data-tour":ke.nav,children:p}),e[14]=p,e[15]=x):x=e[15],x}let f;return e[16]!==p?(f=s.jsx(Js,{className:or,"data-tour":ke.nav,children:p}),e[16]=p,e[17]=f):f=e[17],f}function gs(t){const e=N.c(2),{onNavigate:i}=t;let n;return e[0]!==i?(n=s.jsx(Vs,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(eo,{onNavigate:i}),s.jsx(bo,{onNavigate:i}),s.jsx(Qo,{onNavigate:i})]})}),e[0]=i,e[1]=n):n=e[1],n}function rr(){const t=N.c(10),e=Ot();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(po,{}),t[0]=i):i=t[0];let n;t[1]!==e?(n=e&&s.jsx(xs,{}),t[1]=e,t[2]=n):n=t[2];let o,r;t[3]!==e?(o=e?s.jsx(ps,{}):s.jsx(gs,{}),r=e?s.jsx(hs,{}):s.jsx(co,{}),t[3]=e,t[4]=o,t[5]=r):(o=t[4],r=t[5]);let l;return t[6]!==n||t[7]!==o||t[8]!==r?(l=s.jsx(bs,{header:i,back:n,body:o,footer:r}),t[6]=n,t[7]=o,t[8]=r,t[9]=l):l=t[9],l}function lr(t){const e=N.c(15),{onClose:i}=t,n=Ot();let o;e[0]!==i?(o=s.jsx(xo,{onClose:i}),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==n||e[3]!==i?(r=n&&s.jsx(xs,{onNavigate:i}),e[2]=n,e[3]=i,e[4]=r):r=e[4];let l;e[5]!==n||e[6]!==i?(l=n?s.jsx(ps,{onNavigate:i}):s.jsx(gs,{onNavigate:i}),e[5]=n,e[6]=i,e[7]=l):l=e[7];let a;e[8]!==n?(a=n?s.jsx(hs,{}):s.jsx(mo,{}),e[8]=n,e[9]=a):a=e[9];let c;return e[10]!==o||e[11]!==r||e[12]!==l||e[13]!==a?(c=s.jsx(bs,{sheet:!0,header:o,back:r,body:l,footer:a}),e[10]=o,e[11]=r,e[12]=l,e[13]=a,e[14]=c):c=e[14],c}const ar=new Set(["completed","failed","requires_action"]);function cr(t){const e=N.c(5),[i]=Nt();let n;e[0]!==i?(n=r=>{i.enableSounds&&ar.has(r.data.status)&&wi(Ci.dataUri).catch(dr)},e[0]=i,e[1]=n):n=e[1];let o;e[2]!==t||e[3]!==n?(o={orgSlug:t,onTaskStatus:n},e[2]=t,e[3]=n,e[4]=o):o=e[4],$i(o)}function dr(t){console.warn("[status-sounds] playback failed:",t)}const mr=2e3,ur=4e4;function fr(t){return t==="success"||t==="updated"}function pr(t){const e=N.c(15);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const n=Hs(i),o=nt();let r;e[1]!==n.checkout?(r=fr(n.checkout),e[1]=n.checkout,e[2]=r):r=e[2];const l=r,[a]=ee.useState(xr);let c;e[3]!==t?(c=Me.checkoutReturnPoll(t),e[3]=t,e[4]=c):c=e[4];let u;e[5]!==a?(u=()=>Date.now()<a?mr:!1,e[5]=a,e[6]=u):u=e[6];let m;e[7]!==t||e[8]!==o?(m=async()=>(await o.invalidateQueries({queryKey:Me.aiPlanEntitlements(t)}),Date.now()),e[7]=t,e[8]=o,e[9]=m):m=e[9];let d;e[10]!==l||e[11]!==c||e[12]!==u||e[13]!==m?(d={queryKey:c,enabled:l,gcTime:0,staleTime:0,refetchInterval:u,queryFn:m},e[10]=l,e[11]=c,e[12]=u,e[13]=m,e[14]=d):d=e[14],it(d)}function xr(){return Date.now()+ur}function xa(){const t=N.c(3),{org:e}=Y();cr(e.slug),pr(e.id);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ii,{}),t[0]=i):i=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(qe.Sidebar,{renderMobile:hr,children:s.jsx(rr,{})}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(qe,{notice:i,children:[n,s.jsx(qe.Content,{children:s.jsx(Ws,{})})]}),t[2]=o):o=t[2],o}function hr(t){const{onClose:e}=t;return s.jsx(lr,{onClose:e})}export{xa as default};
@@ -1 +0,0 @@
1
- import{q as b,r as i,eA as ce,bo as le,c as X,e as de,d9 as q,a3 as fe,j as I,a5 as Se,T as me}from"./index-DWvRfTwV.js";import{i as pe,c as ye,u as Ee}from"./chat-context-yHOaM07v.js";import{u as he}from"./use-mcp-client-Z8a6jg-w.js";import{a as xe}from"./input-Lv9puCyJ.js";import{u as Re}from"./thread-intent-BONVdhUb.js";import{u as we}from"./index-BtlZo3IV.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function Te(e,t){const n=b(t);return be({filters:{...e,status:"pending"}},n).length}function j(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function be(e={},t){const n=b(t).getMutationCache(),r=i.useRef(e),s=i.useRef(null);return s.current===null&&(s.current=j(n,e)),i.useEffect(()=>{r.current=e}),i.useSyncExternalStore(i.useCallback(o=>n.subscribe(()=>{const u=ce(s.current,j(n,r.current));s.current!==u&&(s.current=u,le.schedule(o))}),[n]),()=>s.current,()=>s.current)}async function Pe(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const s=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(s)}return r}const Y=["SANDBOX_START"],w=new Map,Ce=e=>`${e.virtualMcpId}::${e.branch??""}`,ke=e=>e.message.includes("retry shortly"),L=new Set,g={mark:(e,t)=>L.add(`${e}::${t}`),clear:(e,t)=>L.delete(`${e}::${t}`),isStopped:(e,t)=>L.has(`${e}::${t}`)};function _e(e,t){const n=b();return de({mutationKey:Y,retry:(r,s)=>ke(s)&&r<6,retryDelay:r=>fe(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&g.clear(r.virtualMcpId,r.branch);const s=Ce(r),o=w.get(s);if(o)return o;const u=(async()=>(await Pe(e,"SANDBOX_START",r)).structuredContent)();w.set(s,u);try{return await u}finally{w.get(s)===u&&w.delete(s)}},onSuccess:()=>{q(n),t?.onStarted?.()}})}function ze(e,t){const n=X.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:Y,predicate:o=>{if(!e)return!1;const u=o.state.variables;return!u||u.virtualMcpId!==e?!1:(u.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Te(r)>0}function Ue(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function Le(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function Ge(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function ge(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Ze(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:s}=e,o=e.ownerId??r;if(!r||!o||!s)return t;const u=n?.[o]?.[s];return u?{...t??{},[r]:{...t?.[r]??{},[s]:u}}:t}function A(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const Q=2,De=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function J(e){return De.has(e)}function $e(e){return e.executionEnabled&&e.failedReason!==null&&J(e.failedReason)&&e.attempts<Q&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const Oe={branch:null,count:0,handled:!1};function Ve(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Be(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function Fe(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function M(e,t){return`${e??""}::${t??""}`}function ve(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function T(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:M(n,t.branch??r),url:t.previewUrl})}const Ke={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},W=i.createContext(Ke);function et(){return i.use(W)}const z=pe(W);function tt(e){const t=X.c(10);let n,r,s;t[0]!==e?({resetKey:s,children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s):(n=t[1],r=t[2],s=t[3]);let o;t[4]!==r||t[5]!==s?(o=I.jsx(Ne,{...r},s),t[4]=r,t[5]=s,t[6]=o):o=t[6];let u;return t[7]!==n||t[8]!==o?(u=I.jsx(z.Host,{source:o,children:n}),t[7]=n,t[8]=o,t[9]=u):u=t[9],u}function Ne(e){return z.usePublish(He(e)),null}function He({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:o,threadId:u}){const{org:P}=Se(),{setCurrentTaskBranch:l}=ye(),G=Re(),p=we(),Z=b(),D=xe(t),ee=D.resolved?D.runtime:null,d=Ee()?.taskId??null,$=he({connectionId:me,orgId:P.id,orgSlug:P.slug}),c=_e($,{onStarted:()=>{u&&G?.refreshThreadMetadata(u)}}),{mutate:f,reset:te}=c,[ne,S]=i.useState(null),C=i.useRef(new Set),k=i.useRef(null),[O,x]=i.useState(Oe),E=Ve(O,n);E!==O&&x(E);const y=p.phase?.kind==="failed"?p.phase:null,V=ve({vmEntry:o,seeded:y?null:ne,key:M(t,n)}),h=!!t&&!!n&&g.isStopped(t,n),re=p.status.state==="paused",se=!y||!J(y.reason)||E.count>=Q,oe=Be({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:se}),B=Ue({previewUrl:V,appPaused:re,userStopped:h,startError:oe}),ae=Fe(B),_=n??"",ue=C.current.has(_),F=Le({executionEnabled:e,hasActiveRepository:s,userId:r,branch:n,vmEntry:o,userStopped:h,isPending:c.isPending,attempted:ue,sessionRuntime:ee});i.useEffect(()=>{if(!F||!t)return;C.current.add(_);const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] auto-start failed:",a)}})},[F,_,n,t,d,f,l,S]);const R=p.notFound?o?.sandboxHandle??null:null,v=ge({executionEnabled:e,notFound:p.notFound,deadVmId:R,lastDeadVmId:k.current,isPending:c.isPending,userStopped:h});i.useEffect(()=>{if(!v||!R||!t)return;k.current=R;const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] self-heal failed:",a)}})},[v,R,t,n,d,f,l,S]);const K=$e({executionEnabled:e,failedReason:y?.reason??null,attempts:E.count,isPending:c.isPending,userStopped:h,alreadyHandled:E.handled});i.useEffect(()=>{if(!y){x(a=>a.handled?{...a,handled:!1}:a);return}if(!K||!t)return;x(a=>({...a,handled:!0,count:a.count+1}));const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",a)}})},[y,K,t,n,d,f,l,S]);const U=()=>{if(!e||!t)return;const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] user start failed:",a)}})},N=async()=>{if(!(!e||!t||!n)&&o){g.mark(t,n);try{await $.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}q(Z)}},ie=async()=>{await N(),U()},H=()=>{C.current=new Set,k.current=null,x({branch:n,count:0,handled:!1}),te(),U()};return{branch:n,previewState:B,status:ae,vmEntry:o,previewUrl:V,userStopped:h,start:U,stop:N,restart:ie,retry:H,resume:H}}export{tt as S,et as a,_e as b,Ze as o,Ge as s,ze as u};
@@ -1 +0,0 @@
1
- import{h$ as Xo,bf as Zo,c as wn,b as Rn,r as b,m as de,j as r,bQ as ei,b8 as Ts,i0 as Pa,B as Ft,Y as an,au as ti,_ as ni,be as si,Z as ri,q as ai,hx as oi,i1 as ii,i2 as li,h as ci,bg as kt,i3 as Ur,i4 as vs,i5 as ui,i6 as dt,i7 as Jr,i8 as di,bt as mi,i9 as fi,ia as Qr,ib as pi,t as W,bZ as Yr,ic as hi,id as Pt,ie as gi,ig as vi,ih as yi,bY as Xr,ii as ys,ij as Si,ik as bi,il as xi,bW as _i,bu as ki,im as wi,io as Ri,bT as ji,K as Ei,ip as Zr,ff as Vi,bm as zn,br as ea,iq as ta,ir as Ti,is as Ai,it as Ni,iu as Ss,iv as Ci,iw as Pi,ix as Bi,iy as na,iz as Di,iA as Ki,bR as sa,iB as Mi,iC as Fi,iD as Ii,bV as Li}from"./index-DWvRfTwV.js";import{u as Oi}from"./chat-context-yHOaM07v.js";import{a5 as zi,O as Qn,a6 as $i,a7 as Wi,a8 as Hi,a9 as qi,aa as Gi,ab as Ui,ac as ra,ad as Ji,ae as Qi,A as qn,y as Gn,d as Yi,u as Xi,af as aa,i as Zi,ag as el,k as tl,h as nl,ah as Ba,p as kn,ai as sl,aj as rl,w as oa,ak as al,al as ol,am as $n,an as ia,ao as la,ap as ca,aq as bs,ar as il,F as ll,as as cl,z as ul,at as ua,au as dl,av as da,aw as ma,ax as fa,M as ml,ay as pa,a as fl,az as on,aA as pl,aB as hl,v as Wn,a4 as xn}from"./parse-sections-CK6AHU3E.js";import{b as gl}from"./repository-binding-CeErFm4l.js";import{n as vl,t as yl}from"./ChevronUp-CDe5Gfov.js";import{a6 as Da,b as Jn,al as Sl,e as bl,D as xl,a0 as ha,X as ga}from"./agent-icon-Nkid6y9z.js";import{S as ln}from"./scroll-area-CUevVS4T.js";import{c as wt,T as Rt,a as jt}from"./tooltip-BVv5wAeF.js";import{l as _l,u as kl,m as wl,S as Rl,ah as jl,R as El,E as va,aW as ya,ar as Bt,as as Dt,a3 as Vl,aX as Tl,aY as Al,aS as Sa,a6 as Nl,ad as Cl}from"./site-editor-toast-B-FxlfJP.js";import{ak as Jt,aa as ws,aN as Rs,al as Mt,ab as cn,u as Pl,aO as ba,e as xa,k as Bl,E as Dl,D as Hn,ao as Kl,ai as Ut,ac as xs,ah as Kt,ag as _n,U as Ml,am as _a,aj as Fl,aD as Il,aF as Ll,aP as Ol,aQ as zl,aR as $l}from"./blocks-tab-states-DP3rjaHt.js";import{m as Wl,u as Hl,P as ql}from"./mustache-DCgM4RQC.js";import{a as js,e as Ka}from"./UserSquare-DmeGszKa.js";import{i as ka,s as wa}from"./Tool01-CyX9Nllj.js";import{s as Gl}from"./Plus-BtfY7EHX.js";import{s as Ul}from"./Trash01-DSJ1LUhI.js";import{i as Es}from"./Zap--C2rij07.js";import{u as Jl,a as Ra,K as Ql,P as Yl,b as Xl,C as Zl,D as ec,c as tc}from"./core.esm-C3kzKmQL.js";import{u as nc,s as sc,a as Un,S as rc,v as ac}from"./sortable.esm-YReNzob1.js";import{s as oc,g as ic,u as lc,A as cc}from"./use-section-preview-base-C7kw5vsr.js";import{u as uc,a as dc,P as ja,w as mc,b as fc}from"./seo-editor-CaLY6KkG.js";import{Q as pc,y as _s,R as Ea,x as hc,T as gc}from"./hosted-reconcile-gHkwH1BF.js";import{u as vc}from"./use-apply-named-rule-BRjLBznN.js";import{b as Va,a as yc}from"./variant-matcher-override-BDeSqmx4.js";import"./autosend-DbfDzqlB.js";import"./thread-route-DMWye38f.js";import"./use-project-scope-B4B7p1mj.js";import"./thread-intent-BONVdhUb.js";import"./use-mcp-client-Z8a6jg-w.js";import"./auth-xvjttF9D.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-B6ObjuCT.js";import"./task-board-CzrPT-OZ.js";import"./schema-DvxWNZKz.js";import"./use-entitlements-BChYmsyZ.js";import"./use-ai-providers-CCcuLCZt.js";import"./use-decopilot-events-CZSx1Itd.js";import"./use-organization-settings-DqaBVcmT.js";import"./utils-B-ZZ1C4f.js";import"./Play-CV8_Sy8a.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BwCxrq_f.js";import"./LinkBroken01-4j6Z2AOF.js";import"./collapsible-WPiOb2df.js";import"./use-copy-CMfnyhoo.js";import"./usage-stats-qZh3WQDj.js";import"./tool-namespace-CmEhPnkj.js";import"./form-DE5X7SPR.js";import"./label-BkzEUDUr.js";import"./utils-CVEq3hMx.js";import"./markdown-DkmjrNqn.js";import"./use-mobile-B7UqukPG.js";import"./shell-layout-Bx4AZ_YV.js";import"./Globe04-Dr1jk8eS.js";import"./use-deployment-admin-DQ5wNSYp.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-avSrIpAi.js";import"./CheckCircle-y3P873c6.js";import"./Monitor01-DWylBoOJ.js";import"./command-CSFENWMV.js";import"./index-Czm9RrRY.js";import"./SearchMd-DD6kw-fs.js";import"./integration-icon-BCp7DD7C.js";import"./project-icon-DTA6ZXhl.js";import"./use-navigate-to-agent-9BOtBFjV.js";import"./new-project-dialog-Kvs8XyHN.js";import"./ArrowLeft-DRdw9Nza.js";import"./repository-picker-C3C3_E5g.js";import"./github-icon-Bvc_Uep-.js";import"./useInfiniteQuery-DAm-dYuC.js";import"./infiniteQueryObserver-O1nZgTsK.js";import"./collection-search-CPadQqKp.js";import"./ShoppingBag01-CY137tVP.js";import"./use-debounced-value-DiJ2aJN8.js";import"./required-auth-layout-nGThcCwM.js";import"./use-org-sso-nKgxHjqa.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CIky1nBi.js";import"./types-7R44AYrk.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-BPGyk76P.js";import"./sheet-BKUVqko3.js";import"./use-connection-BQpfU6u4.js";import"./use-mcp-prompts-KWx0e75o.js";import"./use-thread-outputs-DIlmUcwz.js";import"./file-type-icon-jLU7FJUL.js";import"./switch-UpbwlQtZ.js";import"./textarea-BVq0fBVJ.js";import"./ChevronSelectorVertical-TIONA5Zl.js";import"./popover-CpDRMXBS.js";import"./monaco-editor-Dff4ZjU3.js";import"./editor-CrG4V3zO.js";import"./calendar-CDcnOKeY.js";import"./SwitchHorizontal01-C3qdjyVX.js";import"./Minus-B2u_zm0f.js";import"./select-gJgQvQZg.js";import"./index-BdQq_4o_.js";import"./index-J6dVRDZu.js";import"./editor-classes-LBX4QjrW.js";import"./toggle-group-Bw4R79dp.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-AFeNX90_.js";import"./Upload01-DC0joCKG.js";import"./search-input-DWWqDlal.js";import"./tabs-BFXzZPNk.js";import"./use-file-configs-DRzFKzj4.js";import"./asset-utils-CwwYcMA6.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./input-Lv9puCyJ.js";import"./icon-button-1xC_JQLB.js";import"./chat-draft-BKLG-IxC.js";import"./ArrowUp-BJTv4ddc.js";import"./use-deco-credits-D1bpdE32.js";import"./index-KGPpyCdi.js";import"./checkbox-Dv6iFznu.js";import"./Key01-DzZgIVqE.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./drawer-1kqkgpFK.js";import"./input-Z4x7UYYS.js";import"./suggestion-D-YZpsQl.js";import"./use-org-fs-DU8c86TB.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-BVXAF3Vl.js";import"./plan-ladder-wSfhs4No.js";import"./add-connection-dialog-uIVnUFji.js";import"./extract-connection-data-C6MDLhDM.js";import"./metadata-D72DunRR.js";import"./connection-9Wtillpb.js";import"./url-slug-CoT8zovb.js";import"./connection-card-B7mEOoWU.js";import"./connection-slug-BCjSI_lE.js";import"./schema-DiUKA_SL.js";import"./connection-form-helpers-ZOfZ5xVa.js";import"./authenticate-and-persist-oauth-DdntocF2.js";import"./mcp-oauth-SAUpfbwO.js";import"./mcp-oauth-CNMWqwMp.js";import"./collection-tabs-B05-I-04.js";import"./badge-BLk85LCv.js";import"./use-infinite-scroll-C7IQ9e5j.js";import"./useSuspenseInfiniteQuery-BTqieOpO.js";import"./use-task-board-events-B8bEY6A0.js";import"./use-chat-layout-state-Dnl_7DMo.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./CreditCard01-abk_vBBR.js";import"./Sun-CyYLfv8E.js";import"./Users01-B-OacssU.js";import"./agent-capabilities-4Kae1N0E.js";import"./index-BtlZo3IV.js";import"./empty-state-CbRq3C3n.js";import"./slider-CnnTZZH8.js";import"./index-BJKjGJrF.js";import"./tooltipContext-DwFHeBjZ.js";import"./CategoricalChart-CVu6TY4_.js";import"./index-L3rSytXD.js";import"./use-move-blocks-DqXCo5PB.js";const Sc={escape:zi};function bc(v,e){for(const p of oc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function xc(v,e){if(!e)return;const p=Xo(v,Zo(e));if(p)try{const S=bc(p.resolveType,e);return S&&Wl.render(S,p.data,{},Sc).trim()||void 0}catch{return}}function _c(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let E;e[0]!==x?(E=de("size-3.5",x),e[0]=x,e[1]=E):E=e[1];let C;e[2]!==p||e[3]!==E?(C=r.jsx(p,{className:E}),e[2]=p,e[3]=E,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(Rt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(jt,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(wt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const kc="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 Ta(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Ma(v){return v.map((e,p)=>({...e,index:p}))}function wc(v,e){if(e===v.length)return v;if(e<v.length)return Ma(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Fa(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:E}=v,C=Rn(),_=Qn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let ee;e[0]!==x||e[1]!==S?(ee=S&&x?ic(S,x):void 0,e[0]=x,e[1]=S,e[2]=ee):ee=e[2];const be=ee;let qe;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(qe=S&&x&&!P&&!k?xc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=qe):qe=e[7];const Oe=qe;let De;e[8]!==E||e[9]!==x||e[10]!==S||e[11]!==p?(De=Ui(S,p,E,x),e[8]=E,e[9]=x,e[10]=S,e[11]=p,e[12]=De):De=e[12];const me=De;let l;e[13]!==k||e[14]!==S?.__resolveType?(l=!k&&Ts(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=l):l=e[15];const N=l,Ee=P?Jn:k?Da:Ka;let G;e[16]!==k||e[17]!==P?(G=P?{color:si}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const ie=G;let H;e[19]!==Ee||e[20]!==_?(H=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(Ee,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Qi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(Sl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Ee,e[20]=_,e[21]=H):H=e[21];let m;e[22]!==be?(m=be&&r.jsx("img",{src:be,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=be,e[23]=m):m=e[23];let Y;e[24]!==_||e[25]!==ie?(Y=!_&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:ie}),e[24]=_,e[25]=ie,e[26]=Y):Y=e[26];const u=_?"shrink":"flex-1",Ce=p.isHidden&&"line-through opacity-50";let $;e[27]!==Ce||e[28]!==u?($=de("min-w-0 truncate text-sm font-medium",u,Ce),e[27]=Ce,e[28]=u,e[29]=$):$=e[29];const mt=Oe??p.label;let Ge;e[30]!==$||e[31]!==mt?(Ge=r.jsx("span",{className:$,children:mt}),e[30]=$,e[31]=mt,e[32]=Ge):Ge=e[32];let Xe;e[33]!==N||e[34]!==_||e[35]!==me||e[36]!==C?(Xe=_?r.jsxs(r.Fragment,{children:[N&&r.jsx(_c,{icon:Es,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),me&&r.jsx(ra,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):me&&r.jsx(ra,{className:"absolute -right-0.5 -top-0.5"}),e[33]=N,e[34]=_,e[35]=me,e[36]=C,e[37]=Xe):Xe=e[37];let xe;return e[38]!==Ge||e[39]!==Xe||e[40]!==H||e[41]!==m||e[42]!==Y?(xe=r.jsxs(r.Fragment,{children:[H,m,Y,Ge,Xe]}),e[38]=Ge,e[39]=Xe,e[40]=H,e[41]=m,e[42]=Y,e[43]=xe):xe=e[43],xe}const Rc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",jc="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)]";function Ia(v,e,p){if(p)return Ji({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return de("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?Rc:x?jc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ks(v,e){return de("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Ec(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:E,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:ee,onMakeReusable:be,onToggleHidden:qe,onToggleLazy:Oe,onAddVariant:De,onDetach:me}=v,l=Rn(),N=Qn(),Ee=S?Ts(S.__resolveType??""):!1,G=p.isHidden===!0,ie=Ee||G;let H;e[0]!==p?(H=Pa(p),e[0]=p,e[1]=H):H=e[1];const m=H,Y=!!Oe&&!p.isMultivariate;let u;e[2]!==C?(u={id:C,animateLayoutChanges:Ac},e[2]=C,e[3]=u):u=e[3];const{attributes:Ce,listeners:$,setNodeRef:mt,transform:Ge,isDragging:Xe}=nc(u);let xe;e[4]!==Ge?(xe=Zl.Transform.toString(Ge?{...Ge,x:0}:null),e[4]=Ge,e[5]=xe):xe=e[5];const Ve=Xe?0:void 0;let h;e[6]!==xe||e[7]!==Ve?(h={transform:xe,opacity:Ve},e[6]=xe,e[7]=Ve,e[8]=h):h=e[8];const Te=h;let tt;e[9]!==p?(tt=Wi(p),e[9]=p,e[10]=tt):tt=e[10];const ft=tt,f="button",L=0;let Ze;e[11]!==P?(Ze=z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),P())},e[11]=P,e[12]=Ze):Ze=e[12];const T=Xe?"cursor-grabbing":"cursor-pointer";let et;e[13]!==N||e[14]!==p||e[15]!==_||e[16]!==T?(et=de("touch-none transition-colors",T,Ia(p,_,N)),e[13]=N,e[14]=p,e[15]=_,e[16]=T,e[17]=et):et=e[17];let B;e[18]!==E||e[19]!==x||e[20]!==S||e[21]!==p?(B=r.jsx(Fa,{section:p,raw:S,meta:x,decofile:E}),e[18]=E,e[19]=x,e[20]=S,e[21]=p,e[22]=B):B=e[22];const It=!N&&Y&&r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(Ft,{type:"button",variant:"ghost",size:"icon","aria-label":l(Ee?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:de(ks(ie,Ee)),onClick:z=>{z.stopPropagation(),Oe?.()},onPointerDown:Tc,children:r.jsx(Es,{className:de("h-3.5 w-3.5",Ee&&"text-warning")})})}),r.jsx(jt,{side:"bottom",children:l(Ee?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),he=N?r.jsx(Hi,{label:l(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:qe,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})}):r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(Ft,{type:"button",variant:"ghost",size:"icon","aria-label":l(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:de(ks(ie,G)),onClick:z=>{z.stopPropagation(),qe()},onPointerDown:Vc,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})})}),r.jsx(jt,{side:"bottom",children:l(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),nt=ni,Ue=qi;let _e;e[23]!==l?(_e=l("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=l,e[24]=_e):_e=e[24];const st=de(ks(ie,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ke;e[25]!==Ue||e[26]!==_e||e[27]!==st?(Ke=r.jsx(Ue,{label:_e,classicClassName:st}),e[25]=Ue,e[26]=_e,e[27]=st,e[28]=Ke):Ke=e[28];let Me;e[29]!==N||e[30]!==Y||e[31]!==Ee||e[32]!==Oe||e[33]!==l?(Me=N&&Y&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:z=>{z.stopPropagation(),Oe?.()},children:[r.jsx(Es,{className:"h-4 w-4"}),l(Ee?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ti,{})]}),e[29]=N,e[30]=Y,e[31]=Ee,e[32]=Oe,e[33]=l,e[34]=Me):Me=e[34];let X;e[35]!==ee?(X=z=>{z.stopPropagation(),ee()},e[35]=ee,e[36]=X):X=e[36];let re;e[37]===Symbol.for("react.memo_cache_sentinel")?(re=r.jsx(bl,{className:"h-4 w-4"}),e[37]=re):re=e[37];let te;e[38]!==l?(te=l("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=l,e[39]=te):te=e[39];let K;e[40]!==X||e[41]!==te?(K=r.jsxs(an,{onClick:X,children:[re,te]}),e[40]=X,e[41]=te,e[42]=K):K=e[42];let V;e[43]!==N||e[44]!==m||e[45]!==De||e[46]!==l?(V=m&&r.jsxs(an,{className:de(!N&&Gi),onClick:z=>{z.stopPropagation(),De()},children:[r.jsx(Da,{className:"h-4 w-4"}),l("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=N,e[44]=m,e[45]=De,e[46]=l,e[47]=V):V=e[47];let le;e[48]!==N||e[49]!==ft||e[50]!==be||e[51]!==l?(le=ft&&r.jsxs(an,{className:de(!N&&kc),onClick:z=>{z.stopPropagation(),be()},children:[N?r.jsx(Jn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),l("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=N,e[49]=ft,e[50]=be,e[51]=l,e[52]=le):le=e[52];let ze;e[53]!==N||e[54]!==me||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==l?(ze=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:z=>{z.stopPropagation(),me()},children:[N?r.jsx(Ka,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),l("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=N,e[54]=me,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=l,e[58]=ze):ze=e[58];let $e;e[59]!==k?($e=z=>{z.stopPropagation(),k()},e[59]=k,e[60]=$e):$e=e[60];let Je;e[61]===Symbol.for("react.memo_cache_sentinel")?(Je=r.jsx(Ul,{className:"h-4 w-4"}),e[61]=Je):Je=e[61];let O;e[62]!==l?(O=l("sectionsEditor.sectionList.deleteMenuItem"),e[62]=l,e[63]=O):O=e[63];let ce;e[64]!==$e||e[65]!==O?(ce=r.jsxs(an,{variant:"destructive",onClick:$e,children:[Je,O]}),e[64]=$e,e[65]=O,e[66]=ce):ce=e[66];let Pe;e[67]!==Me||e[68]!==K||e[69]!==V||e[70]!==le||e[71]!==ze||e[72]!==ce?(Pe=r.jsxs(ri,{align:"end",className:"w-44",children:[Me,K,V,le,ze,ce]}),e[67]=Me,e[68]=K,e[69]=V,e[70]=le,e[71]=ze,e[72]=ce,e[73]=Pe):Pe=e[73];let ke;e[74]!==nt||e[75]!==Ke||e[76]!==Pe?(ke=r.jsxs(nt,{children:[Ke,Pe]}),e[74]=nt,e[75]=Ke,e[76]=Pe,e[77]=ke):ke=e[77];let ge;return e[78]!==Ce||e[79]!==$||e[80]!==P||e[81]!==mt||e[82]!==Te||e[83]!==et||e[84]!==B||e[85]!==It||e[86]!==he||e[87]!==ke||e[88]!==Ze?(ge=r.jsxs("div",{ref:mt,style:Te,...Ce,...$,role:f,tabIndex:L,onClick:P,onKeyDown:Ze,className:et,children:[B,It,he,ke]}),e[78]=Ce,e[79]=$,e[80]=P,e[81]=mt,e[82]=Te,e[83]=et,e[84]=B,e[85]=It,e[86]=he,e[87]=ke,e[88]=Ze,e[89]=ge):ge=e[89],ge}function Vc(v){return v.stopPropagation()}function Tc(v){return v.stopPropagation()}function Ac(){return!1}function Vs(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:E}=v,C=Rn();let _;e[0]!==x?(_=de("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Gl,{size:14}),e[2]=k):k=e[2];let ee;e[3]!==C?(ee=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=ee):ee=e[4];let be;return e[5]!==S||e[6]!==E||e[7]!==_||e[8]!==P||e[9]!==ee?(be=r.jsxs(Ft,{type:"button",variant:"outline",size:E,className:_,disabled:P,onClick:S,children:[k,ee]}),e[5]=S,e[6]=E,e[7]=_,e[8]=P,e[9]=ee,e[10]=be):be=e[10],be}function Nc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:E,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:ee,onDuplicate:be,onMakeReusable:qe,onToggleHidden:Oe,onToggleLazy:De,onAddVariant:me,onDetach:l,onAddSection:N,canAddSection:Ee}=v,G=Ee===void 0?!0:Ee,ie=Rn(),H=Qn();let m;e[0]!==x.length?(m=()=>Ta(x.length),e[0]=x.length,e[1]=m):m=e[1];const[Y,u]=b.useState(m),[Ce,$]=b.useState(null),[mt,Ge]=b.useState(p),[Xe,xe]=b.useState(x.length),Ve=b.useRef(!1);mt!==p?(Ge(p),xe(x.length),u(Ta(x.length))):Xe!==x.length&&(xe(x.length),u(Qe=>wc(Qe,x.length)));let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:8}},e[2]=h):h=e[2];let Te;e[3]===Symbol.for("react.memo_cache_sentinel")?(Te={coordinateGetter:sc},e[3]=Te):Te=e[3];const tt=Jl(Ra(Yl,h),Ra(Ql,Te));let ft;e[4]!==Y?(ft=Y.map(Cc),e[4]=Y,e[5]=ft):ft=e[5];const f=ft;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=Qe=>{$(String(Qe.active.id))},e[6]=L):L=e[6];const Ze=L;let T;e[7]!==f||e[8]!==k?(T=Qe=>{$(null);const{active:U,over:ue}=Qe;if(!ue||U.id===ue.id)return;const pt=f.indexOf(String(U.id)),rt=f.indexOf(String(ue.id));pt===-1||rt===-1||(u(ht=>Ma(Un([...ht],pt,rt))),Ve.current=!0,requestAnimationFrame(()=>{Ve.current=!1}),k?.(pt,rt))},e[7]=f,e[8]=k,e[9]=T):T=e[9];const et=T;let B;e[10]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{$(null)},e[10]=B):B=e[10];const It=B;let he,nt,Ue,_e,st,Ke,Me,X,re,te,K,V,le,ze,$e;if(e[11]!==Ce||e[12]!==G||e[13]!==H||e[14]!==C||e[15]!==Y||e[16]!==f||e[17]!==et||e[18]!==E||e[19]!==N||e[20]!==me||e[21]!==ee||e[22]!==l||e[23]!==be||e[24]!==qe||e[25]!==P||e[26]!==Oe||e[27]!==De||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==tt||e[32]!==ie){ze=Symbol.for("react.early_return_sentinel");e:{const Qe=U=>{Ve.current||P(U)};if(e[48]!==Ce||e[49]!==G||e[50]!==H||e[51]!==Y||e[52]!==N||e[53]!==S||e[54]!==x||e[55]!==ie){const U=Ce?Y.find(ue=>ue.id===Ce):null;if(_e=U!=null?x[U.index]:null,Ue=U!=null?S[U.index]:void 0,Y.length===0){let ue;e[59]!==ie?(ue=ie("sectionsEditor.sectionList.noSections"),e[59]=ie,e[60]=ue):ue=e[60];let pt;e[61]!==ue?(pt=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ue}),e[61]=ue,e[62]=pt):pt=e[62];const rt=pt;let ht;e[63]!==G||e[64]!==H||e[65]!==rt||e[66]!==N?(ht=H?rt:r.jsxs("div",{className:"space-y-2",children:[rt,r.jsx(Vs,{canAddSection:G,onAddSection:N,size:"sm"})]}),e[63]=G,e[64]=H,e[65]=rt,e[66]=N,e[67]=ht):ht=e[67],ze=ht;break e}le=de(U&&"cursor-grabbing"),e[48]=Ce,e[49]=G,e[50]=H,e[51]=Y,e[52]=N,e[53]=S,e[54]=x,e[55]=ie,e[56]=Ue,e[57]=_e,e[58]=le}else Ue=e[56],_e=e[57],le=e[58];nt=ec,X=tt,re=tc,te=Ze,K=et,V=It,he=rc,Ke=f,Me=ac,$e="space-y-1",st=Y.map(U=>{const ue=x[U.index];return ue?r.jsx(Ec,{sortableId:U.id,section:ue,raw:S[U.index],meta:E,decofile:C,selected:_===U.index,onSelect:()=>Qe(U.index),onDelete:()=>ee(U.index),onDuplicate:()=>be(U.index),onMakeReusable:()=>qe(U.index),onToggleHidden:()=>Oe(U.index),onToggleLazy:De?()=>De(U.index):void 0,onAddVariant:()=>me(U.index),onDetach:()=>l(U.index)},U.id):null})}e[11]=Ce,e[12]=G,e[13]=H,e[14]=C,e[15]=Y,e[16]=f,e[17]=et,e[18]=E,e[19]=N,e[20]=me,e[21]=ee,e[22]=l,e[23]=be,e[24]=qe,e[25]=P,e[26]=Oe,e[27]=De,e[28]=S,e[29]=x,e[30]=_,e[31]=tt,e[32]=ie,e[33]=he,e[34]=nt,e[35]=Ue,e[36]=_e,e[37]=st,e[38]=Ke,e[39]=Me,e[40]=X,e[41]=re,e[42]=te,e[43]=K,e[44]=V,e[45]=le,e[46]=ze,e[47]=$e}else he=e[33],nt=e[34],Ue=e[35],_e=e[36],st=e[37],Ke=e[38],Me=e[39],X=e[40],re=e[41],te=e[42],K=e[43],V=e[44],le=e[45],ze=e[46],$e=e[47];if(ze!==Symbol.for("react.early_return_sentinel"))return ze;let Je;e[68]!==st||e[69]!==$e?(Je=r.jsx("div",{className:$e,children:st}),e[68]=st,e[69]=$e,e[70]=Je):Je=e[70];let O;e[71]!==he||e[72]!==Ke||e[73]!==Me||e[74]!==Je?(O=r.jsx(he,{items:Ke,strategy:Me,children:Je}),e[71]=he,e[72]=Ke,e[73]=Me,e[74]=Je,e[75]=O):O=e[75];let ce;e[76]!==Ue||e[77]!==_e||e[78]!==H||e[79]!==C||e[80]!==E?(ce=_e?r.jsx("div",{className:de("cursor-grabbing shadow-lift",Ia(_e,!1,H)),children:r.jsx(Fa,{section:_e,raw:Ue,meta:E,decofile:C})}):null,e[76]=Ue,e[77]=_e,e[78]=H,e[79]=C,e[80]=E,e[81]=ce):ce=e[81];let Pe;e[82]!==ce?(Pe=ei.createPortal(r.jsx(Xl,{dropAnimation:$i,children:ce}),document.body),e[82]=ce,e[83]=Pe):Pe=e[83];let ke;e[84]!==nt||e[85]!==X||e[86]!==re||e[87]!==te||e[88]!==K||e[89]!==V||e[90]!==O||e[91]!==Pe?(ke=r.jsxs(nt,{sensors:X,collisionDetection:re,onDragStart:te,onDragEnd:K,onDragCancel:V,children:[O,Pe]}),e[84]=nt,e[85]=X,e[86]=re,e[87]=te,e[88]=K,e[89]=V,e[90]=O,e[91]=Pe,e[92]=ke):ke=e[92];let ge;e[93]!==G||e[94]!==H||e[95]!==N?(ge=!H&&r.jsx(Vs,{canAddSection:G,onAddSection:N,size:"sm",className:"mt-2"}),e[93]=G,e[94]=H,e[95]=N,e[96]=ge):ge=e[96];let z;return e[97]!==le||e[98]!==ke||e[99]!==ge?(z=r.jsxs("div",{className:le,children:[ke,ge]}),e[97]=le,e[98]=ke,e[99]=ge,e[100]=z):z=e[100],z}function Cc(v){return v.id}function Pc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ws(v,p,S)}:{kind:"noop"};const E=Rs(v,p,S);if(!E)return{kind:"error",reason:"unreadable-rule"};if(E.blockKey)return{kind:"updateBlock",blockKey:E.blockKey,blockData:Mt(E.resolveType,E.data,x)};const C=qn(x),_=Gn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Mt(E.resolveType,E.data,x),reference:cn(C)}}const Aa="section-form-stale-save",Bc=3;function Na(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ba(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),E=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:E,parsedSections:kn(E,v,p)}}const Ca=new WeakMap;let Dc=0;function Kc(v){let e=Ca.get(v);return e===void 0&&(e=++Dc,Ca.set(v,e)),e}function Bm({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:E,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:ee=!1,onExitSeo:be,onSelectRoot:qe,onViewJsonFile:Oe,onFocusedBlockChange:De,onVariantPreviewOverride:me}){const l=Rn(),N=Oi(),Ee=N?.taskId??null,G=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:Ee,previewUrl:x}:null,[ie,H]=b.useState([]),{data:m,isLoading:Y}=_l(G,{pollWhile:ie.length>0}),{data:u,isLoading:Ce}=Pl(G),$=Qn(),mt=N?.virtualMcpId,Xe=gl(mt===e?e:null)?.metadata?.siteSlug??null,xe=lc({virtualMcpId:e,branch:p,sandboxUrl:x}),Ve=kl(e,p),h=wl(Ve),Te=ji(h),tt=!h,ft=!!xe||h,[f,L]=b.useState(null),[Ze,T]=b.useState(null),[et,B]=b.useState(null),[It,he]=b.useState(0),[nt,Ue]=b.useState(void 0),[_e,st]=b.useState(null),Ke={index:_e,remember:st},[Me,X]=b.useState(null),[re,te]=b.useState(null),[K,V]=b.useState([]),le=b.useRef(null),[ze,$e]=b.useState(K.length);ze!==K.length&&($e(K.length),requestAnimationFrame(()=>{le.current&&(le.current.scrollTop=0)}));const[Je,O]=b.useState(0),[ce,Pe]=b.useState(null),[ke,ge]=b.useState(null),[z,Qe]=b.useState(null),[U,ue]=b.useState(!1),[pt,rt]=b.useState(!1),ht=b.useRef(null),[jn,La]=b.useState(!0),[Qt,En]=b.useState(!1),[Lt,Vn]=b.useState(!1),[Ae,un]=b.useState(ee),[As,Ns]=b.useState(ee);ee&&!As&&(Ns(!0),un(!0),L(null),T(null),B(null),V([])),!ee&&As&&Ns(!1);const[Oa,dn]=b.useState(null),[Cs,Tn]=b.useState(void 0),[Ps,Ot]=b.useState([]),[Bs,Yt]=b.useState(0),[Fe,at]=b.useState(0),[za,Ie]=b.useState(null),[Xt,We]=b.useState(null),[Ds,Ks]=b.useState(null),Ms=ai(),Fs=Rl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),mn=Yi({orgSlug:v,virtualMcpId:e,branch:p}),[$a,Wa]=b.useState(E),[Ha,qa]=b.useState(C),[Ga,Ua]=b.useState(_);($a!==E||Ha!==C||Ga!==_)&&(queueMicrotask(()=>mn.flush()),Wa(E),qa(C),Ua(_),L(null),T(null),B(null),he(0),X(null),te(null),at(0),Ie(null),We(null),V([]),O(t=>t+1),un(!1),dn(null),Tn(void 0),Ot([]),Yt(t=>t+1));const M=Xi({orgSlug:v,virtualMcpId:e,branch:p}),fn=fl((t,n)=>{M.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:M.reportError})}),An=Hl({orgSlug:v,virtualMcpId:e,branch:p}),Is=vc({orgSlug:v,virtualMcpId:e,branch:p}),[Zt,en]=b.useState(!1),A=b.useRef(null),xt=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Nn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),we=b.useRef(new Map),tn=b.useRef(!1),ot=b.useRef([]),Yn=b.useRef(new WeakSet);jl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ae.current,i=new Set;n&&i.add(n);for(const c of[xt.current?.sectionIndex,o]){const d=c==null?void 0:s[c],R=c==null?void 0:a[c],g=d&&R?.isSavedBlock?Ss(d,R):null;g&&i.add(g)}if([...i].some(c=>t.has(c))){for(const c of[A,gt,vt])c.current&&clearTimeout(c.current),c.current=null;xt.current=null,we.current.clear(),n&&t.has(n)&&(Nn.current={})}});const ae=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=b.useState(0),[Ja,Qa]=b.useState(0),zs=oi(Ve,{orgSlug:v,virtualMcpId:e,branch:p}),$s=ii(zs,ie[0]?.blockKey??null,li(m,ie[0]?.blockKey??null)),[Ya,Xa]=b.useState(null),Xn=El(v,e).epoch,[Za,eo]=b.useState(Xn);uc(Ae?{orgSlug:v,virtualMcpId:e,branch:p}:null,m??void 0,u??void 0);const Ws=_??(m&&u?ba(xa(m,u),E,C)?.key??null:null),Zn=va({orgSlug:v,virtualMcpId:e,branch:p},Ws?[Ws]:[],{withRefs:!0}),[Hs,to]=b.useState(!1),es=va({orgSlug:v,virtualMcpId:e,branch:p},Hs?Bl:[]),qs={ready:!(Ve.kind==="protocol"&&Ve.hosted)||Hs&&es.ready,failed:es.failed,retry:es.retry,request:()=>to(!0)};if(Zn.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:l("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:l("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(Ft,{variant:"outline",size:"sm",onClick:Zn.retry,children:l("sectionsEditor.namedRules.tryAgain")})]});if(!S||Y||Ce||!Zn.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ci,{className:"size-5 text-muted-foreground"})});if(!m||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const no=xa(m,u),q=!!_,oe=q?null:ba(no,E,C),y=q?_:oe?.key??null,ts=q&&_?m[_]:void 0,Gs=q&&_&&ts?Dl(_,ts):q&&_?_:"",nn=!q&&y&&m[y]?m[y]:null,ns=Ae&&m&&u&&y&&oe?aa(m,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,so=Ae?nn?.seo:void 0,Cn=Cs!==void 0?Cs:so,ro=Ae?Zi(Cn):void 0,Us=ns?.seoTypeOptions??[],Js=Ae&&u?el(u):"",ss=Oa??ro??{},Pn=Ae&&ns?dc(ss,ns):null,Qs=Ae&&Pn&&tl(Cn)?Hn(Pn,u):null,Ys=Ae?nl(m,u)?.seoData:void 0,ve=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ba(nn?.sections,m??{},h),yt=ve.length>1,ne=Math.min(It,ve.length-1),Re=ve[ne],F=Re?.sections??[],ye=kn(F,m,h),Bn=!q&&Kl(nn?.sections,h);if(q&&_&&Ds!==_){Ks(_);const t=F[0],n=ye[0];if(t&&n){L(0),at(0),V([]);const s=kt(t,n,m,h);s&&(T(s.data),B(s.resolveType),We(null),Ie(null))}}!q&&Ds!==null&&Ks(null),ae.current={rawSections:F,parsedSections:ye,decofile:m??{},activePageKey:y,pageVariants:ve,variantIndex:ne,sectionVariantIndex:Fe,selectedSectionIndex:f};const ao=()=>({multivariate:Bn,index:ne,variants:ve.map(t=>({rule:t.rule})),lazyValues:h&&Bn&&Vi(nn?.sections?.variants?.[ne]?.value)}),rs=(t,n)=>{if(!me)return;if(!y||!Bn||t.length<=1){me(null);return}const s={multivariate:!0,index:n,variants:t},a=h?ya(y,s):Va(y,s,m,u);me(a.length>0?a:null)},as=me&&y&&Bn&&yt&&!Y&&!Ce?y:null;if(as!==Ya&&(Xa(as),as)){const t=ve.map(s=>({rule:s.rule})),n=ne;queueMicrotask(()=>rs(t,n))}const $t=(t,n,s)=>{if(!me)return;if(!y){me(null);return}const a=ao(),o=h?ya(y,a):Va(y,a,m,u);if(!t||n<0){me(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:ye[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},c=h?Tl(i):yc({...i,decofile:m,meta:u}),d=h?Al(o,c):[...o,...c];me(d.length>0?d:null)},bt=(t,n,s,a=f??-1,o=!1)=>{const i=dt(t,n);if(!i){T(null),B(null),We(null),Ie(null),o&&$t(null,a,s);return}const d=Jr(i,Te)[s];if(!d){T(null),B(null),We(null),Ie(null),o&&$t(null,a,s);return}const R=fi(d.value,m);T(R?.data??null),B(R?.resolveType??null);const{resolveType:g,formValue:w}=Ut(d.rule,m,u??void 0);We(g),Ie(w),o&&$t(i,a,s)},os=t=>{ge(null),he(t),L(null),T(null),B(null),V([]);const n=ve[t]?.rule,{resolveType:s,formValue:a}=Ut(n,m??{},u??void 0);te(s),X(a),rs(ve.map(o=>({rule:o.rule})),t)},oo=(t,n)=>{const s=F[t],a=ye[t];if(!s||!a)return!1;const o=a.isMultivariate?dt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),at(i),V([]),O(c=>c+1),a.isMultivariate)bt(s,a,i,t);else{const c=kt(s,a,m,h);c?(T(c.data),B(c.resolveType)):(T(null),B(null)),We(null),Ie(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==nt&&(Ue(P?.seq??null),typeof Xs=="number"&&oo(Xs,0)),Xn!==Za){eo(Xn);const t=A.current!==null||we.current.size>0||vt.current!==null||gt.current!==null||M.isPending||mn.isPending||ie.length>0,n=f!==null&&Ur(le.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&f!==null){const s=F[f],a=ye[f];if(V([]),O(o=>o+1),!s||!a)L(null),T(null),B(null);else if(a.isMultivariate)bt(s,a,Fe,f);else{const o=kt(s,a,m,h);T(o?.data??null),B(o?.resolveType??null)}}!t&&Ae&&(dn(null),Tn(void 0),Yt(s=>s+1))}if(Ls!==Ja){Qa(Ls);const t=f!==null?F[f]:null,n=f!==null?ye[f]:null;if(t&&n&&f!==null)if(V([]),O(s=>s+1),n.isMultivariate)bt(t,n,Fe,f);else{const s=kt(t,n,m,h);T(s?.data??null),B(s?.resolveType??null)}}const it=ie[0];if(it){const{formBase:t,target:n}=it,s=Na(m,n,h),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?vs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,m,h):null,i=ui(it,o,c=>Qr(t,c));if(i){const d=[{...it,...i,changedAgain:!0},...ie.slice(1)];ot.current=d,H(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:Ee,previewUrl:h?void 0:x??void 0,siteSlug:Xe},Dn=et&&u?Hn(et,u):null,lt=(t,n)=>{if(!y)return;A.current&&(clearTimeout(A.current),A.current=null),we.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(m,y,t,ne,ve);M.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),M.reportError(a)}})},Wt=()=>{De?.(null),L(null),Vn(!1),T(null),B(null),at(0),Ie(null),We(null),V([]),O(t=>t+1)},Zs=()=>Ur(le.current,document.activeElement),is=(t=l("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(A.current&&(clearTimeout(A.current),A.current=null),we.current.clear(),xt.current=null,W.error(t,{id:Aa}),Zs()){tn.current=!0;return}Os(n=>n+1)},er=()=>{!tn.current||Zs()||ot.current.length>0||A.current!==null||pn.current||hn.current||we.current.size>0||(tn.current=!1,Os(t=>t+1))},tr=()=>{tn.current&&setTimeout(er,0)},nr=Ve.kind==="protocol"&&Ve.source==="github",sr=t=>Cl(Ms,Fs,t,Ve.kind==="protocol"?Ve:null),rr=t=>{we.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...we.current.values()];we.current.clear();for(const s of n)s()},t)},io=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ae.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Dn}},vn=t=>{ot.current=t,H(t)},lo=t=>{const n=ot.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:ta(a.plan,a.choices,t.plan),fresh:Mi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||zn(a.plan.theirs)!==zn(t.plan.theirs)}):[...n,{...t,changedAgain:Yn.current.has(t.formBase)}];vn(o)},ar=(t,n)=>{const s=ot.current,a=s.findIndex(c=>c.formBase===t),o=s[a];if(!o)return!1;if(zn(o.plan.mine)===zn(n))return!0;const i=ea({...o.plan,mine:n});if(i.pointers.length===0){const c=s.filter(d=>d!==o);return vn(c),!1}return vn(s.with(a,{...o,plan:i,choices:ta(o.plan,o.choices,i)})),!0},co=t=>{const n=ae.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},uo=()=>{const t=ot.current[0];if(!t)return null;const{formBase:n,target:s}=t;A.current&&xt.current?.sectionIndex===n.sectionIndex&&xt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(A.current),A.current=null,xt.current=null),we.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!ar(n,a)&&yn(a,n.sectionIndex,0,s),ot.current[0]??null},mo=()=>{const t=ot.current[0],n=uo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ki(n.plan,n.choices);Ve.kind==="protocol"&&Ve.source==="github"&&wi(n.plan,n.choices)&&Vl(l,!1),vn(ot.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,Yn.current.add(a),(zt.current===a||co(n))&&(zt.current=a,T(s),O(i=>i+1)),yn(s,a.sectionIndex,0,o)},fo=t=>{const[n,...s]=ot.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??io(n),c=i.sectionVariantIndex,d=i.formBase,R=o||Zr(ot.current,d,i,n,h).runNow,g=xt.current;A.current&&(clearTimeout(A.current),A.current=null,g&&(g.sectionIndex!==n||g.sectionVariantIndex!==c)&&g.write());const w=`${i.pageKey}:${n}:${c}`,j=()=>{if(pn.current||hn.current){we.current.set(w,j);return}const D=typeof t=="function"?t():t,I=Zr(ot.current,d,i,n,h).base;if(I&&ar(I,D))return;const se=ae.current.decofile,{rawSections:J,parsedSections:Be,pageVariants:Q,variantIndex:je}=Na(se,i,h),Le=i.pageKey,Se=J[n];if(!Se)return;const fe=Be[n];if(!fe)return;const He=d?.base,Ye=vs(Se,fe,c,se,h),At=!!He&&!!Ye&&Ti(He,Ye)&&!(d&&Qr(d,Ye));if(At&&He&&Ye){if(Ai(He,Ye)){is(l("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Z=fe.isSavedBlock?"here":Ni(He,J.map((pe,ut)=>vs(pe,Be[ut],c,se,h)),n,d?.sectionCount??J.length);if(Z==="unknown"){is(l("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Z=="number"&&d){d.sectionCount=J.length,d.sectionIndex=Z,zt.current===d&&L(Z),yn(D,Z,s,i);return}}const Nt=At&&He&&Ye?ea({ancestor:He,mine:D,theirs:Ye}):null;if(Nt&&Nt.pointers.length>0&&d){d.sectionCount=J.length,lo({plan:Nt,formBase:d,target:i,sectionIndex:n,choices:Ci(Nt),changedAgain:!1,blockKey:fe.isSavedBlock?Ss(Se,fe):Le,fresh:{}});return}const Ct=Nt?Nt.merged:null,rn=Ct??D,Hr=Pi({merged:!!Ct,tracked:d,current:zt.current,saved:D});Ct&&W.info(l("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Aa}),Hr&&d&&(d.emitted=Ct,T(Ct));const gs=Hr||!Ct?rn:D;d&&(d.base=gs,d.sectionCount=J.length,Bi(d,gs));const qr={onSuccess:()=>{d&&Yn.current.delete(d),k?.()},onError:Z=>{if(d?.base===gs&&He&&(d.base=He),Z instanceof Nl){if(d&&(d.version=void 0),s<Bc){we.current.delete(w),hn.current=!0;const pe=Fi(s,Z.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const ut=d?.emitted;return ut&&typeof ut=="object"?ut:D},n,s+1,i,pe.immediate),we.current.delete(w),rr(xn(h))},pe.delay)}else is();return}M.reportError(Z)}},Gr=Z=>{pn.current=!0;let pe=!1;M.mutateAsync(Z).then(()=>qr.onSuccess(),ut=>{pe=!0,qr.onError(ut)}).finally(()=>{pn.current=!1,rr(pe?xn(h):0),er()})};if(fe.isSavedBlock){const Z=Ss(Se,fe);if(!Z)return;Gr({blockKey:Z,data:rn,...He?{base:{value:Di({startedFrom:He,stored:Ye,rebased:!!Ct,refused:s>0})}}:{},rebaseOnConflict:!1,guard:na({formBase:d,rebased:!!Ct,versionOf:sr,...nr?{copy:{value:se[Z]}}:{}})});return}if(!Le)return;const On={...se[Le]},Gt=[...J];if(fe.isMultivariate){const Z=dt(Se,fe);if(!Z||!Le)return;const pe=Ki(Z,c,rn);Gt[n]=Pt(Se,fe,pe)}else if(fe.isHidden){const Z=Ts(Se.__resolveType),pe=Z?{...Se.section}:{...Se},ut=Array.isArray(pe.variants)?[...pe.variants]:[];ut[0]&&(ut[0]=sa(pe.__resolveType,ut[0],rn)),pe.variants=ut,Z?Gt[n]={...Se,section:pe}:Gt[n]=pe}else fe.isLazy?Gt[n]={...Se,section:rn}:Gt[n]=rn;if(Q.length>1){const Z=On.sections,pe=[...Z?.variants??[]];pe[je]&&(pe[je]=sa(Z?.__resolveType,pe[je],Gt)),On.sections={...Z,variants:pe}}else On.sections=Gt;Gr({blockKey:Le,data:On,rebaseOnConflict:!1,guard:na({formBase:null,rebased:!1,versionOf:sr,...nr?{copy:{value:se[Le]}}:{}})})};if(xt.current={sectionIndex:n,sectionVariantIndex:c,write:j},R){xt.current=null,j();return}A.current=setTimeout(()=>{A.current=null,j()},xn(h))},po=t=>{tn.current=!1,L(t),at(0),V([]),O(o=>o+1);const n=F[t],s=ye[t];if(De?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){bt(n,s,0,t);return}const a=kt(n,s,m,h);if(!a){T(null),B(null),We(null),Ie(null),$t(null,t,0);return}T(a.data),B(a.resolveType),We(null),Ie(null),$t(null,t,0)},or=t=>{const n=t;f!==null&&(zt.current=Ri(zt.current,{sectionIndex:f,variantIndex:ae.current.sectionVariantIndex,shown:Ze,next:n,sectionCount:ae.current.rawSections.length})),T(n),f!==null&&yn(n,f)},ls=t=>{if(!y||!m||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=aa(m,n,u);s&&mn.save(y,()=>{const a=Ms.getQueryData(Ei.decofile(Fs))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Nn.current};return Nn.current={},t?.raw!==void 0?mc(o,t.raw,u):t?.inner!==void 0?fc(n,s,o,t.inner):o})},ir=(t,n)=>{y&&(Nn.current[t]=n,ls())},ho=(t,n)=>{if(!y)return;const s=Un([...F],t,n);f!==null&&(f===t?L(n):t<f&&n>=f?L(f-1):t>f&&n<=f&&L(f+1)),lt(s)},go=t=>{if(!y)return;const n=F.filter((s,a)=>a!==t);f===t?Wt():f!==null&&f>t&&L(f-1),lt(n)},vo=t=>{if(!y)return;const n=F[t];if(!n)return;const s=[...F];s.splice(t+1,0,pl(n)),f!==null&&f>t&&L(f+1),lt(s)},yo=t=>{if(!y)return;const n=F[t],s=ye[t];if(!n||!s)return;const a=s.isHidden?bi(n,h):xi(n,u);if(!a)return;const o=[...F];o[t]=a,f===t&&Wt(),lt(o)},So=t=>{if(!y)return;const n=F[t],s=ye[t];if(!n||!s||s.isMultivariate)return;const a=Si(n);if(!a)return;const o=[...F];o[t]=a,f===t&&Wt(),lt(o)},bo=t=>{if(!y)return;const n=F[t],s=ye[t];if(!n||!s?.isSavedBlock)return;const a=kt(n,s,m,h);if(!a?.data)return;const{name:o,...i}=a.data,c=[...F];s.isLazy?c[t]={...n,section:i}:c[t]=i,f===t&&Wt(),lt(c)},xo=t=>{if(!y)return;const n=[...F,{__resolveType:t.resolveType}],s=n.length-1;lt(n,{onError:()=>{ae.current.selectedSectionIndex===s&&Wt()}}),ue(!1),L(s),at(0),V([]),O(c=>c+1);const a=n[s],o=kn(n,m,h)[s];if(!a||!o)return;if(o.isMultivariate){bt(a,o,0);return}const i=kt(a,o,m,h);if(!i){T(null),B(null),We(null),Ie(null);return}T(i.data),B(i.resolveType),We(null),Ie(null)},lr=t=>{ht.current=t.append,ue(!0)},_o=t=>{const n=ht.current;if(!n){xo(t);return}n({__resolveType:t.resolveType}),ue(!1),ht.current=null},cr=t=>{if(f===null)return;const n=F[f],s=ye[f];!n||!s?.isMultivariate||(at(t),V([]),O(a=>a+1),bt(n,s,t,f,!0))},ko=t=>{if(f===null||!y)return;const n=F[f],s=ye[f];if(!n||!s?.isMultivariate)return;const a=dt(n,s);if(!a)return;const o=vi(a,t);if(!o){W.error(l("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...F];i[f]=Pt(n,s,o);const c=o.variants;let d=Fe;t===Fe?d=Math.min(t,c.length-1):t<Fe&&(d=Fe-1),at(d),V([]),O(R=>R+1),bt(i[f],s,d),lt(i)},wo=t=>{if(f===null||!y)return;const n=F[f],s=ye[f];if(!n||!s?.isMultivariate)return;const a=dt(n,s);if(!a)return;const o=yi(a,t,h),i=[...F];i[f]=Pt(n,s,o);const c=Xr(a.variants??[],t,h);at(c),V([]),O(d=>d+1),bt(i[f],s,c,f,h),lt(i)},Ro=(t,n)=>{if(f===null||!y||t===n)return;const s=F[f],a=ye[f];if(!s||!a?.isMultivariate)return;const o=dt(s,a);if(!o)return;const i=hi(o,t,n),c=[...F];c[f]=Pt(s,a,i);let d=Fe;Fe===t?d=n:t<Fe&&n>=Fe?d=Fe-1:t>Fe&&n<=Fe&&(d=Fe+1),at(d),bt(c[f],a,d,f,h),lt(c)},Sn=t=>{const n=t??f;if(n===null||!y)return;const s=F[n],a=ye[n];if(!s||!a)return;const o=pi(s,a,void 0,u,h);if(!o){W.error(l("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...F];i[n]=o.section;const c=kn(i,m,h)[n];if(!c?.isMultivariate){W.error(l("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),at(o.newVariantIndex),V([]),O(d=>d+1),bt(o.section,c,o.newVariantIndex,n,h),lt(i)},ur=()=>{if(f===null||!y)return;const t=F[f],n=ye[f];if(!t||!n?.isMultivariate)return;const s=dt(t,n);if(!s)return;const a=gi(t,n,s);if(!a){W.error(l("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...F];o[f]=a;const i=kn(o,m,h)[f];if(!i)return;at(0),We(null),Ie(null),V([]),O(d=>d+1);const c=kt(a,i,m,h);c?(T(c.data),B(c.resolveType)):(T(null),B(null)),$t(null,f,0),lt(o)},jo=async t=>{if(ce===null||!y)return;const n=Gn(t,m,u);if(n){W.error(n);return}const s=F[ce],a=ye[ce];if(!s||!a)return;const o=kt(s,a,m,h);if(!o){W.error(l("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const c=await M.mutateAsync({blockKey:t,data:i,create:!0}),d=[...F];d[ce]={__resolveType:t},await M.mutateAsync({blockKey:y,data:on(m,y,d,ne,ve)}),f===ce&&Wt(),Pe(null),Wn(c)||W.success(l("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(c){W.error(l("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Bt(l,Dt(c))})}},dr=Re?.rule;if(yt&&f===null&&re===null&&dr){const{resolveType:t,formValue:n}=Ut(dr,m??{},u??void 0);te(t),X(n)}const sn=u?sl(u):[],cs=u&&m?rl(u,m):[],Ht=h&&u&&m?pc(u,m):[],us=(t,n)=>{if(Ht.length===0)return;const s=Fl(t);return{kinds:Ht,selected:s,campaignPrefill:hc(t),onPick:n,load:qs}},mr=!q&&!!(ft&&u&&m),fr=re&&u?Hn(re,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(zl(n,t,u,h))try{await An.mutateAsync({blockKey:t})}catch(s){W.error(l("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Bt(l,Dt(s))})}},pr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ae.current;if(!n)return;const o={...s[n]},i={...o.sections},c=[...i.variants??[]],d=c[a],R=d?.rule;if(Jt(R,s,u)){const g=R?.__resolveType??"",w=s[g],j=typeof w?.name=="string"?w.name:g,{__resolveType:D,...I}=t;M.mutate({blockKey:g,data:Mt(D??"",I,j)},{onSuccess:()=>k?.(),onError:M.reportError});return}d&&(c[a]={...d,rule:t}),o.sections={...i,variants:c},M.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:M.reportError})},xn(h))},hr=t=>{te(t);const n=t?_a(t,u):{__resolveType:Yr(u)};X(t?n:{}),pr(n)},gr=t=>{const n=t;X(n);const s=re?{__resolveType:re,...n}:{...n};pr(s)},Kn=async(t,n,s)=>{const a=gc(n,t);if(!a.ok)return a.reason==="conflict"&&W.info(t.kind==="experiments"?l("sectionsEditor.namedRulePicker.conflictTests"):l("sectionsEditor.namedRulePicker.conflictCampaigns"),Sa),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&W.success(t.kind==="experiments"?l("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):l("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...Sa,description:l("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},vr=Ht.length>0?{kinds:Ht,load:qs,prepare:async t=>(await Kn(t,ae.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Il(ae.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ll(t).blockKey]:n.block}})).ok}}:null,yr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=ae.current;if(!n)return;const o=await Kn(t,s,d=>{const R=s[n],g=R?.sections;if(!g||typeof g!="object"||Array.isArray(g))return null;const w=g;if(!Array.isArray(w.variants))return null;const j=[...w.variants],D=j[a];return D?(j[a]={...D,rule:d},{blockKey:n,data:{...R,sections:{...w,variants:j}}}):null});if(!o)return;const{resolveType:i,formValue:c}=Ut(o.rule,o.projected,u??void 0);te(i),X(c),k?.()},Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=ae.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const c=i;if(!Array.isArray(c.variants))return;const d=[...c.variants],R=d[a];if(!R)return;const g=Kt(R.rule,s,u),w=cn(t);d[a]={...R,rule:w};const j={...s,[n]:{...o,sections:{...c,variants:d}}},{resolveType:D,formValue:I}=Ut(w,j,u??void 0);te(D),X(I);try{await M.mutateAsync({blockKey:n,data:j[n]}),g&&g!==t&&await qt(g,j),k?.()}catch(se){W.error(l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Bt(l,Dt(se))})}},br=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ae.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:c,pageVariants:d,variantIndex:R}=ae.current;if(!c)return;const g=a[n],w=o[n];if(!g||!w?.isMultivariate)return;const j=dt(g,w);if(!j)return;const I=(j.variants??[])[s]?.rule;if(Jt(I,i,u)){const Q=I?.__resolveType??"",je=i[Q],Le=typeof je?.name=="string"?je.name:Q,{__resolveType:Se,...fe}=t;M.mutate({blockKey:Q,data:Mt(Se??"",fe,Le)},{onSuccess:()=>k?.(),onError:M.reportError});return}const se=ys(j,s,t),J=[...a];J[n]=Pt(g,w,se);const Be=on(i,c,J,R,d);M.mutate({blockKey:c,data:Be},{onSuccess:()=>k?.(),onError:M.reportError})},xn(h)))},Eo=t=>{We(t);const n=t?_a(t,u):{__resolveType:Yr(u)};Ie(t?n:{}),br(n)},Vo=t=>{const n=t;Ie(n);const s=Xt?{__resolveType:Xt,...n}:{...n};br(s)},To=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:c,pageVariants:d,variantIndex:R}=ae.current;if(n===null||!c)return;const g=await Kn(t,i,D=>{const I=a[n],se=o[n];if(!I||!se?.isMultivariate)return null;const J=dt(I,se);if(!J)return null;const Be=[...a];return Be[n]=Pt(I,se,ys(J,s,D)),{blockKey:c,data:on(i,c,Be,R,d)}});if(!g)return;const{resolveType:w,formValue:j}=Ut(g.rule,g.projected,u??void 0);We(w),Ie(j),k?.()},Ao=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:c,pageVariants:d,variantIndex:R}=ae.current;if(n===null||!c)return;const g=a[n],w=o[n];if(!g||!w?.isMultivariate)return;const j=dt(g,w);if(!j)return;const D=j.variants??[],I=Kt(D[s]?.rule,i,u),se=cn(t),J=ys(j,s,se),Be=[...a];Be[n]=Pt(g,w,J);const Q=on(i,c,Be,R,d),je={...i,[c]:Q},{resolveType:Le,formValue:Se}=Ut(se,je,u??void 0);We(Le),Ie(Se);try{await M.mutateAsync({blockKey:c,data:Q}),I&&I!==t&&await qt(I,je),k?.()}catch(fe){W.error(l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Bt(l,Dt(fe))})}};if(!q&&!oe)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.noPageFound",{currentPath:E})});if(q&&!ts)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Ne=f!==null?ye[f]??null:null,xr=f!==null?F[f]:null,_r=xr&&Ne?.isMultivariate?dt(xr,Ne):null,Et=_r?Jr(_r,Te,h):[],Mn=Math.min(Fe,Math.max(Et.length-1,0)),_t=Et[Mn]??null,Vt=Ne?.isMultivariate===!0,ds=f!==null&&Ne!==null,Tt=ds&&(Vt||!!(Dn&&Ze)),No=Tt&&!q&&Ne?.isSavedBlock===!0,ct=q||No,kr=q?Gs:Ne?.label??"",Co=Xt&&u?Hn(Xt,u):null,wr=(t,n)=>n&&$?`${t} · ${n}`:t,Rr=Ne?Ne.variantOf??Ne.label:"",Po=(()=>{const t=Vt&&_t?_t.label:null;return t?$?[wr(Rr,t)]:[Ne.label,t]:[Ne?.label??""]})(),ms=wr(oe?.name??"",yt?Re?.label:null),Fn=Tt&&(!q||K.length>0)?q?[Gs,...K]:[ms,...Po,...K]:[],jr=Ae&&oe?[oe.name,"SEO",...Ps]:[],Er=l("sectionsEditor.pageVariantTabs.variantsLabel"),Vr=Qt&&oe?[oe.name,Er]:Lt&&oe&&Ne?[ms,Rr,Er]:[],In=Vr.length>0?Vr:jr.length>0?jr:ct?Fn.length>0?Fn:[kr]:Fn.length>0?Fn:[ms],Tr=ds&&!Vt&&!Ne?.isHidden&&!!y,Bo=ct||!q&&yt&&!!Re||Tr,Do=ds&&!Vt&&!q&&K.length===0&&!!Ne&&Pa(Ne)&&!!y,Ko=$&&Tt&&!Lt&&Vt&&K.length===0&&!!_t,Ar=$&&K.length>0?oa(K[K.length-1]):null,Mo=K.length>1?oa(K[K.length-2]):null,Nr=ct?kr:Tt?Ne?.label??"":oe?.name??"",Fo=Qt||Lt?l("sectionsEditor.pageVariantTabs.variantsLabel"):Ae?l("sectionsEditor.panelSections.seo"):Ar??Nr,Cr=Lt?Ne?.variantOf??Ne?.label??"":Qt||Ae?oe?.name??"":Ar?Mo??Nr:ct?l("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Tt?oe?.name??"":oe?.path??"",fs=!Qt&&!Lt&&!Ae&&!Tt&&!ct,Io=!$&&!Ae&&!q&&Vt&&K.length===0,bn=()=>{if(!y)return;St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const t=m[y],n=Ml(t.sections,F,u,h);if(!n)return;const{sections:s,newVariantIndex:a}=n;M.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{he(a),L(null),T(null),B(null),V([]),X(null),te(null)},onError:M.reportError})},Ln=(t,n,s)=>{if(!y)return;St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const a=m[y],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const c=t([...i.variants]);if(!c)return;const d=Ol(i,c),R={...m,[y]:{...a,sections:d}};M.mutate({blockKey:y,data:R[y]},{onSuccess:()=>{n?.();const g=typeof s=="string"?[s]:s??[];(async()=>{for(const w of g)await qt(w,R)})()},onError:M.reportError})},Pr=(t,n)=>{if(t===n)return;let s=ne;ne===t?s=n:t<ne&&n>=ne?s=ne-1:t>ne&&n<=ne&&(s=ne+1),he(s);const a=Un(ve.map(o=>({rule:o.rule})),t,n);rs(a,s),Ln(o=>Un(o,t,n))},Br=t=>{const n=ve[t]?.rule,s=Kt(n,m??{},u??void 0);Ln(a=>a.length<=1?null:(a.splice(t,1),a),()=>{ve.length-1===1?he(0):t<ne?he(ne-1):t===ne&&he(Math.max(0,t-1)),L(null),T(null),B(null),V([]),X(null),te(null)},s)},Lo=()=>{const t=ve.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!_i(n.rule)).map(({variant:n})=>Kt(n.rule,m??{},u??void 0)).filter(n=>!!n);Ln(n=>{const s=Ii({variants:n}),a=n[s];return a?[{...a,rule:Li(u)}]:null},()=>{he(0),L(null),T(null),B(null),V([]),X(null),te(null),En(!1)},t)},Dr=t=>{let n=t+1;Ln(s=>(n=Xr(s,t,h),$l(s,t,h)),()=>{he(n),L(null),T(null),B(null),V([]),X(null),te(null)})},Oo=async(t,n)=>{St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const s=ae.current.activePageKey,a=ae.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const c=i;if(!Array.isArray(c.variants))return;const d=[...c.variants],R=d[t];if(!R?.rule||typeof R.rule!="object"){W.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const g=R.rule,w=n.trim();en(!0);try{if(!w){if(!Jt(g,a,u)){ge(null);return}const Q=g.__resolveType??"";d[t]={...R,rule:ws(g,a,u)};const je={...a,[s]:{...o,sections:{...c,variants:d}}};await M.mutateAsync({blockKey:s,data:je[s]}),await qt(Q,je),ge(null),k?.();return}const j=Rs(g,a,u);if(!j){W.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await M.mutateAsync({blockKey:j.blockKey,data:Mt(j.resolveType,j.data,w)}),ge(null),k?.();return}const D=qn(w),I=Gn(D,a,u);if(I){W.error(I);return}const se=Mt(j.resolveType,j.data,w);let J=null,Be=!1;try{const Q=await M.mutateAsync({blockKey:D,data:se,create:!0});Be=Wn(Q),J=Be?null:D,d[t]={...R,rule:cn(D)},await M.mutateAsync({blockKey:s,data:{...o,sections:{...c,variants:d}}}),J=null}catch(Q){throw J&&await An.mutateAsync({blockKey:J}).catch(()=>{}),Q}ge(null),Be||W.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:w})),k?.()}catch(j){W.error(l("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Bt(l,Dt(j))})}finally{en(!1)}},zo=async(t,n)=>{St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:c,pageVariants:d,variantIndex:R}=ae.current;if(s===null||!c)return;const g=a[s],w=o[s];if(!g||!w?.isMultivariate)return;const j=dt(g,w);if(!j)return;const D=j.variants??[],I=D[t];if(!I?.rule||typeof I.rule!="object"){W.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const se=I.rule,J=n.trim();en(!0);const Be=async Q=>{const je={...j,variants:Q},Le=[...a];Le[s]=Pt(g,w,je);const Se=on(i,c,Le,R,d);return await M.mutateAsync({blockKey:c,data:Se}),{...i,[c]:Se}};try{if(!J){if(!Jt(se,i,u)){Qe(null);return}const Ye=se.__resolveType??"",At=[...D];At[t]={...I,rule:ws(se,i,u)};const Nt=await Be(At);await qt(Ye,Nt),Qe(null),k?.();return}const Q=Rs(se,i,u);if(!Q){W.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await M.mutateAsync({blockKey:Q.blockKey,data:Mt(Q.resolveType,Q.data,J)}),Qe(null),k?.();return}const je=qn(J),Le=Gn(je,i,u);if(Le){W.error(Le);return}const Se=Mt(Q.resolveType,Q.data,J);let fe=null,He=!1;try{const Ye=await M.mutateAsync({blockKey:je,data:Se,create:!0});He=Wn(Ye),fe=He?null:je;const At=[...D];At[t]={...I,rule:cn(je)},await Be(At),fe=null}catch(Ye){throw fe&&await An.mutateAsync({blockKey:fe}).catch(()=>{}),Ye}Qe(null),He||W.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){W.error(l("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Bt(l,Dt(Q))})}finally{en(!1)}},Kr=async(t,n,s)=>{T(s);try{await M.mutateAsync({blockKey:t,data:s})}catch(a){throw T(o=>o===s?n:o),a}},$o={rename:async(t,n,s)=>{St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const{activePageKey:a,decofile:o}=ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],c=i[n],d=c?.rule&&typeof c.rule=="object"?c.rule:void 0,R=async w=>{const j={...t,variants:w};return await Kr(a,t,j),{...o,[a]:j}},g=Pc(d,s,o,u);if(g.kind!=="noop"){if(g.kind==="error"){W.error(g.reason==="no-matcher-rule"?l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):g.reason==="unreadable-rule"?l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):g.message??l("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(g.kind==="inline"){const D=[...i];D[n]={...c,rule:g.inlinedRule};const I=await R(D);await qt(g.blockKey,I),k?.();return}if(g.kind==="updateBlock"){await M.mutateAsync({blockKey:g.blockKey,data:g.blockData}),k?.();return}let w=null,j=!1;try{const D=await M.mutateAsync({blockKey:g.blockId,data:g.blockData,create:!0});j=Wn(D),w=j?null:g.blockId;const I=[...i];I[n]={...c,rule:g.reference},await R(I),w=null}catch(D){throw w&&await An.mutateAsync({blockKey:w}).catch(()=>{}),D}j||W.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(w){W.error(l("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Bt(l,Dt(w))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const{activePageKey:a,decofile:o}=ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],c=i[n];if(!c)return;const d=Kt(c.rule,o,u);i[n]={...c,rule:cn(s)};const R={...t,variants:i},g={...o,[a]:R};try{await Kr(a,t,R),d&&d!==s&&await qt(d,g),k?.()}catch(w){W.error(l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Bt(l,Dt(w))})}},selectNamedRule:async(t,n,s)=>{St(),A.current&&(clearTimeout(A.current),A.current=null),we.current.clear();const{activePageKey:a,decofile:o}=ae.current;if(!a)return;let i=null;!await Kn(s,o,d=>{const R=Array.isArray(t.variants)?[...t.variants]:[],g=R[n];return g?(R[n]={...g,rule:d},i={...t,variants:R},{blockKey:a,data:i}):null})||!i||(T(i),k?.())}},Mr=()=>{Wt(),h&&$t(null,-1,0)},Fr=t=>{dn(t),ls({inner:t})},Ir=t=>{Tn(t),ls({raw:t})},Lr=()=>{dn(null),Ot([])},Or=()=>Yt(t=>t+1),zr=()=>{mn.flush(),un(!1),dn(null),Tn(void 0),Ot([]),Yt(t=>t+1),be?.()},Wo=()=>{En(!1),Vn(!1),L(null),un(!0)},Ho=()=>{Ae&&zr(),L(null),En(!0)},qo=()=>Vn(!0),ps=t=>{if(Qt&&t===0){En(!1);return}if(Lt&&t<2){Vn(!1),t===0&&L(null);return}if(Ae){if(t===0){zr();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ps.slice(0,t-1)),Yt(s=>s+1);return}if(q){V(K.slice(0,t)),O(s=>s+1);return}if(t===0){Mr();return}if(t===1){V([]),O(s=>s+1);return}const n=!$&&Vt&&_t?1:0;if(n===1&&t===2){V([]),O(s=>s+1);return}V(K.slice(0,t-1-n))},hs=In.length>1?r.jsx("button",{type:"button",onClick:()=>ps(hl(In.length,{isMultivariateSectionTop:Io})),title:l("sectionsEditor.sectionsEditor.back"),"aria-label":l("sectionsEditor.sectionsEditor.back"),className:de("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ct?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(xl,{className:"size-4"})}):null,Go=ct||Tt||Ae?Bo&&r.jsxs("div",{className:de("border-b px-3 py-2.5",ct&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Re&&r.jsxs("button",{type:"button",onClick:Mr,title:l("sectionsEditor.sectionsEditor.editingInVariant",{variant:Re.label}),className:de("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ol),children:[r.jsx(al,{rule:xs(Re.rule,m??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Re.label})]}),r.jsx("div",{className:"flex-1"}),ct&&r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:l("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Tr&&r.jsx($n,{onClick:()=>Sn()})]}),ct&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:l("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(ia,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:ir,variant:"header"})}),r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(Ft,{type:"button",variant:"ghost",size:"icon-sm","aria-label":l("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(ha,{size:14})})}),r.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(Ft,{type:"button",variant:"ghost",size:"icon-sm","aria-label":l("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&y?Oe():rt(!0),children:r.jsx(ga,{size:14})})}),r.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx($n,{onClick:bn})]}),Uo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(la,{listKey:y,variants:ve,activeIndex:ne,decofile:m??{},meta:u,matchers:sn,onSelect:os,onReorder:Pr,onRename:ge,onDuplicate:Dr,onDelete:Br,onAdd:bn}),yt&&re!==null&&r.jsx(ca,{className:"mt-3",children:r.jsx("div",{className:de("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(bs,{currentRt:re,currentLabel:_n(Re?.rule,m??{},Te,u??void 0),currentGlobalKey:Kt(Re?.rule,m??{},u??void 0)??void 0,matchers:sn,globals:cs,onSelect:hr,onSelectGlobal:Sr,named:us(Re?.rule,yr),namedRow:_s(Re?.rule,Ht),rule:Re?.rule,schema:fr,formValue:Me,onChange:gr,formKey:`${ne}:${re??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:fn,sandbox:gn})})})]}),$r=r.jsxs(r.Fragment,{children:[r.jsx(il,{listKey:`${y??""}:${f??""}`,variants:Et.map((t,n)=>({index:n,label:t.label})),selectedIndex:Mn,onSelect:cr,onRename:Qe,onDuplicate:wo,onDelete:ko,onRemoveAll:ur,onReorder:Ro,onAdd:()=>Sn()}),r.jsx(ca,{children:r.jsx(bs,{currentRt:Xt??"",currentLabel:_n(_t?.rule,m??{},Te,u??void 0),currentGlobalKey:Kt(_t?.rule,m??{},u??void 0)??void 0,matchers:sn,globals:cs,onSelect:Eo,onSelectGlobal:Ao,named:us(_t?.rule,To),namedRow:_s(_t?.rule,Ht),rule:_t?.rule,schema:Co,formValue:za,onChange:Vo,formKey:`${f??"none"}:${Mn}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:m,onSaveReferencedBlock:fn,sandbox:gn})})]}),Wr=r.jsx("div",{className:de($?"px-2":"p-2 pt-3"),children:r.jsx(Nc,{listKey:`${y??""}-${ne}`,rawSections:F,sections:ye,meta:u,decofile:m,selectedIndex:f,onSelect:po,onReorder:ho,onDelete:go,onDuplicate:vo,onMakeReusable:Pe,onToggleHidden:yo,onToggleLazy:tt?So:void 0,onAddVariant:Sn,onDetach:bo,onAddSection:()=>ue(!0),canAddSection:mr})}),Jo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(ia,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:ir}),nn&&y?r.jsx(ja,{rawSeo:Cn,innerSeo:ss,defaultResolveType:Js,seoTypesLoading:h&&!u,seoSchema:Qs,activeResolveType:Pn,seoTypeOptions:Us,formResetKey:Bs,siteDefaultSeo:Ys,onBreadcrumbChange:Ot,onPersistRaw:Ir,onInnerChange:Fr,onClearForm:Lr,onBumpFormKey:Or,asyncRenderAvailable:tt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Qo=r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(ja,{rawSeo:Cn,innerSeo:ss,defaultResolveType:Js,seoTypesLoading:h&&!u,seoSchema:Qs,activeResolveType:Pn,seoTypeOptions:Us,formResetKey:Bs,siteDefaultSeo:Ys,onBreadcrumbChange:Ot,onPersistRaw:Ir,onInnerChange:Fr,onClearForm:Lr,onBumpFormKey:Or,asyncRenderAvailable:tt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Yo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(la,{listKey:y,variants:ve,activeIndex:ne,decofile:m??{},meta:u,matchers:sn,onSelect:os,onReorder:Pr,onRename:ge,onDuplicate:Dr,onDelete:Br,onAdd:bn}),yt&&re!==null&&r.jsxs("div",{className:de("px-3 border-b",jn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>La(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":jn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),jn?r.jsx(vl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(yl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),jn&&r.jsx("div",{className:de("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(bs,{currentRt:re,currentLabel:_n(Re?.rule,m??{},Te,u??void 0),currentGlobalKey:Kt(Re?.rule,m??{},u??void 0)??void 0,matchers:sn,globals:cs,onSelect:hr,onSelectGlobal:Sr,named:us(Re?.rule,yr),namedRow:_s(Re?.rule,Ht),rule:Re?.rule,schema:fr,formValue:Me,onChange:gr,formKey:`${ne}:${re??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:fn,sandbox:gn})})]}),Wr]},"editor-section-list");return r.jsx(ll,{value:h,children:r.jsx(cl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!$&&hs&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:hs}),($||In.length>1)&&r.jsx(ul,{crumbs:In,onSelect:ps,onSelectRoot:()=>{mn.flush(),qe?qe():ps(0)}}),r.jsx("div",{className:"shrink-0",children:$?r.jsxs("div",{className:de("flex items-center gap-2 border-b px-3 py-2.5",ct&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[$&&hs,ct&&r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:l("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Fo}),Cr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Cr})]}),fs&&yt&&Re&&r.jsx(ua,{variants:ve,activeIndex:ne,onSelect:os,onManage:Ho,onRemoveAll:Lo}),Ko&&r.jsx(ua,{variants:Et,activeIndex:Mn,onSelect:cr,onManage:qo,onRemoveAll:ur}),fs&&!yt&&r.jsx($n,{onClick:bn}),Do&&r.jsx($n,{onClick:()=>Sn()}),r.jsx(dl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(Ft,{type:"button",variant:"outline",size:"icon-sm","aria-label":l("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Wo,children:r.jsx(ha,{size:14})})}),r.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(wt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(Ft,{type:"button",variant:"outline",size:"icon-sm","aria-label":l("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>rt(!0),children:r.jsx(ga,{size:14})})}),r.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Go}),it&&r.jsx(di,{open:!0,fields:mi(it.plan,it.target.schema),choices:it.choices,changedAgain:it.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:it.fresh,keepTyping:h,onChoose:(t,n)=>fo({...it.choices,[t]:n}),onApply:mo},Kc(it.formBase)),Lt?r.jsx(da,{onAdd:()=>Sn(),children:$r},"editor-section-variants"):Tt?r.jsxs(ln,{viewportRef:le,onBlur:tr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!$&&Vt&&Et.length>0&&K.length===0&&$r,r.jsx(Ea,{value:vr,children:r.jsx(ma,{value:q&&h?Ke:null,children:r.jsx(fa,{activeSchema:Dn,formValue:Ze,formResetKey:Je,onFormChange:or,onBreadcrumbChange:V,breadcrumbPath:K,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:m,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:xe,onRequestAddSection:lr,onVariantMatcherOp:q?$o:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:le,onBlur:tr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ea,{value:vr,children:r.jsx(ma,{value:q&&h?Ke:null,children:r.jsx(fa,{activeSchema:Dn,formValue:Ze,formResetKey:Je,onFormChange:or,onBreadcrumbChange:V,breadcrumbPath:K,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:m,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:xe,onRequestAddSection:lr})})})},"editor-global-block"):Ae?$?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Jo})},"editor-seo"):Qo:Qt?r.jsx(da,{onAdd:bn,children:Uo},"editor-variants"):$?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Wr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Vs,{canAddSection:mr,onAddSection:()=>ue(!0)})})]},"editor-section-list"):Yo,r.jsx(ml,{open:ce!==null,onOpenChange:t=>{t||Pe(null)},defaultBlockId:ce!==null?qn(ye[ce]?.label??""):"",isPending:M.isPending,onSubmit:jo}),ft&&r.jsx(cc,{open:U,onOpenChange:t=>{ue(t),t||(ht.current=null)},meta:u,decofile:m,previewBaseUrl:xe,onSelect:_o}),pt&&y&&m&&r.jsx(ql,{open:pt,onOpenChange:rt,pageKey:y,decofile:m}),ke!==null&&r.jsx(pa,{open:!0,initialName:Jt(ve[ke]?.rule,m??{},u??void 0)?_n(ve[ke]?.rule,m??{},Te,u??void 0):"",autoLabel:Te(xs(ve[ke]?.rule,m??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Oo(ke,t)},onOpenChange:t=>{!t&&!Zt&&ge(null)}}),z!==null&&r.jsx(pa,{open:!0,initialName:Jt(Et[z]?.rule,m??{},u??void 0)?_n(Et[z]?.rule,m??{},Te,u??void 0):"",autoLabel:Te(xs(Et[z]?.rule,m??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await zo(z,t)},onOpenChange:t=>{!t&&!Zt&&Qe(null)}})]})})})}export{Bm as SectionsEditor};
@@ -1 +0,0 @@
1
- import{c as _,b as ee,j as s,q as ze,K as Ne,r as X,as as Ae,B as Ie,h as Pe}from"./index-DWvRfTwV.js";import{a0 as we}from"./agent-icon-Nkid6y9z.js";import{S as Ee}from"./scroll-area-CUevVS4T.js";import{O as Oe,aC as Ue,k as fe,a3 as Be,aD as He,aE as Re,aF as Me,d as Ge,aG as Qe,J as _e,aH as qe,af as Ve,i as We,aI as Ye,ag as Je,h as Xe}from"./parse-sections-CK6AHU3E.js";import{a2 as Ze,D as et}from"./blocks-tab-states-DP3rjaHt.js";import{L as Fe}from"./label-BkzEUDUr.js";import{S as Ce}from"./switch-UpbwlQtZ.js";import{c as tt,b as st,a as lt,d as ot,S as it}from"./select-gJgQvQZg.js";import{c as nt,u as rt}from"./hosted-reconcile-gHkwH1BF.js";import{b as Ke}from"./Tool01-CyX9Nllj.js";import{E as at,u as ct,m as dt}from"./site-editor-toast-B-FxlfJP.js";const ft="https://deco.cx/docs/en/performance/edge-async-render";function mt(a){const e=_.c(30),{rawSeo:t,onEnableChange:i,onAsyncRenderChange:f,enableUnavailable:r,enableUnavailableHint:l,children:o}=a,u=r===void 0?!1:r,c=ee(),m=Oe();let p;e[0]!==t?(p=fe(t),e[0]=t,e[1]=p):p=e[1];const n=p;let d;e[2]!==t?(d=Ue(t),e[2]=t,e[3]=d):d=e[3];const x=d,h=!n&&u;let v;e[4]!==c?(v=c("sectionsEditor.seoFormChrome.enableLabel"),e[4]=c,e[5]=v):v=e[5];let y;e[6]!==v?(y=s.jsx(Fe,{htmlFor:"seo-enable",className:"text-sm font-medium",children:v}),e[6]=v,e[7]=y):y=e[7];const k=h&&l?"seo-enable-hint":void 0;let b;e[8]!==h||e[9]!==n||e[10]!==i||e[11]!==k?(b=s.jsx(Ce,{id:"seo-enable",checked:n,disabled:h,"aria-describedby":k,onCheckedChange:i}),e[8]=h,e[9]=n,e[10]=i,e[11]=k,e[12]=b):b=e[12];let S;e[13]!==y||e[14]!==b?(S=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,b]}),e[13]=y,e[14]=b,e[15]=S):S=e[15];let j;e[16]!==h||e[17]!==l?(j=h&&l&&s.jsx("p",{id:"seo-enable-hint",className:"text-xs leading-normal text-muted-foreground",children:l}),e[16]=h,e[17]=l,e[18]=j):j=e[18];let g;e[19]!==x||e[20]!==o||e[21]!==m||e[22]!==n||e[23]!==f||e[24]!==c?(g=n&&(m||!f?o:s.jsxs(s.Fragment,{children:[o,s.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm font-medium",children:c("sectionsEditor.seoFormChrome.asyncRenderLabel")}),s.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",s.jsx("a",{href:ft,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:c("sectionsEditor.seoFormChrome.documentationLinkText")}),"."]})]}),s.jsx(Ce,{id:"seo-async-render",checked:x,onCheckedChange:f,className:"shrink-0"})]})]})),e[19]=x,e[20]=o,e[21]=m,e[22]=n,e[23]=f,e[24]=c,e[25]=g):g=e[25];let N;return e[26]!==g||e[27]!==S||e[28]!==j?(N=s.jsxs("div",{className:"space-y-4",children:[S,j,g]}),e[26]=g,e[27]=S,e[28]=j,e[29]=N):N=e[29],N}function ut(a){const e=_.c(20),{options:t,value:i,onChange:f}=a,r=ee();if(t.length<=1)return null;let l;e[0]!==r?(l=r("sectionsEditor.seoTypeSelect.label"),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==l?(o=s.jsx(Fe,{className:"text-xs text-muted-foreground",children:l}),e[2]=l,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("sectionsEditor.seoTypeSelect.placeholder"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==u?(c=s.jsx(st,{className:"w-full",children:s.jsx(lt,{placeholder:u})}),e[6]=u,e[7]=c):c=e[7];let m;e[8]!==t?(m=t.filter(ht).map(pt),e[8]=t,e[9]=m):m=e[9];let p;e[10]!==m?(p=s.jsx(ot,{children:m}),e[10]=m,e[11]=p):p=e[11];let n;e[12]!==f||e[13]!==c||e[14]!==p||e[15]!==i?(n=s.jsxs(it,{value:i,onValueChange:f,children:[c,p]}),e[12]=f,e[13]=c,e[14]=p,e[15]=i,e[16]=n):n=e[16];let d;return e[17]!==o||e[18]!==n?(d=s.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[o,n]}),e[17]=o,e[18]=n,e[19]=d):d=e[19],d}function pt(a){return s.jsx(tt,{value:a.resolveType,children:a.title},a.resolveType)}function ht(a){return a.resolveType.length>0}function xt(a){const e=_.c(40),{rawSeo:t,innerSeo:i,defaultResolveType:f,seoSchema:r,activeResolveType:l,seoTypeOptions:o,formResetKey:u,siteDefaultSeo:c,onBreadcrumbChange:m,onPersistRaw:p,onInnerChange:n,onClearForm:d,onBumpFormKey:x,beforeFields:h,asyncRenderAvailable:v,seoTypesLoading:y}=a,k=v===void 0?!0:v,b=y===void 0?!1:y,S=ee(),g=!Be()||!b&&f!=="";let N;e[0]!==f||e[1]!==x||e[2]!==d||e[3]!==p||e[4]!==g?(N=K=>{if(K){if(!g)return;const $=Me(f);p($),d(),x();return}p(null),d(),x()},e[0]=f,e[1]=x,e[2]=d,e[3]=p,e[4]=g,e[5]=N):N=e[5];const w=N;let E;e[6]!==p||e[7]!==t?(E=K=>{const $=He(K,t);p($)},e[6]=p,e[7]=t,e[8]=E):E=e[8];const C=E;let T;e[9]!==x||e[10]!==n?(T=K=>{n({__resolveType:K}),x()},e[9]=x,e[10]=n,e[11]=T):T=e[11];const L=T,z=!g;let R;e[12]!==g||e[13]!==b||e[14]!==S?(R=g||b?void 0:S("sectionsEditor.seoFormChrome.noSeoTypeHint"),e[12]=g,e[13]=b,e[14]=S,e[15]=R):R=e[15];const Y=k?C:void 0;let P;e[16]!==l||e[17]!==L||e[18]!==t||e[19]!==r||e[20]!==o?(P=fe(t)&&r&&l&&o&&o.length>0&&s.jsx(ut,{options:o,value:l,onChange:L}),e[16]=l,e[17]=L,e[18]=t,e[19]=r,e[20]=o,e[21]=P):P=e[21];let F;e[22]!==l||e[23]!==u||e[24]!==i||e[25]!==m||e[26]!==n||e[27]!==t||e[28]!==r||e[29]!==c?(F=fe(t)&&r&&l&&s.jsx(Re,{schema:r,resolveType:l,value:i,formResetKey:u,onChange:K=>n(K),onBreadcrumbChange:m,siteDefaultSeo:c}),e[22]=l,e[23]=u,e[24]=i,e[25]=m,e[26]=n,e[27]=t,e[28]=r,e[29]=c,e[30]=F):F=e[30];let U;return e[31]!==h||e[32]!==w||e[33]!==t||e[34]!==F||e[35]!==z||e[36]!==R||e[37]!==Y||e[38]!==P?(U=s.jsxs(mt,{rawSeo:t,onEnableChange:w,enableUnavailable:z,enableUnavailableHint:R,onAsyncRenderChange:Y,children:[h,P,F]}),e[31]=h,e[32]=w,e[33]=t,e[34]=F,e[35]=z,e[36]=R,e[37]=Y,e[38]=P,e[39]=U):U=e[39],U}function Se(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function yt(a,e,t,i){if(a.kind==="page"){if(!Se(t))return null;const f=t.seo!==void 0?t.seo:e.rawSeoData;return{...t,seo:i===null?null:Qe(i,f)}}return Se(t)?e.siteKind==="block"?i:{...t,seo:i}:null}function vt(a,e,t){if(e===null&&Ze(t??void 0)){const{seo:i,...f}=a;return f}return{...a,seo:e}}function gt(a,e){const t=a.__resolveType;return typeof t=="string"&&t.length>0?t:e.seoResolveType}function bt(a){const e=_.c(25),{orgSlug:t,virtualMcpId:i,branch:f,target:r,resolved:l,meta:o,onSaved:u}=a,c=ze(),m=`${t}/${i}/${f}`;let p;e[0]!==f||e[1]!==t||e[2]!==i?(p={orgSlug:t,virtualMcpId:i,branch:f},e[0]=f,e[1]=t,e[2]=i,e[3]=p):p=e[3];let n;e[4]!==u?(n={onSaved:u,holdsCopy:!0},e[4]=u,e[5]=n):n=e[5];const{save:d,flush:x,isPending:h,hold:v}=Ge(p,n);let y;e[6]!==m||e[7]!==c||e[8]!==l||e[9]!==d||e[10]!==r?(y=g=>{l&&d(l.blockKey,()=>{const w=c.getQueryData(Ne.decofile(m))?.[l.blockKey];return yt(r,l,w,g)})},e[6]=m,e[7]=c,e[8]=l,e[9]=d,e[10]=r,e[11]=y):y=e[11];const k=y;let b;e[12]!==m||e[13]!==o||e[14]!==c||e[15]!==l||e[16]!==d||e[17]!==r?(b=g=>{!l||r.kind!=="page"||d(l.blockKey,()=>{const w=c.getQueryData(Ne.decofile(m))?.[l.blockKey];return Se(w)?vt(w,g,o):null})},e[12]=m,e[13]=o,e[14]=c,e[15]=l,e[16]=d,e[17]=r,e[18]=b):b=e[18];const S=b;let j;return e[19]!==x||e[20]!==v||e[21]!==h||e[22]!==S||e[23]!==k?(j={persistSeo:k,persistRawSeo:S,flush:x,isPending:h,hold:v},e[19]=x,e[20]=v,e[21]=h,e[22]=S,e[23]=k,e[24]=j):j=e[24],j}function Z(a){return typeof a=="string"&&a.trim()?a:void 0}function Te(a,e){if(a){if(e)try{const t=new URL(a,e).href;return _e(t)}catch{return}return _e(a)}}function St(a){if(!a)return{};const e=Z(a.title),t=Z(a.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:Z(a.description),image:Z(a.image),favicon:Z(a.favicon)}}function jt(a){if(!a)return"example.com";try{return new URL(a).host}catch{return"example.com"}}const kt=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function je(a){const e=_.c(10),{src:t,className:i,iconSize:f}=a,r=f===void 0?20:f;if(t){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={objectFit:"cover"},e[0]=c):c=e[0];let m;return e[1]!==i||e[2]!==t?(m=s.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:i,style:c}),e[1]=i,e[2]=t,e[3]=m):m=e[3],m}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=l):l=e[4];let o;e[5]!==r?(o=s.jsx(Ke,{size:r}),e[5]=r,e[6]=o):o=e[6];let u;return e[7]!==i||e[8]!==o?(u=s.jsx("div",{className:i,style:l,children:o}),e[7]=i,e[8]=o,e[9]=u):u=e[9],u}function Nt(a){const e=_.c(33),{seo:t,host:i,path:f,t:r}=a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={background:"#fff",border:"1px solid #dadce0"},e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={background:"#f1f3f4"},e[1]=o):o=e[1];let u;e[2]!==t.favicon?(u=s.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:o,children:t.favicon?s.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):s.jsx(Ke,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#202124"},e[4]=c):c=e[4];let m;e[5]!==i?(m=s.jsx("div",{className:"truncate text-[13px] leading-tight",style:c,children:i}),e[5]=i,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 n;e[8]!==i||e[9]!==f?(n=s.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[i,f]}),e[8]=i,e[9]=f,e[10]=n):n=e[10];let d;e[11]!==m||e[12]!==n?(d=s.jsxs("div",{className:"min-w-0",children:[m,n]}),e[11]=m,e[12]=n,e[13]=d):d=e[13];let x;e[14]!==u||e[15]!==d?(x=s.jsxs("div",{className:"flex items-center gap-2",children:[u,d]}),e[14]=u,e[15]=d,e[16]=x):x=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h={color:"#1a0dab"},e[17]=h):h=e[17];let v;e[18]!==t.title||e[19]!==r?(v=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=r,e[20]=v):v=e[20];let y;e[21]!==v?(y=s.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:h,children:v}),e[21]=v,e[22]=y):y=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k={color:"#4d5156"},e[23]=k):k=e[23];let b;e[24]!==t.description||e[25]!==r?(b=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=r,e[26]=b):b=e[26];let S;e[27]!==b?(S=s.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:k,children:b}),e[27]=b,e[28]=S):S=e[28];let j;return e[29]!==y||e[30]!==S||e[31]!==x?(j=s.jsxs("div",{className:"rounded-lg p-3 text-left",style:l,children:[x,y,S]}),e[29]=y,e[30]=S,e[31]=x,e[32]=j):j=e[32],j}function wt(a){const e=_.c(26),{seo:t,host:i,t:f}=a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"#fff",border:"1px solid #e2e8f0"},e[0]=r):r=e[0];let l;e[1]!==t.image?(l=s.jsx(je,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o={borderTop:"1px solid #e2e8f0"},e[3]=o):o=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[4]=u):u=e[4];let c;e[5]!==i?(c=s.jsx("div",{className:"truncate text-[11px]",style:u,children:i}),e[5]=i,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];let p;e[8]!==t.title||e[9]!==f?(p=t.title??f("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=f,e[10]=p):p=e[10];let n;e[11]!==p?(n=s.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[11]=p,e[12]=n):n=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d={color:"#60666c"},e[13]=d):d=e[13];let x;e[14]!==t.description||e[15]!==f?(x=t.description??f("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=f,e[16]=x):x=e[16];let h;e[17]!==x?(h=s.jsx("div",{className:"line-clamp-2 text-[12px]",style:d,children:x}),e[17]=x,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==c||e[21]!==n?(v=s.jsxs("div",{className:"px-3 py-2",style:o,children:[c,n,h]}),e[19]=h,e[20]=c,e[21]=n,e[22]=v):v=e[22];let y;return e[23]!==v||e[24]!==l?(y=s.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:r,children:[l,v]}),e[23]=v,e[24]=l,e[25]=y):y=e[25],y}function Et(a){const e=_.c(36),{seo:t,host:i,accent:f,t:r}=a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={background:"#f0f2f5"},e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#3b4045"},e[1]=o):o=e[1];let u;e[2]!==r?(u=r("sectionsEditor.seoPreview.chatCardHint"),e[2]=r,e[3]=u):u=e[3];let c;e[4]!==u?(c=s.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:o,children:u}),e[4]=u,e[5]=c):c=e[5];const m=`3px solid ${f}`;let p;e[6]!==m?(p={background:"#fff",borderLeft:m},e[6]=m,e[7]=p):p=e[7];let n;e[8]!==t.image?(n=s.jsx(je,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=n):n=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d={color:"#1c2024"},e[10]=d):d=e[10];let x;e[11]!==t.title||e[12]!==r?(x=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=r,e[13]=x):x=e[13];let h;e[14]!==x?(h=s.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:d,children:x}),e[14]=x,e[15]=h):h=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v={color:"#60666c"},e[16]=v):v=e[16];let y;e[17]!==t.description||e[18]!==r?(y=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=r,e[19]=y):y=e[19];let k;e[20]!==y?(k=s.jsx("div",{className:"line-clamp-2 text-[11px]",style:v,children:y}),e[20]=y,e[21]=k):k=e[21];let b;e[22]===Symbol.for("react.memo_cache_sentinel")?(b={color:"#8a9099"},e[22]=b):b=e[22];let S;e[23]!==i?(S=s.jsx("div",{className:"mt-0.5 text-[10px]",style:b,children:i}),e[23]=i,e[24]=S):S=e[24];let j;e[25]!==h||e[26]!==k||e[27]!==S?(j=s.jsxs("div",{className:"px-2.5 py-1.5",children:[h,k,S]}),e[25]=h,e[26]=k,e[27]=S,e[28]=j):j=e[28];let g;e[29]!==j||e[30]!==p||e[31]!==n?(g=s.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:p,children:[n,j]}),e[29]=j,e[30]=p,e[31]=n,e[32]=g):g=e[32];let N;return e[33]!==g||e[34]!==c?(N=s.jsxs("div",{className:"rounded-lg p-2 text-left",style:l,children:[c,g]}),e[33]=g,e[34]=c,e[35]=N):N=e[35],N}function _t(a){const e=_.c(39),{seo:t,host:i,accent:f,dark:r,t:l}=a,o=r?"#2b2d31":"#fff",u=r?"#00a8fc":"#1264a3",c=r?"#dbdee1":"#3b4045",m=r?"#949ba4":"#8a9099",p=r?"none":"1px solid #e2e8f0";let n;e[0]!==o||e[1]!==p?(n={background:o,border:p},e[0]=o,e[1]=p,e[2]=n):n=e[2];const d=`3px solid ${f}`;let x;e[3]!==d?(x={borderLeft:d,borderRadius:2},e[3]=d,e[4]=x):x=e[4];let h;e[5]!==m?(h={color:m},e[5]=m,e[6]=h):h=e[6];let v;e[7]!==i||e[8]!==h?(v=s.jsx("div",{className:"text-[10px]",style:h,children:i}),e[7]=i,e[8]=h,e[9]=v):v=e[9];let y;e[10]!==u?(y={color:u},e[10]=u,e[11]=y):y=e[11];let k;e[12]!==t.title||e[13]!==l?(k=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=l,e[14]=k):k=e[14];let b;e[15]!==y||e[16]!==k?(b=s.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:y,children:k}),e[15]=y,e[16]=k,e[17]=b):b=e[17];let S;e[18]!==c?(S={color:c},e[18]=c,e[19]=S):S=e[19];let j;e[20]!==t.description||e[21]!==l?(j=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=l,e[22]=j):j=e[22];let g;e[23]!==S||e[24]!==j?(g=s.jsx("div",{className:"line-clamp-2 text-[12px]",style:S,children:j}),e[23]=S,e[24]=j,e[25]=g):g=e[25];let N;e[26]!==g||e[27]!==v||e[28]!==b?(N=s.jsxs("div",{className:"min-w-0 flex-1",children:[v,b,g]}),e[26]=g,e[27]=v,e[28]=b,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=s.jsx(je,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let E;e[32]!==N||e[33]!==w||e[34]!==x?(E=s.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:x,children:[N,w]}),e[32]=N,e[33]=w,e[34]=x,e[35]=E):E=e[35];let C;return e[36]!==E||e[37]!==n?(C=s.jsx("div",{className:"rounded-lg p-2.5 text-left",style:n,children:E}),e[36]=E,e[37]=n,e[38]=C):C=e[38],C}function Ct(a){const e=_.c(21),{platform:t,seo:i,host:f,path:r,t:l}=a;let o;e[0]!==f||e[1]!==r||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==i||e[6]!==l?(o=t.layout==="search"?s.jsx(Nt,{seo:i,host:f,path:r,t:l}):t.layout==="card"?s.jsx(wt,{seo:i,host:f,path:r,t:l}):t.layout==="chat"?s.jsx(Et,{seo:i,host:f,path:r,accent:t.color,t:l}):s.jsx(_t,{seo:i,host:f,path:r,accent:t.color,dark:t.id==="discord",t:l}),e[0]=f,e[1]=r,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=i,e[6]=l,e[7]=o):o=e[7];const u=o;let c;e[8]!==t.color?(c=s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=c):c=e[9];let m;e[10]!==t.labelKey||e[11]!==l?(m=l(t.labelKey),e[10]=t.labelKey,e[11]=l,e[12]=m):m=e[12];let p;e[13]!==m?(p=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:m}),e[13]=m,e[14]=p):p=e[14];let n;e[15]!==c||e[16]!==p?(n=s.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[c,p]}),e[15]=c,e[16]=p,e[17]=n):n=e[17];let d;return e[18]!==u||e[19]!==n?(d=s.jsxs("div",{children:[n,u]}),e[18]=u,e[19]=n,e[20]=d):d=e[20],d}function Tt(a){const e=_.c(18),{seo:t,url:i,path:f}=a,r=f===void 0?"/":f,l=ee();let o,u,c;if(e[0]!==t||e[1]!==i){const y=St(t);o=y,u=Te(y.image,i),c=Te(y.favicon,i),e[0]=t,e[1]=i,e[2]=o,e[3]=u,e[4]=c}else o=e[2],u=e[3],c=e[4];let m;e[5]!==o||e[6]!==u||e[7]!==c?(m={...o,image:u,favicon:c},e[5]=o,e[6]=u,e[7]=c,e[8]=m):m=e[8];const p=m;let n;e[9]!==i?(n=jt(i),e[9]=i,e[10]=n):n=e[10];const d=n,x=r==="/"?"":r;let h;e[11]!==x||e[12]!==d||e[13]!==l||e[14]!==p?(h=kt.map(y=>s.jsx(Ct,{platform:y,seo:p,host:d,path:x,t:l},y.id)),e[11]=x,e[12]=d,e[13]=l,e[14]=p,e[15]=h):h=e[15];let v;return e[16]!==h?(v=s.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:h}),e[16]=h,e[17]=v):v=e[17],v}function De(a,e,t){const i=_.c(3);let f;return i[0]!==e||i[1]!==t?(f=e?qe(e,t):[],i[0]=e,i[1]=t,i[2]=f):f=i[2],at(a,f)}function Pt(a){const e=_.c(7),{orgSlug:t,virtualMcpId:i,branch:f,decofile:r,meta:l}=a;let o;if(e[0]!==f||e[1]!==t||e[2]!==i?(o={orgSlug:t,virtualMcpId:i,branch:f},e[0]=f,e[1]=t,e[2]=i,e[3]=o):o=e[3],!De(o,r,l).ready){let m;return e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Pe,{className:"size-5 text-muted-foreground"})}),e[4]=m):m=e[4],m}let c;return e[5]!==a?(c=s.jsx(Rt,{...a}),e[5]=a,e[6]=c):c=e[6],c}function Rt(a){const e=_.c(77),{orgSlug:t,virtualMcpId:i,branch:f,decofile:r,meta:l,target:o,previewBaseUrl:u,onSaved:c,onEditDefaultSeo:m,onBack:p}=a,n=ee(),d=Ve(r,o,l),x=ct(i,f);let h;e[0]!==x?(h=dt(x),e[0]=x,e[1]=h):h=e[1];const v=!h,y=d?.seoData,k=o.kind==="site"?"site":o.pageKey,[b,S]=X.useState(k),[j,g]=X.useState(null),[N,w]=X.useState(0),[E,C]=X.useState(void 0),{persistSeo:T,persistRawSeo:L,flush:z,isPending:R,hold:Y}=bt({orgSlug:t,virtualMcpId:i,branch:f,target:o,resolved:d,meta:l,onSaved:c});let P;e[2]!==f||e[3]!==t||e[4]!==i?(P=nt({orgSlug:t,virtualMcpId:i,branch:f}),e[2]=f,e[3]=t,e[4]=i,e[5]=P):P=e[5];const F=rt(P)(d?.blockKey??""),[U,K]=X.useState(F);(b!==k||U!==F)&&(d&&Y(d.blockKey),S(k),K(F),g(null),C(void 0),w(Kt));const $=o.kind==="page",$e=$?d?.rawSeoData:void 0,J=E!==void 0?E:$e,Le=$?We(J)??void 0:void 0,D=j??Le??y??{},A=d?Ye(gt(D,d),r,l):null,B=A&&(!$||fe(J))?et(A,l):null;let te;e[6]!==l?(te=Je(l),e[6]=l,e[7]=te):te=e[7];const me=te;let I,se;e[8]!==r||e[9]!==D||e[10]!==l||e[11]!==o.kind?(I=o.kind==="page"?Xe(r,l)?.seoData??{}:{},se=o.kind==="page"?$t(I,D):D,e[8]=r,e[9]=D,e[10]=l,e[11]=o.kind,e[12]=I,e[13]=se):(I=e[12],se=e[13]);const ue=se;let le;e[14]!==T||e[15]!==d||e[16]!==g?(le=O=>{if(!d)return;const ke=O;g(ke),T(ke)},e[14]=T,e[15]=d,e[16]=g,e[17]=le):le=e[17];const pe=le;let oe;e[18]!==g?(oe=()=>g(null),e[18]=g,e[19]=oe):oe=e[19];const he=oe;let ie;e[20]!==w?(ie=()=>w(Ft),e[20]=w,e[21]=ie):ie=e[21];const xe=ie;let ne;e[22]!==z||e[23]!==p?(ne=()=>{z(),p?.()},e[22]=z,e[23]=p,e[24]=ne):ne=e[24];const ye=ne,H=o.kind==="page"?o.path:"/";let re;e[25]!==H||e[26]!==u||e[27]!==o.kind?(re=o.kind==="page"&&u?Dt(H,u):u??null,e[25]=H,e[26]=u,e[27]=o.kind,e[28]=re):re=e[28];const ve=re;let ae;e[29]!==d||e[30]!==n||e[31]!==o.kind?(ae=o.kind==="site"?n("sectionsEditor.seoEditor.noSiteSeoBlock"):n(d?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[29]=d,e[30]=n,e[31]=o.kind,e[32]=ae):ae=e[32];const ge=ae,ce=$&&d,be=o.kind==="site"&&d&&B;let M;e[33]!==ye||e[34]!==n||e[35]!==o.kind||e[36]!==o.pageName?(M=o.kind==="page"?s.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[s.jsx("button",{type:"button",onClick:ye,title:o.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),s.jsx(Ae,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(we,{size:16,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:n("sectionsEditor.seoEditor.defaultSeoLabel")}),s.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",n("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[33]=ye,e[34]=n,e[35]=o.kind,e[36]=o.pageName,e[37]=M):M=e[37];let G;e[38]!==R?(G=R&&s.jsx(Pe,{className:"size-3.5 text-muted-foreground"}),e[38]=R,e[39]=G):G=e[39];let Q;e[40]!==m||e[41]!==n||e[42]!==o.kind?(Q=o.kind==="page"&&m&&s.jsxs(Ie,{type:"button",variant:"outline",size:"sm",onClick:m,children:[s.jsx(we,{size:14}),n("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[40]=m,e[41]=n,e[42]=o.kind,e[43]=Q):Q=e[43];let q;e[44]!==G||e[45]!==Q?(q=s.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[G,Q]}),e[44]=G,e[45]=Q,e[46]=q):q=e[46];let V;e[47]!==M||e[48]!==q?(V=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[M,q]}),e[47]=M,e[48]=q,e[49]=V):V=e[49];let W;e[50]!==A||e[51]!==v||e[52]!==xe||e[53]!==he||e[54]!==me||e[55]!==J||e[56]!==D||e[57]!==ge||e[58]!==N||e[59]!==pe||e[60]!==H||e[61]!==L||e[62]!==T||e[63]!==ue||e[64]!==ve||e[65]!==d||e[66]!==B||e[67]!==g||e[68]!==C||e[69]!==ce||e[70]!==be||e[71]!==I||e[72]!==n?(W=!d||!ce&&!be?s.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ge}):s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx(Ee,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"px-5 py-4",children:ce?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:n("sectionsEditor.seoEditor.emptyFieldsHint")}),s.jsx(xt,{rawSeo:J,innerSeo:D,defaultResolveType:me,seoSchema:B,activeResolveType:A,seoTypeOptions:d.seoTypeOptions,formResetKey:N,siteDefaultSeo:I,onPersistRaw:O=>{C(O),L(O)},onInnerChange:O=>{g(O),T(O)},onClearForm:he,onBumpFormKey:xe,asyncRenderAvailable:v})]}):B&&A&&s.jsx(Re,{schema:B,resolveType:A,value:D,formResetKey:N,onChange:pe})})}),s.jsx(Ee,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"@container px-5 py-4",children:s.jsx(Tt,{seo:ue,url:ve,path:H})})})]}),e[50]=A,e[51]=v,e[52]=xe,e[53]=he,e[54]=me,e[55]=J,e[56]=D,e[57]=ge,e[58]=N,e[59]=pe,e[60]=H,e[61]=L,e[62]=T,e[63]=ue,e[64]=ve,e[65]=d,e[66]=B,e[67]=g,e[68]=C,e[69]=ce,e[70]=be,e[71]=I,e[72]=n,e[73]=W):W=e[73];let de;return e[74]!==V||e[75]!==W?(de=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[V,W]}),e[74]=V,e[75]=W,e[76]=de):de=e[76],de}function Ft(a){return a+1}function Kt(a){return a+1}function Dt(a,e){try{return new URL(a,e).href}catch{return e}}function $t(a,e){const t=e.__resolveType,i=a.__resolveType;if(typeof t=="string"&&typeof i=="string"&&t!==i)return{...e};const f={...a};for(const[r,l]of Object.entries(e))r!=="__resolveType"&&l!=null&&(typeof l=="string"&&l.trim()===""||(f[r]=l));return f}const qt=Object.freeze(Object.defineProperty({__proto__:null,SeoEditor:Pt,useEnsureSiteSeoBlocks:De},Symbol.toStringTag,{value:"Module"}));export{xt as P,gt as a,yt as b,qt as s,De as u,vt as w};
@@ -1 +0,0 @@
1
- import{c as e,j as o}from"./index-DWvRfTwV.js";import{V as a}from"./index-Chg--78J.js";function p(s){const t=e.c(2),{virtualMcpId:r}=s;let i;return t[0]!==r?(i=o.jsx(a,{virtualMcpId:r}),t[0]=r,t[1]=i):i=t[1],i}export{p as S};