decocms 4.446.2 → 4.447.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DjoFdKqn.js → AlertCircle-Dsxcywwk.js} +1 -1
- package/dist/client/assets/{AreaChart-B4-QNIT5.js → AreaChart-BzkZYIYf.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DCPdaQBd.js → ArrowLeft-CUAoXnBl.js} +1 -1
- package/dist/client/assets/{ArrowUp-CxGCH_mE.js → ArrowUp-DvEWAQS1.js} +1 -1
- package/dist/client/assets/{Building02-DQhkI7KU.js → Building02-DQSa0aPk.js} +1 -1
- package/dist/client/assets/{CartesianChart-B1qOpm8T.js → CartesianChart-C_rbOUc_.js} +1 -1
- package/dist/client/assets/{Check-aE-8J-dx.js → Check-CzhgdtoZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-Yu1WDdmS.js → CheckCircle-48zzWb5o.js} +1 -1
- package/dist/client/assets/{ChevronUp-Br5R9lTH.js → ChevronUp-bPHHer4a.js} +1 -1
- package/dist/client/assets/{Copy01-CtLn8eQC.js → Copy01-DK-rveWk.js} +1 -1
- package/dist/client/assets/{CreditCard01-DARYnajC.js → CreditCard01-Bv4apDUd.js} +1 -1
- package/dist/client/assets/{DotsVertical-BkKYV-uH.js → DotsVertical-Cz9DnVkj.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-C1OQDTFH.js → ErrorBarContext-CAdF3KX1.js} +1 -1
- package/dist/client/assets/{Image01-CUJhdG59.js → Image01-DkSAzjSu.js} +1 -1
- package/dist/client/assets/{Key01-DA8aX6Mo.js → Key01-2_VP-ymA.js} +1 -1
- package/dist/client/assets/{Line-rn1mQt36.js → Line-BEPKdvRr.js} +1 -1
- package/dist/client/assets/{Link01-PgFxgiYI.js → Link01-CBIFqZsw.js} +1 -1
- package/dist/client/assets/{LinkBroken01-_oPW_2dj.js → LinkBroken01-CyPIuvAF.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Bzb2WBKu.js → LinkExternal01-D20IL3CN.js} +1 -1
- package/dist/client/assets/{Monitor01-evoIPilr.js → Monitor01-WwJ1rHPk.js} +1 -1
- package/dist/client/assets/{Palette-CI5-z0zm.js → Palette-jHJa2pFE.js} +1 -1
- package/dist/client/assets/{Plus-MXLtMY7l.js → Plus-BvxsRY-0.js} +1 -1
- package/dist/client/assets/{SearchMd-D2iMNQwW.js → SearchMd-CHmk5GD6.js} +1 -1
- package/dist/client/assets/{Sector-C_r2Ffen.js → Sector-BZGQzXCu.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BUSIbN12.js → ShoppingBag01-D0N-Vb4c.js} +1 -1
- package/dist/client/assets/{Sun-DaF8KN8m.js → Sun-7ajd25ZV.js} +1 -1
- package/dist/client/assets/{Tool01-BgPGiYBJ.js → Tool01-DetpIMtk.js} +1 -1
- package/dist/client/assets/{Trash01-DEfHm1-C.js → Trash01-DKbCrUTj.js} +1 -1
- package/dist/client/assets/{Upload01-AiwUaS84.js → Upload01-BBKhvCnt.js} +1 -1
- package/dist/client/assets/{User01-BJjdpbkY.js → User01-D2Lmw0ef.js} +1 -1
- package/dist/client/assets/{UserSquare-DkdLf214.js → UserSquare-CuUPyuma.js} +1 -1
- package/dist/client/assets/{Users01-DB-isk4t.js → Users01-DsJzDkrr.js} +1 -1
- package/dist/client/assets/{X-BHK_66ka.js → X-ateu7dRb.js} +1 -1
- package/dist/client/assets/{XAxis-alrFH4LG.js → XAxis-o5Dc22O9.js} +1 -1
- package/dist/client/assets/{XClose-oHtKIul6.js → XClose-Chbrrnow.js} +1 -1
- package/dist/client/assets/{ZoomOut-tzNSNsYS.js → ZoomOut-Bt3p5CRf.js} +1 -1
- package/dist/client/assets/{access-gate-DCBw1mxT.js → access-gate-Uqlikjgu.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CxePJyfV.js → add-connection-dialog-B0L-P2sh.js} +1 -1
- package/dist/client/assets/{agent-analytics-CmDIgmaf.js → agent-analytics-BFb91OPU.js} +1 -1
- package/dist/client/assets/agent-app-Dz4q7M33.js +1 -0
- package/dist/client/assets/{agent-assets-BKN8mrH9.js → agent-assets-CLxww7C0.js} +1 -1
- package/dist/client/assets/{agent-automation-D2_4jFte.js → agent-automation-CIS8quGB.js} +1 -1
- package/dist/client/assets/{agent-automations-BdO5Otm-.js → agent-automations-BFirWNhs.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-C_Vz66Hn.js → agent-connect-sources-BwAWjblO.js} +1 -1
- package/dist/client/assets/agent-deck-WsR4Kn9L.js +1 -0
- package/dist/client/assets/{agent-e2e-BtxZGTPP.js → agent-e2e-BaIs1jb9.js} +1 -1
- package/dist/client/assets/{agent-experiments-jrY0lkQL.js → agent-experiments-1jqEeSlQ.js} +1 -1
- package/dist/client/assets/{agent-file-DW7h_l0N.js → agent-file-53hFn7yw.js} +1 -1
- package/dist/client/assets/{agent-git-CNZofsuU.js → agent-git-CTTGxwmS.js} +1 -1
- package/dist/client/assets/{agent-hosting-Do0x_Cui.js → agent-hosting--ETESSTx.js} +1 -1
- package/dist/client/assets/{agent-icon-B_yyO4wu.js → agent-icon-BRxvZRmN.js} +1 -1
- package/dist/client/assets/agent-library-BKKs17DG.js +1 -0
- package/dist/client/assets/agent-library-file-os4HTtuL.js +1 -0
- package/dist/client/assets/{agent-monitor-qUYNqgR7.js → agent-monitor-BILhL5_y.js} +1 -1
- package/dist/client/assets/{agent-overview-CIJcl1y9.js → agent-overview-DZ3BLKKZ.js} +1 -1
- package/dist/client/assets/agent-settings-DkVBAYdv.js +1 -0
- package/dist/client/assets/{agent-site-editor-CGcJkBvQ.js → agent-site-editor-BL5gelUr.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BhSQKIbt.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-C3un--7d.js → agent-site-editor-content-BopCmF1V.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CzW3y0aF.js → agent-site-editor-preview-CvTzIzXq.js} +3 -3
- package/dist/client/assets/agent-view-DHNwmHuh.js +1 -0
- package/dist/client/assets/{agent-view-guard-COpIrMD5.js → agent-view-guard-C9ItTzPi.js} +1 -1
- package/dist/client/assets/{agents-list-DbnK_TS0.js → agents-list-COSLVvDS.js} +1 -1
- package/dist/client/assets/{ai-providers-BWZH15D3.js → ai-providers-BCvug74N.js} +1 -1
- package/dist/client/assets/{alert-B1_hjg8d.js → alert-DsodQpgY.js} +1 -1
- package/dist/client/assets/{alert-dialog-D39kK11B.js → alert-dialog-Dr37XaeA.js} +1 -1
- package/dist/client/assets/{analytics-sections-DioPGL-G.js → analytics-sections-DbtkycCZ.js} +1 -1
- package/dist/client/assets/api-keys-Cz0CzGuc.js +1 -0
- package/dist/client/assets/{api-keys-DRbDIYDv.js → api-keys-DAccLTlD.js} +1 -1
- package/dist/client/assets/app-editor-JPlYmOB_.js +1 -0
- package/dist/client/assets/{asset-utils-BO8plCL6.js → asset-utils-CEMW7jjJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-DRT8MYeJ.js → auth-catchall--nnHYbyR.js} +1 -1
- package/dist/client/assets/{auth-entry-0e7KL3PN.js → auth-entry-Dc4OnWLn.js} +1 -1
- package/dist/client/assets/{auth-BII1ityf.js → auth-qAvZ1LNt.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bg4lwkz7.js → auth-split-layout-Co7x06Lg.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-D4OxRuRh.js → authenticate-and-persist-oauth-Bm9fWsOa.js} +1 -1
- package/dist/client/assets/{automation-list-row-cmz2A1Mm.js → automation-list-row-CqDXRJhE.js} +1 -1
- package/dist/client/assets/{automation-runs-By1RUmSp.js → automation-runs-bvqul2ks.js} +1 -1
- package/dist/client/assets/{automations-Dxsyy-_P.js → automations-Jd1l1G4G.js} +1 -1
- package/dist/client/assets/{autosend-B3t52XX_.js → autosend-BrczLssG.js} +1 -1
- package/dist/client/assets/{avatar-BTitfgsj.js → avatar-Be2YP03d.js} +1 -1
- package/dist/client/assets/{badge-E2auaQms.js → badge-BbkeIMgp.js} +1 -1
- package/dist/client/assets/{block-document-C0DAZm8i.js → block-document-Df24gcAz.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Pq5_mqQ_.js → blocks-preview-workspace-context-CeDfLC0U.js} +1 -1
- package/dist/client/assets/{buckets-BJvCDpwG.js → buckets-9WzbA5Lg.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DbrN2I_U.js → build-improve-prompt-doc-Cp9ERAt-.js} +1 -1
- package/dist/client/assets/{calendar-1uM2n-Jw.js → calendar-B6jARNSc.js} +1 -1
- package/dist/client/assets/{capability-load-error--JlNKsUV.js → capability-load-error-DPnEcJx5.js} +1 -1
- package/dist/client/assets/{category-editor-BRLR25s7.js → category-editor-By3O-w3E.js} +1 -1
- package/dist/client/assets/{chart-BWgcHAUx.js → chart-DQLuV_FI.js} +1 -1
- package/dist/client/assets/{chat-context-rrrEGdS4.js → chat-context-Bf1EEUa_.js} +1 -1
- package/dist/client/assets/{chat-draft-dKpt_1aH.js → chat-draft-D0DwqSRP.js} +1 -1
- package/dist/client/assets/{checkbox-Dzt92tI8.js → checkbox-GjKetutN.js} +1 -1
- package/dist/client/assets/{choose-editor-CuReZRwP.js → choose-editor-CCuyU2RH.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BIkHWTfz.js → claim-phase-copy-qcCOlkIz.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Cgszpcpc.js → cli-auth-success-B9a1R8wa.js} +1 -1
- package/dist/client/assets/{client-icons-7ySP-Erv.js → client-icons-C4EJJI6g.js} +1 -1
- package/dist/client/assets/{collapsible-wtqcAzkF.js → collapsible-C3DyD3IY.js} +1 -1
- package/dist/client/assets/{collection-detail-DFQ_Ozgb.js → collection-detail-4z7JbQw1.js} +1 -1
- package/dist/client/assets/{collection-display-button-C5weD_DC.js → collection-display-button-C0cLpFRb.js} +1 -1
- package/dist/client/assets/{collection-search-B7qdcCbg.js → collection-search-qakQR89K.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Ca4ZKWBI.js → collection-table-wrapper-4oDVKFGl.js} +1 -1
- package/dist/client/assets/{collection-tabs-B4z9WtuV.js → collection-tabs-CJy8rHXV.js} +1 -1
- package/dist/client/assets/{column-rules-D1hu0gi4.js → column-rules-DMmszLDK.js} +1 -1
- package/dist/client/assets/{combobox-pwfK5e2Y.js → combobox-CKdv5r-2.js} +1 -1
- package/dist/client/assets/{command-DTs9ObR-.js → command-CNDsxgwl.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BRquAdAG.js → companion-mcps-section-bUkIE-gG.js} +1 -1
- package/dist/client/assets/{config-C96MdU2Q.js → config-BFtdxgOC.js} +1 -1
- package/dist/client/assets/{connect-JpHHEq0g.js → connect-C_Bx49BR.js} +1 -1
- package/dist/client/assets/{connect-layout-C6hpYb9u.js → connect-layout-clJE61fN.js} +1 -1
- package/dist/client/assets/{connection-B2m_fkQ_.js → connection-KyEHQxp9.js} +1 -1
- package/dist/client/assets/{connection-card-DBWNFKql.js → connection-card-XVRQmb88.js} +1 -1
- package/dist/client/assets/{connection-detail-C0vRZ2H6.js → connection-detail-qTgpDNX7.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BwQZA_xH.js → connection-form-helpers-Bz949-9G.js} +1 -1
- package/dist/client/assets/{connections-CDnUvJCF.js → connections-R5S4BIDs.js} +1 -1
- package/dist/client/assets/{context-Dkg4joGs.js → context-BA5tBJat.js} +1 -1
- package/dist/client/assets/{context-menu-CEwcq9KD.js → context-menu-BElFzhuX.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-B_uh2TuL.js → create-organization-dialog-DKdoNuXz.js} +1 -1
- package/dist/client/assets/daily-pulse-CKz-O4VD.js +1 -0
- package/dist/client/assets/{decopilot-DNRWEod6.js → decopilot-D0L_iZDN.js} +1 -1
- package/dist/client/assets/{device-hint-CPjfUQMP.js → device-hint-BHJC54cI.js} +1 -1
- package/dist/client/assets/{dialog-BDXg80r_.js → dialog-CSMrPqBB.js} +1 -1
- package/dist/client/assets/{discover-C1wwFXVd.js → discover-DDLMC3cx.js} +1 -1
- package/dist/client/assets/{domain-settings-DbZZ4hAo.js → domain-settings-Cr2aZAf_.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CgdOlOsO.js → download-app-dialog-DegRrl-D.js} +1 -1
- package/dist/client/assets/{drawer-DAp1D7F-.js → drawer-DamNEeFr.js} +1 -1
- package/dist/client/assets/{editor-D6ylwlDD.js → editor-D-2XKeKJ.js} +1 -1
- package/dist/client/assets/{empty-state-BWACKPTq.js → empty-state-DfF0wZnW.js} +1 -1
- package/dist/client/assets/{empty-state-DXW-Qm8C.js → empty-state-e8q1K35w.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C3og9nET.js → extract-connection-data-Yv51Ip2F.js} +1 -1
- package/dist/client/assets/{feature-gate-DvnLrc-B.js → feature-gate-Dj2ZsmzR.js} +1 -1
- package/dist/client/assets/{feature-paywall-C__T43mL.js → feature-paywall-DK7jIYwT.js} +1 -1
- package/dist/client/assets/{file-explorer-BlJGBAuC.js → file-explorer-CfxW2_sL.js} +1 -1
- package/dist/client/assets/{file-preview-BQqXnMWa.js → file-preview-ODrawZXt.js} +1 -1
- package/dist/client/assets/{file-share-button-B0H2-78i.js → file-share-button-DT9bUw3x.js} +1 -1
- package/dist/client/assets/{file-type-icon-DzrUMDgr.js → file-type-icon-Bv7OJA49.js} +1 -1
- package/dist/client/assets/flat-project-C-eO96A2.js +1 -0
- package/dist/client/assets/{folder-icon-CnNcFzK_.js → folder-icon-DGqv3QUB.js} +1 -1
- package/dist/client/assets/{form-BQW41VGV.js → form-BJXkrxaF.js} +1 -1
- package/dist/client/assets/{gateway-client-DeH7kjYP.js → gateway-client-9xfivYUp.js} +1 -1
- package/dist/client/assets/{general-DpC2Xqx-.js → general-BP_QzpXy.js} +1 -1
- package/dist/client/assets/{home-BGumdQEa.js → home-VShFyYWB.js} +1 -1
- package/dist/client/assets/{icon-button-DexH_d8x.js → icon-button-C4oA9vAv.js} +1 -1
- package/dist/client/assets/{index-BaM-tpLs.js → index-4hz_47mP.js} +3 -3
- package/dist/client/assets/{index-DXEiFGhx.js → index-Bj6rDen7.js} +1 -1
- package/dist/client/assets/{index-N3y65NSG.js → index-C46RwiKZ.js} +1 -1
- package/dist/client/assets/{index-yQ2CKmbB.js → index-CDt6WI9m.js} +1 -1
- package/dist/client/assets/{index-BYU2fptV.js → index-CEGt2PRu.js} +1 -1
- package/dist/client/assets/{index-B5AhRWPJ.js → index-CTYuweYZ.js} +1 -1
- package/dist/client/assets/{index-DKop9cOd.js → index-CXm3YShm.js} +1 -1
- package/dist/client/assets/{index-Cy_i_3Zg.js → index-CecxwC7F.js} +1 -1
- package/dist/client/assets/{index-Ce0CI_HW.js → index-DK0Dq4zJ.js} +1 -1
- package/dist/client/assets/{index-Dsl1ukJt.js → index-DNU42V4k.js} +1 -1
- package/dist/client/assets/{index-DD17LdOo.js → index-DbabGxy6.js} +5 -5
- package/dist/client/assets/{index-Dq_1-8A2.js → index-DbpjHDZh.js} +1 -1
- package/dist/client/assets/index-DoNIk522.css +1 -0
- package/dist/client/assets/{index-DCe0TA20.js → index-Dy0RWBgm.js} +1 -1
- package/dist/client/assets/{index-Cf73Fziv.js → index-Il2w9u7T.js} +1 -1
- package/dist/client/assets/{index-bQA4cKD0.js → index-rVMtfSUP.js} +1 -1
- package/dist/client/assets/{index-redirect-6LEJgFFV.js → index-redirect-CsG08aDH.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DjN6qwGN.js → infiniteQueryObserver-yDX2PlMf.js} +1 -1
- package/dist/client/assets/{infra-billing-ByEqMCug.js → infra-billing-CsnOWCZW.js} +1 -1
- package/dist/client/assets/{input-VO0irtoo.js → input-DGumA8Me.js} +3 -3
- package/dist/client/assets/{input-BbeG6cTt.js → input-DV9TXIhc.js} +1 -1
- package/dist/client/assets/{input-fqK_PA15.js → input-fdBI3UiD.js} +1 -1
- package/dist/client/assets/{integration-icon-DNr48VB-.js → integration-icon-CFV7KR9Q.js} +1 -1
- package/dist/client/assets/{label-DeoZl-yW.js → label-CaVwbUwP.js} +1 -1
- package/dist/client/assets/{layout-CssYzEFi.js → layout-Cn4gYBB0.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Di8U03Ks.js → legacy-agents-deep-CImQMpuD.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-aXZ00Ch4.js → legacy-main-redirect-pPc22tCf.js} +1 -1
- package/dist/client/assets/library-VxiqdGt5.js +1 -0
- package/dist/client/assets/{library-tab-DO-vL1Sp.js → library-tab-DzLJVAy7.js} +1 -1
- package/dist/client/assets/{login-CIyCTb3_.js → login-9E08_289.js} +1 -1
- package/dist/client/assets/{markdown-CDhnofjs.js → markdown-BFRBcVyc.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-2ABF18H4.js → mcp-app-renderer-2vEnBSMK.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DRu55AOe.js → mcp-oauth-DPBTzzM-.js} +1 -1
- package/dist/client/assets/{members-DJvZO0Gs.js → members-4taneDvj.js} +1 -1
- package/dist/client/assets/{memory-CHY8Nsh9.js → memory-ihVMY_AG.js} +1 -1
- package/dist/client/assets/{message-templates-CAOd2UKb.js → message-templates-DZjeVSbL.js} +1 -1
- package/dist/client/assets/{mini-report-page-BAjp42Eo.js → mini-report-page-DtLYvRQ1.js} +1 -1
- package/dist/client/assets/{mock-board-Ci0rJP9S.js → mock-board-CwpnFESF.js} +1 -1
- package/dist/client/assets/{monaco-editor-B9-EbuZp.js → monaco-editor-CTBaCfme.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C4IvvKh8.js → monitoring-stats-row-BkHIbumL.js} +1 -1
- package/dist/client/assets/{multi-select-DWjLi79A.js → multi-select-Z8b5GDV-.js} +1 -1
- package/dist/client/assets/{mustache-CGqpmqnY.js → mustache-B8Ea1V5C.js} +1 -1
- package/dist/client/assets/{new-project-dialog-aJ5dJ1rh.js → new-project-dialog-B-Knb9QQ.js} +1 -1
- package/dist/client/assets/{oauth-callback-CTZ5IMCe.js → oauth-callback-C8PRuTdi.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DQXOWeoZ.js → oauth-callback-ai-provider-aQAEhewW.js} +1 -1
- package/dist/client/assets/{onboarding-BY2hI8B5.js → onboarding-CQwAJGam.js} +1 -1
- package/dist/client/assets/{openai-conversation-oO5Jtxhx.js → openai-conversation-BieePbjd.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DCkPfpOs.js → optimistic-project-sidebar-views-BjQNVvvG.js} +1 -1
- package/dist/client/assets/{org-file-open-context-BkQsHsKZ.js → org-file-open-context-DOjVu33M.js} +1 -1
- package/dist/client/assets/{organization-choice-Cv2hkzvH.js → organization-choice-DGHtNB__.js} +1 -1
- package/dist/client/assets/{orgs-Cy2r07rI.js → orgs-CrnZIBKQ.js} +1 -1
- package/dist/client/assets/{page-seo-form-Mk2av7Sl.js → page-seo-form-Cz3um724.js} +1 -1
- package/dist/client/assets/{pair-DdTx6Iw4.js → pair-28ek-gGQ.js} +1 -1
- package/dist/client/assets/{plan-ladder-wwhl4s-D.js → plan-ladder-CyI_9DNH.js} +1 -1
- package/dist/client/assets/{popover-WjvvubuZ.js → popover-DpWUGKUo.js} +1 -1
- package/dist/client/assets/{post-calendar-BNR4t9ZN.js → post-calendar-DeYBTRsx.js} +1 -1
- package/dist/client/assets/{post-editor-DOklsxV3.js → post-editor-Vuu8KboN.js} +1 -1
- package/dist/client/assets/{preview-content-DPf79jXA.js → preview-content-CnVo4-8-.js} +1 -1
- package/dist/client/assets/{preview-dialog-xi299w6D.js → preview-dialog-DIfOL8lf.js} +1 -1
- package/dist/client/assets/{profile-BEB3wVnr.js → profile-BHIo5II1.js} +1 -1
- package/dist/client/assets/{project-app-view-CPv6WSxO.js → project-app-view-DSWQ2xlW.js} +1 -1
- package/dist/client/assets/{project-feed-BIBH3UPz.js → project-feed-BuwrAz5D.js} +1 -1
- package/dist/client/assets/{project-icon-D1c3GFHZ.js → project-icon-B2QkPtkD.js} +1 -1
- package/dist/client/assets/project-reports-C2fGvQWV.js +1 -0
- package/dist/client/assets/project-tasks-CIHsh5h6.js +1 -0
- package/dist/client/assets/{projects-rXHz0BaU.js → projects-CeBBjzLS.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B79AOVTQ.js → projects-empty-state-DqQWmR8c.js} +1 -1
- package/dist/client/assets/{prompts-BCxnWdIU.js → prompts-DMHqwjaa.js} +1 -1
- package/dist/client/assets/record-editor-tpiSv1vv.js +1 -0
- package/dist/client/assets/{redirect-editor-DeKPZWhP.js → redirect-editor-VS53IAor.js} +1 -1
- package/dist/client/assets/{reports-DGvj55Ah.js → reports-CRnJns1V.js} +1 -1
- package/dist/client/assets/reports-Cjp1W3ep.js +1 -0
- package/dist/client/assets/{reports-onboarding-B7ECOmwM.js → reports-onboarding-iY5NlXnv.js} +1 -1
- package/dist/client/assets/{reports-tab-DToyyT3v.js → reports-tab-CjdgNBIh.js} +2 -2
- package/dist/client/assets/{repositories-DQB7QntA.js → repositories-By85nJ-O.js} +1 -1
- package/dist/client/assets/{repository-binding-CJ_pw95F.js → repository-binding-DST5BjAq.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Dr1vQH8s.js → repository-import-picker-Cefyzn5z.js} +1 -1
- package/dist/client/assets/{repository-picker-C5h4QyUX.js → repository-picker-DIYtkoGR.js} +1 -1
- package/dist/client/assets/{require-capability-CdLM5-q0.js → require-capability-Cgz4k3Fi.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DErGL9Rh.js → required-auth-layout-Sm_LEIrf.js} +1 -1
- package/dist/client/assets/{reset-password-D81cB6v9.js → reset-password-BwpS-xL5.js} +1 -1
- package/dist/client/assets/{resizable-CkV4haoj.js → resizable-Dd8Oiyrn.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-2k8oZvTh.js → resolve-tab-icon-BHe-FJLH.js} +1 -1
- package/dist/client/assets/{review-settings-CcqxaPA7.js → review-settings-3T-TH-W9.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-C94WsSn4.js → rich-text-link-control-CO6qXsgG.js} +1 -1
- package/dist/client/assets/{roles-CwOlJtAT.js → roles-BxZ_96io.js} +1 -1
- package/dist/client/assets/route-BWoA72Ha.js +1 -0
- package/dist/client/assets/route-Cc-MOYOr.js +1 -0
- package/dist/client/assets/{route-DFtzuP8H.js → route-MgE6XCPe.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-DJs4CTRJ.js → runnable-block-editor-0DsB0lC3.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-xQTXGx64.js → sandbox-lifecycle-context-ZoWZCIt3.js} +1 -1
- package/dist/client/assets/{schema-BPz-DoxV.js → schema-BD3Ue3jK.js} +1 -1
- package/dist/client/assets/{scroll-area-BYX63UJI.js → scroll-area-C1UEqWPg.js} +1 -1
- package/dist/client/assets/{search-input-BML3Kenk.js → search-input-uE9X4-9v.js} +1 -1
- package/dist/client/assets/{search-toggle-CvhVGWw1.js → search-toggle-BgK-oFXG.js} +1 -1
- package/dist/client/assets/{secret-picker-B9rV98rP.js → secret-picker-DpiORdM4.js} +1 -1
- package/dist/client/assets/{secrets-CXLj5c-L.js → secrets-CG0o7p-Z.js} +1 -1
- package/dist/client/assets/{sections-editor-CnNLFRme.js → sections-editor-mB_t7BGu.js} +1 -1
- package/dist/client/assets/{select-CvaUVwrC.js → select-DOq28vkW.js} +1 -1
- package/dist/client/assets/{select-model-C1nF3qen.js → select-model-BvwOHBLi.js} +1 -1
- package/dist/client/assets/{seo-editor-GB3MOC4z.js → seo-editor-te_rCW-y.js} +1 -1
- package/dist/client/assets/{separator-CR_-CVBp.js → separator-BQGbPFWO.js} +1 -1
- package/dist/client/assets/{settings-tab-CLxqNPs8.js → settings-tab-h8YLdZG4.js} +1 -1
- package/dist/client/assets/{sheet-BID6Bcl4.js → sheet-CAPBfpxY.js} +1 -1
- package/dist/client/assets/{shell-layout-B48Lo5Zk.js → shell-layout-D3hbXuJp.js} +1 -1
- package/dist/client/assets/{skills-CckAVRfc.js → skills-bn8hfZhY.js} +1 -1
- package/dist/client/assets/{sso-ILTug89T.js → sso-B2mfdHDN.js} +1 -1
- package/dist/client/assets/{suggestion-BriuVru4.js → suggestion-CxpxmxhU.js} +1 -1
- package/dist/client/assets/{switch-CDzEt_Yx.js → switch-DobgoLr7.js} +1 -1
- package/dist/client/assets/{synced-repos-xqnoVQ3o.js → synced-repos-BkubYLAQ.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DfT7jmRq.js → tab-icon-glyph-DTu4Vb5u.js} +1 -1
- package/dist/client/assets/{table-8bUT8seV.js → table-B3glu4jC.js} +1 -1
- package/dist/client/assets/{tabs-BaxVRsCI.js → tabs-tpTL3qIk.js} +1 -1
- package/dist/client/assets/{task-board-D2BE2LPw.js → task-board-DD4Wj2ht.js} +1 -1
- package/dist/client/assets/{task-route-BlXoLKUv.js → task-route-DkYY7Jf8.js} +1 -1
- package/dist/client/assets/{task-status-BMtNEPmq.js → task-status-DQDKjMn6.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BfH8uJBw.js → taskboard-analytics-BqZn-lMy.js} +1 -1
- package/dist/client/assets/tasks-DARVJAgH.js +1 -0
- package/dist/client/assets/{tasks-BOz1Ws1V.js → tasks-DoHgB8D-.js} +1 -1
- package/dist/client/assets/{textarea-C7A4jkvL.js → textarea-B-0phPFl.js} +1 -1
- package/dist/client/assets/{thread-analytics-Jd9FTruE.js → thread-analytics-BqmJENFM.js} +1 -1
- package/dist/client/assets/thread-button-B6AnS30f.js +1 -0
- package/dist/client/assets/{thread-intent-wfAGHI9k.js → thread-intent-CgGr7s14.js} +1 -1
- package/dist/client/assets/{thread-route-BWW9Xj2f.js → thread-route-CYYizTAL.js} +1 -1
- package/dist/client/assets/{thread-route-DsI5gcIr.js → thread-route-DIGJI8Dr.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Bd1XBkek.js → thread-sheet-body-Ywa9zjyd.js} +1 -1
- package/dist/client/assets/{toggle-group-C85PVL3X.js → toggle-group-CHFxR7n1.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DKjVMod_.js → toolbar-icon-button-CLiPKHlm.js} +1 -1
- package/dist/client/assets/{tooltip-Cyc9NKXJ.js → tooltip-wkfHPLLP.js} +1 -1
- package/dist/client/assets/{track-p_LAuNvK.js → track-DHiW7Kzl.js} +1 -1
- package/dist/client/assets/{types-l4l1-swZ.js → types-D821jmOY.js} +1 -1
- package/dist/client/assets/{usage-stats-EK6mC9s2.js → usage-stats-dtNozGHE.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BKLzJh1_.js → use-ai-providers-DAPxuNGR.js} +1 -1
- package/dist/client/assets/{use-automations-D3x6QSEG.js → use-automations-BSdsdElw.js} +1 -1
- package/dist/client/assets/{use-autosave-oFSjwwUF.js → use-autosave-Bb3SyJ6X.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-0qWIlbnk.js → use-chat-layout-state-DMEvvTdU.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BYTJfFPJ.js → use-clock-tick-CcZLWvhU.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DZDzQd28.js → use-connect-companion-bZE9oz5D.js} +1 -1
- package/dist/client/assets/{use-connection-BDIMmEql.js → use-connection-CbaLhExN.js} +1 -1
- package/dist/client/assets/{use-copy-DNk3vyQa.js → use-copy-ClIijIuF.js} +1 -1
- package/dist/client/assets/use-create-virtual-mcp-Ct8X79Tz.js +1 -0
- package/dist/client/assets/{use-date-fns-locale-CatCLOAz.js → use-date-fns-locale-Casbf2a3.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BqsvUMpV.js → use-debounced-autosave-BWu_uxAJ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CMs08Lup.js → use-debounced-value-B8wDF2XE.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DO_Mi4f2.js → use-deco-credits-CV7jBFos.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BY_hixqd.js → use-decopilot-events-Ch1NmAx8.js} +1 -1
- package/dist/client/assets/{use-delete-connection-JYdb3g8I.js → use-delete-connection-UsR0uNx4.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-lMjJ-tOg.js → use-deployment-admin-BF_f54Es.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-D8bUARFA.js → use-fast-preview-draft-url-B2gvR8WR.js} +1 -1
- package/dist/client/assets/{use-file-configs-BYFcKLTt.js → use-file-configs-DI1Gb-A6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D_h1bU_O.js → use-infinite-scroll-Cq0eGH_b.js} +1 -1
- package/dist/client/assets/{use-join-requests-CuheCnou.js → use-join-requests-CuAsvnrr.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CT7NVKmX.js → use-main-panel-tabs-DpHhPbO5.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-C0JasP2w.js → use-mcp-auth-status-DL6cA7oB.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BwmV3MW8.js → use-mcp-client-CfAhFfUQ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DfL0DKop.js → use-mcp-prompts-DUcMyHUY.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DaY04Cnx.js → use-mcp-tools-CzCYSnw_.js} +1 -1
- package/dist/client/assets/{use-members-CeSqgIx5.js → use-members-DgL3Nti4.js} +1 -1
- package/dist/client/assets/{use-mobile-dxqjeB9C.js → use-mobile-CRrGxASl.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Co4saf9i.js → use-navigate-to-agent-BvvbqcqU.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-DMxJSTvk.js +1 -0
- package/dist/client/assets/{use-open-billing-url-DNH1wvY9.js → use-open-billing-url-CeVw8-rB.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D4bGY1I4.js → use-org-auth-client-BdIkgk3C.js} +1 -1
- package/dist/client/assets/{use-org-fs-DTUSNHuq.js → use-org-fs-DnXImEGt.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CDggK2v-.js → use-org-repo-syncs-CR1cxPeJ.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bbo5tHOp.js → use-org-sso-BWqpxNPp.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DJHkyVq7.js → use-organization-roles-DeZ0GmYu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-4sBPGImH.js → use-organization-settings-CAg22Y85.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C-oGXzox.js → use-panel-navigate-1U3BGwp7.js} +1 -1
- package/dist/client/assets/{use-project-scope-BYZ6yY5x.js → use-project-scope-CAwN_j8n.js} +1 -1
- package/dist/client/assets/{use-releases-D6w9Gx21.js → use-releases-oNY9aclO.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BO4L5i9s.js → use-reports-diagnostic-BERenbrG.js} +1 -1
- package/dist/client/assets/{use-secrets-B3wy2yaT.js → use-secrets-DVp8iDqR.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-D_QxAs1Z.js → use-section-preview-base-0SFqRDNJ.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CEr5Osm3.js → use-session-runtime-CYBHR_jn.js} +1 -1
- package/dist/client/assets/{use-tags-BIcLkILs.js → use-tags-BhYfCjoP.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CXzmZIDx.js → use-task-board-analytics-g2dJA7k7.js} +1 -1
- package/dist/client/assets/{use-task-board-events-xJ2Gil4b.js → use-task-board-events-g4QVOfjw.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CCng6xu_.js → use-task-metadata-DyoW40DT.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-tp8G0WjA.js → use-thread-analytics-CqH2wFAc.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-8410oJSY.js → use-thread-outputs-Dlae_WuT.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CCCPgG_d.js +1 -0
- package/dist/client/assets/{useQueries-ChX2pN0S.js → useQueries-BrUezESb.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-VJgBO4F9.js +1 -0
- package/dist/client/assets/{users-CQgXffaI.js → users-DLL0mxIn.js} +1 -1
- package/dist/client/assets/{utils-Bcg0LMFt.js → utils-CRUIllS1.js} +1 -1
- package/dist/client/assets/{variant-calendar-CjE-C9R-.js → variant-calendar-B-KiE4--.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Dr2AK1Ld.js → variant-matcher-override-QKsigM8f.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C4wafyT7.js → view-mode-toggle-BP4sJ9Zb.js} +1 -1
- package/dist/client/assets/{virtual-mcp-3VgUzbRs.js → virtual-mcp-CU6lFPKs.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BFLhnOBw.js +0 -1
- package/dist/client/assets/agent-deck-SJNcwym0.js +0 -1
- package/dist/client/assets/agent-library-CZwkAyEb.js +0 -1
- package/dist/client/assets/agent-library-file-BNnVRc85.js +0 -1
- package/dist/client/assets/agent-settings-DRae4Kkc.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DZBVrZ49.js +0 -2
- package/dist/client/assets/agent-view-D4okXxIR.js +0 -1
- package/dist/client/assets/api-keys-Js_fbclL.js +0 -1
- package/dist/client/assets/app-editor-Cm4YSTQy.js +0 -1
- package/dist/client/assets/daily-pulse-Dj713Lim.js +0 -1
- package/dist/client/assets/flat-project-nMTKhWNR.js +0 -1
- package/dist/client/assets/index-6WjGaIcE.css +0 -1
- package/dist/client/assets/library-BsFI4hAN.js +0 -1
- package/dist/client/assets/project-reports-DgCdGEvu.js +0 -1
- package/dist/client/assets/project-tasks-CM7ap7PD.js +0 -1
- package/dist/client/assets/record-editor-y816y4Ir.js +0 -1
- package/dist/client/assets/reports-D8CHApNA.js +0 -1
- package/dist/client/assets/route-Bk-qMy-9.js +0 -1
- package/dist/client/assets/route-Ct8T-J8s.js +0 -1
- package/dist/client/assets/tasks-Dsw3egox.js +0 -1
- package/dist/client/assets/thread-button-DNHhXrfO.js +0 -1
- package/dist/client/assets/use-create-virtual-mcp-BpxFtCSO.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-CyUK_4wA.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CTTKOBfu.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-3AX2bQF7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{au as n,bK as t,av as e,bL as m,bM as p,bN as d,bO as h}from"./index-
|
|
1
|
+
import{au as n,bK as t,av as e,bL as m,bM as p,bN as d,bO as h}from"./index-DbabGxy6.js";const s=500;n({title:e().max(s),url:e().max(s),icon:e().max(s)});const i=n({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});n({tiers:n({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});const v=50,b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(s).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(s).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const x=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:t().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function w(a,r){const c=a?.[r];return u.has(r)?c!==!1:c===!0}function A(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(d(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as G,x as O,y as S,A as a,b,w as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-DD17LdOo.js";import{e as de}from"./select-CvaUVwrC.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=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,W]=d.useState(!1),v=T(e,R=>c(R)),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:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,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=m(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=m(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=m(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=m(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=m(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 E(o.viewport,c),E(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=m(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(ve,{...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=m(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)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(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)}})}})}),[me,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=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),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 W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{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,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,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=m(H,o),s=ee(H,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=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(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=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(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 E(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,Re=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] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),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 Ee(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,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-DbabGxy6.js";import{e as de}from"./select-DOq28vkW.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=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,W]=d.useState(!1),v=T(e,R=>c(R)),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:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,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=m(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=m(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=m(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=m(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=m(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 E(o.viewport,c),E(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=m(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(ve,{...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=m(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)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(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)}})}})}),[me,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=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),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 W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{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,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,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=m(H,o),s=ee(H,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=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(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=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(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 E(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,Re=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] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),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 Ee(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 b,l as w,j as a,h as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,h as j}from"./index-DbabGxy6.js";import{i as v}from"./SearchMd-CHmk5GD6.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,l as B,j as a}from"./index-
|
|
1
|
+
import{c as K,r as C,l as B,j as a}from"./index-DbabGxy6.js";import{i as I}from"./SearchMd-CHmk5GD6.js";import{i as M}from"./X-ateu7dRb.js";import{I as O}from"./icon-button-C4oA9vAv.js";function H(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,y=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:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=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]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,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 k=!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]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,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]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,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]=y,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{H as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,b as d,j as l}from"./index-
|
|
1
|
+
import{c as x,b as d,j as l}from"./index-DbabGxy6.js";import{s as j}from"./User01-D2Lmw0ef.js";import{t as E}from"./Users01-DsJzDkrr.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.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=l.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(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,
|
|
1
|
+
import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,a7 as E,t as _}from"./index-DbabGxy6.js";import{i as O}from"./AlertCircle-Dsxcywwk.js";import{s as B}from"./Plus-BvxsRY-0.js";import{s as A}from"./User01-D2Lmw0ef.js";import{t as R}from"./Users01-DsJzDkrr.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-CSMrPqBB.js";import{I as z}from"./input-DV9TXIhc.js";import{L as w}from"./label-CaVwbUwP.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-DOq28vkW.js";import{T as W}from"./textarea-B-0phPFl.js";import{u as X,a as Y}from"./use-secrets-DVp8iDqR.js";import{R as Z}from"./require-capability-Cgz4k3Fi.js";import"./X-ateu7dRb.js";import"./index-DNU42V4k.js";import"./Check-CzhgdtoZ.js";import"./ChevronUp-bPHHer4a.js";import"./access-gate-Uqlikjgu.js";import"./capability-load-error-DPnEcJx5.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{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 a;return e[4]!==n?(a=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]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;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 a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=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:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(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(E,{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(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=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]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=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 m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),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 a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,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(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{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(z,{id:"secret-name",value:n,onChange:u=>a(u.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(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.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(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{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()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{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,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background 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:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background 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(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();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(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),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($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-DD17LdOo.js";import{u as _o}from"./chat-context-rrrEGdS4.js";import{u as fs}from"./use-new-blocks-editor-CyUK_4wA.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Xo,af as qt,ag as Zo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-DJs4CTRJ.js";import{f as sr}from"./repository-binding-CJ_pw95F.js";import{n as nr,t as ar}from"./ChevronUp-Br5R9lTH.js";import{a6 as oa,b as ms,aj as or,y as rr,_ as Wn,H as Un}from"./agent-icon-B_yyO4wu.js";import{S as Bt}from"./scroll-area-BYX63UJI.js";import{b as ct,T as ut,a as dt}from"./tooltip-Cyc9NKXJ.js";import{m as ir,u as lr,P as cr}from"./mustache-CGqpmqnY.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Xn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-BIkHWTfz.js";import{a as Pr}from"./Copy01-CtLn8eQC.js";import{a as Bs,d as la}from"./UserSquare-DkdLf214.js";import{b as Zn}from"./Tool01-BgPGiYBJ.js";import{s as ea}from"./Image01-CUJhdG59.js";import{s as Cr}from"./Plus-MXLtMY7l.js";import{s as Dr}from"./Trash01-DEfHm1-C.js";import{i as Ls}from"./ZoomOut-tzNSNsYS.js";import{a as Kr,b as ta,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ds,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-C94WsSn4.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-Mk2av7Sl.js";import{u as Jr,A as Yr}from"./use-section-preview-base-D_QxAs1Z.js";import{b as na,a as Qr}from"./variant-matcher-override-Dr2AK1Ld.js";import"./use-panel-navigate-C-oGXzox.js";import"./thread-route-BWW9Xj2f.js";import"./use-project-scope-BYZ6yY5x.js";import"./autosend-B3t52XX_.js";import"./thread-intent-wfAGHI9k.js";import"./use-mcp-client-BwmV3MW8.js";import"./auth-BII1ityf.js";import"./backoff-8mStPHYB.js";import"./task-board-D2BE2LPw.js";import"./schema-BPz-DoxV.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-BY_hixqd.js";import"./use-ai-providers-BKLzJh1_.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-4sBPGImH.js";import"./use-session-runtime-CEr5Osm3.js";import"./Sun-DaF8KN8m.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DdTx6Iw4.js";import"./LinkBroken01-_oPW_2dj.js";import"./Check-aE-8J-dx.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-wtqcAzkF.js";import"./use-copy-DNk3vyQa.js";import"./usage-stats-EK6mC9s2.js";import"./markdown-CDhnofjs.js";import"./dialog-BDXg80r_.js";import"./X-BHK_66ka.js";import"./org-file-open-context-BkQsHsKZ.js";import"./use-mobile-dxqjeB9C.js";import"./use-clock-tick-BYTJfFPJ.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-2ABF18H4.js";import"./types-l4l1-swZ.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-DeH7kjYP.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-DjoFdKqn.js";import"./XClose-oHtKIul6.js";import"./ShoppingBag01-BUSIbN12.js";import"./SearchMd-D2iMNQwW.js";import"./shell-layout-B48Lo5Zk.js";import"./avatar-BTitfgsj.js";import"./User01-BJjdpbkY.js";import"./Building02-DQhkI7KU.js";import"./download-app-dialog-CgdOlOsO.js";import"./CheckCircle-Yu1WDdmS.js";import"./Monitor01-evoIPilr.js";import"./command-DTs9ObR-.js";import"./index-DXEiFGhx.js";import"./integration-icon-DNr48VB-.js";import"./project-icon-D1c3GFHZ.js";import"./new-project-dialog-aJ5dJ1rh.js";import"./ArrowLeft-DCPdaQBd.js";import"./input-BbeG6cTt.js";import"./label-DeoZl-yW.js";import"./repository-import-picker-Dr1vQH8s.js";import"./use-navigate-to-agent-Co4saf9i.js";import"./repository-picker-C5h4QyUX.js";import"./LinkExternal01-Bzb2WBKu.js";import"./useInfiniteQuery-CTTKOBfu.js";import"./infiniteQueryObserver-DjN6qwGN.js";import"./collection-search-B7qdcCbg.js";import"./use-debounced-value-CMs08Lup.js";import"./required-auth-layout-DErGL9Rh.js";import"./use-org-sso-Bbo5tHOp.js";import"./sheet-BID6Bcl4.js";import"./use-connection-BDIMmEql.js";import"./Palette-CI5-z0zm.js";import"./Link01-PgFxgiYI.js";import"./use-mcp-prompts-DfL0DKop.js";import"./index-Cy_i_3Zg.js";import"./form-BQW41VGV.js";import"./use-thread-outputs-8410oJSY.js";import"./file-type-icon-DzrUMDgr.js";import"./popover-WjvvubuZ.js";import"./utils-Bcg0LMFt.js";import"./monaco-editor-B9-EbuZp.js";import"./editor-D6ylwlDD.js";import"./calendar-1uM2n-Jw.js";import"./textarea-C7A4jkvL.js";import"./select-CvaUVwrC.js";import"./index-Dsl1ukJt.js";import"./switch-CDzEt_Yx.js";import"./combobox-pwfK5e2Y.js";import"./alert-dialog-D39kK11B.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-AiwUaS84.js";import"./DotsVertical-BkKYV-uH.js";import"./search-input-BML3Kenk.js";import"./tabs-BaxVRsCI.js";import"./use-file-configs-BYFcKLTt.js";import"./asset-utils-BO8plCL6.js";import"./use-chat-layout-state-0qWIlbnk.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-C85PVL3X.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-CxGCH_mE.js";import"./CreditCard01-DARYnajC.js";import"./Key01-DA8aX6Mo.js";import"./Users01-DB-isk4t.js";import"./section-preview-url-7zfngvgW.js";function Xr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Xr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Zr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Zr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="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 aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let X;e[0]!==h||e[1]!==p?(X=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=X):X=e[2];const me=X;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="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 ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("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":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("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 ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:X,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=Ir(J);let d;e[4]!==qe?(d=Or.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!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 Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==X?(H=P=>{P.stopPropagation(),X()},e[35]=X,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let X;e[3]!==w?(X=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=X):X=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==X?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,X]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=X,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:X,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:zr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Ze=fe.indexOf(String(D.id));Fe===-1||Ze===-1||(G(nt=>ua(ds([...nt],Fe,Ze))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Ze))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==X||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Ze=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Ze||e[66]!==V?(nt=O?Ze:n.jsxs("div",{className:"space-y-2",children:[Ze,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Ze,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=$r,ue=z,je=Hr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>X(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=X,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Bc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:X=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(X),[Ze,nt]=j.useState(X);X&&!Ze&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!X&&Ze&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Xt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Xt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Xo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const Z={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=Z.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),Z.sections={...F,variants:U}}else Z.sections=ee;Y.mutate({blockKey:R,data:Z},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Xs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Xt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Zs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Zo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...Z}=t;Y.mutate({blockKey:S,data:xt(W??"",Z,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:Z}=Wt(E,_,l??void 0);Ae(W),ie(Z);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const Z=(_.variants??[])[a]?.rule;if(Rt(Z,m,l)){const I=Z?.__resolveType??"",Xe=m[I],rt=typeof Xe?.name=="string"?Xe.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Xn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=bt(W[a]?.rule,m,l),ee=Lt(t),F=Xn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Xe={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Xe,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),Z&&Z!==t&&await Et(Z,Xe),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&>&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Xa=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Za=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Xa??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&>&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),Z=us(W,o);if(Z){N.error(Z);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Zt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=W[t];if(!Z?.rule||typeof Z.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=Z.rule,F=s.trim();At(!0);const U=async I=>{const Xe={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Xe);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...Z,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Xe=cs(F),rt=us(Xe,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Xe,data:St}),it=Xe;const yt=[...W];yt[t]={...Z,rule:Lt(Xe)},await U(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Zt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Xt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&>&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("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",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(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-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Za}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&>&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Bc as SectionsEditor};
|
|
1
|
+
import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-DbabGxy6.js";import{u as _o}from"./chat-context-Bf1EEUa_.js";import{u as fs}from"./use-new-blocks-editor-DMxJSTvk.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Xo,af as qt,ag as Zo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-0DsB0lC3.js";import{c as sr}from"./repository-binding-DST5BjAq.js";import{n as nr,t as ar}from"./ChevronUp-bPHHer4a.js";import{a6 as oa,b as ms,aj as or,y as rr,_ as Wn,H as Un}from"./agent-icon-BRxvZRmN.js";import{S as Bt}from"./scroll-area-C1UEqWPg.js";import{b as ct,T as ut,a as dt}from"./tooltip-wkfHPLLP.js";import{m as ir,u as lr,P as cr}from"./mustache-B8Ea1V5C.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Xn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-qcCOlkIz.js";import{a as Pr}from"./Copy01-DK-rveWk.js";import{a as Bs,d as la}from"./UserSquare-CuUPyuma.js";import{b as Zn}from"./Tool01-DetpIMtk.js";import{s as ea}from"./Image01-DkSAzjSu.js";import{s as Cr}from"./Plus-BvxsRY-0.js";import{s as Dr}from"./Trash01-DKbCrUTj.js";import{i as Ls}from"./ZoomOut-Bt3p5CRf.js";import{a as Kr,b as ta,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ds,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-CO6qXsgG.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-Cz3um724.js";import{u as Jr,A as Yr}from"./use-section-preview-base-0SFqRDNJ.js";import{b as na,a as Qr}from"./variant-matcher-override-QKsigM8f.js";import"./use-panel-navigate-1U3BGwp7.js";import"./thread-route-CYYizTAL.js";import"./use-project-scope-CAwN_j8n.js";import"./autosend-BrczLssG.js";import"./thread-intent-CgGr7s14.js";import"./use-mcp-client-CfAhFfUQ.js";import"./auth-qAvZ1LNt.js";import"./backoff-8mStPHYB.js";import"./task-board-DD4Wj2ht.js";import"./schema-BD3Ue3jK.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-Ch1NmAx8.js";import"./use-ai-providers-DAPxuNGR.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-CAg22Y85.js";import"./use-session-runtime-CYBHR_jn.js";import"./Sun-7ajd25ZV.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-28ek-gGQ.js";import"./LinkBroken01-CyPIuvAF.js";import"./Check-CzhgdtoZ.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-C3DyD3IY.js";import"./use-copy-ClIijIuF.js";import"./usage-stats-dtNozGHE.js";import"./markdown-BFRBcVyc.js";import"./dialog-CSMrPqBB.js";import"./X-ateu7dRb.js";import"./org-file-open-context-DOjVu33M.js";import"./use-mobile-CRrGxASl.js";import"./use-clock-tick-CcZLWvhU.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-2vEnBSMK.js";import"./types-D821jmOY.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-9xfivYUp.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-Dsxcywwk.js";import"./XClose-Chbrrnow.js";import"./ShoppingBag01-D0N-Vb4c.js";import"./SearchMd-CHmk5GD6.js";import"./shell-layout-D3hbXuJp.js";import"./avatar-Be2YP03d.js";import"./User01-D2Lmw0ef.js";import"./Building02-DQSa0aPk.js";import"./download-app-dialog-DegRrl-D.js";import"./CheckCircle-48zzWb5o.js";import"./Monitor01-WwJ1rHPk.js";import"./command-CNDsxgwl.js";import"./index-Bj6rDen7.js";import"./integration-icon-CFV7KR9Q.js";import"./project-icon-B2QkPtkD.js";import"./new-project-dialog-B-Knb9QQ.js";import"./ArrowLeft-CUAoXnBl.js";import"./input-DV9TXIhc.js";import"./label-CaVwbUwP.js";import"./repository-import-picker-Cefyzn5z.js";import"./use-navigate-to-agent-BvvbqcqU.js";import"./repository-picker-DIYtkoGR.js";import"./LinkExternal01-D20IL3CN.js";import"./useInfiniteQuery-CCCPgG_d.js";import"./infiniteQueryObserver-yDX2PlMf.js";import"./collection-search-qakQR89K.js";import"./use-debounced-value-B8wDF2XE.js";import"./required-auth-layout-Sm_LEIrf.js";import"./use-org-sso-BWqpxNPp.js";import"./sheet-CAPBfpxY.js";import"./use-connection-CbaLhExN.js";import"./Palette-jHJa2pFE.js";import"./Link01-CBIFqZsw.js";import"./use-mcp-prompts-DUcMyHUY.js";import"./index-CecxwC7F.js";import"./form-BJXkrxaF.js";import"./use-thread-outputs-Dlae_WuT.js";import"./file-type-icon-Bv7OJA49.js";import"./popover-DpWUGKUo.js";import"./utils-CRUIllS1.js";import"./monaco-editor-CTBaCfme.js";import"./editor-D-2XKeKJ.js";import"./calendar-B6jARNSc.js";import"./textarea-B-0phPFl.js";import"./select-DOq28vkW.js";import"./index-DNU42V4k.js";import"./switch-DobgoLr7.js";import"./combobox-CKdv5r-2.js";import"./alert-dialog-Dr37XaeA.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-BBKhvCnt.js";import"./DotsVertical-Cz9DnVkj.js";import"./search-input-uE9X4-9v.js";import"./tabs-tpTL3qIk.js";import"./use-file-configs-DI1Gb-A6.js";import"./asset-utils-CEMW7jjJ.js";import"./use-chat-layout-state-DMEvvTdU.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-CHFxR7n1.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-DvEWAQS1.js";import"./CreditCard01-Bv4apDUd.js";import"./Key01-2_VP-ymA.js";import"./Users01-DsJzDkrr.js";import"./section-preview-url-7zfngvgW.js";function Xr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Xr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Zr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Zr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="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 aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let X;e[0]!==h||e[1]!==p?(X=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=X):X=e[2];const me=X;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="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 ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("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":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("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 ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:X,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=Ir(J);let d;e[4]!==qe?(d=Or.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!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 Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==X?(H=P=>{P.stopPropagation(),X()},e[35]=X,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let X;e[3]!==w?(X=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=X):X=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==X?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,X]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=X,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:X,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:zr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Ze=fe.indexOf(String(D.id));Fe===-1||Ze===-1||(G(nt=>ua(ds([...nt],Fe,Ze))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Ze))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==X||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Ze=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Ze||e[66]!==V?(nt=O?Ze:n.jsxs("div",{className:"space-y-2",children:[Ze,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Ze,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=$r,ue=z,je=Hr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>X(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=X,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Bc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:X=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(X),[Ze,nt]=j.useState(X);X&&!Ze&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!X&&Ze&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Xt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Xt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Xo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const Z={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=Z.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),Z.sections={...F,variants:U}}else Z.sections=ee;Y.mutate({blockKey:R,data:Z},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Xs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Xt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Zs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Zo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...Z}=t;Y.mutate({blockKey:S,data:xt(W??"",Z,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:Z}=Wt(E,_,l??void 0);Ae(W),ie(Z);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const Z=(_.variants??[])[a]?.rule;if(Rt(Z,m,l)){const I=Z?.__resolveType??"",Xe=m[I],rt=typeof Xe?.name=="string"?Xe.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Xn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=bt(W[a]?.rule,m,l),ee=Lt(t),F=Xn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Xe={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Xe,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),Z&&Z!==t&&await Et(Z,Xe),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&>&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Xa=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Za=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Xa??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&>&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),Z=us(W,o);if(Z){N.error(Z);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Zt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=W[t];if(!Z?.rule||typeof Z.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=Z.rule,F=s.trim();At(!0);const U=async I=>{const Xe={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Xe);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...Z,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Xe=cs(F),rt=us(Xe,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Xe,data:St}),it=Xe;const yt=[...W];yt[t]={...Z,rule:Lt(Xe)},await U(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Zt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Xt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&>&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("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",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(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-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Za}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&>&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Bc as SectionsEditor};
|