decocms 4.574.4 → 4.574.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Y_OUILZ3.js → AlertCircle-r3-65QGa.js} +1 -1
- package/dist/client/assets/{AreaChart-BS5obASA.js → AreaChart-C5PjXsTV.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CB426JlK.js → ArrowLeft-D6scOXD-.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cp2Ml2vf.js → ArrowUp-Cn2kMl0m.js} +1 -1
- package/dist/client/assets/{CartesianChart-BwAnmURd.js → CartesianChart-B1oaYNTr.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DsdW4Q1n.js → CategoricalChart-DzzGNLUP.js} +1 -1
- package/dist/client/assets/{CheckCircle-CEPNyqYQ.js → CheckCircle-Uj5wL5gk.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DClPI-qU.js → ChevronSelectorVertical-zTQaeZAI.js} +1 -1
- package/dist/client/assets/{ChevronUp-Dsr9gtxU.js → ChevronUp-BjA2VknT.js} +1 -1
- package/dist/client/assets/{CreditCard01-D6m8lGLv.js → CreditCard01-BvXb2Lni.js} +1 -1
- package/dist/client/assets/{Globe04-DOLChRWZ.js → Globe04-CoUsMEms.js} +1 -1
- package/dist/client/assets/{Key01-CcC-DNfV.js → Key01-Cwya0Bqg.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Bu5CIeMz.js → LinkBroken01-BsflEjnj.js} +1 -1
- package/dist/client/assets/{Minus-cqn26HtL.js → Minus-B714ZjWA.js} +1 -1
- package/dist/client/assets/{Monitor01-BeH9O99T.js → Monitor01-Cuwl6kJ_.js} +1 -1
- package/dist/client/assets/{Play-o5_wqCmk.js → Play-BwysvS-E.js} +1 -1
- package/dist/client/assets/{Plus-sBQQfz_j.js → Plus-Dhutz31g.js} +1 -1
- package/dist/client/assets/ReferenceLine-TBQQ-iJC.js +1 -0
- package/dist/client/assets/{SearchMd-CBPTYB4H.js → SearchMd-DYX8MZiO.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-C88ytSQP.js → ShoppingBag01-gbNNAeM0.js} +1 -1
- package/dist/client/assets/{Sun-9dowJ77Q.js → Sun-BQnmg69t.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BXlvEeQ4.js → SwitchHorizontal01-xcLba1bf.js} +1 -1
- package/dist/client/assets/{Tool01-D9z5UHl1.js → Tool01-CBLhcG71.js} +1 -1
- package/dist/client/assets/{Tooltip-C_vqgUhw.js → Tooltip-B0F_Vcsg.js} +1 -1
- package/dist/client/assets/{Trash01-C3vHEhEb.js → Trash01-BTmzVQk_.js} +1 -1
- package/dist/client/assets/{Upload01-RcrRUOsi.js → Upload01-Cl2zCfWN.js} +1 -1
- package/dist/client/assets/{UserSquare-YXEd-AbI.js → UserSquare-DGUSiZ1P.js} +1 -1
- package/dist/client/assets/{Users01-CC5oUscX.js → Users01-DZO5qwDg.js} +1 -1
- package/dist/client/assets/{XClose-UU_Qx1D3.js → XClose-G4YrC3Pn.js} +1 -1
- package/dist/client/assets/{Zap-CO42SvK0.js → Zap-vn2maseg.js} +1 -1
- package/dist/client/assets/{access-gate-DSwIamvO.js → access-gate-DIjds3ci.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-B5G2C2cs.js → add-connection-dialog-COyMgVte.js} +1 -1
- package/dist/client/assets/agent-app-D5QgsYqc.js +1 -0
- package/dist/client/assets/{agent-assets-BKVS3WSt.js → agent-assets-fNqBCKHt.js} +1 -1
- package/dist/client/assets/{agent-automation-Cl_Mzi6e.js → agent-automation-VkyKtW9U.js} +1 -1
- package/dist/client/assets/{agent-automations-C7N7FlhQ.js → agent-automations-CVJfPHfF.js} +1 -1
- package/dist/client/assets/{agent-calendar-6WYiR_eD.js → agent-calendar-Bo7r9Vky.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DLDLILDU.js → agent-capabilities-BYI80-yc.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CSCpdzg5.js → agent-connect-sources-B1ogKhmB.js} +1 -1
- package/dist/client/assets/agent-deck-DFSjszrf.js +1 -0
- package/dist/client/assets/{agent-e2e-D94KjHQG.js → agent-e2e-iOKW7dHH.js} +1 -1
- package/dist/client/assets/agent-experiments-I73pTJTd.js +1 -0
- package/dist/client/assets/{agent-file-BoQHNMP7.js → agent-file-VFhRgETL.js} +1 -1
- package/dist/client/assets/{agent-hosting-BNNjZNQs.js → agent-hosting-F7wnXc5D.js} +1 -1
- package/dist/client/assets/{agent-icon-DYPj-9S0.js → agent-icon-Bd5DjuVH.js} +1 -1
- package/dist/client/assets/agent-library-DWh6KRhL.js +1 -0
- package/dist/client/assets/agent-library-file-lCIRTUSD.js +1 -0
- package/dist/client/assets/agent-overview-Cz7UwSDQ.js +1 -0
- package/dist/client/assets/{agent-releases-CFjOd9p0.js → agent-releases-JjIyhQ8o.js} +2 -2
- package/dist/client/assets/agent-settings-i843C-TL.js +1 -0
- package/dist/client/assets/{agent-site-editor-DS_SOZYh.js → agent-site-editor-DyvD6coP.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-D-9tyAcE.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DZG2siue.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-B1i0x30d.js +1 -0
- package/dist/client/assets/agent-view-BM-3dQi3.js +1 -0
- package/dist/client/assets/{agent-view-guard-DQNO5wut.js → agent-view-guard-L6gyipxF.js} +1 -1
- package/dist/client/assets/{ai-providers-CB35CJ-r.js → ai-providers-DuSrjEsM.js} +1 -1
- package/dist/client/assets/{alert-BfpOJ3QC.js → alert-DKmdEqFw.js} +1 -1
- package/dist/client/assets/{analytics-sections-DqSJTMHS.js → analytics-sections-BwF8iocD.js} +1 -1
- package/dist/client/assets/{api-keys-C9RfpFWT.js → api-keys-BGBs72Hh.js} +1 -1
- package/dist/client/assets/api-keys-Dm40J7UN.js +1 -0
- package/dist/client/assets/{app-editor-CHqAZ-8c.js → app-editor-DEKiUudf.js} +1 -1
- package/dist/client/assets/{asset-utils-BIz1znAk.js → asset-utils-Bn1iB4IB.js} +1 -1
- package/dist/client/assets/{auth-CGSiE6Ch.js → auth-B9FRbbSg.js} +1 -1
- package/dist/client/assets/{auth-catchall-pVvy0s4e.js → auth-catchall-Cfn19MlN.js} +1 -1
- package/dist/client/assets/{auth-entry-TEqh-7ub.js → auth-entry-DarDiRFD.js} +1 -1
- package/dist/client/assets/{auth-split-layout-R8Bk7IQM.js → auth-split-layout-NuyNrtc1.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C3rmsbOR.js → authenticate-and-persist-oauth-DbBE_3KO.js} +1 -1
- package/dist/client/assets/{automation-list-row-_t0nrhFD.js → automation-list-row-DhNblfKh.js} +1 -1
- package/dist/client/assets/{automation-runs-Cmm8lebF.js → automation-runs-CM_NVYxO.js} +1 -1
- package/dist/client/assets/{automations-DByyLA6Z.js → automations-DRiO_jED.js} +1 -1
- package/dist/client/assets/{autosend-ChY4eKzU.js → autosend-BQzY1y5n.js} +1 -1
- package/dist/client/assets/{badge-DXTq7juk.js → badge-D17_WC-Q.js} +1 -1
- package/dist/client/assets/{block-document-Dg43t_cN.js → block-document-BLA0kAXd.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CnFe6MxR.js → blocks-preview-workspace-context-BGXxGGI-.js} +1 -1
- package/dist/client/assets/blocks-tab-states-5fAC-Jvu.js +1 -0
- package/dist/client/assets/{blog-schema-DLE0PJtr.js → blog-schema-D1br3hZ9.js} +1 -1
- package/dist/client/assets/{buckets-DY1vce0F.js → buckets-Bnooosbl.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Df0z7skN.js → build-improve-prompt-doc-U_S4OhQh.js} +1 -1
- package/dist/client/assets/{calendar-BGDDe831.js → calendar-BBjKT4Y4.js} +1 -1
- package/dist/client/assets/{capability-load-error-CNpbDyX4.js → capability-load-error-B5mCDF3r.js} +1 -1
- package/dist/client/assets/{category-editor-R_XIhJ9S.js → category-editor-Bj6oJb66.js} +1 -1
- package/dist/client/assets/chart-DHbQOnD2.js +13 -0
- package/dist/client/assets/{chat-context--sx_tT3a.js → chat-context-D__edm74.js} +1 -1
- package/dist/client/assets/{chat-draft-BAtgCZ3L.js → chat-draft-DOwDIvwR.js} +1 -1
- package/dist/client/assets/{checkbox-CZnP9NXa.js → checkbox-Xa1XT9y9.js} +1 -1
- package/dist/client/assets/{choose-editor-DYxsXNSd.js → choose-editor-BZDc27QM.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BN8nYAwK.js → cli-auth-success-DcNBgMWE.js} +1 -1
- package/dist/client/assets/{client-icons-Dnxm_fsV.js → client-icons-Baga43Je.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-BZsD4zo_.js → cms-settings-editor-DwsfGfxl.js} +1 -1
- package/dist/client/assets/cms-store-drafts-DO3GS-BC.js +1 -0
- package/dist/client/assets/{collapsible-CAWr0Uf-.js → collapsible--DSKOo3p.js} +1 -1
- package/dist/client/assets/{collection-detail-DTMma4Re.js → collection-detail-l5EAxPj8.js} +1 -1
- package/dist/client/assets/{collection-display-button-DPJAc88l.js → collection-display-button-CAXaH0_X.js} +1 -1
- package/dist/client/assets/{collection-search-CXkzfc9r.js → collection-search-iWjyQyoE.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bl8czn0p.js → collection-table-wrapper-DULM5aVC.js} +1 -1
- package/dist/client/assets/{collection-tabs-mu__SPg6.js → collection-tabs-D5bCrQWd.js} +1 -1
- package/dist/client/assets/{combobox-DU-BWR6s.js → combobox-BojjAtvD.js} +1 -1
- package/dist/client/assets/{command-CSPHvNyT.js → command-Dz2oRnZb.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DFcjkcx9.js → companion-mcps-section-C9oCfjV-.js} +1 -1
- package/dist/client/assets/{config-NmGpqpBn.js → config-Bx8A1535.js} +1 -1
- package/dist/client/assets/{connect-C4yS4zXm.js → connect--gHxmjfk.js} +3 -3
- package/dist/client/assets/{connect-layout-B6A4FqDB.js → connect-layout-nODaAO4K.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BIqYqxRx.js → connect-source-dialog-D4ezswW7.js} +1 -1
- package/dist/client/assets/{connection-DgHvsn_X.js → connection-C6vq1sCN.js} +1 -1
- package/dist/client/assets/{connection-card-CrrO3ejB.js → connection-card-DByKtq4T.js} +1 -1
- package/dist/client/assets/{connection-detail-BMMfs5vK.js → connection-detail-BYMgTrKV.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Dhos9NR1.js → connection-form-helpers-BovE5YOR.js} +1 -1
- package/dist/client/assets/{connection-slug-BY7_frFV.js → connection-slug-DNLnZOJk.js} +1 -1
- package/dist/client/assets/{connections-hcM7xUnc.js → connections-B6YR0-M-.js} +1 -1
- package/dist/client/assets/{content-tab-CAhVvpMk.js → content-tab-DKxUFS3M.js} +3 -3
- package/dist/client/assets/{context-C7PxWYJ-.js → context-VrbAdDEo.js} +1 -1
- package/dist/client/assets/{context-menu-DipHTfvq.js → context-menu-BERaowmZ.js} +1 -1
- package/dist/client/assets/{context-shell-B-eLBue7.js → context-shell-Cz6NPjEK.js} +3 -3
- package/dist/client/assets/{core.esm-BcKT6bZa.js → core.esm-zdyJobf2.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DtUha4Y4.js → create-organization-dialog-DKVN237m.js} +1 -1
- package/dist/client/assets/{device-hint-BjjaBI1z.js → device-hint-BDdfDIcL.js} +1 -1
- package/dist/client/assets/{discover-CQ7cMbu6.js → discover-DTSj3AvJ.js} +1 -1
- package/dist/client/assets/{domain-settings-DF0qdE25.js → domain-settings-BSfIsMFs.js} +1 -1
- package/dist/client/assets/{drawer-2P1ke0v5.js → drawer-BqEmUb4n.js} +1 -1
- package/dist/client/assets/{editor-BXgkmrWx.js → editor-4N5Zqxy_.js} +1 -1
- package/dist/client/assets/{editor-classes-CntBx7_T.js → editor-classes-Dg5BrFCM.js} +1 -1
- package/dist/client/assets/{empty-state-CC-oozy8.js → empty-state-DB3KUDYc.js} +1 -1
- package/dist/client/assets/{empty-state-B1eFFEza.js → empty-state-DzKImAtb.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-KOKZYAnv.js → experiments-tab-choice-DJfA9UFl.js} +1 -1
- package/dist/client/assets/{extract-connection-data-sd_xyzvc.js → extract-connection-data-Ba81Qqm1.js} +1 -1
- package/dist/client/assets/{feature-gate-DcT_fryQ.js → feature-gate-CUU0Fv0y.js} +1 -1
- package/dist/client/assets/{feature-paywall-BCcQWh7w.js → feature-paywall--88Nne2L.js} +1 -1
- package/dist/client/assets/{file-explorer-B_yB3TRi.js → file-explorer-DoNlypVE.js} +1 -1
- package/dist/client/assets/{file-preview-BTZhj6pd.js → file-preview-D77KJkpr.js} +1 -1
- package/dist/client/assets/{file-share-button-YeFjmtWG.js → file-share-button-Bl7t6a9g.js} +1 -1
- package/dist/client/assets/{file-type-icon-DYMrEOTS.js → file-type-icon-B8ydIjHI.js} +1 -1
- package/dist/client/assets/{folder-icon-CvzICvU-.js → folder-icon-CwFmdi5D.js} +1 -1
- package/dist/client/assets/{form-BFewkYbP.js → form-BXj3YBhn.js} +1 -1
- package/dist/client/assets/{general-B3PWCa84.js → general-Rkm9HtwH.js} +1 -1
- package/dist/client/assets/{github-icon-C2RYJxpH.js → github-icon-BIb5Vfpr.js} +1 -1
- package/dist/client/assets/{home-DLwvjHsh.js → home-B8En4Jxp.js} +1 -1
- package/dist/client/assets/{home-overview-9Le8NPiW.js → home-overview-uLEZMT8T.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-DBZyiSDy.js → hosted-reconcile-v19CihgF.js} +1 -1
- package/dist/client/assets/{icon-button-D5d00wVb.js → icon-button-zoxb5UGy.js} +1 -1
- package/dist/client/assets/{index-DdpcXjHR.js → index-7_HMIPHJ.js} +1 -1
- package/dist/client/assets/{index-6fq9tzTG.js → index-B3ZR6FKh.js} +1 -1
- package/dist/client/assets/{index-CP9rTnyG.js → index-BPLzAbmE.js} +1 -1
- package/dist/client/assets/{index-B2c7ptSv.js → index-C5zKB8Ws.js} +1 -1
- package/dist/client/assets/{index-xLbT0TA8.js → index-CX-DNJFH.js} +1 -1
- package/dist/client/assets/{index-CCbQRrnr.js → index-CbmJOLRb.js} +1 -1
- package/dist/client/assets/{index-B6nB1oBs.js → index-D-pfNS-S.js} +1 -1
- package/dist/client/assets/{index-BhagIWfP.js → index-DG86sSdc.js} +1 -1
- package/dist/client/assets/{index-DAS_1BE2.js → index-DHdn4GVF.js} +1 -1
- package/dist/client/assets/{index-1J_VjTgY.js → index-DJiYOFZT.js} +1 -1
- package/dist/client/assets/{index-h1XTCueR.js → index-DLrFWx5Y.js} +39 -39
- package/dist/client/assets/{index-B6WkvUi4.js → index-DlGI6s_b.js} +1 -1
- package/dist/client/assets/{index-Bhb7tUT1.js → index-M2AI6x1u.js} +1 -1
- package/dist/client/assets/{index-BXjAEYmT.js → index-_tlLxqQr.js} +1 -1
- package/dist/client/assets/{index-vfReuDCU.js → index-rSGOnG16.js} +1 -1
- package/dist/client/assets/{index-redirect-BKtHHV2b.js → index-redirect-DJgUOEFg.js} +1 -1
- package/dist/client/assets/{index-BdqM0lZt.js → index-uzZt69XO.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CHwNipYb.js → infiniteQueryObserver-CxT8wQIc.js} +1 -1
- package/dist/client/assets/{infra-billing-kjaxJDtG.js → infra-billing-B-yG5gsq.js} +1 -1
- package/dist/client/assets/{input-DV98ow22.js → input-9_e3fHfS.js} +1 -1
- package/dist/client/assets/{input-C_dtPix5.js → input-f_GWmlkU.js} +4 -4
- package/dist/client/assets/{integration-icon-BX--0-gC.js → integration-icon-Chtj05eK.js} +1 -1
- package/dist/client/assets/{jira-icon-ChmudZ3X.js → jira-icon-BeOKkf6M.js} +1 -1
- package/dist/client/assets/{label-7Sx3Bd-m.js → label-DzXAppDM.js} +1 -1
- package/dist/client/assets/{layout-D0p7Bi_M.js → layout-D4jG7v-0.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DP-92Dz3.js → legacy-admin-welcome-dialog-BKs0Fyaf.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BUFBVFZA.js → legacy-agents-deep-eH17kCQv.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BOVE_v_s.js → legacy-main-redirect-DmyZ5nIX.js} +1 -1
- package/dist/client/assets/library-CPmo79Aj.js +1 -0
- package/dist/client/assets/{library-tab-BVLYgEIj.js → library-tab-zuXLBhZD.js} +1 -1
- package/dist/client/assets/{login-DmfKqvWA.js → login-f4ji59Ob.js} +1 -1
- package/dist/client/assets/{markdown-C5fMrlG3.js → markdown-D6jTtk0G.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BHQzXoMa.js → mcp-app-renderer-voFMel4o.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BPKVuGj7.js → mcp-oauth-BWAVhH3v.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DdsjIog0.js → mcp-oauth-Do-na6T3.js} +1 -1
- package/dist/client/assets/{members-BUgt2v5k.js → members-CqQBQk1P.js} +1 -1
- package/dist/client/assets/{memory-CpIy9WxU.js → memory-Bfk8WziL.js} +1 -1
- package/dist/client/assets/{mock-board-C8Scb14T.js → mock-board-DLFDSUsN.js} +3 -3
- package/dist/client/assets/{monaco-editor-Dn3JUtr6.js → monaco-editor-BhbaBg5Q.js} +1 -1
- package/dist/client/assets/{monitoring-CSmLuvXL.js → monitoring-B_xzjSSK.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DnbBc-SM.js → monitoring-stats-row-t5zQGycF.js} +1 -1
- package/dist/client/assets/{multi-select-D6qN_k_Q.js → multi-select-CDQPcRMW.js} +1 -1
- package/dist/client/assets/{mustache-BGmZfDW9.js → mustache-3I6NpSTH.js} +1 -1
- package/dist/client/assets/{named-rule-view-TVPYWAXx.js → named-rule-view-DbZxafsz.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BU-wxed9.js → new-project-dialog-BjM9FoLr.js} +1 -1
- package/dist/client/assets/{oauth-callback-CanlAXdb.js → oauth-callback-DvbDZuYM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DOqtXeQE.js → oauth-callback-ai-provider--FzfmjdQ.js} +1 -1
- package/dist/client/assets/{oauth-consent-NZZACOUo.js → oauth-consent-Cr-zlxu_.js} +1 -1
- package/dist/client/assets/{onboarding-rYSWsG3S.js → onboarding-uguDJVea.js} +1 -1
- package/dist/client/assets/{openai-conversation-B6DkopEN.js → openai-conversation-B8S0Gyws.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CSzTTT3t.js → optimistic-project-sidebar-views-3XRF84J-.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BgrYiKjT.js → order-monitor-day-CRhx574b.js} +1 -1
- package/dist/client/assets/{organization-choice-BlHBHiMN.js → organization-choice-D6svk97q.js} +1 -1
- package/dist/client/assets/{orgs-BE7PoniG.js → orgs-S0_l6-lv.js} +1 -1
- package/dist/client/assets/{own-accounts-section-gUye1hC4.js → own-accounts-section-ORFpyS1q.js} +1 -1
- package/dist/client/assets/{pair-DclsAW7v.js → pair-B7REjwrW.js} +8 -8
- package/dist/client/assets/{parse-sections-ki2R7CT5.js → parse-sections-BJOrOXAt.js} +3 -3
- package/dist/client/assets/{plan--Ofz0lEx.js → plan-BGVf8uPH.js} +1 -1
- package/dist/client/assets/{plan-ladder-7wWPqUAB.js → plan-ladder-CLj7THz5.js} +1 -1
- package/dist/client/assets/{plan-usage-card-CFXb8pkH.js → plan-usage-card-B9gvfgRW.js} +2 -2
- package/dist/client/assets/{popover-CseyhIeF.js → popover-C5Rig4oB.js} +1 -1
- package/dist/client/assets/{post-calendar-CVMGU40q.js → post-calendar-C7USsx2-.js} +1 -1
- package/dist/client/assets/{post-editor-br_fwHLt.js → post-editor-DoW4sTc1.js} +1 -1
- package/dist/client/assets/{preview-content-Bt1TcNSG.js → preview-content-DV5sFV9o.js} +1 -1
- package/dist/client/assets/{preview-dialog-QuWbcizM.js → preview-dialog-CD582B_r.js} +1 -1
- package/dist/client/assets/{preview-panel-BHVWqnx5.js → preview-panel-BxgHibuA.js} +1 -1
- package/dist/client/assets/{preview-tab-tyxCKhqI.js → preview-tab-ULIonVmC.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-2HDu0aVm.js → product-picker-dialog-DyKE58eB.js} +1 -1
- package/dist/client/assets/{profile-CyNnrVrl.js → profile-CuCEVON6.js} +1 -1
- package/dist/client/assets/project-app-view-CDYBe6LA.js +1 -0
- package/dist/client/assets/{project-apps-BWReKPEd.js → project-apps-1PIcY2fU.js} +1 -1
- package/dist/client/assets/{project-icon-DH181ON5.js → project-icon-lOdr7-bW.js} +1 -1
- package/dist/client/assets/{project-index-DJdMbgvn.js → project-index-DnzvcYr9.js} +1 -1
- package/dist/client/assets/project-reports-CAXpt4HL.js +1 -0
- package/dist/client/assets/project-tasks-BQyDwkep.js +1 -0
- package/dist/client/assets/{projects-31i0PwsS.js → projects-BzNvdAj8.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DFMppW3W.js → projects-empty-state-C50kQmxR.js} +1 -1
- package/dist/client/assets/{prompts-Ba_ATRu9.js → prompts-DYWwdVd5.js} +1 -1
- package/dist/client/assets/{record-editor-0Tx1_v8I.js → record-editor-BtPiEFZl.js} +1 -1
- package/dist/client/assets/{redirect-editor-BfchOu4t.js → redirect-editor-CSPQETPg.js} +1 -1
- package/dist/client/assets/reports-0rcav9J3.js +1 -0
- package/dist/client/assets/{reports-BE_n3WJk.js → reports-Bv-k3l8Z.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CgJu__YK.js → reports-onboarding-Cl8M6F_R.js} +1 -1
- package/dist/client/assets/{reports-tab-b2RlpEFn.js → reports-tab-eTrrOJiF.js} +2 -2
- package/dist/client/assets/repositories-CFYcSU_L.js +1 -0
- package/dist/client/assets/{repositories-tpe2RwmP.js → repositories-DjXcvvKn.js} +1 -1
- package/dist/client/assets/{repository-binding-DOWKMbHI.js → repository-binding-Z_PJssXg.js} +1 -1
- package/dist/client/assets/{repository-picker-TR2KC739.js → repository-picker-Ms6PvgtV.js} +1 -1
- package/dist/client/assets/{require-capability-BzHftBt7.js → require-capability-DgcGeKzj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DIKOlnAp.js → required-auth-layout-C2eHliL_.js} +1 -1
- package/dist/client/assets/{reset-password-Wb7HvzNe.js → reset-password-BcwahPOk.js} +1 -1
- package/dist/client/assets/{resizable-DAgqrae3.js → resizable-C-HNoLnr.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BjuG9u8a.js → resolve-tab-icon-DrkwPXhW.js} +1 -1
- package/dist/client/assets/{review-settings-BOPY1Icl.js → review-settings-_1imHTyn.js} +1 -1
- package/dist/client/assets/{role-color-HJokgczM.js → role-color-D2Bpci18.js} +1 -1
- package/dist/client/assets/{roles-DAHXDDc8.js → roles-D2CchlZ1.js} +1 -1
- package/dist/client/assets/{route-fmNu9Y2e.js → route-BHnz08YL.js} +1 -1
- package/dist/client/assets/{route-Bo8TfZ0r.js → route-BrONX68k.js} +1 -1
- package/dist/client/assets/route-LJXnhVhn.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-B6qzzFbP.js → sandbox-lifecycle-context-Do_X3N1Q.js} +1 -1
- package/dist/client/assets/{schema-D2LQQw_P.js → schema-C3iRMQDR.js} +1 -1
- package/dist/client/assets/{schema-Cr_W3Ejo.js → schema-DflsRwxx.js} +1 -1
- package/dist/client/assets/{scroll-area-C6_sUrpC.js → scroll-area-BjnkF9XV.js} +1 -1
- package/dist/client/assets/{search-input-CkfYzX_4.js → search-input-Dk-PX53Q.js} +1 -1
- package/dist/client/assets/{search-toggle-SyoEzk7o.js → search-toggle-KA6A8kEs.js} +1 -1
- package/dist/client/assets/{secret-picker-6gfx0PIf.js → secret-picker-B3ZqYPjh.js} +1 -1
- package/dist/client/assets/{secrets-CYXbderS.js → secrets-D8UbBg_V.js} +1 -1
- package/dist/client/assets/{section-array-field-DzN0sOy6.js → section-array-field-DTz67Y2Z.js} +1 -1
- package/dist/client/assets/{sections-editor-Cyc1q4ur.js → sections-editor-DI0biq8F.js} +1 -1
- package/dist/client/assets/{sections-Cet2GaYS.js → sections-r0ffiyN1.js} +1 -1
- package/dist/client/assets/{select-CaCnnAps.js → select-BYZPn2vc.js} +1 -1
- package/dist/client/assets/{select-model-B236ukdj.js → select-model-BNTqmjVq.js} +1 -1
- package/dist/client/assets/{seo-editor-2r__edg_.js → seo-editor-phk-cNbV.js} +1 -1
- package/dist/client/assets/{separator-Cq1oEAV9.js → separator-D2l0P7OD.js} +1 -1
- package/dist/client/assets/settings-tab-Bj09PR_D.js +1 -0
- package/dist/client/assets/{sheet-CgfMkJkk.js → sheet-BGkMUGZP.js} +1 -1
- package/dist/client/assets/{shell-layout-CkS9YSvj.js → shell-layout-C9pzHPCy.js} +1 -1
- package/dist/client/assets/{site-draft-actions-D7OJNSVO.js → site-draft-actions-CO6_hVyN.js} +1 -1
- package/dist/client/assets/{site-draft-view-CpE6eqx7.js → site-draft-view-B5Rpd0IB.js} +1 -1
- package/dist/client/assets/site-editor-toast-D_mo8TLM.js +1 -0
- package/dist/client/assets/site-editor-y5BHxD0w.js +1 -0
- package/dist/client/assets/{skills-vzYrLk2q.js → skills-C_ZaFX-W.js} +1 -1
- package/dist/client/assets/{slider-BUo3LEh2.js → slider-C6NJcOKc.js} +1 -1
- package/dist/client/assets/{sortable.esm-DZUKX3g6.js → sortable.esm-DkLzay3X.js} +1 -1
- package/dist/client/assets/{sso-Da3BBFEk.js → sso-aNPiZ-nK.js} +1 -1
- package/dist/client/assets/suggestion-XDtYV8VG.js +2 -0
- package/dist/client/assets/{super-agent-icon-B9hbG__1.js → super-agent-icon-CQ6xujSj.js} +1 -1
- package/dist/client/assets/{switch-CSQfbdA0.js → switch-aqNVrOiZ.js} +1 -1
- package/dist/client/assets/{synced-repos-ClWHK5mH.js → synced-repos-BevdaaXa.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DGdRBBFj.js → tab-icon-glyph-r819MRQJ.js} +1 -1
- package/dist/client/assets/{table-Do5Q-ybe.js → table-DkeWUhEA.js} +1 -1
- package/dist/client/assets/{tabs-UY_qfXkT.js → tabs-DdQ7zWRN.js} +1 -1
- package/dist/client/assets/{task-board-DfdsuuL-.js → task-board-P3oVDv96.js} +1 -1
- package/dist/client/assets/{task-route-DLXhcxnL.js → task-route-C_xiYnWJ.js} +1 -1
- package/dist/client/assets/{task-status-ORmQL9VH.js → task-status-DddMvcVZ.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D5YETO-h.js → taskboard-analytics-BEIrDYqd.js} +1 -1
- package/dist/client/assets/tasks-Di0UVLcT.js +1 -0
- package/dist/client/assets/{tasks-ZUsku0Sn.js → tasks-XsUVhM-J.js} +3 -3
- package/dist/client/assets/{textarea-Bhlc1rhY.js → textarea-Cfu8XQdh.js} +1 -1
- package/dist/client/assets/{thread-analytics-CUOQjb-2.js → thread-analytics-BlolJtDD.js} +1 -1
- package/dist/client/assets/{thread-intent-D_k-pawu.js → thread-intent-v870fhCT.js} +1 -1
- package/dist/client/assets/{thread-route-B8Y5c0rh.js → thread-route-CvlfcLbb.js} +1 -1
- package/dist/client/assets/{thread-route-BP_rLVAA.js → thread-route-GRPoLral.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DDIzp5Vi.js → thread-sheet-body-BfzpkGhR.js} +1 -1
- package/dist/client/assets/{time-range-picker-524ULj1s.js → time-range-picker-DZeWndYv.js} +1 -1
- package/dist/client/assets/{toggle-group-ViM2aXo0.js → toggle-group-BgRJSOhH.js} +1 -1
- package/dist/client/assets/{tool-namespace-CZhD1QHX.js → tool-namespace-nRSGF6tI.js} +1 -1
- package/dist/client/assets/{tool-set-selector-DDCkNBEl.js → tool-set-selector-B214xmA9.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BNq-FZTg.js → toolbar-icon-button-CDSVGpZE.js} +1 -1
- package/dist/client/assets/{tooltip-CKmg0cr7.js → tooltip-D4RVnddm.js} +1 -1
- package/dist/client/assets/{tooltipContext-DJ-bu_AF.js → tooltipContext-BXwqSkFH.js} +1 -1
- package/dist/client/assets/{track-UTndtUbf.js → track-B8JEMHvk.js} +1 -1
- package/dist/client/assets/{types-BNoZpJhV.js → types-BQSSBiIo.js} +1 -1
- package/dist/client/assets/{url-slug-DXHd23Qm.js → url-slug-DdVUOIRJ.js} +1 -1
- package/dist/client/assets/{usage-stats-Bd_jKdgA.js → usage-stats-BbCFi8o4.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dy2qKq-c.js → use-ai-providers-CF3gJxn2.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-D5eT3JPq.js → use-apply-named-rule-KXbxqT7_.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-sDCRGkVA.js +1 -0
- package/dist/client/assets/{use-automations-D6wZw1e0.js → use-automations-B-3A2umX.js} +1 -1
- package/dist/client/assets/{use-autosave-Ch2NSpoO.js → use-autosave-C6gNBer7.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-2B03tBP7.js +1 -0
- package/dist/client/assets/{use-chat-layout-state--45rT-ve.js → use-chat-layout-state-BrmTWqoG.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BoOF_-HD.js → use-cms-publish-actions-CIJ6zHNm.js} +3 -3
- package/dist/client/assets/{use-connect-companion-CwwZpYTZ.js → use-connect-companion-HZWizNOx.js} +1 -1
- package/dist/client/assets/use-connection-C5-uyAt3.js +1 -0
- package/dist/client/assets/{use-content-sync-BqMl-SDk.js → use-content-sync-B98fKQ39.js} +1 -1
- package/dist/client/assets/{use-copy-BH9CGszX.js → use-copy-DtaCyKxk.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Ce7nv8OR.js → use-date-fns-locale-mMKDMfq6.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B_WhYc20.js → use-debounced-autosave-BaLD9UYj.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CvXfSmyn.js → use-debounced-value-CkSIMvSM.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DWjWti03.js → use-deco-credits-CHzcLKoW.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CDPhmAAN.js → use-decopilot-events-DNjBbEST.js} +1 -1
- package/dist/client/assets/{use-delete-connection-rLQ-bKYo.js → use-delete-connection-d_sBLctd.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DXfttv5t.js → use-deployment-admin-CSAQGY_O.js} +1 -1
- package/dist/client/assets/{use-entitlements-BUjouq1Y.js → use-entitlements-CNt3pGa0.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Cnn72cB6.js → use-fast-preview-draft-url-7QxfEcUc.js} +1 -1
- package/dist/client/assets/{use-file-configs-B9qMFEGr.js → use-file-configs-C7s_koIb.js} +1 -1
- package/dist/client/assets/{use-id-selection-Ddv_u3et.js → use-id-selection-BGMDhEyc.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DW13LJyg.js → use-inbox-feed-Dv0lvbq1.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CxakbxgS.js → use-infinite-scroll-BZ3LS1DV.js} +1 -1
- package/dist/client/assets/{use-join-requests-DmzhnEci.js → use-join-requests-C42CNIpx.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-OQ4A9hsj.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-D545uZng.js → use-mcp-auth-status-WL287lkM.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CU2L24s0.js → use-mcp-client-B5xjs2K9.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DpK2reps.js → use-mcp-prompts-DEhNBwFv.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DosfGQ8x.js → use-mcp-tools-CtEmHoLl.js} +1 -1
- package/dist/client/assets/{use-mobile-8jTJxNX-.js → use-mobile-DLEV_nGJ.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DxdFuQ_c.js → use-move-blocks-BVhwg8WS.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-DbsMPucS.js +1 -0
- package/dist/client/assets/{use-org-fs-BtQY-xQ8.js → use-org-fs-BsN8VM5Z.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BxYtN8jM.js → use-org-repo-syncs-Ddabxxnq.js} +1 -1
- package/dist/client/assets/{use-org-sso-BDjJrxCz.js → use-org-sso-DvSOJZ_W.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C32cjrXo.js → use-organization-settings-BTNKvxbS.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-WoHGC8IW.js → use-project-native-view-presence-C_VTJOR2.js} +1 -1
- package/dist/client/assets/{use-project-scope-CzvPVO9m.js → use-project-scope-DYHM9a74.js} +1 -1
- package/dist/client/assets/{use-recent-apps-C70YR4qH.js → use-recent-apps-BwkYdV8J.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Bf3vjylM.js → use-reports-diagnostic-DxprW3FU.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-7-fLrTMJ.js → use-sandbox-events-BmsgjLgS.js} +1 -1
- package/dist/client/assets/{use-secrets-BlJhGBSI.js → use-secrets-9rv-ZTFT.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BIuAmj_g.js → use-section-preview-base-BXQtliBp.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DZVmbSWr.js → use-sidebar-collapsed-iSryvG4A.js} +1 -1
- package/dist/client/assets/{use-tags-Cnuk2dlj.js → use-tags-CTHOEC1c.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DwYWlRcM.js → use-task-board-analytics-CJkqrRST.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BHvdCTkN.js → use-task-board-events-CTeANaje.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CxV10EKA.js → use-task-board-item-prs-DViaWzzx.js} +1 -1
- package/dist/client/assets/{use-task-board-items-Cgj8_BfM.js → use-task-board-items-Bb0LBUTU.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-BSuuBCmb.js → use-task-board-prompts-DDA-l1V3.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Djv9mzpW.js → use-task-metadata-4UYb5uTu.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-B82qJYY6.js → use-thread-outputs-CJJmQUoi.js} +1 -1
- package/dist/client/assets/{use-voice-input-DNj7vd9z.js → use-voice-input-C35dv3A1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3nmwRd2.js +1 -0
- package/dist/client/assets/{useQueries-DFXnDWAo.js → useQueries-DZSM8cCd.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BHZshmPL.js +1 -0
- package/dist/client/assets/{users-BT3VCaoh.js → users-Q-FJAOp2.js} +1 -1
- package/dist/client/assets/{utils-CaKh8ISH.js → utils-DsmWCt7e.js} +1 -1
- package/dist/client/assets/{variant-calendar-DQM6WWEC.js → variant-calendar-o3Pktueb.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DJmy2Bwl.js → variant-matcher-override-YE4lbHNL.js} +1 -1
- package/dist/client/assets/{view-header-Da0TRSut.js → view-header-D5ldHG8R.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BLhbBj3g.js → virtual-mcp-DFlO2tW2.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-lW9b9_hM.js → watch-sse-pool-CxFrglEk.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +676 -676
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-DgNwUxHe.js +0 -1
- package/dist/client/assets/agent-app-tZ7osM--.js +0 -1
- package/dist/client/assets/agent-deck-VahyZcsX.js +0 -1
- package/dist/client/assets/agent-experiments-BSEXxjSj.js +0 -1
- package/dist/client/assets/agent-library-CGg_KWMi.js +0 -1
- package/dist/client/assets/agent-library-file-lYvplSEG.js +0 -1
- package/dist/client/assets/agent-overview-BSloChkB.js +0 -1
- package/dist/client/assets/agent-settings-BcalFi59.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DASkKQTm.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BT3P7Fgk.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DPHEzCVq.js +0 -1
- package/dist/client/assets/agent-view-BHSLybsi.js +0 -1
- package/dist/client/assets/api-keys-1ftOr4jE.js +0 -1
- package/dist/client/assets/blocks-tab-states-7fd3YmUI.js +0 -1
- package/dist/client/assets/chart-vlFPDMF3.js +0 -13
- package/dist/client/assets/cms-store-drafts-usYzPqQo.js +0 -1
- package/dist/client/assets/library-J7TYx4da.js +0 -1
- package/dist/client/assets/project-app-view-unEGL71X.js +0 -1
- package/dist/client/assets/project-reports-5RjNN5dh.js +0 -1
- package/dist/client/assets/project-tasks-u14l25cn.js +0 -1
- package/dist/client/assets/reports-C-nEVqyN.js +0 -1
- package/dist/client/assets/repositories-Cr4YJltZ.js +0 -1
- package/dist/client/assets/route-CYWUUsoK.js +0 -1
- package/dist/client/assets/settings-tab-BFgPTT8v.js +0 -1
- package/dist/client/assets/site-editor-BliSF1HI.js +0 -1
- package/dist/client/assets/site-editor-toast-B1r9KPgS.js +0 -1
- package/dist/client/assets/suggestion-CbiVJhLZ.js +0 -2
- package/dist/client/assets/tasks-DUX6R8fb.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Ds_a2eir.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-B7yRGBZv.js +0 -1
- package/dist/client/assets/use-connection-CL03pbmH.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-CBKdXvqC.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-B0fVaV8h.js +0 -1
- package/dist/client/assets/useInfiniteQuery-8WTGmXox.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B5sH0yes.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,cE as T,cA as ce,j as b,cG as _,cT as ae,ew as O,cH as C,cN as P,cI as ie,c as F,m as $}from"./index-h1XTCueR.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,v]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),m=T(e,E=>c(E)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:m,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=v(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=v(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return R(o.viewport,c),R(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=v(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(me,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),me=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[ve,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=v(g,o),[w,A]=d.useState(null),Y=T(e,m=>A(m)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(m){if(x.current){const p=m.clientX-x.current.left,E=m.clientY-x.current.top;u({x:p,y:E})}}return d.useEffect(()=>{const m=p=>{const E=p.target;w?.contains(E)&&D(p,j)};return document.addEventListener("wheel",m,{passive:!1}),()=>document.removeEventListener("wheel",m,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),R(w,N),R(S.content,N),b.jsx(ve,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,m=>{m.button===0&&(m.target.setPointerCapture(m.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(m))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=v(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=v(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=v(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return R(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),R(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function R(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Ee=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] transition-[color,box-shadow] focus-ring",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Re,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Ee,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Re(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
1
|
+
import{r as d,cE as T,cA as ce,j as b,cG as _,cT as ae,ev as O,cH as C,cN as P,cI as ie,c as F,m as $}from"./index-DLrFWx5Y.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,v]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),m=T(e,E=>c(E)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:m,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=v(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=v(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return R(o.viewport,c),R(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=v(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(me,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),me=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[ve,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=v(g,o),[w,A]=d.useState(null),Y=T(e,m=>A(m)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(m){if(x.current){const p=m.clientX-x.current.left,E=m.clientY-x.current.top;u({x:p,y:E})}}return d.useEffect(()=>{const m=p=>{const E=p.target;w?.contains(E)&&D(p,j)};return document.addEventListener("wheel",m,{passive:!1}),()=>document.removeEventListener("wheel",m,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),R(w,N),R(S.content,N),b.jsx(ve,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,m=>{m.button===0&&(m.target.setPointerCapture(m.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(m))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=v(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=v(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=v(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return R(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),R(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function R(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Ee=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] transition-[color,box-shadow] focus-ring",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Re,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Ee,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Re(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,j as a,cu as j,h as I,cv as S,cw as g}from"./index-
|
|
1
|
+
import{c as f,j as a,cu as j,h as I,cv as S,cw as g}from"./index-DLrFWx5Y.js";import{i as v}from"./SearchMd-DYX8MZiO.js";function w(x){const e=f.c(14),{value:r,onChange:l,placeholder:h,onKeyDown:c,className:i,isSearching:p,disabled:u}=x,m=h===void 0?"Search...":h;let s;e[0]!==p?(s=a.jsx(j,{className:"pr-0",children:p?a.jsx(I,{className:"size-4"}):a.jsx(v,{})}),e[0]=p,e[1]=s):s=e[1];let t;e[2]!==l?(t=d=>l(d.target.value),e[2]=l,e[3]=t):t=e[3];let n;e[4]!==u||e[5]!==c||e[6]!==m||e[7]!==t||e[8]!==r?(n=a.jsx(S,{type:"text",value:r,onChange:t,onKeyDown:c,placeholder:m,disabled:u}),e[4]=u,e[5]=c,e[6]=m,e[7]=t,e[8]=r,e[9]=n):n=e[9];let o;return e[10]!==i||e[11]!==s||e[12]!==n?(o=a.jsxs(g,{size:"sm",className:i,children:[s,n]}),e[10]=i,e[11]=s,e[12]=n,e[13]=o):o=e[13],o}export{w as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,m as B,j as a,b1 as M}from"./index-
|
|
1
|
+
import{c as K,r as C,m as B,j as a,b1 as M}from"./index-DLrFWx5Y.js";import{i as I}from"./SearchMd-DYX8MZiO.js";import{I as O}from"./icon-button-zoxb5UGy.js";function G(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,_=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"outline",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const k=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==k?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground shadow-edge",k,j),e[4]=j,e[5]=k,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const y=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==y||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:y,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=y,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==_||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":_,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=_,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{G as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,aw as d,b as j,j as i}from"./index-
|
|
1
|
+
import{c as x,aw as d,b as j,j as i}from"./index-DLrFWx5Y.js";import{t as E}from"./Users01-DZO5qwDg.js";const R=/^[A-Za-z0-9_.-]+$/;function b(f){const e=x.c(15),{field:p,secretById:t}=f,s=j(),n=p.value||"";if(!n)return null;let l;e[0]!==n||e[1]!==t?(l=t.get(n),e[0]=n,e[1]=t,e[2]=l):l=e[2];const c=l;if(!c){let a;e[3]!==n||e[4]!==s?(a=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=a):a=e[5];let u;return e[6]!==a?(u=i.jsx("span",{className:"text-destructive",children:a}),e[6]=a,e[7]=u):u=e[7],u}let o;e[8]!==c.scope?(o=i.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=i.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=i.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(f){const e=x.c(2),{scope:p}=f,t=p==="user"?d:E;let s;return e[0]!==t?(s=i.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{b as S,R as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as N,j as s,n as C,
|
|
1
|
+
import{c as j,b as N,j as s,n as C,hi as F,R as k,r as y,bC as L,B as D,aw as O,af as T,D as B,v as R,w as A,x as I,aS as q,I as _,y as V,t as z,g1 as H}from"./index-DLrFWx5Y.js";import{i as G}from"./AlertCircle-r3-65QGa.js";import{s as J}from"./Plus-Dhutz31g.js";import{t as K}from"./Users01-DZO5qwDg.js";import{E as M}from"./empty-state-DB3KUDYc.js";import{L as w}from"./label-DzXAppDM.js";import{S as Q,b as U,a as W,d as X,c as P}from"./select-BYZPn2vc.js";import{T as Y}from"./textarea-Cfu8XQdh.js";import{u as Z,a as ee}from"./use-secrets-9rv-ZTFT.js";import{R as te}from"./require-capability-DgcGeKzj.js";import"./index-BdQq_4o_.js";import"./index-D-pfNS-S.js";import"./ChevronUp-BjA2VknT.js";import"./access-gate-DIjds3ci.js";import"./capability-load-error-B5mCDF3r.js";function se(t){const e=j.c(6),{error:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(G,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function re(t){const e=j.c(8),{scope:r}=t,i=N(),c=r==="user"?O:K;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let m;return e[5]!==l||e[6]!==a?(m=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=m):m=e[7],m}function $(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(T,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let m;e[10]!==l||e[11]!==a?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=m):m=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let u;e[15]!==d?(u=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=u):u=e[16];let x;return e[17]!==m||e[18]!==u?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=x):x=e[19],x}function ne(t){const e=j.c(9),{action:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T,{}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==i?(l=i("settings.secrets.emptyDescription"),e[3]=i,e[4]=l):l=e[4];let a;return e[5]!==r||e[6]!==n||e[7]!==l?(a=s.jsx(H,{children:s.jsx(M,{size:"inline",icon:c,title:n,description:l,children:r})}),e[5]=r,e[6]=n,e[7]=l,e[8]=a):a=e[8],a}function E({open:t,onOpenChange:e}){const r=N(),[i,c]=y.useState("organization"),[n,l]=y.useState(""),[a,m]=y.useState(""),[d,u]=y.useState(""),x=ee();function g(){c("organization"),l(""),m(""),u("")}function p(){g(),e(!1)}async function S(o){if(o.preventDefault(),!(!n.trim()||!a))try{await x.mutateAsync({scope:i,name:n.trim(),value:a,description:d.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){z.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(B,{open:t,onOpenChange:o=>{o?e(o):p()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(Q,{value:i,onValueChange:o=>c(o),children:[s.jsx(U,{id:"secret-scope",children:s.jsx(W,{})}),s.jsxs(X,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(_,{id:"secret-name",value:n,onChange:o=>l(o.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(_,{id:"secret-value",type:"password",value:a,onChange:o=>m(o.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Y,{id:"secret-description",value:d,onChange:o=>u(o.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!a,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=j.c(34),e=N(),r=Z(),[i,c]=y.useState(!1);let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),l=s.jsx(J,{size:14}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let a;t[2]!==e?(a=e("settings.secrets.newSecret"),t[2]=e,t[3]=a):a=t[3];let m;t[4]!==a?(m=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[l,a]})}),t[4]=a,t[5]=m):m=t[5];const d=m;if(r.length===0){let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ne,{action:!1}),t[6]=o):o=t[6];let f;t[7]!==i?(f=s.jsx(E,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,o,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let u,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const o=r.filter(oe),f=r.filter(ae),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let b;t[18]!==r.length||t[19]!==e||t[20]!==h?(b=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=b):b=t[21];let v;t[22]!==b?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),t[22]=b,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=u):u=t[26],x=o.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:o.map(le)})]}):null,g=f.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ce)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=u,t[16]=x,t[17]=g}else u=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(E,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let S;return t[29]!==u||t[30]!==x||t[31]!==g||t[32]!==p?(S=s.jsxs(s.Fragment,{children:[u,x,g,p]}),t[29]=u,t[30]=x,t[31]=g,t[32]=p,t[33]=S):S=t[33],S}function ce(t){return s.jsx($,{secret:t},t.id)}function le(t){return s.jsx($,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function me(){const t=j.c(7),e=N();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(k,{fallback:de,children:s.jsx(y.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs(F,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function de(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function _e(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(me,{})}),t[0]=e):e=t[0],e}export{_e as default};
|
package/dist/client/assets/{section-array-field-DzN0sOy6.js → section-array-field-DTz67Y2Z.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bB as g,c7 as E,
|
|
1
|
+
import{bB as g,c7 as E,fz as w,fd as D,fA as A,bG as y,fB as L,bM as d,bZ as P,bF as T,bX as k,bD as j,bY as B,fC as R,b6 as x,bS as C,b_ as K}from"./index-DLrFWx5Y.js";import{D as I,r as F,A as U,Y as W,ad as Y}from"./blocks-tab-states-5fAC-Jvu.js";const l="https://docs.decocms.com/storefront/blocks",ne={quickstart:`${l}/next/quickstart`,siteEditor:`${l}/next/site-editor#edit-on-your-machine`,serve:`${l}/next/cli#deco-serve`,schema:`${l}/next/cli#deco-schema-and-deco-content`,troubleshooting:`${l}/next/troubleshooting#site-editor`},ae="https://github.com/decocms/blocks/tree/main/.agents/skills/deco-site-workflow";function $(e){return e.includes("matchers")||e.includes("Match")}function m(e,r){const t=e.__resolveType;return typeof t!="string"||!t||W(t,r)?!1:r?w(r,t):$(t)}function oe(e,r){const t=[];for(const[n,a]of Object.entries(r)){if(n.includes("/")||!g(n,e)||E(n)||!a||typeof a!="object"||Array.isArray(a))continue;const o=a;m(o,e)&&t.push({blockKey:n,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return t.sort((n,a)=>(n.name??n.blockKey).localeCompare(a.name??a.blockKey))}function p(e,r,t){if(!e)return!1;const n=e.__resolveType;if(typeof n!="string"||!g(n,t)||!Object.hasOwn(r,n))return!1;const a=r[n];return!a||typeof a!="object"||Array.isArray(a)?!1:m(a,t)}function se(e,r,t){return p(e,r,t)?e?.__resolveType??null:null}function S(e,r,t){if(!e)return null;const n=e.__resolveType??"";if(!n)return null;if(p(e,r,t)){const s=r[n]??{},i=s.__resolveType??n,{__resolveType:c,name:u,...v}=s;return{resolveType:i,data:v,blockKey:n}}const{__resolveType:a,...o}=e;return{resolveType:n,data:o}}function q(e,r,t){const n=S(e,r,t);return n?{__resolveType:n.resolveType,...n.data}:{__resolveType:""}}function ie(e,r,t){if(e)return p(e,r,t)?q(e,r,t):e}function z(e,r,t,n){if(!e)return"Default";if(p(e,r,n)){const a=e.__resolveType??"",o=r[a];return I(a,o)}return t(e,F(r))}function ce(e,r,t){return{__resolveType:e,...r,name:t}}function ue(e){return{__resolveType:e}}function le(e,r,t){const n=S(e,r,t);return n?{resolveType:n.resolveType,formValue:n.data}:{resolveType:"",formValue:{}}}function fe(e,r){const t={__resolveType:e};if(!e||!r)return t;const n=U(e,r),a=n?.type==="inline-union"?n.inlineUnionBranches?.[0]?.discriminators:void 0;return a?{...t,...a}:t}function V(e){const r=[];for(let t=e;t?.key!=null;t=t.parent)r.push(t.key);return r.reverse()}function G(e){return{blockKey:e.blockKey,path:V(e)}}function N(e,r,t){const n=[];for(const[o,s]of Object.entries(e))o!==r&&n.push({node:s,blockKey:o,parent:null,key:null});const a=new Set;for(;n.length>0;){const o=n.pop(),{node:s}=o;if(!(!s||typeof s!="object")&&!a.has(s)){if(a.add(s),Array.isArray(s)){s.forEach((i,c)=>{n.push({node:i,blockKey:o.blockKey,parent:o,key:c})});continue}t(s,o);for(const[i,c]of Object.entries(s))n.push({node:c,blockKey:o.blockKey,parent:o,key:i})}}}function H(e,r,t){if(!r)return[];const n=[];return N(e,r,(a,o)=>{if(a.__resolveType!==r||!p(a,e,t))return;const s=X(o);n.push({...G(o),...s?{variant:s}:{}})}),n}function X(e){for(let r=e;r;r=r.parent){const t=r.parent,n=t?.parent,a=n?.parent;if(!t||!n||!a)return;if(r.key==="rule"&&typeof t.key=="number"&&n.key==="variants"&&Y(a.node)&&D(a.node.__resolveType)){const o=a.node.experiment;return{containerPath:V(a),containerType:a.node.__resolveType,index:t.key,...typeof o=="string"?{experiment:o}:{}}}}}function Z(e){for(const r of e.anyOfRefs??[]){if(r.resolveType!==A&&r.resolveType!==y)continue;const t=r.schema?.properties?.variants?.items?.properties?.value,n=t?.lazy?t.properties?.value:t;if(n?.type==="array")return n}}function J(e){return Z(e)!==void 0}function ye(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return Array.isArray(t.variants)?t.__resolveType===R?!0:r&&t.__resolveType===y&&!M(t.variants):!1}function M(e){return e.some(r=>Array.isArray(d(r)))}function O(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return t.__resolveType===A?!0:r&&t.__resolveType===y&&Array.isArray(t.variants)&&M(t.variants)}function pe(e,r){if(!O(e,r))return null;const t=e.variants;if(!Array.isArray(t))return null;const n=x(t[0],r);return Array.isArray(n)?n:null}function ve(e,r,t,n){if(!O(e,n))return r;const a=structuredClone(e),o=[...a.variants??[]];return o.length===0?o.push({rule:k(t),value:T(a.__resolveType,r)}):o[0]=C(a.__resolveType,o[0],r),{...a,variants:o}}function de(e,r){const n=e[r]?.sections;if(!n||Array.isArray(n))return 1;const a=n;return Array.isArray(a.variants)?a.variants.length:1}function _e(e,r,t){const a=e[r]?.sections;if(Array.isArray(a))return t===0?a:[];if(a&&typeof a=="object"){const o=a.variants;if(Array.isArray(o)){const s=d(o[t]);return Array.isArray(s)?s:[]}}return[]}function be(e,r,t){if(Array.isArray(e))return[{label:"Default",sections:e}];if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.variants)){const a=n.variants,o=L(a.map(s=>z(s.rule,r,t)));return a.map((s,i)=>{const c=o[i],u=d(s);return{label:c||`Variant ${i+1}`,sections:Array.isArray(u)?u:[],rule:s.rule}})}}return[]}function _(e,r,t){return{rule:k(r),value:T(t,e)}}function b(e,r){return e?e.__resolveType===y?y:A:j(r)}function f(e,r,t){return{...r,__resolveType:b(r,t),variants:e}}function he(e,r,t,n=!1){const a=structuredClone(r);if(e&&typeof e=="object"&&!Array.isArray(e)){const c=e;if(!Array.isArray(c.variants))return null;const u=[...c.variants],v=P(u,n);return u.splice(v,0,_(a,t,b(c))),{sections:f(u,c),newVariantIndex:v}}const o=b(void 0,t),s=_(Array.isArray(e)?e:[],t,o),i=_(a,t,o);return{sections:f(n?[i,s]:[s,i],void 0,t),newVariantIndex:n?0:1}}function Ae(e,r,t=!1){const n=e[r];if(!n)return null;const a=[...e];return a.splice(K(e,r,t),0,structuredClone(n)),a}function ge(e,r){if(r.length===0)return f([],e);if(r.length===1){const t=r[0],n=t?.rule;if(!B(n))return f(r,e);const a=d(t);if(Array.isArray(a))return a}return f(r,e)}function Q(e,r,t){return H(e,r,t).length}function Te(e,r,t,n){return n?!1:Q(e,r,t)===0}const ke={claiming:{long:"Reserving sandbox",short:"Reserving sandbox"},"waiting-for-capacity":{long:"Waiting for cluster capacity",short:"Waiting for capacity"},"pulling-image":{long:"Downloading sandbox image",short:"Downloading image"},"starting-container":{long:"Starting your sandbox",short:"Starting container"},"warming-daemon":{long:"Connecting to your sandbox",short:"Connecting to sandbox"}};function h(e){return e.includes("/sections/")||e.includes("multivariate/section")||e===R}function ee(e){if(e.anyOfRefs?.length)return e.anyOfRefs.some(t=>h(t.resolveType));const r=e.properties?.__resolveType;return r?.type==="block-ref"&&r.anyOfRefs?.length?r.anyOfRefs.some(t=>h(t.resolveType)):!1}function Re(e){return e.type!=="block-ref"||!e.anyOfRefs?.length?!1:e.anyOfRefs.some(r=>h(r.resolveType))}function me(e,r){if(r==="global"||r==="sections"||J(e))return!0;const t=e.type==="array"?e.items:void 0;return t?ee(t):!1}export{Te as A,Ae as B,ke as C,ae as D,de as a,he as b,me as c,q as d,ue as e,Re as f,_e as g,z as h,J as i,se as j,le as k,oe as l,p as m,ce as n,ye as o,be as p,O as q,ie as r,fe as s,Z as t,pe as u,ne as v,ve as w,h as x,S as y,ge as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i1 as ei,bf as ti,c as wn,b as Rn,r as b,m as le,j as r,bR as ni,b7 as Cs,i2 as Da,B as It,Y as an,at as si,_ as ri,be as ai,Z as oi,q as ii,hz as li,i3 as ci,i4 as ui,h as di,bg as wt,i5 as Jr,i6 as bs,i7 as fi,i8 as pt,i9 as Yr,ia as mi,bu as pi,ib as hi,ic as Qr,id as gi,t as W,b$ as Xr,ie as vi,ig as Bt,ih as yi,ii as Si,ij as bi,b_ as Zr,ik as xs,il as xi,im as _i,io as ki,bY as wi,bv as Ri,ip as ji,iq as Ei,bU as Vi,K as Ti,ir as ea,fd as Ai,bm as Wn,bs as ta,is as na,it as Ni,iu as Ci,iv as Pi,iw as _s,ix as Bi,iy as Di,iz as Ki,iA as sa,iB as Mi,iC as Fi,bS as ra,iD as Ii,iE as Li,bp as aa,iF as Oi,bX as zi}from"./index-h1XTCueR.js";import{u as $i}from"./chat-context--sx_tT3a.js";import{a6 as Hi,Q as Zn,a7 as Wi,a8 as qi,a9 as Gi,aa as Ui,ab as Ji,ac as Yi,ad as oa,ae as Qi,af as Xi,A as Jn,y as Yn,d as Zi,u as el,ag as ia,i as tl,ah as nl,k as sl,h as rl,ai as Ka,p as kn,aj as al,ak as ol,w as la,al as il,am as ll,an as qn,ao as ca,ap as ua,aq as da,ar as ks,as as cl,F as ul,at as dl,z as fl,au as fa,av as ml,aw as ma,ax as pa,ay as ha,M as pl,az as ga,a as hl,aA as on,aB as gl,aC as vl,v as Gn,a5 as xn}from"./parse-sections-ki2R7CT5.js";import{b as yl}from"./repository-binding-DOWKMbHI.js";import{n as Sl,t as bl}from"./ChevronUp-Dsr9gtxU.js";import{a7 as Ma,b as Xn,am as xl,e as _l,F as kl,a1 as va,Y as ya}from"./agent-icon-DYPj-9S0.js";import{S as ln}from"./scroll-area-C6_sUrpC.js";import{c as Rt,T as jt,a as Et}from"./tooltip-CKmg0cr7.js";import{k as wl,u as Rl,m as jl,l as El,ak as Vl,S as Tl,t as Sa,b0 as ba,au as Dt,av as Kt,a5 as Al,b1 as Nl,b2 as Cl,aU as xa,a8 as Pl,ag as Bl}from"./site-editor-toast-B1r9KPgS.js";import{u as Dl,ao as _a,e as ka,j as Kl,D as Ml,A as Un,a3 as Fl,ae as Il,aj as Ll}from"./blocks-tab-states-7fd3YmUI.js";import{m as Ol,u as zl,P as $l}from"./mustache-BGmZfDW9.js";import{a as Es,e as Fa}from"./UserSquare-YXEd-AbI.js";import{i as wa,s as Ra}from"./Tool01-D9z5UHl1.js";import{s as Hl}from"./Plus-sBQQfz_j.js";import{s as Wl}from"./Trash01-C3vHEhEb.js";import{i as Vs}from"./Zap-CO42SvK0.js";import{u as ql,a as ja,K as Gl,P as Ul,b as Jl,C as Yl,D as Ql,c as Xl}from"./core.esm-BcKT6bZa.js";import{u as Zl,s as ec,a as Qn,S as tc,v as nc}from"./sortable.esm-DZUKX3g6.js";import{s as sc,g as rc,u as ac,A as oc}from"./use-section-preview-base-BIuAmj_g.js";import{u as ic,a as lc,P as Ea,w as cc,b as uc}from"./seo-editor-2r__edg_.js";import{R as dc,y as ws,T as Va,x as fc,U as mc}from"./hosted-reconcile-DBZyiSDy.js";import{u as pc}from"./use-apply-named-rule-D5eT3JPq.js";import{m as Jt,d as Ts,y as As,n as Ft,e as cn,q as hc,k as Ut,r as Rs,j as Mt,h as _n,b as gc,s as Ta,z as vc,A as yc,B as Sc}from"./section-array-field-DzN0sOy6.js";import{b as Aa,a as bc}from"./variant-matcher-override-DJmy2Bwl.js";import"./autosend-ChY4eKzU.js";import"./thread-route-B8Y5c0rh.js";import"./use-project-scope-CzvPVO9m.js";import"./thread-intent-D_k-pawu.js";import"./use-mcp-client-CU2L24s0.js";import"./auth-CGSiE6Ch.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-lW9b9_hM.js";import"./task-board-DfdsuuL-.js";import"./schema-D2LQQw_P.js";import"./use-entitlements-BUjouq1Y.js";import"./use-ai-providers-Dy2qKq-c.js";import"./use-decopilot-events-CDPhmAAN.js";import"./use-organization-settings-C32cjrXo.js";import"./utils-CaKh8ISH.js";import"./Play-o5_wqCmk.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DclsAW7v.js";import"./LinkBroken01-Bu5CIeMz.js";import"./collapsible-CAWr0Uf-.js";import"./use-copy-BH9CGszX.js";import"./usage-stats-Bd_jKdgA.js";import"./tool-namespace-CZhD1QHX.js";import"./form-BFewkYbP.js";import"./label-7Sx3Bd-m.js";import"./utils-CVEq3hMx.js";import"./markdown-C5fMrlG3.js";import"./use-mobile-8jTJxNX-.js";import"./shell-layout-CkS9YSvj.js";import"./Globe04-DOLChRWZ.js";import"./use-deployment-admin-DXfttv5t.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-UU_Qx1D3.js";import"./CheckCircle-CEPNyqYQ.js";import"./Monitor01-BeH9O99T.js";import"./command-CSPHvNyT.js";import"./index-CP9rTnyG.js";import"./SearchMd-CBPTYB4H.js";import"./integration-icon-BX--0-gC.js";import"./project-icon-DH181ON5.js";import"./use-navigate-to-agent-B0fVaV8h.js";import"./use-debounced-value-CvXfSmyn.js";import"./new-project-dialog-BU-wxed9.js";import"./ArrowLeft-CB426JlK.js";import"./repository-picker-TR2KC739.js";import"./github-icon-C2RYJxpH.js";import"./useInfiniteQuery-8WTGmXox.js";import"./infiniteQueryObserver-CHwNipYb.js";import"./collection-search-CXkzfc9r.js";import"./ShoppingBag01-C88ytSQP.js";import"./legacy-admin-welcome-dialog-DP-92Dz3.js";import"./drawer-2P1ke0v5.js";import"./required-auth-layout-DIKOlnAp.js";import"./use-org-sso-BDjJrxCz.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BHQzXoMa.js";import"./types-BNoZpJhV.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-Y_OUILZ3.js";import"./sheet-CgfMkJkk.js";import"./use-connection-CL03pbmH.js";import"./use-mcp-prompts-DpK2reps.js";import"./use-thread-outputs-B82qJYY6.js";import"./file-type-icon-DYMrEOTS.js";import"./switch-CSQfbdA0.js";import"./textarea-Bhlc1rhY.js";import"./ChevronSelectorVertical-DClPI-qU.js";import"./popover-CseyhIeF.js";import"./monaco-editor-Dn3JUtr6.js";import"./editor-BXgkmrWx.js";import"./calendar-BGDDe831.js";import"./SwitchHorizontal01-BXlvEeQ4.js";import"./Minus-cqn26HtL.js";import"./select-CaCnnAps.js";import"./index-BdQq_4o_.js";import"./index-B6nB1oBs.js";import"./editor-classes-CntBx7_T.js";import"./toggle-group-ViM2aXo0.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-DU-BWR6s.js";import"./Upload01-RcrRUOsi.js";import"./search-input-CkfYzX_4.js";import"./tabs-UY_qfXkT.js";import"./use-file-configs-B9qMFEGr.js";import"./asset-utils-BIz1znAk.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-voice-input-DNj7vd9z.js";import"./index-DAS_1BE2.js";import"./checkbox-CZnP9NXa.js";import"./Key01-CcC-DNfV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-Cp2Ml2vf.js";import"./CreditCard01-D6m8lGLv.js";import"./Sun-9dowJ77Q.js";import"./Users01-CC5oUscX.js";import"./use-sandbox-events-7-fLrTMJ.js";import"./use-blocks-v8-project-B7yRGBZv.js";import"./empty-state-B1eFFEza.js";import"./slider-BUo3LEh2.js";import"./index-B6WkvUi4.js";import"./tooltipContext-DJ-bu_AF.js";import"./CategoricalChart-DsdW4Q1n.js";import"./index-BXjAEYmT.js";import"./use-move-blocks-DxdFuQ_c.js";const xc={escape:Hi};function _c(v,e){for(const p of sc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function kc(v,e){if(!e)return;const p=ei(v,ti(e));if(p)try{const S=_c(p.resolveType,e);return S&&Ol.render(S,p.data,{},xc).trim()||void 0}catch{return}}function wc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{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(Et,{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(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Rc="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 Na(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Ia(v){return v.map((e,p)=>({...e,index:p}))}function jc(v,e){if(e===v.length)return v;if(e<v.length)return Ia(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 La(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=Rn(),_=Zn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let X;e[0]!==x||e[1]!==S?(X=S&&x?rc(S,x):void 0,e[0]=x,e[1]=S,e[2]=X):X=e[2];const ge=X;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?kc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=Yi(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Xn:k?Ma:Fa;let G;e[16]!==k||e[17]!==P?(G=P?{color:ai}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Xi,{"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(xl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const Z=Le??p.label;let ze;e[30]!==Ee||e[31]!==Z?(ze=r.jsx("span",{className:Ee,children:Z}),e[30]=Ee,e[31]=Z,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(wc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(oa,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(oa,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Ec="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Vc="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 Oa(v,e,p){if(p)return Qi({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return le("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?Ec:x?Vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function js(v,e){return le("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 Tc(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:X,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=Rn(),c=Zn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Da(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Cc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:Z,transform:ze,isDragging:nt}=Zl(Oe);let Pe;e[4]!==ze?(Pe=Yl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let ue;e[6]!==Pe||e[7]!==st?(ue={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=ue):ue=e[8];const g=ue;let we;e[9]!==p?(we=qi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,at="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Ze=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Ze?(A=le("touch-none transition-colors",Ze,Oa(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Ze,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Ye=r.jsx(La,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Ye):Ye=e[22];const H=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(js(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Nc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ot=c?r.jsx(Gi,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(wa,{className:"h-3.5 w-3.5"}):r.jsx(Ra,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(js(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Ac,children:G?r.jsx(wa,{className:"h-3.5 w-3.5"}):r.jsx(Ra,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),de=ri,Qe=Ui;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(js(_e,!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 $e;e[25]!==Qe||e[26]!==ve||e[27]!==it?($e=r.jsx(Qe,{label:ve,classicClassName:it}),e[25]=Qe,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(si,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let De;e[35]!==X?(De=F=>{F.stopPropagation(),X()},e[35]=X,e[36]=De):De=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(_l,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Q;e[38]!==w?(Q=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Q):Q=e[39];let ee;e[40]!==De||e[41]!==Q?(ee=r.jsxs(an,{onClick:De,children:[se,Q]}),e[40]=De,e[41]=Q,e[42]=ee):ee=e[42];let K;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(K=ke&&r.jsxs(an,{className:le(!c&&Ji),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Ma,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=K):K=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(an,{className:le(!c&&Rc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Xn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let fe;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(fe=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Fa,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=fe):fe=e[58];let He;e[59]!==k?(He=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=He):He=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Wl,{className:"h-4 w-4"}),e[61]=et):et=e[61];let Ke;e[62]!==w?(Ke=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=Ke):Ke=e[63];let $;e[64]!==He||e[65]!==Ke?($=r.jsxs(an,{variant:"destructive",onClick:He,children:[et,Ke]}),e[64]=He,e[65]=Ke,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==K||e[70]!==T||e[71]!==fe||e[72]!==$?(ie=r.jsxs(oi,{align:"end",className:"w-44",children:[Be,ee,K,T,fe,$]}),e[67]=Be,e[68]=ee,e[69]=K,e[70]=T,e[71]=fe,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==de||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(de,{children:[$e,ie]}),e[74]=de,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==Z||e[82]!==g||e[83]!==A||e[84]!==Ye||e[85]!==H||e[86]!==ot||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:Z,style:g,...u,...Ee,role:at,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Ye,H,ot,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=Z,e[82]=g,e[83]=A,e[84]=Ye,e[85]=H,e[86]=ot,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Ac(v){return v.stopPropagation()}function Nc(v){return v.stopPropagation()}function Cc(){return!1}function Ns(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=Rn();let _;e[0]!==x?(_=le("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(Hl,{size:14}),e[2]=k):k=e[2];let X;e[3]!==C?(X=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=X):X=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==X?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,X]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=X,e[10]=ge):ge=e[10],ge}function Pc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:X,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=Rn(),I=Zn();let ke;e[0]!==x.length?(ke=()=>Na(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[Z,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);Z!==p?(ze(p),Pe(x.length),Oe(Na(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>jc(tt,x.length)));let ue;e[2]===Symbol.for("react.memo_cache_sentinel")?(ue={activationConstraint:{distance:8}},e[2]=ue):ue=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:ec},e[3]=g):g=e[3];const we=ql(ja(Ul,ue),ja(Gl,g));let rt;e[4]!==d?(rt=d.map(Bc),e[4]=d,e[5]=rt):rt=e[5];const at=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Ze;e[7]!==at||e[8]!==k?(Ze=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const We=at.indexOf(String(O.id)),ht=at.indexOf(String(Ae.id));We===-1||ht===-1||(Oe(bt=>Ia(Qn([...bt],We,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(We,ht))},e[7]=at,e[8]=k,e[9]=Ze):Ze=e[9];const A=Ze;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Ee(null)},e[10]=Ye):Ye=e[10];const H=Ye;let ot,de,Qe,ve,it,$e,Be,De,se,Q,ee,K,T,fe,He;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==at||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==X||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){fe=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Qe=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let We;e[61]!==Ae?(We=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=We):We=e[62];const ht=We;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],fe=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Qe,e[57]=ve,e[58]=T}else Qe=e[56],ve=e[57],T=e[58];de=Ql,De=we,se=Xl,Q=L,ee=A,K=H,ot=tc,$e=at,Be=nc,He="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Tc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>X(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=at,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=X,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=ot,e[34]=de,e[35]=Qe,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=De,e[41]=se,e[42]=Q,e[43]=ee,e[44]=K,e[45]=T,e[46]=fe,e[47]=He}else ot=e[33],de=e[34],Qe=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],De=e[40],se=e[41],Q=e[42],ee=e[43],K=e[44],T=e[45],fe=e[46],He=e[47];if(fe!==Symbol.for("react.early_return_sentinel"))return fe;let et;e[68]!==it||e[69]!==He?(et=r.jsx("div",{className:He,children:it}),e[68]=it,e[69]=He,e[70]=et):et=e[70];let Ke;e[71]!==ot||e[72]!==$e||e[73]!==Be||e[74]!==et?(Ke=r.jsx(ot,{items:$e,strategy:Be,children:et}),e[71]=ot,e[72]=$e,e[73]=Be,e[74]=et,e[75]=Ke):Ke=e[75];let $;e[76]!==Qe||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",Oa(ve,!1,I)),children:r.jsx(La,{section:ve,raw:Qe,meta:V,decofile:C})}):null,e[76]=Qe,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=ni.createPortal(r.jsx(Jl,{dropAnimation:Wi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==de||e[85]!==De||e[86]!==se||e[87]!==Q||e[88]!==ee||e[89]!==K||e[90]!==Ke||e[91]!==ie?(Ve=r.jsxs(de,{sensors:De,collisionDetection:se,onDragStart:Q,onDragEnd:ee,onDragCancel:K,children:[Ke,ie]}),e[84]=de,e[85]=De,e[86]=se,e[87]=Q,e[88]=ee,e[89]=K,e[90]=Ke,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Bc(v){return v.id}function Dc(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:Ts(v,p,S)}:{kind:"noop"};const V=As(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Yn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Ca="section-form-stale-save",Kc=3;function Pa(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ka(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Ba=new WeakMap;let Mc=0;function Fc(v){let e=Ba.get(v);return e===void 0&&(e=++Mc,Ba.set(v,e)),e}function mf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:X=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=$i(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=wl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Dl(_e),Z=Zn(),ze=xe?.virtualMcpId,Pe=yl(ze===e?e:null)?.metadata?.siteSlug??null,st=ac({virtualMcpId:e,branch:p,sandboxUrl:x}),ue=Rl(e,p),g=jl(ue),we=Vi(g),rt=!g,at=!!st||g,[m,L]=b.useState(null),[Ze,A]=b.useState(null),[Ye,H]=b.useState(null),[ot,de]=b.useState(0),[Qe,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[De,se]=b.useState(null),[Q,ee]=b.useState(null),[K,T]=b.useState([]),fe=b.useRef(null),[He,et]=b.useState(K.length);He!==K.length&&(et(K.length),requestAnimationFrame(()=>{fe.current&&(fe.current.scrollTop=0)}));const[Ke,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,We]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,za]=b.useState(!0),[Yt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(X),[Ps,Bs]=b.useState(X);X&&!Ps&&(Bs(!0),un(!0),L(null),A(null),H(null),T([])),!X&&Ps&&Bs(!1);const[$a,dn]=b.useState(null),[Ds,An]=b.useState(void 0),[Ks,Ot]=b.useState([]),[Ms,Qt]=b.useState(0),[Me,lt]=b.useState(0),[Ha,Fe]=b.useState(null),[Xt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=ii(),Cn=El({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Zi({orgSlug:v,virtualMcpId:e,branch:p}),[Wa,qa]=b.useState(V),[Ga,Ua]=b.useState(C),[Ja,Ya]=b.useState(_);(Wa!==V||Ga!==C||Ja!==_)&&(queueMicrotask(()=>fn.flush()),qa(V),Ua(C),Ya(_),L(null),A(null),H(null),de(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1));const B=el({orgSlug:v,virtualMcpId:e,branch:p}),mn=hl(t=>{B.mutate(t,{onSuccess:()=>k?.(),onError:B.reportError})},d??{},B.v8),Pn=zl({orgSlug:v,virtualMcpId:e,branch:p}),Ls=pc({orgSlug:v,virtualMcpId:e,branch:p}),[Zt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);Vl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,o]){const f=l==null?void 0:s[l],j=l==null?void 0:a[l],h=f&&j?.isSavedBlock?_s(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Qa,Xa]=b.useState(0),$s=li(ue,{orgSlug:v,virtualMcpId:e,branch:p}),Hs=ci($s,I[0]?.blockKey??null,ui(d,I[0]?.blockKey??null)),[Za,eo]=b.useState(null),ts=Tl(v,e).epoch,[to,no]=b.useState(ts);ic(Re?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Ws=_??(d&&u?_a(ka(d,u),V,C)?.key??null:null),ns=Sa({orgSlug:v,virtualMcpId:e,branch:p},Ws?[Ws]:[],{withRefs:!0}),[qs,so]=b.useState(!1),ss=Sa({orgSlug:v,virtualMcpId:e,branch:p},qs?Kl:[]),Gs={ready:!(ue.kind==="protocol"&&ue.hosted)||qs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>so(!0)};if(ns.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:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(di,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ro=ka(d,u),q=!!_,ae=q?null:_a(ro,V,C),y=q?_:ae?.key??null,rs=q&&_?d[_]:void 0,Us=q&&_&&rs?Ml(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,as=Re&&d&&u&&y&&ae?ia(d,{kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},u):null,ao=Re?nn?.seo:void 0,Dn=Ds!==void 0?Ds:ao,oo=Re?tl(Dn):void 0,Js=as?.seoTypeOptions??[],Ys=Re&&u?nl(u):"",os=$a??oo??{},Kn=Re&&as?lc(os,as):null,Qs=Re&&Kn&&sl(Dn)?Un(Kn,u):null,Xs=Re?rl(d,u)?.seoData:void 0,me=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ka(nn?.sections,d??{},g),yt=me.length>1,te=Math.min(ot,me.length-1),Se=me[te],M=Se?.sections??[],pe=kn(M,d,g),Mn=!q&&hc(nn?.sections,g);if(q&&_&&Fs!==_){Is(_);const t=M[0],n=pe[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),H(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:M,parsedSections:pe,decofile:d??{},activePageKey:y,pageVariants:me,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const io=()=>({multivariate:Mn,index:te,variants:me.map(t=>({rule:t.rule})),lazyValues:g&&Mn&&Ai(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Mn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},a=g?ba(y,s):Aa(y,s,d,u);w(a.length>0?a:null)},ls=w&&y&&Mn&&yt&&!Oe&&!Ee?y:null;if(ls!==Za&&(eo(ls),ls)){const t=me.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const a=io(),o=g?ba(y,a):Aa(y,a,d,u);if(!t||n<0){w(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:pe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?Nl(i):bc({...i,decofile:d,meta:u}),f=g?Cl(o,l):[...o,...l];w(f.length>0?f:null)},xt=(t,n,s,a=m??-1,o=!1)=>{const i=pt(t,n);if(!i){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const f=Yr(i,we)[s];if(!f){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const j=hi(f.value,d);A(j?.data??null),H(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),o&&$t(i,a,s)},cs=t=>{F(null),de(t),L(null),A(null),H(null),T([]);const n=me[t]?.rule,{resolveType:s,formValue:a}=Ut(n,d??{},u??void 0);ee(s),se(a),is(me.map(o=>({rule:o.rule})),t)},lo=(t,n)=>{const s=M[t],a=pe[t];if(!s||!a)return!1;const o=a.isMultivariate?pt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),lt(i),T([]),$(l=>l+1),a.isMultivariate)xt(s,a,i,t);else{const l=wt(s,a,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),qe(null),Fe(null)}return!0},Zs=P?.index;if(P!==void 0&&(P?.seq??null)!==Qe&&(ve(P?.seq??null),typeof Zs=="number"&&lo(Zs,0)),ts!==to){no(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||B.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(fe.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=pe[m];if(T([]),$(o=>o+1),!s||!a)L(null),A(null),H(null);else if(a.isMultivariate)xt(s,a,Me,m);else{const o=wt(s,a,d,g);A(o?.data??null),H(o?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Qt(s=>s+1))}if(Os!==Qa){Xa(Os);const t=m!==null?M[m]:null,n=m!==null?pe[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),H(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Pa(d,n,g),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?bs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,d,g):null,i=fi(ut,o,l=>Qr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Fn=Ye&&u?Un(Ye,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(d,y,t,te,me);B.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),B.reportError(a)}})},Ht=()=>{Ce?.(null),L(null),Tn(!1),A(null),H(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(fe.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,W.error(t,{id:Ca}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=ue.kind==="protocol"&&ue.source==="github",rr=t=>Bl(Nn,Cn,t,ue.kind==="protocol"?ue:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},co=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=re.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{ct.current=t,ke(t)},uo=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:na(a.plan,a.choices,t.plan),fresh:Ii(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||Wn(a.plan.theirs)!==Wn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},or=(t,n)=>{const s=ct.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(Wn(o.plan.mine)===Wn(n))return!0;const i=ta({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:na(o.plan,o.choices,i)})),!0},fo=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},mo=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!or(n,a)&&yn(a,n.sectionIndex,0,s),ct.current[0]??null},po=()=>{const t=ct.current[0],n=mo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=Ri(n.plan,n.choices);ue.kind==="protocol"&&ue.source==="github"&&ji(n.plan,n.choices)&&Al(c,!1),vn(ct.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(zt.current===a||fo(n))&&(zt.current=a,A(s),$(i=>i+1)),yn(s,a.sectionIndex,0,o)},ho=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??co(n),l=i.sectionVariantIndex,f=i.formBase,j=o||ea(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const D=typeof t=="function"?t():t,z=ea(ct.current,f,i,n,g).base;if(z&&or(z,D))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Y,variantIndex:be}=Pa(ne,i,g),Ie=i.pageKey,he=J[n];if(!he)return;const ce=Ne[n];if(!ce)return;const Ge=f?.base,Xe=bs(he,ce,l,ne,g),Nt=!!Ge&&!!Xe&&Ni(Ge,Xe)&&!(f&&Qr(f,Xe));if(Nt&&Ge&&Xe){if(Ci(Ge,Xe)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ce.isSavedBlock?"here":Pi(Ge,J.map((oe,mt)=>bs(oe,Ne[mt],l,ne,g)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&L(U),yn(D,U,s,i);return}}const Ct=Nt&&Ge&&Xe?ta({ancestor:Ge,mine:D,theirs:Xe}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,uo({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Bi(Ct),changedAgain:!1,blockKey:ce.isSavedBlock?_s(he,ce):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??D,qr=Di({merged:!!Pt,tracked:f,current:zt.current,saved:D});Pt&&W.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Ca}),qr&&f&&(f.emitted=Pt,A(Pt));const Ss=qr||!Pt?rn:D;f&&(f.base=Ss,f.sectionCount=J.length,Ki(f,Ss));const Gr={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof Pl){if(f&&(f.version=void 0),s<Kc){ye.current.delete(R),hn.current=!0;const oe=Li(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:D},n,s+1,i,oe.immediate),ye.current.delete(R),ar(xn(g))},oe.delay)}else us();return}B.reportError(U)}},Ur=U=>{pn.current=!0;let oe=!1;B.mutateAsync(U).then(()=>Gr.onSuccess(),mt=>{oe=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,ar(oe?xn(g):0),tr()})};if(ce.isSavedBlock){const U=_s(he,ce);if(!U)return;Ur({blockKey:U,data:rn,...Ge?{base:{value:Mi({startedFrom:Ge,stored:Xe,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:sa({formBase:f,rebased:!!Pt,versionOf:rr,productionVersionOf:oe=>aa(Nn,Cn,oe),...sr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Hn={...ne[Ie]},Gt=[...J];if(ce.isMultivariate){const U=pt(he,ce);if(!U||!Ie)return;const oe=Fi(U,l,rn);Gt[n]=Bt(he,ce,oe)}else if(ce.isHidden){const U=Cs(he.__resolveType),oe=U?{...he.section}:{...he},mt=Array.isArray(oe.variants)?[...oe.variants]:[];mt[0]&&(mt[0]=ra(oe.__resolveType,mt[0],rn)),oe.variants=mt,U?Gt[n]={...he,section:oe}:Gt[n]=oe}else ce.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Y.length>1){const U=Hn.sections,oe=[...U?.variants??[]];oe[be]&&(oe[be]=ra(U?.__resolveType,oe[be],Gt)),Hn.sections={...U,variants:oe}}else Hn.sections=Gt;Ur({blockKey:Ie,data:Hn,rebaseOnConflict:!1,guard:sa({formBase:null,rebased:!1,versionOf:rr,productionVersionOf:U=>aa(Nn,Cn,U),...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},go=t=>{tn.current=!1,L(t),lt(0),T([]),$(o=>o+1);const n=M[t],s=pe[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const a=wt(n,s,d,g);if(!a){A(null),H(null),qe(null),Fe(null),$t(null,t,0);return}A(a.data),H(a.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=Ei(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Ze,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!ae)return;const n={kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},s=ia(d,n,u);s&&fn.save(y,()=>{const a=Nn.getQueryData(Ti.decofile(Cn))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Bn.current};return Bn.current={},t?.raw!==void 0?cc(o,t.raw,u):t?.inner!==void 0?uc(n,s,o,t.inner):o})},lr=(t,n)=>{y&&(Bn.current[t]=n,ds())},vo=(t,n)=>{if(!y)return;const s=Qn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},yo=t=>{if(!y)return;const n=M.filter((s,a)=>a!==t);m===t?Ht():m!==null&&m>t&&L(m-1),dt(n)},So=t=>{if(!y)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,gl(n)),m!==null&&m>t&&L(m+1),dt(s)},bo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s)return;const a=s.isHidden?_i(n,g):ki(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},xo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s||s.isMultivariate)return;const a=xi(n);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},_o=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s?.isSavedBlock)return;const a=wt(n,s,d,g);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Ht(),dt(l)},ko=t=>{if(!y)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;dt(n,{onError:()=>{re.current.selectedSectionIndex===s&&Ht()}}),We(!1),L(s),lt(0),T([]),$(l=>l+1);const a=n[s],o=kn(n,d,g)[s];if(!a||!o)return;if(o.isMultivariate){xt(a,o,0);return}const i=wt(a,o,d,g);if(!i){A(null),H(null),qe(null),Fe(null);return}A(i.data),H(i.resolveType),qe(null),Fe(null)},cr=t=>{jn.current=t.append,We(!0)},wo=t=>{const n=jn.current;if(!n){ko(t);return}n({__resolveType:t.resolveType}),We(!1),jn.current=null},ur=t=>{if(m===null)return;const n=M[m],s=pe[m];!n||!s?.isMultivariate||(lt(t),T([]),$(a=>a+1),xt(n,s,t,m,!0))},Ro=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=Si(a,t);if(!o){W.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Bt(n,s,o);const l=o.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},jo=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=bi(a,t,g),i=[...M];i[m]=Bt(n,s,o);const l=Zr(a.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},Eo=(t,n)=>{if(m===null||!y||t===n)return;const s=M[m],a=pe[m];if(!s||!a?.isMultivariate)return;const o=pt(s,a);if(!o)return;const i=vi(o,t,n),l=[...M];l[m]=Bt(s,a,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],a,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=M[n],a=pe[n];if(!s||!a)return;const o=gi(s,a,void 0,u,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){W.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(o.newVariantIndex),T([]),$(f=>f+1),xt(o.section,l,o.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=M[m],n=pe[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const a=yi(t,n,s);if(!a){W.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=kn(o,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(a,i,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),$t(null,m,0),dt(o)},Vo=async t=>{if(ie===null||!y)return;const n=Yn(t,d,u);if(n){W.error(n);return}const s=M[ie],a=pe[ie];if(!s||!a)return;const o=wt(s,a,d,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await B.mutateAsync({blockKey:t,data:i,create:!0}),f=[...M];f[ie]={__resolveType:t},await B.mutateAsync({blockKey:y,data:on(d,y,f,te,me)}),m===ie&&Ht(),Ve(null),Gn(l)||W.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){W.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Dt(c,Kt(l))})}},fr=Se?.rule;if(yt&&m===null&&Q===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?al(u):[],fs=u&&d?ol(u,d):[],Wt=g&&u&&d?dc(u,d):[],ms=(t,n)=>{if(Wt.length===0)return;const s=Fl(t);return{kinds:Wt,selected:s,campaignPrefill:fc(t),onPick:n,load:Gs}},mr=!q&&!!(at&&u&&d),pr=Q&&u?Un(Q,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(yc(n,t,u,g))try{await Pn.mutateAsync({blockKey:t})}catch(s){W.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Dt(c,Kt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],f=l[a],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:D,...z}=t;B.mutate({blockKey:h,data:Ft(D??"",z,E)},{onSuccess:()=>k?.(),onError:B.reportError});return}f&&(l[a]={...f,rule:t}),o.sections={...i,variants:l},B.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Ta(t,u):{__resolveType:Xr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Q?{__resolveType:Q,...n}:{...n};hr(s)},In=async(t,n,s)=>{const a=mc(n,t);if(!a.ok)return a.reason==="conflict"&&W.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),xa),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 Ls.apply({writes:o})).ok?null:(a.blockWrite&&W.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...xa,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},yr=Wt.length>0?{kinds:Wt,load:Gs,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Il(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Ll(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=await In(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],D=E[a];return D?(E[a]={...D,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!o)return;const{resolveType:i,formValue:l}=Ut(o.rule,o.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[a];if(!j)return;const h=Mt(j.rule,s,u),R=cn(t);f[a]={...j,rule:R};const E={...s,[n]:{...o,sections:{...l,variants:f}}},{resolveType:D,formValue:z}=Ut(R,E,u??void 0);ee(D),se(z);try{await B.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Dt(c,Kt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Y=z?.__resolveType??"",be=i[Y],Ie=typeof be?.name=="string"?be.name:Y,{__resolveType:he,...ce}=t;B.mutate({blockKey:Y,data:Ft(he??"",ce,Ie)},{onSuccess:()=>k?.(),onError:B.reportError});return}const ne=xs(E,s,t),J=[...a];J[n]=Bt(h,R,ne);const Ne=on(i,l,J,j,f);B.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g)))},To=t=>{qe(t);const n=t?Ta(t,u):{__resolveType:Xr(u)};Fe(t?n:{}),xr(n)},Ao=t=>{const n=t;Fe(n);const s=Xt?{__resolveType:Xt,...n}:{...n};xr(s)},No=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await In(t,i,D=>{const z=a[n],ne=o[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...a];return Ne[n]=Bt(z,ne,xs(J,s,D)),{blockKey:l,data:on(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},Co=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const D=E.variants??[],z=Mt(D[s]?.rule,i,u),ne=cn(t),J=xs(E,s,ne),Ne=[...a];Ne[n]=Bt(h,R,J);const Y=on(i,l,Ne,j,f),be={...i,[l]:Y},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await B.mutateAsync({blockKey:l,data:Y}),z&&z!==t&&await qt(z,be),k?.()}catch(ce){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Dt(c,Kt(ce))})}};if(!q&&!ae)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!rs)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?pe[m]??null:null,_r=m!==null?M[m]:null,kr=_r&&je?.isMultivariate?pt(_r,je):null,Vt=kr?Yr(kr,we,g):[],Ln=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=je?.isMultivariate===!0,ps=m!==null&&je!==null,At=ps&&(Tt||!!(Fn&&Ze)),Po=At&&!q&&je?.isSavedBlock===!0,ft=q||Po,wr=q?Us:je?.label??"",Bo=Xt&&u?Un(Xt,u):null,Rr=(t,n)=>n&&Z?`${t} · ${n}`:t,jr=je?je.variantOf??je.label:"",Do=(()=>{const t=Tt&&kt?kt.label:null;return t?Z?[Rr(jr,t)]:[je.label,t]:[je?.label??""]})(),hs=Rr(ae?.name??"",yt?Se?.label:null),On=At&&(!q||K.length>0)?q?[Us,...K]:[hs,...Do,...K]:[],Er=Re&&ae?[ae.name,"SEO",...Ks]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Yt&&ae?[ae.name,Vr]:Lt&&ae&&je?[hs,jr,Vr]:[],zn=Tr.length>0?Tr:Er.length>0?Er:ft?On.length>0?On:[wr]:On.length>0?On:[hs],Ar=ps&&!Tt&&!je?.isHidden&&!!y,Ko=ft||!q&&yt&&!!Se||Ar,Mo=ps&&!Tt&&!q&&K.length===0&&!!je&&Da(je)&&!!y,Fo=Z&&At&&!Lt&&Tt&&K.length===0&&!!kt,Nr=Z&&K.length>0?la(K[K.length-1]):null,Io=K.length>1?la(K[K.length-2]):null,Cr=ft?wr:At?je?.label??"":ae?.name??"",Lo=Yt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?je?.variantOf??je?.label??"":Yt||Re?ae?.name??"":Nr?Io??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?ae?.name??"":ae?.path??"",gs=!Yt&&!Lt&&!Re&&!At&&!ft,Oo=!Z&&!Re&&!q&&Tt&&K.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=gc(t.sections,M,u,g);if(!n)return;const{sections:s,newVariantIndex:a}=n;B.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{de(a),L(null),A(null),H(null),T([]),se(null),ee(null)},onError:B.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const a=d[y],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=vc(i,l),j={...d,[y]:{...a,sections:f}};B.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:B.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),de(s);const a=Qn(me.map(o=>({rule:o.rule})),t,n);is(a,s),$n(o=>Qn(o,t,n))},Dr=t=>{const n=me[t]?.rule,s=Mt(n,d??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{me.length-1===1?de(0):t<te?de(te-1):t===te&&de(Math.max(0,t-1)),L(null),A(null),H(null),T([]),se(null),ee(null)},s)},zo=()=>{const t=me.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!wi(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Oi({variants:n}),a=n[s];return a?[{...a,rule:zi(u)}]:null},()=>{de(0),L(null),A(null),H(null),T([]),se(null),ee(null),Vn(!1)},t)},Kr=t=>{let n=t+1;$n(s=>(n=Zr(s,t,g),Sc(s,t,g)),()=>{de(n),L(null),A(null),H(null),T([]),se(null),ee(null)})},$o=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,a=re.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,a,u)){F(null);return}const Y=h.__resolveType??"";f[t]={...j,rule:Ts(h,a,u)};const be={...a,[s]:{...o,sections:{...l,variants:f}}};await B.mutateAsync({blockKey:s,data:be[s]}),await qt(Y,be),F(null),k?.();return}const E=As(h,a,u);if(!E){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await B.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),F(null),k?.();return}const D=Jn(R),z=Yn(D,a,u);if(z){W.error(z);return}const ne=Ft(E.resolveType,E.data,R);let J=null,Ne=!1;try{const Y=await B.mutateAsync({blockKey:D,data:ne,create:!0});Ne=Gn(Y),J=Ne?null:D,f[t]={...j,rule:cn(D)},await B.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:f}}}),J=null}catch(Y){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Y}F(null),Ne||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Dt(c,Kt(E))})}finally{en(!1)}},Ho=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=a[s],R=o[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const D=E.variants??[],z=D[t];if(!z?.rule||typeof z.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Y=>{const be={...E,variants:Y},Ie=[...a];Ie[s]=Bt(h,R,be);const he=on(i,l,Ie,j,f);return await B.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Xe=ne.__resolveType??"",Nt=[...D];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Xe,Ct),O(null),k?.();return}const Y=As(ne,i,u);if(!Y){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Y.blockKey){await B.mutateAsync({blockKey:Y.blockKey,data:Ft(Y.resolveType,Y.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Yn(be,i,u);if(Ie){W.error(Ie);return}const he=Ft(Y.resolveType,Y.data,J);let ce=null,Ge=!1;try{const Xe=await B.mutateAsync({blockKey:be,data:he,create:!0});Ge=Gn(Xe),ce=Ge?null:be;const Nt=[...D];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ce=null}catch(Xe){throw ce&&await Pn.mutateAsync({blockKey:ce}).catch(()=>{}),Xe}O(null),Ge||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Y){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Dt(c,Kt(Y))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await B.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Wo={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Mr(a,t,E),{...o,[a]:E}},h=Dc(f,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){W.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const D=[...i];D[n]={...l,rule:h.inlinedRule};const z=await j(D);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await B.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const D=await B.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Gn(D),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(D){throw R&&await Pn.mutateAsync({blockKey:R}).catch(()=>{}),D}E||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Dt(c,Kt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,o,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...o,[a]:j};try{await Mr(a,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Dt(c,Kt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;let i=null;!await In(s,o,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:a,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Ht(),g&&$t(null,-1,0)},Ir=t=>{dn(t),ds({inner:t})},Lr=t=>{An(t),ds({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Qt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1),ge?.()},qo=()=>{Vn(!1),Tn(!1),L(null),un(!0)},Go=()=>{Re&&$r(),L(null),Vn(!0)},Uo=()=>Tn(!0),vs=t=>{if(Yt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(Re){if(t===0){$r();return}if(t===1){Ot([]),Qt(s=>s+1);return}Ot(Ks.slice(0,t-1)),Qt(s=>s+1);return}if(q){T(K.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!Z&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(K.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(vl(zn.length,{isMultivariateSectionTop:Oo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(kl,{className:"size-4"})}):null,Jo=ft||At||Re?Ko&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"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&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("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",ll),children:[r.jsx(il,{rule:Rs(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(qn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("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(ca,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(ya,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(qn,{onClick:bn})]}),Yo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(ua,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Kr,onDelete:Dr,onAdd:bn}),yt&&Q!==null&&r.jsx(da,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Q,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:De,onChange:vr,formKey:`${te}:${Q??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Hr=r.jsxs(r.Fragment,{children:[r.jsx(cl,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:ur,onRename:O,onDuplicate:jo,onDelete:Ro,onRemoveAll:dr,onReorder:Eo,onAdd:()=>Sn()}),r.jsx(da,{children:r.jsx(ks,{currentRt:Xt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:To,onSelectGlobal:Co,named:ms(kt?.rule,No),namedRow:ws(kt?.rule,Wt),rule:kt?.rule,schema:Bo,formValue:Ha,onChange:Ao,formKey:`${m??"none"}:${Ln}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr=r.jsx("div",{className:le(Z?"px-2":"p-2 pt-3"),children:r.jsx(Pc,{listKey:`${y??""}-${te}`,rawSections:M,sections:pe,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{go(t),Je?.(t)},onReorder:vo,onDelete:yo,onDuplicate:So,onMakeReusable:Ve,onToggleHidden:bo,onToggleLazy:rt?xo:void 0,onAddVariant:Sn,onDetach:_o,onAddSection:()=>We(!0),canAddSection:mr})}),Qo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&ae&&r.jsx(ca,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr}),nn&&y?r.jsx(Ea,{rawSeo:Dn,innerSeo:os,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Kn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Xs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Xo=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(Ea,{rawSeo:Dn,innerSeo:os,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Kn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Xs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Zo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(ua,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Kr,onDelete:Dr,onAdd:bn}),yt&&Q!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>za(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":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Sl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(bl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Q,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:De,onChange:vr,formKey:`${te}:${Q??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr]},"editor-section-list");return r.jsx(ul,{value:g,children:r.jsx(dl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!Z&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(Z||zn.length>1)&&r.jsx(fl,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:Z?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[Z&&ys,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("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:Lo}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),gs&&yt&&Se&&r.jsx(fa,{variants:me,activeIndex:te,onSelect:cs,onManage:Go,onRemoveAll:zo}),Fo&&r.jsx(fa,{variants:Vt,activeIndex:Ln,onSelect:ur,onManage:Uo,onRemoveAll:dr}),gs&&!yt&&r.jsx(qn,{onClick:bn}),Mo&&r.jsx(qn,{onClick:()=>Sn()}),r.jsx(ml,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:qo,children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(ya,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Jo}),ut&&r.jsx(mi,{open:!0,fields:pi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Hs??null,authorPending:Hs===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>ho({...ut.choices,[t]:n}),onApply:po},Fc(ut.formBase)),Lt?r.jsx(ma,{onAdd:()=>Sn(),children:Hr},"editor-section-variants"):At?r.jsxs(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!Z&&Tt&&Vt.length>0&&K.length===0&&Hr,r.jsx(Va,{value:yr,children:r.jsx(pa,{value:q&&g?Be:null,children:r.jsx(ha,{activeSchema:Fn,formValue:Ze,formResetKey:Ke,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Wo:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Va,{value:yr,children:r.jsx(pa,{value:q&&g?Be:null,children:r.jsx(ha,{activeSchema:Fn,formValue:Ze,formResetKey:Ke,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):Re?Z?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Qo})},"editor-seo"):Xo:Yt?r.jsx(ma,{onAdd:bn,children:Yo},"editor-variants"):Z?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(Ns,{canAddSection:mr,onAddSection:()=>We(!0)})})]},"editor-section-list"):Zo,r.jsx(pl,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(pe[ie]?.label??""):"",isPending:B.isPending,onSubmit:Vo}),at&&r.jsx(oc,{open:Ae,onOpenChange:t=>{We(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:wo}),ht&&y&&d&&r.jsx($l,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(ga,{open:!0,initialName:Jt(me[Te]?.rule,d??{},u??void 0)?_n(me[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(me[Te]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await $o(Te,t)},onOpenChange:t=>{!t&&!Zt&&F(null)}}),tt!==null&&r.jsx(ga,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(Vt[tt]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Ho(tt,t)},onOpenChange:t=>{!t&&!Zt&&O(null)}})]})})})}export{mf as SectionsEditor};
|
|
1
|
+
import{i0 as ei,bf as ti,c as wn,b as Rn,r as b,m as le,j as r,bR as ni,b7 as Cs,i1 as Da,B as It,Y as an,at as si,_ as ri,be as ai,Z as oi,q as ii,hy as li,i2 as ci,i3 as ui,h as di,bg as wt,i4 as Jr,i5 as bs,i6 as fi,i7 as pt,i8 as Yr,i9 as mi,bu as pi,ia as hi,ib as Qr,ic as gi,t as W,b$ as Xr,id as vi,ie as Bt,ig as yi,ih as Si,ii as bi,b_ as Zr,ij as xs,ik as xi,il as _i,im as ki,bY as wi,bv as Ri,io as ji,ip as Ei,bU as Vi,K as Ti,iq as ea,fc as Ai,bm as Wn,bs as ta,ir as na,is as Ni,it as Ci,iu as Pi,iv as _s,iw as Bi,ix as Di,iy as Ki,iz as sa,iA as Mi,iB as Fi,bS as ra,iC as Ii,iD as Li,bp as aa,iE as Oi,bX as zi}from"./index-DLrFWx5Y.js";import{u as $i}from"./chat-context-D__edm74.js";import{a6 as Hi,Q as Zn,a7 as Wi,a8 as qi,a9 as Gi,aa as Ui,ab as Ji,ac as Yi,ad as oa,ae as Qi,af as Xi,A as Jn,y as Yn,d as Zi,u as el,ag as ia,i as tl,ah as nl,k as sl,h as rl,ai as Ka,p as kn,aj as al,ak as ol,w as la,al as il,am as ll,an as qn,ao as ca,ap as ua,aq as da,ar as ks,as as cl,F as ul,at as dl,z as fl,au as fa,av as ml,aw as ma,ax as pa,ay as ha,M as pl,az as ga,a as hl,aA as on,aB as gl,aC as vl,v as Gn,a5 as xn}from"./parse-sections-BJOrOXAt.js";import{b as yl}from"./repository-binding-Z_PJssXg.js";import{n as Sl,t as bl}from"./ChevronUp-BjA2VknT.js";import{a7 as Ma,b as Xn,am as xl,e as _l,F as kl,a1 as va,Y as ya}from"./agent-icon-Bd5DjuVH.js";import{S as ln}from"./scroll-area-BjnkF9XV.js";import{c as Rt,T as jt,a as Et}from"./tooltip-D4RVnddm.js";import{k as wl,u as Rl,m as jl,l as El,ak as Vl,S as Tl,t as Sa,b1 as ba,au as Dt,av as Kt,a5 as Al,b2 as Nl,b3 as Cl,aV as xa,a8 as Pl,ag as Bl}from"./site-editor-toast-D_mo8TLM.js";import{u as Dl,ao as _a,e as ka,j as Kl,D as Ml,A as Un,a3 as Fl,ae as Il,aj as Ll}from"./blocks-tab-states-5fAC-Jvu.js";import{m as Ol,u as zl,P as $l}from"./mustache-3I6NpSTH.js";import{a as Es,e as Fa}from"./UserSquare-DGUSiZ1P.js";import{i as wa,s as Ra}from"./Tool01-CBLhcG71.js";import{s as Hl}from"./Plus-Dhutz31g.js";import{s as Wl}from"./Trash01-BTmzVQk_.js";import{i as Vs}from"./Zap-vn2maseg.js";import{u as ql,a as ja,K as Gl,P as Ul,b as Jl,C as Yl,D as Ql,c as Xl}from"./core.esm-zdyJobf2.js";import{u as Zl,s as ec,a as Qn,S as tc,v as nc}from"./sortable.esm-DkLzay3X.js";import{s as sc,g as rc,u as ac,A as oc}from"./use-section-preview-base-BXQtliBp.js";import{u as ic,a as lc,P as Ea,w as cc,b as uc}from"./seo-editor-phk-cNbV.js";import{R as dc,y as ws,T as Va,x as fc,U as mc}from"./hosted-reconcile-v19CihgF.js";import{u as pc}from"./use-apply-named-rule-KXbxqT7_.js";import{m as Jt,d as Ts,y as As,n as Ft,e as cn,q as hc,k as Ut,r as Rs,j as Mt,h as _n,b as gc,s as Ta,z as vc,A as yc,B as Sc}from"./section-array-field-DTz67Y2Z.js";import{b as Aa,a as bc}from"./variant-matcher-override-YE4lbHNL.js";import"./autosend-BQzY1y5n.js";import"./thread-route-CvlfcLbb.js";import"./use-project-scope-DYHM9a74.js";import"./thread-intent-v870fhCT.js";import"./use-mcp-client-B5xjs2K9.js";import"./auth-B9FRbbSg.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CxFrglEk.js";import"./task-board-P3oVDv96.js";import"./schema-C3iRMQDR.js";import"./use-entitlements-CNt3pGa0.js";import"./use-ai-providers-CF3gJxn2.js";import"./use-decopilot-events-DNjBbEST.js";import"./use-organization-settings-BTNKvxbS.js";import"./utils-DsmWCt7e.js";import"./Play-BwysvS-E.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-B7REjwrW.js";import"./LinkBroken01-BsflEjnj.js";import"./collapsible--DSKOo3p.js";import"./use-copy-DtaCyKxk.js";import"./usage-stats-BbCFi8o4.js";import"./tool-namespace-nRSGF6tI.js";import"./form-BXj3YBhn.js";import"./label-DzXAppDM.js";import"./utils-CVEq3hMx.js";import"./markdown-D6jTtk0G.js";import"./use-mobile-DLEV_nGJ.js";import"./shell-layout-C9pzHPCy.js";import"./Globe04-CoUsMEms.js";import"./use-deployment-admin-CSAQGY_O.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-G4YrC3Pn.js";import"./CheckCircle-Uj5wL5gk.js";import"./Monitor01-Cuwl6kJ_.js";import"./command-Dz2oRnZb.js";import"./index-BPLzAbmE.js";import"./SearchMd-DYX8MZiO.js";import"./integration-icon-Chtj05eK.js";import"./project-icon-lOdr7-bW.js";import"./use-navigate-to-agent-DbsMPucS.js";import"./use-debounced-value-CkSIMvSM.js";import"./new-project-dialog-BjM9FoLr.js";import"./ArrowLeft-D6scOXD-.js";import"./repository-picker-Ms6PvgtV.js";import"./github-icon-BIb5Vfpr.js";import"./useInfiniteQuery-B3nmwRd2.js";import"./infiniteQueryObserver-CxT8wQIc.js";import"./collection-search-iWjyQyoE.js";import"./ShoppingBag01-gbNNAeM0.js";import"./legacy-admin-welcome-dialog-BKs0Fyaf.js";import"./drawer-BqEmUb4n.js";import"./required-auth-layout-C2eHliL_.js";import"./use-org-sso-DvSOJZ_W.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-voFMel4o.js";import"./types-BQSSBiIo.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-r3-65QGa.js";import"./sheet-BGkMUGZP.js";import"./use-connection-C5-uyAt3.js";import"./use-mcp-prompts-DEhNBwFv.js";import"./use-thread-outputs-CJJmQUoi.js";import"./file-type-icon-B8ydIjHI.js";import"./switch-aqNVrOiZ.js";import"./textarea-Cfu8XQdh.js";import"./ChevronSelectorVertical-zTQaeZAI.js";import"./popover-C5Rig4oB.js";import"./monaco-editor-BhbaBg5Q.js";import"./editor-4N5Zqxy_.js";import"./calendar-BBjKT4Y4.js";import"./SwitchHorizontal01-xcLba1bf.js";import"./Minus-B714ZjWA.js";import"./select-BYZPn2vc.js";import"./index-BdQq_4o_.js";import"./index-D-pfNS-S.js";import"./editor-classes-Dg5BrFCM.js";import"./toggle-group-BgRJSOhH.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BojjAtvD.js";import"./Upload01-Cl2zCfWN.js";import"./search-input-Dk-PX53Q.js";import"./tabs-DdQ7zWRN.js";import"./use-file-configs-C7s_koIb.js";import"./asset-utils-Bn1iB4IB.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-voice-input-C35dv3A1.js";import"./index-DHdn4GVF.js";import"./checkbox-Xa1XT9y9.js";import"./Key01-Cwya0Bqg.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-Cn2kMl0m.js";import"./CreditCard01-BvXb2Lni.js";import"./Sun-BQnmg69t.js";import"./Users01-DZO5qwDg.js";import"./use-sandbox-events-BmsgjLgS.js";import"./use-blocks-v8-project-2B03tBP7.js";import"./empty-state-DzKImAtb.js";import"./slider-C6NJcOKc.js";import"./index-DlGI6s_b.js";import"./tooltipContext-BXwqSkFH.js";import"./CategoricalChart-DzzGNLUP.js";import"./index-_tlLxqQr.js";import"./use-move-blocks-BVhwg8WS.js";const xc={escape:Hi};function _c(v,e){for(const p of sc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function kc(v,e){if(!e)return;const p=ei(v,ti(e));if(p)try{const S=_c(p.resolveType,e);return S&&Ol.render(S,p.data,{},xc).trim()||void 0}catch{return}}function wc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{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(Et,{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(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Rc="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 Na(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Ia(v){return v.map((e,p)=>({...e,index:p}))}function jc(v,e){if(e===v.length)return v;if(e<v.length)return Ia(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 La(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=Rn(),_=Zn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let X;e[0]!==x||e[1]!==S?(X=S&&x?rc(S,x):void 0,e[0]=x,e[1]=S,e[2]=X):X=e[2];const ge=X;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?kc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=Yi(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Xn:k?Ma:Fa;let G;e[16]!==k||e[17]!==P?(G=P?{color:ai}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Xi,{"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(xl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const Z=Le??p.label;let ze;e[30]!==Ee||e[31]!==Z?(ze=r.jsx("span",{className:Ee,children:Z}),e[30]=Ee,e[31]=Z,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(wc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(oa,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(oa,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Ec="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Vc="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 Oa(v,e,p){if(p)return Qi({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return le("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?Ec:x?Vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function js(v,e){return le("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 Tc(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:X,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=Rn(),c=Zn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Da(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Cc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:Z,transform:ze,isDragging:nt}=Zl(Oe);let Pe;e[4]!==ze?(Pe=Yl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let ue;e[6]!==Pe||e[7]!==st?(ue={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=ue):ue=e[8];const g=ue;let we;e[9]!==p?(we=qi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,at="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Ze=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Ze?(A=le("touch-none transition-colors",Ze,Oa(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Ze,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Ye=r.jsx(La,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Ye):Ye=e[22];const H=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(js(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Nc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ot=c?r.jsx(Gi,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(wa,{className:"h-3.5 w-3.5"}):r.jsx(Ra,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(js(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Ac,children:G?r.jsx(wa,{className:"h-3.5 w-3.5"}):r.jsx(Ra,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),de=ri,Qe=Ui;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(js(_e,!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 $e;e[25]!==Qe||e[26]!==ve||e[27]!==it?($e=r.jsx(Qe,{label:ve,classicClassName:it}),e[25]=Qe,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(si,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let De;e[35]!==X?(De=F=>{F.stopPropagation(),X()},e[35]=X,e[36]=De):De=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(_l,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Q;e[38]!==w?(Q=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Q):Q=e[39];let ee;e[40]!==De||e[41]!==Q?(ee=r.jsxs(an,{onClick:De,children:[se,Q]}),e[40]=De,e[41]=Q,e[42]=ee):ee=e[42];let K;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(K=ke&&r.jsxs(an,{className:le(!c&&Ji),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Ma,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=K):K=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(an,{className:le(!c&&Rc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Xn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let fe;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(fe=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Fa,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=fe):fe=e[58];let He;e[59]!==k?(He=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=He):He=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Wl,{className:"h-4 w-4"}),e[61]=et):et=e[61];let Ke;e[62]!==w?(Ke=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=Ke):Ke=e[63];let $;e[64]!==He||e[65]!==Ke?($=r.jsxs(an,{variant:"destructive",onClick:He,children:[et,Ke]}),e[64]=He,e[65]=Ke,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==K||e[70]!==T||e[71]!==fe||e[72]!==$?(ie=r.jsxs(oi,{align:"end",className:"w-44",children:[Be,ee,K,T,fe,$]}),e[67]=Be,e[68]=ee,e[69]=K,e[70]=T,e[71]=fe,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==de||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(de,{children:[$e,ie]}),e[74]=de,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==Z||e[82]!==g||e[83]!==A||e[84]!==Ye||e[85]!==H||e[86]!==ot||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:Z,style:g,...u,...Ee,role:at,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Ye,H,ot,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=Z,e[82]=g,e[83]=A,e[84]=Ye,e[85]=H,e[86]=ot,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Ac(v){return v.stopPropagation()}function Nc(v){return v.stopPropagation()}function Cc(){return!1}function Ns(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=Rn();let _;e[0]!==x?(_=le("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(Hl,{size:14}),e[2]=k):k=e[2];let X;e[3]!==C?(X=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=X):X=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==X?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,X]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=X,e[10]=ge):ge=e[10],ge}function Pc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:X,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=Rn(),I=Zn();let ke;e[0]!==x.length?(ke=()=>Na(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[Z,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);Z!==p?(ze(p),Pe(x.length),Oe(Na(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>jc(tt,x.length)));let ue;e[2]===Symbol.for("react.memo_cache_sentinel")?(ue={activationConstraint:{distance:8}},e[2]=ue):ue=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:ec},e[3]=g):g=e[3];const we=ql(ja(Ul,ue),ja(Gl,g));let rt;e[4]!==d?(rt=d.map(Bc),e[4]=d,e[5]=rt):rt=e[5];const at=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Ze;e[7]!==at||e[8]!==k?(Ze=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const We=at.indexOf(String(O.id)),ht=at.indexOf(String(Ae.id));We===-1||ht===-1||(Oe(bt=>Ia(Qn([...bt],We,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(We,ht))},e[7]=at,e[8]=k,e[9]=Ze):Ze=e[9];const A=Ze;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Ee(null)},e[10]=Ye):Ye=e[10];const H=Ye;let ot,de,Qe,ve,it,$e,Be,De,se,Q,ee,K,T,fe,He;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==at||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==X||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){fe=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Qe=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let We;e[61]!==Ae?(We=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=We):We=e[62];const ht=We;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],fe=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Qe,e[57]=ve,e[58]=T}else Qe=e[56],ve=e[57],T=e[58];de=Ql,De=we,se=Xl,Q=L,ee=A,K=H,ot=tc,$e=at,Be=nc,He="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Tc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>X(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=at,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=X,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=ot,e[34]=de,e[35]=Qe,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=De,e[41]=se,e[42]=Q,e[43]=ee,e[44]=K,e[45]=T,e[46]=fe,e[47]=He}else ot=e[33],de=e[34],Qe=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],De=e[40],se=e[41],Q=e[42],ee=e[43],K=e[44],T=e[45],fe=e[46],He=e[47];if(fe!==Symbol.for("react.early_return_sentinel"))return fe;let et;e[68]!==it||e[69]!==He?(et=r.jsx("div",{className:He,children:it}),e[68]=it,e[69]=He,e[70]=et):et=e[70];let Ke;e[71]!==ot||e[72]!==$e||e[73]!==Be||e[74]!==et?(Ke=r.jsx(ot,{items:$e,strategy:Be,children:et}),e[71]=ot,e[72]=$e,e[73]=Be,e[74]=et,e[75]=Ke):Ke=e[75];let $;e[76]!==Qe||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",Oa(ve,!1,I)),children:r.jsx(La,{section:ve,raw:Qe,meta:V,decofile:C})}):null,e[76]=Qe,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=ni.createPortal(r.jsx(Jl,{dropAnimation:Wi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==de||e[85]!==De||e[86]!==se||e[87]!==Q||e[88]!==ee||e[89]!==K||e[90]!==Ke||e[91]!==ie?(Ve=r.jsxs(de,{sensors:De,collisionDetection:se,onDragStart:Q,onDragEnd:ee,onDragCancel:K,children:[Ke,ie]}),e[84]=de,e[85]=De,e[86]=se,e[87]=Q,e[88]=ee,e[89]=K,e[90]=Ke,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Bc(v){return v.id}function Dc(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:Ts(v,p,S)}:{kind:"noop"};const V=As(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Yn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Ca="section-form-stale-save",Kc=3;function Pa(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ka(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Ba=new WeakMap;let Mc=0;function Fc(v){let e=Ba.get(v);return e===void 0&&(e=++Mc,Ba.set(v,e)),e}function mf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:X=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=$i(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=wl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Dl(_e),Z=Zn(),ze=xe?.virtualMcpId,Pe=yl(ze===e?e:null)?.metadata?.siteSlug??null,st=ac({virtualMcpId:e,branch:p,sandboxUrl:x}),ue=Rl(e,p),g=jl(ue),we=Vi(g),rt=!g,at=!!st||g,[m,L]=b.useState(null),[Ze,A]=b.useState(null),[Ye,H]=b.useState(null),[ot,de]=b.useState(0),[Qe,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[De,se]=b.useState(null),[Q,ee]=b.useState(null),[K,T]=b.useState([]),fe=b.useRef(null),[He,et]=b.useState(K.length);He!==K.length&&(et(K.length),requestAnimationFrame(()=>{fe.current&&(fe.current.scrollTop=0)}));const[Ke,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,We]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,za]=b.useState(!0),[Yt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(X),[Ps,Bs]=b.useState(X);X&&!Ps&&(Bs(!0),un(!0),L(null),A(null),H(null),T([])),!X&&Ps&&Bs(!1);const[$a,dn]=b.useState(null),[Ds,An]=b.useState(void 0),[Ks,Ot]=b.useState([]),[Ms,Qt]=b.useState(0),[Me,lt]=b.useState(0),[Ha,Fe]=b.useState(null),[Xt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=ii(),Cn=El({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Zi({orgSlug:v,virtualMcpId:e,branch:p}),[Wa,qa]=b.useState(V),[Ga,Ua]=b.useState(C),[Ja,Ya]=b.useState(_);(Wa!==V||Ga!==C||Ja!==_)&&(queueMicrotask(()=>fn.flush()),qa(V),Ua(C),Ya(_),L(null),A(null),H(null),de(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1));const B=el({orgSlug:v,virtualMcpId:e,branch:p}),mn=hl(t=>{B.mutate(t,{onSuccess:()=>k?.(),onError:B.reportError})},d??{},B.v8),Pn=zl({orgSlug:v,virtualMcpId:e,branch:p}),Ls=pc({orgSlug:v,virtualMcpId:e,branch:p}),[Zt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);Vl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,o]){const f=l==null?void 0:s[l],j=l==null?void 0:a[l],h=f&&j?.isSavedBlock?_s(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Qa,Xa]=b.useState(0),$s=li(ue,{orgSlug:v,virtualMcpId:e,branch:p}),Hs=ci($s,I[0]?.blockKey??null,ui(d,I[0]?.blockKey??null)),[Za,eo]=b.useState(null),ts=Tl(v,e).epoch,[to,no]=b.useState(ts);ic(Re?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Ws=_??(d&&u?_a(ka(d,u),V,C)?.key??null:null),ns=Sa({orgSlug:v,virtualMcpId:e,branch:p},Ws?[Ws]:[],{withRefs:!0}),[qs,so]=b.useState(!1),ss=Sa({orgSlug:v,virtualMcpId:e,branch:p},qs?Kl:[]),Gs={ready:!(ue.kind==="protocol"&&ue.hosted)||qs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>so(!0)};if(ns.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:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(di,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ro=ka(d,u),q=!!_,ae=q?null:_a(ro,V,C),y=q?_:ae?.key??null,rs=q&&_?d[_]:void 0,Us=q&&_&&rs?Ml(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,as=Re&&d&&u&&y&&ae?ia(d,{kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},u):null,ao=Re?nn?.seo:void 0,Dn=Ds!==void 0?Ds:ao,oo=Re?tl(Dn):void 0,Js=as?.seoTypeOptions??[],Ys=Re&&u?nl(u):"",os=$a??oo??{},Kn=Re&&as?lc(os,as):null,Qs=Re&&Kn&&sl(Dn)?Un(Kn,u):null,Xs=Re?rl(d,u)?.seoData:void 0,me=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ka(nn?.sections,d??{},g),yt=me.length>1,te=Math.min(ot,me.length-1),Se=me[te],M=Se?.sections??[],pe=kn(M,d,g),Mn=!q&&hc(nn?.sections,g);if(q&&_&&Fs!==_){Is(_);const t=M[0],n=pe[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),H(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:M,parsedSections:pe,decofile:d??{},activePageKey:y,pageVariants:me,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const io=()=>({multivariate:Mn,index:te,variants:me.map(t=>({rule:t.rule})),lazyValues:g&&Mn&&Ai(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Mn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},a=g?ba(y,s):Aa(y,s,d,u);w(a.length>0?a:null)},ls=w&&y&&Mn&&yt&&!Oe&&!Ee?y:null;if(ls!==Za&&(eo(ls),ls)){const t=me.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const a=io(),o=g?ba(y,a):Aa(y,a,d,u);if(!t||n<0){w(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:pe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?Nl(i):bc({...i,decofile:d,meta:u}),f=g?Cl(o,l):[...o,...l];w(f.length>0?f:null)},xt=(t,n,s,a=m??-1,o=!1)=>{const i=pt(t,n);if(!i){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const f=Yr(i,we)[s];if(!f){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const j=hi(f.value,d);A(j?.data??null),H(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),o&&$t(i,a,s)},cs=t=>{F(null),de(t),L(null),A(null),H(null),T([]);const n=me[t]?.rule,{resolveType:s,formValue:a}=Ut(n,d??{},u??void 0);ee(s),se(a),is(me.map(o=>({rule:o.rule})),t)},lo=(t,n)=>{const s=M[t],a=pe[t];if(!s||!a)return!1;const o=a.isMultivariate?pt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),lt(i),T([]),$(l=>l+1),a.isMultivariate)xt(s,a,i,t);else{const l=wt(s,a,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),qe(null),Fe(null)}return!0},Zs=P?.index;if(P!==void 0&&(P?.seq??null)!==Qe&&(ve(P?.seq??null),typeof Zs=="number"&&lo(Zs,0)),ts!==to){no(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||B.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(fe.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=pe[m];if(T([]),$(o=>o+1),!s||!a)L(null),A(null),H(null);else if(a.isMultivariate)xt(s,a,Me,m);else{const o=wt(s,a,d,g);A(o?.data??null),H(o?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Qt(s=>s+1))}if(Os!==Qa){Xa(Os);const t=m!==null?M[m]:null,n=m!==null?pe[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),H(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Pa(d,n,g),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?bs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,d,g):null,i=fi(ut,o,l=>Qr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Fn=Ye&&u?Un(Ye,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(d,y,t,te,me);B.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),B.reportError(a)}})},Ht=()=>{Ce?.(null),L(null),Tn(!1),A(null),H(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(fe.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,W.error(t,{id:Ca}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=ue.kind==="protocol"&&ue.source==="github",rr=t=>Bl(Nn,Cn,t,ue.kind==="protocol"?ue:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},co=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=re.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{ct.current=t,ke(t)},uo=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:na(a.plan,a.choices,t.plan),fresh:Ii(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||Wn(a.plan.theirs)!==Wn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},or=(t,n)=>{const s=ct.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(Wn(o.plan.mine)===Wn(n))return!0;const i=ta({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:na(o.plan,o.choices,i)})),!0},fo=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},mo=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!or(n,a)&&yn(a,n.sectionIndex,0,s),ct.current[0]??null},po=()=>{const t=ct.current[0],n=mo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=Ri(n.plan,n.choices);ue.kind==="protocol"&&ue.source==="github"&&ji(n.plan,n.choices)&&Al(c,!1),vn(ct.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(zt.current===a||fo(n))&&(zt.current=a,A(s),$(i=>i+1)),yn(s,a.sectionIndex,0,o)},ho=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??co(n),l=i.sectionVariantIndex,f=i.formBase,j=o||ea(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const D=typeof t=="function"?t():t,z=ea(ct.current,f,i,n,g).base;if(z&&or(z,D))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Y,variantIndex:be}=Pa(ne,i,g),Ie=i.pageKey,he=J[n];if(!he)return;const ce=Ne[n];if(!ce)return;const Ge=f?.base,Xe=bs(he,ce,l,ne,g),Nt=!!Ge&&!!Xe&&Ni(Ge,Xe)&&!(f&&Qr(f,Xe));if(Nt&&Ge&&Xe){if(Ci(Ge,Xe)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ce.isSavedBlock?"here":Pi(Ge,J.map((oe,mt)=>bs(oe,Ne[mt],l,ne,g)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&L(U),yn(D,U,s,i);return}}const Ct=Nt&&Ge&&Xe?ta({ancestor:Ge,mine:D,theirs:Xe}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,uo({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Bi(Ct),changedAgain:!1,blockKey:ce.isSavedBlock?_s(he,ce):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??D,qr=Di({merged:!!Pt,tracked:f,current:zt.current,saved:D});Pt&&W.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Ca}),qr&&f&&(f.emitted=Pt,A(Pt));const Ss=qr||!Pt?rn:D;f&&(f.base=Ss,f.sectionCount=J.length,Ki(f,Ss));const Gr={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof Pl){if(f&&(f.version=void 0),s<Kc){ye.current.delete(R),hn.current=!0;const oe=Li(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:D},n,s+1,i,oe.immediate),ye.current.delete(R),ar(xn(g))},oe.delay)}else us();return}B.reportError(U)}},Ur=U=>{pn.current=!0;let oe=!1;B.mutateAsync(U).then(()=>Gr.onSuccess(),mt=>{oe=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,ar(oe?xn(g):0),tr()})};if(ce.isSavedBlock){const U=_s(he,ce);if(!U)return;Ur({blockKey:U,data:rn,...Ge?{base:{value:Mi({startedFrom:Ge,stored:Xe,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:sa({formBase:f,rebased:!!Pt,versionOf:rr,productionVersionOf:oe=>aa(Nn,Cn,oe),...sr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Hn={...ne[Ie]},Gt=[...J];if(ce.isMultivariate){const U=pt(he,ce);if(!U||!Ie)return;const oe=Fi(U,l,rn);Gt[n]=Bt(he,ce,oe)}else if(ce.isHidden){const U=Cs(he.__resolveType),oe=U?{...he.section}:{...he},mt=Array.isArray(oe.variants)?[...oe.variants]:[];mt[0]&&(mt[0]=ra(oe.__resolveType,mt[0],rn)),oe.variants=mt,U?Gt[n]={...he,section:oe}:Gt[n]=oe}else ce.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Y.length>1){const U=Hn.sections,oe=[...U?.variants??[]];oe[be]&&(oe[be]=ra(U?.__resolveType,oe[be],Gt)),Hn.sections={...U,variants:oe}}else Hn.sections=Gt;Ur({blockKey:Ie,data:Hn,rebaseOnConflict:!1,guard:sa({formBase:null,rebased:!1,versionOf:rr,productionVersionOf:U=>aa(Nn,Cn,U),...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},go=t=>{tn.current=!1,L(t),lt(0),T([]),$(o=>o+1);const n=M[t],s=pe[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const a=wt(n,s,d,g);if(!a){A(null),H(null),qe(null),Fe(null),$t(null,t,0);return}A(a.data),H(a.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=Ei(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Ze,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!ae)return;const n={kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},s=ia(d,n,u);s&&fn.save(y,()=>{const a=Nn.getQueryData(Ti.decofile(Cn))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Bn.current};return Bn.current={},t?.raw!==void 0?cc(o,t.raw,u):t?.inner!==void 0?uc(n,s,o,t.inner):o})},lr=(t,n)=>{y&&(Bn.current[t]=n,ds())},vo=(t,n)=>{if(!y)return;const s=Qn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},yo=t=>{if(!y)return;const n=M.filter((s,a)=>a!==t);m===t?Ht():m!==null&&m>t&&L(m-1),dt(n)},So=t=>{if(!y)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,gl(n)),m!==null&&m>t&&L(m+1),dt(s)},bo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s)return;const a=s.isHidden?_i(n,g):ki(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},xo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s||s.isMultivariate)return;const a=xi(n);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},_o=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s?.isSavedBlock)return;const a=wt(n,s,d,g);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Ht(),dt(l)},ko=t=>{if(!y)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;dt(n,{onError:()=>{re.current.selectedSectionIndex===s&&Ht()}}),We(!1),L(s),lt(0),T([]),$(l=>l+1);const a=n[s],o=kn(n,d,g)[s];if(!a||!o)return;if(o.isMultivariate){xt(a,o,0);return}const i=wt(a,o,d,g);if(!i){A(null),H(null),qe(null),Fe(null);return}A(i.data),H(i.resolveType),qe(null),Fe(null)},cr=t=>{jn.current=t.append,We(!0)},wo=t=>{const n=jn.current;if(!n){ko(t);return}n({__resolveType:t.resolveType}),We(!1),jn.current=null},ur=t=>{if(m===null)return;const n=M[m],s=pe[m];!n||!s?.isMultivariate||(lt(t),T([]),$(a=>a+1),xt(n,s,t,m,!0))},Ro=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=Si(a,t);if(!o){W.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Bt(n,s,o);const l=o.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},jo=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=bi(a,t,g),i=[...M];i[m]=Bt(n,s,o);const l=Zr(a.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},Eo=(t,n)=>{if(m===null||!y||t===n)return;const s=M[m],a=pe[m];if(!s||!a?.isMultivariate)return;const o=pt(s,a);if(!o)return;const i=vi(o,t,n),l=[...M];l[m]=Bt(s,a,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],a,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=M[n],a=pe[n];if(!s||!a)return;const o=gi(s,a,void 0,u,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){W.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(o.newVariantIndex),T([]),$(f=>f+1),xt(o.section,l,o.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=M[m],n=pe[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const a=yi(t,n,s);if(!a){W.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=kn(o,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(a,i,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),$t(null,m,0),dt(o)},Vo=async t=>{if(ie===null||!y)return;const n=Yn(t,d,u);if(n){W.error(n);return}const s=M[ie],a=pe[ie];if(!s||!a)return;const o=wt(s,a,d,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await B.mutateAsync({blockKey:t,data:i,create:!0}),f=[...M];f[ie]={__resolveType:t},await B.mutateAsync({blockKey:y,data:on(d,y,f,te,me)}),m===ie&&Ht(),Ve(null),Gn(l)||W.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){W.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Dt(c,Kt(l))})}},fr=Se?.rule;if(yt&&m===null&&Q===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?al(u):[],fs=u&&d?ol(u,d):[],Wt=g&&u&&d?dc(u,d):[],ms=(t,n)=>{if(Wt.length===0)return;const s=Fl(t);return{kinds:Wt,selected:s,campaignPrefill:fc(t),onPick:n,load:Gs}},mr=!q&&!!(at&&u&&d),pr=Q&&u?Un(Q,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(yc(n,t,u,g))try{await Pn.mutateAsync({blockKey:t})}catch(s){W.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Dt(c,Kt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],f=l[a],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:D,...z}=t;B.mutate({blockKey:h,data:Ft(D??"",z,E)},{onSuccess:()=>k?.(),onError:B.reportError});return}f&&(l[a]={...f,rule:t}),o.sections={...i,variants:l},B.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Ta(t,u):{__resolveType:Xr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Q?{__resolveType:Q,...n}:{...n};hr(s)},In=async(t,n,s)=>{const a=mc(n,t);if(!a.ok)return a.reason==="conflict"&&W.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),xa),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 Ls.apply({writes:o})).ok?null:(a.blockWrite&&W.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...xa,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},yr=Wt.length>0?{kinds:Wt,load:Gs,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Il(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Ll(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=await In(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],D=E[a];return D?(E[a]={...D,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!o)return;const{resolveType:i,formValue:l}=Ut(o.rule,o.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[a];if(!j)return;const h=Mt(j.rule,s,u),R=cn(t);f[a]={...j,rule:R};const E={...s,[n]:{...o,sections:{...l,variants:f}}},{resolveType:D,formValue:z}=Ut(R,E,u??void 0);ee(D),se(z);try{await B.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Dt(c,Kt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Y=z?.__resolveType??"",be=i[Y],Ie=typeof be?.name=="string"?be.name:Y,{__resolveType:he,...ce}=t;B.mutate({blockKey:Y,data:Ft(he??"",ce,Ie)},{onSuccess:()=>k?.(),onError:B.reportError});return}const ne=xs(E,s,t),J=[...a];J[n]=Bt(h,R,ne);const Ne=on(i,l,J,j,f);B.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g)))},To=t=>{qe(t);const n=t?Ta(t,u):{__resolveType:Xr(u)};Fe(t?n:{}),xr(n)},Ao=t=>{const n=t;Fe(n);const s=Xt?{__resolveType:Xt,...n}:{...n};xr(s)},No=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await In(t,i,D=>{const z=a[n],ne=o[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...a];return Ne[n]=Bt(z,ne,xs(J,s,D)),{blockKey:l,data:on(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},Co=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const D=E.variants??[],z=Mt(D[s]?.rule,i,u),ne=cn(t),J=xs(E,s,ne),Ne=[...a];Ne[n]=Bt(h,R,J);const Y=on(i,l,Ne,j,f),be={...i,[l]:Y},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await B.mutateAsync({blockKey:l,data:Y}),z&&z!==t&&await qt(z,be),k?.()}catch(ce){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Dt(c,Kt(ce))})}};if(!q&&!ae)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!rs)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?pe[m]??null:null,_r=m!==null?M[m]:null,kr=_r&&je?.isMultivariate?pt(_r,je):null,Vt=kr?Yr(kr,we,g):[],Ln=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=je?.isMultivariate===!0,ps=m!==null&&je!==null,At=ps&&(Tt||!!(Fn&&Ze)),Po=At&&!q&&je?.isSavedBlock===!0,ft=q||Po,wr=q?Us:je?.label??"",Bo=Xt&&u?Un(Xt,u):null,Rr=(t,n)=>n&&Z?`${t} · ${n}`:t,jr=je?je.variantOf??je.label:"",Do=(()=>{const t=Tt&&kt?kt.label:null;return t?Z?[Rr(jr,t)]:[je.label,t]:[je?.label??""]})(),hs=Rr(ae?.name??"",yt?Se?.label:null),On=At&&(!q||K.length>0)?q?[Us,...K]:[hs,...Do,...K]:[],Er=Re&&ae?[ae.name,"SEO",...Ks]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Yt&&ae?[ae.name,Vr]:Lt&&ae&&je?[hs,jr,Vr]:[],zn=Tr.length>0?Tr:Er.length>0?Er:ft?On.length>0?On:[wr]:On.length>0?On:[hs],Ar=ps&&!Tt&&!je?.isHidden&&!!y,Ko=ft||!q&&yt&&!!Se||Ar,Mo=ps&&!Tt&&!q&&K.length===0&&!!je&&Da(je)&&!!y,Fo=Z&&At&&!Lt&&Tt&&K.length===0&&!!kt,Nr=Z&&K.length>0?la(K[K.length-1]):null,Io=K.length>1?la(K[K.length-2]):null,Cr=ft?wr:At?je?.label??"":ae?.name??"",Lo=Yt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?je?.variantOf??je?.label??"":Yt||Re?ae?.name??"":Nr?Io??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?ae?.name??"":ae?.path??"",gs=!Yt&&!Lt&&!Re&&!At&&!ft,Oo=!Z&&!Re&&!q&&Tt&&K.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=gc(t.sections,M,u,g);if(!n)return;const{sections:s,newVariantIndex:a}=n;B.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{de(a),L(null),A(null),H(null),T([]),se(null),ee(null)},onError:B.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const a=d[y],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=vc(i,l),j={...d,[y]:{...a,sections:f}};B.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:B.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),de(s);const a=Qn(me.map(o=>({rule:o.rule})),t,n);is(a,s),$n(o=>Qn(o,t,n))},Dr=t=>{const n=me[t]?.rule,s=Mt(n,d??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{me.length-1===1?de(0):t<te?de(te-1):t===te&&de(Math.max(0,t-1)),L(null),A(null),H(null),T([]),se(null),ee(null)},s)},zo=()=>{const t=me.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!wi(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Oi({variants:n}),a=n[s];return a?[{...a,rule:zi(u)}]:null},()=>{de(0),L(null),A(null),H(null),T([]),se(null),ee(null),Vn(!1)},t)},Kr=t=>{let n=t+1;$n(s=>(n=Zr(s,t,g),Sc(s,t,g)),()=>{de(n),L(null),A(null),H(null),T([]),se(null),ee(null)})},$o=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,a=re.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,a,u)){F(null);return}const Y=h.__resolveType??"";f[t]={...j,rule:Ts(h,a,u)};const be={...a,[s]:{...o,sections:{...l,variants:f}}};await B.mutateAsync({blockKey:s,data:be[s]}),await qt(Y,be),F(null),k?.();return}const E=As(h,a,u);if(!E){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await B.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),F(null),k?.();return}const D=Jn(R),z=Yn(D,a,u);if(z){W.error(z);return}const ne=Ft(E.resolveType,E.data,R);let J=null,Ne=!1;try{const Y=await B.mutateAsync({blockKey:D,data:ne,create:!0});Ne=Gn(Y),J=Ne?null:D,f[t]={...j,rule:cn(D)},await B.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:f}}}),J=null}catch(Y){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Y}F(null),Ne||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Dt(c,Kt(E))})}finally{en(!1)}},Ho=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=a[s],R=o[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const D=E.variants??[],z=D[t];if(!z?.rule||typeof z.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Y=>{const be={...E,variants:Y},Ie=[...a];Ie[s]=Bt(h,R,be);const he=on(i,l,Ie,j,f);return await B.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Xe=ne.__resolveType??"",Nt=[...D];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Xe,Ct),O(null),k?.();return}const Y=As(ne,i,u);if(!Y){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Y.blockKey){await B.mutateAsync({blockKey:Y.blockKey,data:Ft(Y.resolveType,Y.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Yn(be,i,u);if(Ie){W.error(Ie);return}const he=Ft(Y.resolveType,Y.data,J);let ce=null,Ge=!1;try{const Xe=await B.mutateAsync({blockKey:be,data:he,create:!0});Ge=Gn(Xe),ce=Ge?null:be;const Nt=[...D];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ce=null}catch(Xe){throw ce&&await Pn.mutateAsync({blockKey:ce}).catch(()=>{}),Xe}O(null),Ge||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Y){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Dt(c,Kt(Y))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await B.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Wo={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Mr(a,t,E),{...o,[a]:E}},h=Dc(f,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){W.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const D=[...i];D[n]={...l,rule:h.inlinedRule};const z=await j(D);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await B.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const D=await B.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Gn(D),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(D){throw R&&await Pn.mutateAsync({blockKey:R}).catch(()=>{}),D}E||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Dt(c,Kt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,o,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...o,[a]:j};try{await Mr(a,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Dt(c,Kt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;let i=null;!await In(s,o,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:a,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Ht(),g&&$t(null,-1,0)},Ir=t=>{dn(t),ds({inner:t})},Lr=t=>{An(t),ds({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Qt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1),ge?.()},qo=()=>{Vn(!1),Tn(!1),L(null),un(!0)},Go=()=>{Re&&$r(),L(null),Vn(!0)},Uo=()=>Tn(!0),vs=t=>{if(Yt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(Re){if(t===0){$r();return}if(t===1){Ot([]),Qt(s=>s+1);return}Ot(Ks.slice(0,t-1)),Qt(s=>s+1);return}if(q){T(K.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!Z&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(K.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(vl(zn.length,{isMultivariateSectionTop:Oo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(kl,{className:"size-4"})}):null,Jo=ft||At||Re?Ko&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"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&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("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",ll),children:[r.jsx(il,{rule:Rs(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(qn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("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(ca,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(ya,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(qn,{onClick:bn})]}),Yo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(ua,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Kr,onDelete:Dr,onAdd:bn}),yt&&Q!==null&&r.jsx(da,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Q,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:De,onChange:vr,formKey:`${te}:${Q??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Hr=r.jsxs(r.Fragment,{children:[r.jsx(cl,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:ur,onRename:O,onDuplicate:jo,onDelete:Ro,onRemoveAll:dr,onReorder:Eo,onAdd:()=>Sn()}),r.jsx(da,{children:r.jsx(ks,{currentRt:Xt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:To,onSelectGlobal:Co,named:ms(kt?.rule,No),namedRow:ws(kt?.rule,Wt),rule:kt?.rule,schema:Bo,formValue:Ha,onChange:Ao,formKey:`${m??"none"}:${Ln}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr=r.jsx("div",{className:le(Z?"px-2":"p-2 pt-3"),children:r.jsx(Pc,{listKey:`${y??""}-${te}`,rawSections:M,sections:pe,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{go(t),Je?.(t)},onReorder:vo,onDelete:yo,onDuplicate:So,onMakeReusable:Ve,onToggleHidden:bo,onToggleLazy:rt?xo:void 0,onAddVariant:Sn,onDetach:_o,onAddSection:()=>We(!0),canAddSection:mr})}),Qo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&ae&&r.jsx(ca,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr}),nn&&y?r.jsx(Ea,{rawSeo:Dn,innerSeo:os,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Kn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Xs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Xo=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(Ea,{rawSeo:Dn,innerSeo:os,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Kn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Xs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Zo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(ua,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Kr,onDelete:Dr,onAdd:bn}),yt&&Q!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>za(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":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Sl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(bl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Q,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:De,onChange:vr,formKey:`${te}:${Q??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr]},"editor-section-list");return r.jsx(ul,{value:g,children:r.jsx(dl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!Z&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(Z||zn.length>1)&&r.jsx(fl,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:Z?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[Z&&ys,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("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:Lo}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),gs&&yt&&Se&&r.jsx(fa,{variants:me,activeIndex:te,onSelect:cs,onManage:Go,onRemoveAll:zo}),Fo&&r.jsx(fa,{variants:Vt,activeIndex:Ln,onSelect:ur,onManage:Uo,onRemoveAll:dr}),gs&&!yt&&r.jsx(qn,{onClick:bn}),Mo&&r.jsx(qn,{onClick:()=>Sn()}),r.jsx(ml,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:qo,children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(ya,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Jo}),ut&&r.jsx(mi,{open:!0,fields:pi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Hs??null,authorPending:Hs===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>ho({...ut.choices,[t]:n}),onApply:po},Fc(ut.formBase)),Lt?r.jsx(ma,{onAdd:()=>Sn(),children:Hr},"editor-section-variants"):At?r.jsxs(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!Z&&Tt&&Vt.length>0&&K.length===0&&Hr,r.jsx(Va,{value:yr,children:r.jsx(pa,{value:q&&g?Be:null,children:r.jsx(ha,{activeSchema:Fn,formValue:Ze,formResetKey:Ke,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Wo:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Va,{value:yr,children:r.jsx(pa,{value:q&&g?Be:null,children:r.jsx(ha,{activeSchema:Fn,formValue:Ze,formResetKey:Ke,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):Re?Z?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Qo})},"editor-seo"):Xo:Yt?r.jsx(ma,{onAdd:bn,children:Yo},"editor-variants"):Z?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(Ns,{canAddSection:mr,onAddSection:()=>We(!0)})})]},"editor-section-list"):Zo,r.jsx(pl,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(pe[ie]?.label??""):"",isPending:B.isPending,onSubmit:Vo}),at&&r.jsx(oc,{open:Ae,onOpenChange:t=>{We(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:wo}),ht&&y&&d&&r.jsx($l,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(ga,{open:!0,initialName:Jt(me[Te]?.rule,d??{},u??void 0)?_n(me[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(me[Te]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await $o(Te,t)},onOpenChange:t=>{!t&&!Zt&&F(null)}}),tt!==null&&r.jsx(ga,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(Vt[tt]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Ho(tt,t)},onOpenChange:t=>{!t&&!Zt&&O(null)}})]})})})}export{mf as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aU as i,T as e,l as s}from"./agent-icon-
|
|
1
|
+
import{aU as i,T as e,l as s}from"./agent-icon-Bd5DjuVH.js";import{c8 as n}from"./index-DLrFWx5Y.js";import{a as o}from"./UserSquare-DGUSiZ1P.js";const r=["general","views","connections","repository","site"],a={general:{icon:s,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},views:{icon:o,titleKey:"virtualMcp.settings.views.title",descriptionKey:"virtualMcp.settings.views.description"},connections:{icon:i,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},repository:{icon:n,titleKey:"virtualMcp.settings.repository.title",descriptionKey:"virtualMcp.settings.repository.description"},site:{icon:e,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function g(t){return!!t&&r.includes(t)}export{a as P,r as a,g as i};
|