decocms 4.570.0 → 4.571.0
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-1CFQF9HU.js → AlertCircle-Cbs5Ab1P.js} +1 -1
- package/dist/client/assets/{AreaChart-CUZD7bCb.js → AreaChart-CToSouiR.js} +1 -1
- package/dist/client/assets/{ArrowLeft-yZosAbEQ.js → ArrowLeft-2ggpgqb0.js} +1 -1
- package/dist/client/assets/{ArrowUp-B_QEh9AM.js → ArrowUp-cgUvwam2.js} +1 -1
- package/dist/client/assets/{CartesianChart-DOo-DPo8.js → CartesianChart-CQdu8PPi.js} +1 -1
- package/dist/client/assets/{CategoricalChart-KK8jWPWD.js → CategoricalChart-B5fszPCD.js} +1 -1
- package/dist/client/assets/{CheckCircle-DjUjDOFk.js → CheckCircle-D2qom1Qe.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-C2ySHatm.js → ChevronSelectorVertical-CSCxxcTv.js} +1 -1
- package/dist/client/assets/{ChevronUp-aVrgoYI4.js → ChevronUp-DPwvtZ7T.js} +1 -1
- package/dist/client/assets/{CreditCard01-CMrZYrMd.js → CreditCard01-BeIdgKm8.js} +1 -1
- package/dist/client/assets/{Globe04-Czvq6voU.js → Globe04-BNjS8hE_.js} +1 -1
- package/dist/client/assets/{Key01-CJVeUDDi.js → Key01-Bb2fYsyQ.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Dhn_nIp2.js → LinkBroken01-a5oI2X-K.js} +1 -1
- package/dist/client/assets/{Minus-qjFidgiH.js → Minus-HfQUebB7.js} +1 -1
- package/dist/client/assets/{Monitor01-BwW28bRE.js → Monitor01-D0NO-K1o.js} +1 -1
- package/dist/client/assets/{Play-DWKJ4lP6.js → Play-UerN5i51.js} +1 -1
- package/dist/client/assets/{Plus-u00IxELx.js → Plus-BqBCvRtk.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DhlQLhxT.js → ReferenceLine-8Od-_LqW.js} +1 -1
- package/dist/client/assets/{SearchMd-DrxAIngK.js → SearchMd-ip9BTueQ.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BOpj8wnX.js → ShoppingBag01-Z5jujKnF.js} +1 -1
- package/dist/client/assets/{Sun-CUTKbSf6.js → Sun-BqxGPQ7c.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DedOEqGg.js → SwitchHorizontal01-xah_f_KH.js} +1 -1
- package/dist/client/assets/{Tool01-BXFm5jK2.js → Tool01-CAgFzAvv.js} +1 -1
- package/dist/client/assets/{Tooltip-DhVaIgPv.js → Tooltip-2CGCyakg.js} +1 -1
- package/dist/client/assets/{Trash01-t2BYg0st.js → Trash01-C7v1fWGY.js} +1 -1
- package/dist/client/assets/{Upload01-BBUgsLLD.js → Upload01-7apXt8L7.js} +1 -1
- package/dist/client/assets/{UserSquare-BloCTB27.js → UserSquare-Dfda7sxk.js} +1 -1
- package/dist/client/assets/{Users01-D0A6lP8t.js → Users01-DGaGzIcz.js} +1 -1
- package/dist/client/assets/{XClose-CUME_VK2.js → XClose-DaTfQwji.js} +1 -1
- package/dist/client/assets/{Zap-CmNmFUbX.js → Zap-CmFvKOKc.js} +1 -1
- package/dist/client/assets/{access-gate-CbFfEOdM.js → access-gate-DSrHE9mR.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bk4KRwLm.js → add-connection-dialog-sfNoRM_t.js} +1 -1
- package/dist/client/assets/agent-app-B_xuQBe4.js +1 -0
- package/dist/client/assets/agent-assets-BOBiAU4U.js +1 -0
- package/dist/client/assets/{agent-automation-CHtwx6sg.js → agent-automation-JSDOOiNt.js} +1 -1
- package/dist/client/assets/{agent-automations-BgmzkAtz.js → agent-automations-dSGzVGTE.js} +1 -1
- package/dist/client/assets/agent-calendar-JsZQH9DJ.js +1 -0
- package/dist/client/assets/{agent-capabilities-DmNIevq-.js → agent-capabilities-CuOmNgv3.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DgRvrlpj.js → agent-connect-sources-f0poJHtj.js} +1 -1
- package/dist/client/assets/agent-deck-DrS8cvv6.js +1 -0
- package/dist/client/assets/agent-e2e-DsNy3BsN.js +1 -0
- package/dist/client/assets/agent-experiments-BmXzB7sO.js +1 -0
- package/dist/client/assets/agent-file-Y-EO6Btn.js +1 -0
- package/dist/client/assets/agent-hosting-BS_jB6we.js +1 -0
- package/dist/client/assets/{agent-icon-AbOSM7KF.js → agent-icon-BGTckvlP.js} +1 -1
- package/dist/client/assets/agent-library-BeOICuv4.js +1 -0
- package/dist/client/assets/agent-library-file-BLEe6X-g.js +1 -0
- package/dist/client/assets/agent-overview-DK7iRg_t.js +1 -0
- package/dist/client/assets/{agent-releases-BWDO07Iy.js → agent-releases-B_K3FIWy.js} +1 -1
- package/dist/client/assets/agent-settings-BjOD_o2l.js +1 -0
- package/dist/client/assets/{agent-site-editor-BubERiUy.js → agent-site-editor-CiaB1f7K.js} +1 -1
- package/dist/client/assets/agent-site-editor-code--mSzyNhn.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CxN1Ldoy.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-RW-nzlvn.js +1 -0
- package/dist/client/assets/agent-view-DaSIF8yy.js +1 -0
- package/dist/client/assets/{agent-view-guard-w1_Juyu5.js → agent-view-guard-H_xpaENl.js} +1 -1
- package/dist/client/assets/{ai-providers-DAY0nNTK.js → ai-providers-OlLaxP2V.js} +1 -1
- package/dist/client/assets/{alert-hJJytfOJ.js → alert-CWtTJO7c.js} +1 -1
- package/dist/client/assets/{analytics-sections-BNJmu5jh.js → analytics-sections-DH9U0O99.js} +1 -1
- package/dist/client/assets/{api-keys-DOETgk_S.js → api-keys-B4joTgKi.js} +1 -1
- package/dist/client/assets/api-keys-CI8mz52i.js +1 -0
- package/dist/client/assets/{app-editor-CN-Ok2RW.js → app-editor-BrdqMvUA.js} +1 -1
- package/dist/client/assets/{asset-utils-DhDLN_-h.js → asset-utils-BO-AcYFX.js} +1 -1
- package/dist/client/assets/{auth-D1oBKWc9.js → auth-BExDXNDY.js} +1 -1
- package/dist/client/assets/{auth-catchall-CU9OueC2.js → auth-catchall-CU4VU9mW.js} +1 -1
- package/dist/client/assets/{auth-entry-BrGmprWz.js → auth-entry-CuJQjZjM.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DdjSjW7w.js → auth-split-layout-BCXGVZBW.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DfXhL6KV.js → authenticate-and-persist-oauth-vexqf63k.js} +1 -1
- package/dist/client/assets/{automation-list-row-D2RgfFAV.js → automation-list-row-Bp87yYiZ.js} +1 -1
- package/dist/client/assets/{automation-runs-_P-ch70z.js → automation-runs-DiRDWuN3.js} +1 -1
- package/dist/client/assets/{automations-DVc_UfEJ.js → automations-DMWU0I6x.js} +1 -1
- package/dist/client/assets/{autosend-xPyRMwmc.js → autosend-DL4CutFR.js} +1 -1
- package/dist/client/assets/{badge-BLopTdJo.js → badge-CVFmvf1e.js} +1 -1
- package/dist/client/assets/{block-document-DRcrQBeX.js → block-document-BENHfkyr.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-D9X9QQD5.js → blocks-preview-workspace-context-EXsoCHPE.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DOYuC7hO.js → blocks-tab-states-Of3CFRB8.js} +1 -1
- package/dist/client/assets/{blog-schema-njjjFtQI.js → blog-schema-BG9a5NjF.js} +1 -1
- package/dist/client/assets/{buckets-DHR--iFw.js → buckets-CC28Un34.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DrCjUiSm.js → build-improve-prompt-doc-BISiPdsN.js} +1 -1
- package/dist/client/assets/{calendar-8e1bW3QX.js → calendar-9d4oM3ql.js} +1 -1
- package/dist/client/assets/{capability-load-error-C9mmbd-g.js → capability-load-error-ByWk_AoZ.js} +1 -1
- package/dist/client/assets/{category-editor-ngsbNhPd.js → category-editor-7CKgp_eM.js} +1 -1
- package/dist/client/assets/{chart-PfmlhR6m.js → chart-DXLoDuxi.js} +1 -1
- package/dist/client/assets/{chat-context-BFpdF0Ea.js → chat-context-WEEHZlsn.js} +1 -1
- package/dist/client/assets/{chat-draft-B0ZUpMX_.js → chat-draft-CeM2nWLu.js} +1 -1
- package/dist/client/assets/{checkbox-DDDKCgb5.js → checkbox-KpsWsk0_.js} +1 -1
- package/dist/client/assets/{choose-editor-XtwrmhD8.js → choose-editor-PfXE6_H8.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BnJsDVo5.js → cli-auth-success-C2W_huzL.js} +1 -1
- package/dist/client/assets/{client-icons-Cw3Ivutw.js → client-icons-CCN4dFtx.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-DY67ejEv.js → cms-settings-editor-CdGJgv0b.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-CYIZoD9d.js → cms-store-drafts-dVKFaKA7.js} +1 -1
- package/dist/client/assets/{collapsible-C4GX1H_R.js → collapsible-B14xMZuR.js} +1 -1
- package/dist/client/assets/{collection-detail-8Mxw24IU.js → collection-detail-pdnHCRF6.js} +1 -1
- package/dist/client/assets/{collection-display-button-WZ9U6Dnn.js → collection-display-button-CRiNqITy.js} +1 -1
- package/dist/client/assets/{collection-search-Dz7QHmOz.js → collection-search-Ck-1gfFY.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-06TDQKrw.js → collection-table-wrapper-BlhppHAs.js} +1 -1
- package/dist/client/assets/{collection-tabs-C-fKyh8w.js → collection-tabs-6FzXiv6G.js} +1 -1
- package/dist/client/assets/{combobox-DqPSOi3v.js → combobox-fgtxpSsO.js} +1 -1
- package/dist/client/assets/{command-CYK5M8XI.js → command-C37DfioB.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CAKFIeG-.js → companion-mcps-section-pEyer4h1.js} +1 -1
- package/dist/client/assets/{config-DBXuSQO1.js → config-C_d2w75d.js} +1 -1
- package/dist/client/assets/{connect-NGxtU5_0.js → connect-CyzT5SDn.js} +1 -1
- package/dist/client/assets/{connect-layout-DBzvmer6.js → connect-layout-DCavpmFh.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BnXxvvcJ.js → connect-source-dialog-MOlb_mGB.js} +1 -1
- package/dist/client/assets/{connection-_PcrLws7.js → connection-BjCYlDIW.js} +1 -1
- package/dist/client/assets/{connection-card-4gZcunZq.js → connection-card-qC58rx0g.js} +1 -1
- package/dist/client/assets/{connection-detail-C0eX0pfz.js → connection-detail-CnaYuh7u.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C7Gv9-lg.js → connection-form-helpers-9PE7Ghza.js} +1 -1
- package/dist/client/assets/{connection-slug-BsU2LQiu.js → connection-slug-DgmEtT2x.js} +1 -1
- package/dist/client/assets/{connections-BA8V7XrH.js → connections-DG7FZ0U7.js} +1 -1
- package/dist/client/assets/{content-tab-C_nIeaie.js → content-tab-Ce8Q2_t2.js} +3 -3
- package/dist/client/assets/{context-8d_KiSNS.js → context-BB5j-Jdw.js} +1 -1
- package/dist/client/assets/{context-menu-o6rJLNXJ.js → context-menu-BrSBg_ox.js} +1 -1
- package/dist/client/assets/{context-shell-C1Ha8IE2.js → context-shell-D7i0aANg.js} +3 -3
- package/dist/client/assets/{core.esm-BGRTXfSt.js → core.esm-FUcIa7Fp.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-h3rzGSt9.js → create-organization-dialog-D_0hk2gK.js} +1 -1
- package/dist/client/assets/{device-hint-BOo4jdep.js → device-hint-CyMFSeT8.js} +1 -1
- package/dist/client/assets/{discover-BeGAehHo.js → discover-DJRtlG9n.js} +1 -1
- package/dist/client/assets/{domain-settings-Nhk3Nbp-.js → domain-settings-Y_vTNHIA.js} +1 -1
- package/dist/client/assets/{drawer-C1zPem_-.js → drawer-C8tQ9pS2.js} +1 -1
- package/dist/client/assets/{editor-BcXADR5b.js → editor-QJRHEQ16.js} +1 -1
- package/dist/client/assets/{editor-classes-BftbquCD.js → editor-classes-B6F-sROj.js} +1 -1
- package/dist/client/assets/{empty-state-tlDzCEBe.js → empty-state-BCvL-1M3.js} +1 -1
- package/dist/client/assets/{empty-state-BrKCVCOA.js → empty-state-DKsEkDWT.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-Dnv5W_mO.js → experiments-tab-choice-CbV3SQAK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B4CAQLEm.js → extract-connection-data-Co4igpCy.js} +1 -1
- package/dist/client/assets/{feature-gate-DWILcK73.js → feature-gate-CS539brz.js} +1 -1
- package/dist/client/assets/{feature-paywall-BOdJ7pc_.js → feature-paywall-BVeAB8_F.js} +1 -1
- package/dist/client/assets/{feedback--BP5XsMC.js → feedback-DF1F9BRw.js} +1 -1
- package/dist/client/assets/{file-explorer-BHgkTafl.js → file-explorer-Sdd0azAq.js} +1 -1
- package/dist/client/assets/{file-preview-B3c1V4-B.js → file-preview-BQioSlJw.js} +1 -1
- package/dist/client/assets/{file-share-button-BmfBQCy7.js → file-share-button-Dq-dVjtE.js} +1 -1
- package/dist/client/assets/{file-type-icon-C-QM854F.js → file-type-icon-CNDz0hBy.js} +1 -1
- package/dist/client/assets/{folder-icon-evgkGdeR.js → folder-icon-U2FEFXsO.js} +1 -1
- package/dist/client/assets/{form-D2GmFQW3.js → form-DXyLAoEr.js} +1 -1
- package/dist/client/assets/{general-B3MQGRB4.js → general-DxPErvh9.js} +1 -1
- package/dist/client/assets/{github-icon-i7iUozqR.js → github-icon-DTSso41S.js} +1 -1
- package/dist/client/assets/{home-ZCo0svlJ.js → home-C-LgRFYa.js} +1 -1
- package/dist/client/assets/{home-overview-qYf3hL7N.js → home-overview-BLmq-j06.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-CvdR91uj.js → hosted-reconcile-BRk5mz3x.js} +1 -1
- package/dist/client/assets/{icon-button-BUwzNv83.js → icon-button-B4XnwraP.js} +1 -1
- package/dist/client/assets/{index-Dn1UQvhJ.js → index-B6AqVyRx.js} +1 -1
- package/dist/client/assets/{index-DQBul4yU.js → index-BFve9Wi8.js} +1 -1
- package/dist/client/assets/{index-xj3IgJTF.js → index-BMlrWTB1.js} +1 -1
- package/dist/client/assets/{index-clkmgwR3.js → index-BgFyWMUk.js} +1 -1
- package/dist/client/assets/{index-BpRy7AHp.js → index-Bgkjt4vy.js} +3 -3
- package/dist/client/assets/{index-BfxdS8h-.js → index-C7lWWhIU.js} +1 -1
- package/dist/client/assets/{index-CKnb1ufF.js → index-CQ63loJV.js} +1 -1
- package/dist/client/assets/{index-D_UeTS1-.js → index-D08mzr4H.js} +1 -1
- package/dist/client/assets/{index-DPD9OENi.js → index-D3t73ds8.js} +1 -1
- package/dist/client/assets/{index-C_UqErbC.js → index-DObYgDqg.js} +1 -1
- package/dist/client/assets/{index-lbygo01z.js → index-DP8sH5of.js} +1 -1
- package/dist/client/assets/{index-ukVGoFpO.js → index-DovyWo-R.js} +1 -1
- package/dist/client/assets/index-DxfUJlA4.js +4 -0
- package/dist/client/assets/{index-CCTNTj2P.js → index-RQA3UZ8F.js} +1 -1
- package/dist/client/assets/{index-OBb8rfAw.js → index-cE8Cg_AR.js} +1 -1
- package/dist/client/assets/{index-ChAPkvx3.js → index-kwATYZnP.js} +1 -1
- package/dist/client/assets/{index-redirect-D-YiN8Xo.js → index-redirect-CcWBc9jM.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D03R0ede.js → infiniteQueryObserver-X5CcDr9j.js} +1 -1
- package/dist/client/assets/{infra-billing-s8EIFgUr.js → infra-billing-DFPWiYwa.js} +1 -1
- package/dist/client/assets/{input-DfTSMalp.js → input-B1ylvcHV.js} +3 -3
- package/dist/client/assets/{input-Cnq9i2l1.js → input-BYA2vxZm.js} +1 -1
- package/dist/client/assets/{integration-icon-FxF8FEU6.js → integration-icon-C7bRwcH_.js} +1 -1
- package/dist/client/assets/{jira-icon-BLg3npMf.js → jira-icon-DGCOmFp6.js} +1 -1
- package/dist/client/assets/{label-Bh2Pit2O.js → label-D25-0Wh6.js} +1 -1
- package/dist/client/assets/{layout-C60ZlULv.js → layout-DnoCv7Y5.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DwelfdPA.js → legacy-agents-deep-C5jspcJW.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-C_4oCw1E.js → legacy-main-redirect-D7NT1WBZ.js} +1 -1
- package/dist/client/assets/library-B8KAYORe.js +1 -0
- package/dist/client/assets/{library-tab-BaUP3ZVF.js → library-tab-tbFrXHgR.js} +1 -1
- package/dist/client/assets/{login-bcoCcqBW.js → login-Cn8-U1Kv.js} +1 -1
- package/dist/client/assets/{markdown-j0gDnxTp.js → markdown-12a9C6gs.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-C3zml1pp.js → mcp-app-renderer-D5couJ6l.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D4Pxc73w.js → mcp-oauth-BaddOlGq.js} +1 -1
- package/dist/client/assets/{mcp-oauth-I0kjN__K.js → mcp-oauth-a2WNYr35.js} +1 -1
- package/dist/client/assets/{members-Dxz1ewpb.js → members-CZ44ad9P.js} +1 -1
- package/dist/client/assets/{memory-C_AcXDod.js → memory-C6DEVRSO.js} +1 -1
- package/dist/client/assets/{mock-board-COgbDYxA.js → mock-board-DfUD0CJt.js} +3 -3
- package/dist/client/assets/{monaco-editor-DtIoXdMD.js → monaco-editor-Cn1TEUmq.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BSstVGMX.js → monitoring-stats-row-B_RviRp-.js} +1 -1
- package/dist/client/assets/{monitoring-DWb86ZoC.js → monitoring-z5KlpAiC.js} +1 -1
- package/dist/client/assets/{multi-select-DailkN9Q.js → multi-select-DAJzscc4.js} +1 -1
- package/dist/client/assets/{mustache-BSD6v2ig.js → mustache-BYgEr74H.js} +1 -1
- package/dist/client/assets/{named-rule-view-B_8gTqcI.js → named-rule-view-a6Af9Y_h.js} +1 -1
- package/dist/client/assets/{new-project-dialog-wz5dJWkC.js → new-project-dialog-DZScwreb.js} +1 -1
- package/dist/client/assets/{oauth-callback-B7Nohzxd.js → oauth-callback-CssoBuAl.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BmsntsZe.js → oauth-callback-ai-provider-DeW99Mbt.js} +1 -1
- package/dist/client/assets/{oauth-consent-cf55Bmz-.js → oauth-consent-3FbtrQ-O.js} +1 -1
- package/dist/client/assets/{onboarding-Cdi9idPQ.js → onboarding-idlA3-zh.js} +1 -1
- package/dist/client/assets/{openai-conversation-BMpQOydo.js → openai-conversation-C88BC7Je.js} +1 -1
- package/dist/client/assets/optimistic-project-sidebar-views-C-XQYFtN.js +1 -0
- package/dist/client/assets/{order-monitor-day-Bk2YpEn9.js → order-monitor-day-DRh7v9Pq.js} +1 -1
- package/dist/client/assets/{organization-choice-CcyZ2sED.js → organization-choice-D8HF6Nft.js} +1 -1
- package/dist/client/assets/{orgs-C6-Q2iMm.js → orgs-HEuftt--.js} +1 -1
- package/dist/client/assets/{own-accounts-section-BEuNQYr7.js → own-accounts-section-BoGn4pOO.js} +1 -1
- package/dist/client/assets/{pair-D0R2UDgp.js → pair-Ct1xgxut.js} +1 -1
- package/dist/client/assets/{parse-sections-DTDSECqx.js → parse-sections-D-35SZIB.js} +7 -7
- package/dist/client/assets/{plan-D5_Bt3KJ.js → plan-CfTunmR6.js} +1 -1
- package/dist/client/assets/{plan-ladder-BWKx4tc-.js → plan-ladder-iJPGG0mc.js} +1 -1
- package/dist/client/assets/{plan-usage-card-Z5a-2qYK.js → plan-usage-card-CPmF1Mdc.js} +1 -1
- package/dist/client/assets/{popover-BrVMYzI-.js → popover-CRX5tFOb.js} +1 -1
- package/dist/client/assets/{post-calendar-BpEmJgqQ.js → post-calendar-BJXCzebc.js} +1 -1
- package/dist/client/assets/{post-editor-yNAWU29F.js → post-editor-wf3j_7Z5.js} +1 -1
- package/dist/client/assets/{preview-content-CWagFWI_.js → preview-content-BSZZr-mZ.js} +1 -1
- package/dist/client/assets/{preview-dialog-Bc1z8QHZ.js → preview-dialog-BcxXfQ6o.js} +1 -1
- package/dist/client/assets/{preview-panel-bcbhyFq_.js → preview-panel-Ce1qZOdd.js} +1 -1
- package/dist/client/assets/{preview-tab-nbSkAxxa.js → preview-tab-ClX_Bl94.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-CNr_kHqK.js → product-picker-dialog-Q92D1y36.js} +1 -1
- package/dist/client/assets/{profile-DtHrUsir.js → profile-CERW1LgW.js} +1 -1
- package/dist/client/assets/{project-app-view-BfN3k7ju.js → project-app-view-CEubGD1t.js} +1 -1
- package/dist/client/assets/{project-apps-C_vCRb8O.js → project-apps-C951mymv.js} +1 -1
- package/dist/client/assets/{project-icon-n7LBJrfx.js → project-icon-CzcU3Mqg.js} +1 -1
- package/dist/client/assets/{project-index-2cTAo4fH.js → project-index-BJwudS3v.js} +1 -1
- package/dist/client/assets/project-reports-BfKeLcLP.js +1 -0
- package/dist/client/assets/project-tasks-Dn-Gv_TR.js +1 -0
- package/dist/client/assets/{projects-OSECm-FW.js → projects-DYDXJVDD.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B7zdGKEZ.js → projects-empty-state-DQUhcI6R.js} +1 -1
- package/dist/client/assets/{prompts-J4HaC_ei.js → prompts-Pr-m_FAx.js} +1 -1
- package/dist/client/assets/record-editor-DBJCnSL6.js +1 -0
- package/dist/client/assets/{redirect-editor-DeoRyu0l.js → redirect-editor-BGvUBqUv.js} +1 -1
- package/dist/client/assets/reports-DR2YJPbu.js +1 -0
- package/dist/client/assets/{reports-CpGpr_ZH.js → reports-DzbfP0a1.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CJMXOfw7.js → reports-onboarding-fdfwoC5Y.js} +1 -1
- package/dist/client/assets/{reports-tab-LNIEzMQ4.js → reports-tab-DsenaOP3.js} +2 -2
- package/dist/client/assets/{repositories-CCBdk88v.js → repositories-BKBt9Cjw.js} +1 -1
- package/dist/client/assets/repositories-ByhK-3bU.js +1 -0
- package/dist/client/assets/{repository-binding-DdmRVWpz.js → repository-binding-SOF1batH.js} +1 -1
- package/dist/client/assets/{repository-picker-ClelLyeu.js → repository-picker-DL7LhDyE.js} +1 -1
- package/dist/client/assets/{require-capability-BCUql2uo.js → require-capability-CulwBmL_.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Lh-Wt6uK.js → required-auth-layout-Bbj3yijQ.js} +1 -1
- package/dist/client/assets/{reset-password-Cq-nDwrY.js → reset-password-CEDutYaS.js} +1 -1
- package/dist/client/assets/{resizable-D8U4YOro.js → resizable-BF1q0sZm.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CukmKoWA.js → resolve-tab-icon-BZMbKk3n.js} +1 -1
- package/dist/client/assets/{review-settings-BzmxgDqt.js → review-settings-ZkiMBoaj.js} +1 -1
- package/dist/client/assets/{role-color-C-Q62gr6.js → role-color-C9uhwzF-.js} +1 -1
- package/dist/client/assets/{roles-b8ba7BB1.js → roles-CEON3RQs.js} +1 -1
- package/dist/client/assets/route-D7DW4Q6o.js +1 -0
- package/dist/client/assets/route-DEPx9jGW.js +1 -0
- package/dist/client/assets/route-iWPPipTt.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-o_ip6_5z.js → sandbox-lifecycle-context-Cuu6DFTF.js} +1 -1
- package/dist/client/assets/{schema-ByYst2Pb.js → schema-DCIk1LTk.js} +1 -1
- package/dist/client/assets/{schema-CDmusrrq.js → schema-DJM5djBQ.js} +1 -1
- package/dist/client/assets/{scroll-area-Ch8iXNIM.js → scroll-area-jAJHvOhj.js} +1 -1
- package/dist/client/assets/{search-input-CqM9MiZ3.js → search-input-DVDThqIB.js} +1 -1
- package/dist/client/assets/{search-toggle-VKaSo9uW.js → search-toggle-CI-y0p8p.js} +1 -1
- package/dist/client/assets/{secret-picker-DPC7oeFy.js → secret-picker-popVUrUL.js} +1 -1
- package/dist/client/assets/{secrets-2ntDkWXH.js → secrets-DalYwIr1.js} +1 -1
- package/dist/client/assets/{section-array-field-ziyJ9KKG.js → section-array-field-DC06wjHY.js} +1 -1
- package/dist/client/assets/{sections-B2FraWlK.js → sections-D1hA-xOU.js} +1 -1
- package/dist/client/assets/{sections-editor-D6NJi3oc.js → sections-editor-D78O6u_r.js} +1 -1
- package/dist/client/assets/{select-BqAgCf_e.js → select-lF0wcoip.js} +1 -1
- package/dist/client/assets/{select-model-CgHPgPvz.js → select-model-D7HU-f3b.js} +1 -1
- package/dist/client/assets/{seo-editor-Bc6Ncl3H.js → seo-editor-CtzJbmZQ.js} +1 -1
- package/dist/client/assets/{separator-B2LjZA6j.js → separator-C_6waQwt.js} +1 -1
- package/dist/client/assets/settings-tab-udmQO91m.js +1 -0
- package/dist/client/assets/{sheet-y4usetIj.js → sheet-B-HfTX7L.js} +1 -1
- package/dist/client/assets/{shell-layout-BHLD5jhn.js → shell-layout-DJhfQde-.js} +1 -1
- package/dist/client/assets/{site-draft-actions-gfTBLW-u.js → site-draft-actions-CMHnwxCd.js} +1 -1
- package/dist/client/assets/{site-draft-view-B7polEM8.js → site-draft-view-CwjjGmMd.js} +1 -1
- package/dist/client/assets/site-editor-DG5keOVm.js +1 -0
- package/dist/client/assets/{site-editor-toast-DaSHvCWu.js → site-editor-toast-CFZ3g20k.js} +1 -1
- package/dist/client/assets/{skills-BemYRmGR.js → skills-TRY4s8Yy.js} +1 -1
- package/dist/client/assets/{slider-CUVU1H_x.js → slider-DGqHqKd3.js} +1 -1
- package/dist/client/assets/{sortable.esm-Sw9w3P90.js → sortable.esm-DwDHqu2Z.js} +1 -1
- package/dist/client/assets/{sso-C3qLFTZi.js → sso-Am4Nf_A1.js} +1 -1
- package/dist/client/assets/{suggestion-BiaV3mvJ.js → suggestion-9_dojs-y.js} +1 -1
- package/dist/client/assets/{switch-DKx4qpl7.js → switch-Bh4leDQ8.js} +1 -1
- package/dist/client/assets/{synced-repos-edmrMUSZ.js → synced-repos-lK4skxC9.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-C8csunxY.js → tab-icon-glyph-DQowlddo.js} +1 -1
- package/dist/client/assets/{table-Dq5I6aY7.js → table-BVlqjzf4.js} +1 -1
- package/dist/client/assets/{tabs-0SGJ_qve.js → tabs-CE50d848.js} +1 -1
- package/dist/client/assets/{task-board-CWLsdAvC.js → task-board-D_hXj2Vy.js} +1 -1
- package/dist/client/assets/{task-route-Cay3KQ6a.js → task-route-Be5seRTj.js} +1 -1
- package/dist/client/assets/{task-status-D-bn6Q3b.js → task-status-1axt5dZB.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-L-F5O9dg.js → taskboard-analytics-r6HixYm_.js} +1 -1
- package/dist/client/assets/tasks-BWjB_1VS.js +1 -0
- package/dist/client/assets/{tasks-DIxE8tYD.js → tasks-CdxgNM_V.js} +1 -1
- package/dist/client/assets/{textarea-C8pP4RDC.js → textarea-DnFolSR6.js} +1 -1
- package/dist/client/assets/{thread-analytics-01LkdxOy.js → thread-analytics-BoSR9_dC.js} +1 -1
- package/dist/client/assets/{thread-intent-D7FGI3D0.js → thread-intent-W-PQxNVd.js} +1 -1
- package/dist/client/assets/{thread-route-E0bMcc27.js → thread-route-B-6djUfH.js} +1 -1
- package/dist/client/assets/{thread-route-CKRKYHUZ.js → thread-route-mCuisQJI.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DkwRzpXX.js → thread-sheet-body-C1IbmVK3.js} +1 -1
- package/dist/client/assets/{time-range-picker-DNs3LiZc.js → time-range-picker-DihnOOBB.js} +1 -1
- package/dist/client/assets/{toggle-group-DkZuJxmr.js → toggle-group-DErjWYXo.js} +1 -1
- package/dist/client/assets/{tool-namespace-CCkkm2qA.js → tool-namespace-Dwob85yl.js} +1 -1
- package/dist/client/assets/{tool-set-selector-5zt8G69C.js → tool-set-selector-C4XbxKMC.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Cx0kc5lZ.js → toolbar-icon-button-CuzSG6Ep.js} +1 -1
- package/dist/client/assets/{tooltip-jhiffORJ.js → tooltip-BP38juWI.js} +1 -1
- package/dist/client/assets/{tooltipContext-BYQJi6EG.js → tooltipContext-BmU0TqD4.js} +1 -1
- package/dist/client/assets/{track-8QL-WYe-.js → track-auFJ_XdC.js} +1 -1
- package/dist/client/assets/{types-CR7kvQl1.js → types-8U8D-Y9v.js} +1 -1
- package/dist/client/assets/{url-slug-BxiYZtUy.js → url-slug-CvXmCpJZ.js} +1 -1
- package/dist/client/assets/{usage-stats-DB51uKij.js → usage-stats-C-iZo0BZ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-sfkouqgF.js → use-ai-providers-BIh1KBLl.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DA98Iihd.js → use-apply-named-rule-Cp8bLYtd.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BvyYDdXE.js +1 -0
- package/dist/client/assets/{use-automations-DD-H-0gg.js → use-automations-BomrPGWU.js} +1 -1
- package/dist/client/assets/{use-autosave-Bw7KaLnG.js → use-autosave-CwfHnqn6.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-iz2iNvo9.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-BbG5C9on.js → use-chat-layout-state-BJFKgYgw.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-1o6NX1uP.js → use-cms-publish-actions-BqHNyOA0.js} +1 -1
- package/dist/client/assets/{use-connect-companion-LWK1AWBF.js → use-connect-companion-B9Lrc-HW.js} +1 -1
- package/dist/client/assets/{use-connection-CgY1E7FR.js → use-connection-BT_OOtuG.js} +1 -1
- package/dist/client/assets/{use-content-sync-9QsuTp3C.js → use-content-sync-B0MN54yQ.js} +1 -1
- package/dist/client/assets/{use-copy-DRW_V1kW.js → use-copy-DrB0tWuk.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Cw3Zaqb5.js → use-date-fns-locale-BBt-5tGJ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CgAvArNN.js → use-debounced-autosave-DsHXF_za.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B0a3uxKQ.js → use-debounced-value-CekhRquV.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BVH6IrV5.js → use-deco-credits-qwzMk2Ai.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BYlxYXUQ.js → use-decopilot-events-Dd92yoAZ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CvuMwKsA.js → use-delete-connection-D-UTTC0v.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bw3ciRk9.js → use-deployment-admin-DE1jKIDx.js} +1 -1
- package/dist/client/assets/{use-entitlements-CMCBZq5_.js → use-entitlements-BWZ6Su0L.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BUD5f_Gm.js → use-fast-preview-draft-url-Cqws--qI.js} +1 -1
- package/dist/client/assets/{use-file-configs-2Z7OwHbg.js → use-file-configs-DpxzYxst.js} +1 -1
- package/dist/client/assets/{use-id-selection--cuaALt7.js → use-id-selection-BGnSfWFf.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DxzsD1YQ.js → use-inbox-feed-lQA3V0xG.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BKVwA-Ob.js → use-infinite-scroll-wFaFK15q.js} +1 -1
- package/dist/client/assets/{use-join-requests-BZlGoiU5.js → use-join-requests-BdaV0Rjj.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-Dk8fH1fE.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-CYCjckUQ.js → use-mcp-auth-status-Ck3Se_Y3.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CjLtJgTU.js → use-mcp-client-IMgoLgFY.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-JVEMCdnt.js → use-mcp-prompts-Bk_g-v-0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C5jhMv1O.js → use-mcp-tools-CtpSFCmz.js} +1 -1
- package/dist/client/assets/{use-mobile-CKr6zvd6.js → use-mobile-CW7DCn5M.js} +1 -1
- package/dist/client/assets/{use-move-blocks-B-6qZYKa.js → use-move-blocks-DfaBs3sc.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BJsKVGd6.js → use-navigate-to-agent-DUsfLcvr.js} +1 -1
- package/dist/client/assets/{use-org-fs-DDhNsbr6.js → use-org-fs-DDvKBG9i.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DBx3nqV9.js → use-org-repo-syncs-C4JLwrAt.js} +1 -1
- package/dist/client/assets/{use-org-sso-DyxTDJHi.js → use-org-sso-BH_ZUFcu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Cs5X07HH.js → use-organization-settings-Ca4qUgyM.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-4sY_IqcV.js +1 -0
- package/dist/client/assets/{use-project-scope-DK5Zq3Vj.js → use-project-scope-CxaJ6AcP.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BrqeKXhi.js → use-recent-apps-kdlh-9NG.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-D0MF0Enh.js → use-reports-diagnostic-DYAFraaD.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-DKvN2vib.js → use-sandbox-events-Bv6EHRzy.js} +1 -1
- package/dist/client/assets/{use-secrets-q3tQjsVS.js → use-secrets-BwcJJCVK.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DI0VnMUg.js → use-section-preview-base-CWdiCrj1.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-NHFQSjyB.js → use-sidebar-collapsed-CEHXblGy.js} +1 -1
- package/dist/client/assets/{use-tags-7ZRefyR6.js → use-tags-CoD8SrC4.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CFKUFKZO.js → use-task-board-analytics-B7geh4Sd.js} +1 -1
- package/dist/client/assets/{use-task-board-events-D1ietf1D.js → use-task-board-events-CVDrlP1V.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-hyB7mT0I.js → use-task-board-item-prs-BrtOevur.js} +1 -1
- package/dist/client/assets/{use-task-board-items-C5M-iJHh.js → use-task-board-items-COv-bhs6.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-Bj8qQJuo.js → use-task-board-prompts-Dx8vM0fR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D_W5nMRB.js → use-task-metadata-DPZ7Y524.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CIMyOC9i.js → use-thread-outputs-Pm3V0nbB.js} +1 -1
- package/dist/client/assets/{use-voice-input-D0UxQK8p.js → use-voice-input-DwO5kNPT.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Sda1zjLQ.js +1 -0
- package/dist/client/assets/{useQueries-D-paqk_N.js → useQueries-CvrSJ4L5.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CscGJh0l.js +1 -0
- package/dist/client/assets/{users-CgyVEAVi.js → users-B-jZ9pgk.js} +1 -1
- package/dist/client/assets/{utils-CML3oMCb.js → utils-CnVlph4k.js} +1 -1
- package/dist/client/assets/{variant-calendar-CiRidZhE.js → variant-calendar-DSMYmXmT.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DptryLC2.js → variant-matcher-override-DCs6FrU7.js} +1 -1
- package/dist/client/assets/{view-header-C5UPfmG7.js → view-header-CggAPEpA.js} +1 -1
- package/dist/client/assets/virtual-mcp-knTda3gw.js +1 -0
- package/dist/client/assets/{watch-sse-pool-DiT4THMV.js → watch-sse-pool-CjiXfMh2.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-app-D1s_xxXR.js +0 -1
- package/dist/client/assets/agent-assets-CvRDUZu-.js +0 -1
- package/dist/client/assets/agent-calendar-BQ5xnVXW.js +0 -1
- package/dist/client/assets/agent-deck-1mK6Ythm.js +0 -1
- package/dist/client/assets/agent-e2e-CowJJC6D.js +0 -1
- package/dist/client/assets/agent-experiments-3ZqH1pHZ.js +0 -1
- package/dist/client/assets/agent-file-w7JCVN0l.js +0 -1
- package/dist/client/assets/agent-hosting-p1C0G82t.js +0 -1
- package/dist/client/assets/agent-library-Bivz2SRZ.js +0 -1
- package/dist/client/assets/agent-library-file-CpGwdPNs.js +0 -1
- package/dist/client/assets/agent-overview-CwCkuDX2.js +0 -1
- package/dist/client/assets/agent-settings-DEn_87Gp.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DqKm62jM.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DmZnej6I.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DuaKrxk_.js +0 -1
- package/dist/client/assets/agent-view-Cey5y0PV.js +0 -1
- package/dist/client/assets/api-keys-IHsKCg1y.js +0 -1
- package/dist/client/assets/index-cKSjr8CK.js +0 -4
- package/dist/client/assets/library-B-jS61L0.js +0 -1
- package/dist/client/assets/optimistic-project-sidebar-views-AOXvjkSa.js +0 -1
- package/dist/client/assets/project-reports-C1Hkwfya.js +0 -1
- package/dist/client/assets/project-sidebar-views-DhZy-bnC.js +0 -1
- package/dist/client/assets/project-tasks-B8hDD-I8.js +0 -1
- package/dist/client/assets/record-editor-B3zURv0C.js +0 -1
- package/dist/client/assets/reports-CofWqBLU.js +0 -1
- package/dist/client/assets/repositories-yBP4WuG_.js +0 -1
- package/dist/client/assets/route-BK2wi4kD.js +0 -1
- package/dist/client/assets/route-CXbtT4mj.js +0 -1
- package/dist/client/assets/route-Dq87eMEg.js +0 -1
- package/dist/client/assets/settings-tab-DzS7_7oR.js +0 -1
- package/dist/client/assets/site-editor-Cp5Zuvwt.js +0 -1
- package/dist/client/assets/tasks-Drp2qtBI.js +0 -1
- package/dist/client/assets/use-ask-in-chat-tQsBmTsy.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DzHuTeMz.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-4JSMbOrH.js +0 -1
- package/dist/client/assets/useInfiniteQuery-4mlqNbEX.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-6pYaPTkl.js +0 -1
- package/dist/client/assets/virtual-mcp-BVgnJh3F.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i3 as Xo,bf as ei,c as wn,b as Rn,r as b,m as ie,j as r,bQ as ti,b8 as As,i4 as Ba,B as It,Y as an,au as ni,_ as si,be as ri,Z as ai,q as oi,hB as ii,i5 as li,i6 as ci,h as ui,bg as wt,i7 as Jr,i8 as ys,i9 as di,ia as pt,ib as Yr,ic as fi,bt as mi,id as pi,ie as Qr,ig as hi,t as W,bZ as Zr,ih as gi,ii as Bt,ij as vi,ik as yi,il as Si,bY as Xr,im as Ss,io as bi,ip as xi,iq as _i,bW as ki,bu as wi,ir as Ri,is as ji,bT as Ei,K as Vi,it as ea,fe as Ti,bm as $n,br as ta,iu as na,iv as Ai,iw as Ni,ix as Ci,iy as bs,iz as Pi,iA as Bi,iB as Ki,iC as sa,iD as Di,iE as Mi,bR as ra,iF as Fi,iG as Ii,iH as Li,bV as Oi}from"./index-BpRy7AHp.js";import{u as zi}from"./chat-context-BFpdF0Ea.js";import{a5 as $i,O as Qn,a6 as Hi,a7 as Wi,a8 as qi,a9 as Gi,aa as Ui,ab as Ji,ac as aa,ad as Yi,ae as Qi,A as Gn,y as Un,d as Zi,u as Xi,af as oa,i as el,ag as tl,k as nl,h as sl,ah as Ka,p as kn,ai as rl,aj as al,w as ia,ak as ol,al as il,am as Hn,an as la,ao as ca,ap as ua,aq as xs,ar as ll,F as cl,as as ul,z as dl,at as da,au as fl,av as fa,aw as ma,ax as pa,M as ml,ay as ha,a as pl,az as on,aA as hl,aB as gl,v as Wn,a4 as xn}from"./parse-sections-DTDSECqx.js";import{b as vl}from"./repository-binding-DdmRVWpz.js";import{n as yl,t as Sl}from"./ChevronUp-aVrgoYI4.js";import{a7 as Da,b as Yn,am as bl,e as xl,E as _l,a1 as ga,Y as va}from"./agent-icon-AbOSM7KF.js";import{S as ln}from"./scroll-area-Ch8iXNIM.js";import{c as Rt,T as jt,a as Et}from"./tooltip-jhiffORJ.js";import{l as kl,u as wl,m as Rl,U as jl,ai as El,S as Vl,F as ya,aX as Sa,as as Kt,at as Dt,a4 as Tl,aY as Al,aZ as Nl,aT as ba,a7 as Cl,ae as Pl}from"./site-editor-toast-DaSHvCWu.js";import{u as Bl,ao as xa,e as _a,j as Kl,D as Dl,A as qn,a3 as Ml,ae as Fl,ag as Il}from"./blocks-tab-states-DOYuC7hO.js";import{m as Ll,u as Ol,P as zl}from"./mustache-BSD6v2ig.js";import{a as Rs,e as Ma}from"./UserSquare-BloCTB27.js";import{i as ka,s as wa}from"./Tool01-BXFm5jK2.js";import{s as $l}from"./Plus-u00IxELx.js";import{s as Hl}from"./Trash01-t2BYg0st.js";import{i as js}from"./Zap-CmNmFUbX.js";import{u as Wl,a as Ra,K as ql,P as Gl,b as Ul,C as Jl,D as Yl,c as Ql}from"./core.esm-BGRTXfSt.js";import{u as Zl,s as Xl,a as Jn,S as ec,v as tc}from"./sortable.esm-Sw9w3P90.js";import{s as nc,g as sc,u as rc,A as ac}from"./use-section-preview-base-DI0VnMUg.js";import{u as oc,a as ic,P as ja,w as lc,b as cc}from"./seo-editor-Bc6Ncl3H.js";import{R as uc,y as _s,T as Ea,x as dc,U as fc}from"./hosted-reconcile-CvdR91uj.js";import{u as mc}from"./use-apply-named-rule-DA98Iihd.js";import{m as Jt,d as Es,y as Vs,n as Ft,e as cn,q as pc,k as Ut,r as ks,j as Mt,h as _n,b as hc,s as Va,z as gc,A as vc,B as yc}from"./section-array-field-ziyJ9KKG.js";import{b as Ta,a as Sc}from"./variant-matcher-override-DptryLC2.js";import"./autosend-xPyRMwmc.js";import"./thread-route-E0bMcc27.js";import"./use-project-scope-DK5Zq3Vj.js";import"./thread-intent-D7FGI3D0.js";import"./use-mcp-client-CjLtJgTU.js";import"./auth-D1oBKWc9.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-DiT4THMV.js";import"./task-board-CWLsdAvC.js";import"./schema-CDmusrrq.js";import"./use-entitlements-CMCBZq5_.js";import"./use-ai-providers-sfkouqgF.js";import"./use-decopilot-events-BYlxYXUQ.js";import"./use-organization-settings-Cs5X07HH.js";import"./utils-CML3oMCb.js";import"./Play-DWKJ4lP6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-D0R2UDgp.js";import"./LinkBroken01-Dhn_nIp2.js";import"./collapsible-C4GX1H_R.js";import"./use-copy-DRW_V1kW.js";import"./usage-stats-DB51uKij.js";import"./tool-namespace-CCkkm2qA.js";import"./form-D2GmFQW3.js";import"./label-Bh2Pit2O.js";import"./utils-CVEq3hMx.js";import"./markdown-j0gDnxTp.js";import"./use-mobile-CKr6zvd6.js";import"./shell-layout-BHLD5jhn.js";import"./Globe04-Czvq6voU.js";import"./use-deployment-admin-Bw3ciRk9.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-CUME_VK2.js";import"./CheckCircle-DjUjDOFk.js";import"./Monitor01-BwW28bRE.js";import"./command-CYK5M8XI.js";import"./index-DQBul4yU.js";import"./SearchMd-DrxAIngK.js";import"./integration-icon-FxF8FEU6.js";import"./project-icon-n7LBJrfx.js";import"./use-navigate-to-agent-BJsKVGd6.js";import"./use-debounced-value-B0a3uxKQ.js";import"./new-project-dialog-wz5dJWkC.js";import"./ArrowLeft-yZosAbEQ.js";import"./repository-picker-ClelLyeu.js";import"./github-icon-i7iUozqR.js";import"./useInfiniteQuery-4mlqNbEX.js";import"./infiniteQueryObserver-D03R0ede.js";import"./collection-search-Dz7QHmOz.js";import"./ShoppingBag01-BOpj8wnX.js";import"./required-auth-layout-Lh-Wt6uK.js";import"./use-org-sso-DyxTDJHi.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C3zml1pp.js";import"./types-CR7kvQl1.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-1CFQF9HU.js";import"./sheet-y4usetIj.js";import"./use-connection-CgY1E7FR.js";import"./use-mcp-prompts-JVEMCdnt.js";import"./use-thread-outputs-CIMyOC9i.js";import"./file-type-icon-C-QM854F.js";import"./switch-DKx4qpl7.js";import"./textarea-C8pP4RDC.js";import"./ChevronSelectorVertical-C2ySHatm.js";import"./popover-BrVMYzI-.js";import"./monaco-editor-DtIoXdMD.js";import"./editor-BcXADR5b.js";import"./calendar-8e1bW3QX.js";import"./SwitchHorizontal01-DedOEqGg.js";import"./Minus-qjFidgiH.js";import"./select-BqAgCf_e.js";import"./index-BdQq_4o_.js";import"./index-lbygo01z.js";import"./editor-classes-BftbquCD.js";import"./toggle-group-DkZuJxmr.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-DqPSOi3v.js";import"./Upload01-BBUgsLLD.js";import"./search-input-CqM9MiZ3.js";import"./tabs-0SGJ_qve.js";import"./use-file-configs-2Z7OwHbg.js";import"./asset-utils-DhDLN_-h.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-voice-input-D0UxQK8p.js";import"./drawer-C1zPem_-.js";import"./index-DPD9OENi.js";import"./checkbox-DDDKCgb5.js";import"./Key01-CJVeUDDi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-B_QEh9AM.js";import"./CreditCard01-CMrZYrMd.js";import"./Sun-CUTKbSf6.js";import"./Users01-D0A6lP8t.js";import"./use-blocks-v8-project-DzHuTeMz.js";import"./use-sandbox-events-DKvN2vib.js";import"./empty-state-tlDzCEBe.js";import"./slider-CUVU1H_x.js";import"./index-OBb8rfAw.js";import"./tooltipContext-BYQJi6EG.js";import"./CategoricalChart-KK8jWPWD.js";import"./index-D_UeTS1-.js";import"./use-move-blocks-B-6qZYKa.js";const bc={escape:$i};function xc(v,e){for(const p of nc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function _c(v,e){if(!e)return;const p=Xo(v,ei(e));if(p)try{const S=xc(p.resolveType,e);return S&&Ll.render(S,p.data,{},bc).trim()||void 0}catch{return}}function kc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=ie("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const wc="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,p)=>({id:crypto.randomUUID(),index:p}))}function Fa(v){return v.map((e,p)=>({...e,index:p}))}function Rc(v,e){if(e===v.length)return v;if(e<v.length)return Fa(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Ia(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=Rn(),_=Qn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?sc(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?_c(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=Ji(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&As(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Yn:k?Da:Ma;let G;e[16]!==k||e[17]!==P?(G=P?{color:ri}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Qi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(bl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Rs,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=ie("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(kc,{icon:js,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(aa,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(aa,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const jc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ec="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 La(v,e,p){if(p)return Yi({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return ie("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?jc:x?Ec:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(v,e){return ie("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 Vc(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=Rn(),c=Qn(),xe=S?As(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Ba(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Nc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Zl(Oe);let Pe;e[4]!==ze?(Pe=Jl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let ue;e[6]!==Pe||e[7]!==st?(ue={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=ue):ue=e[8];const g=ue;let we;e[9]!==p?(we=Wi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,at="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=ie("touch-none transition-colors",Xe,La(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Ye=r.jsx(Ia,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Ye):Ye=e[22];const H=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ie(ws(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Ac,children:r.jsx(js,{className:ie("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ot=c?r.jsx(qi,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ie(ws(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Tc,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),de=si,Qe=Gi;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=ie(ws(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let $e;e[25]!==Qe||e[26]!==ve||e[27]!==it?($e=r.jsx(Qe,{label:ve,classicClassName:it}),e[25]=Qe,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(js,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ni,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(xl,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(an,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let K;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(K=ke&&r.jsxs(an,{className:ie(!c&&Ui),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Da,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=K):K=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(an,{className:ie(!c&&wc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Yn,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let fe;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(fe=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Ma,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=fe):fe=e[58];let He;e[59]!==k?(He=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=He):He=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Hl,{className:"h-4 w-4"}),e[61]=et):et=e[61];let De;e[62]!==w?(De=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=De):De=e[63];let $;e[64]!==He||e[65]!==De?($=r.jsxs(an,{variant:"destructive",onClick:He,children:[et,De]}),e[64]=He,e[65]=De,e[66]=$):$=e[66];let oe;e[67]!==Be||e[68]!==ee||e[69]!==K||e[70]!==T||e[71]!==fe||e[72]!==$?(oe=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,K,T,fe,$]}),e[67]=Be,e[68]=ee,e[69]=K,e[70]=T,e[71]=fe,e[72]=$,e[73]=oe):oe=e[73];let Ve;e[74]!==de||e[75]!==$e||e[76]!==oe?(Ve=r.jsxs(de,{children:[$e,oe]}),e[74]=de,e[75]=$e,e[76]=oe,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Ye||e[85]!==H||e[86]!==ot||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:at,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Ye,H,ot,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Ye,e[85]=H,e[86]=ot,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Tc(v){return v.stopPropagation()}function Ac(v){return v.stopPropagation()}function Nc(){return!1}function Ts(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=Rn();let _;e[0]!==x?(_=ie("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx($l,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Cc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=Rn(),I=Qn();let ke;e[0]!==x.length?(ke=()=>Aa(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Aa(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Rc(tt,x.length)));let ue;e[2]===Symbol.for("react.memo_cache_sentinel")?(ue={activationConstraint:{distance:8}},e[2]=ue):ue=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Xl},e[3]=g):g=e[3];const we=Wl(Ra(Gl,ue),Ra(ql,g));let rt;e[4]!==d?(rt=d.map(Pc),e[4]=d,e[5]=rt):rt=e[5];const at=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==at||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const We=at.indexOf(String(O.id)),ht=at.indexOf(String(Ae.id));We===-1||ht===-1||(Oe(bt=>Fa(Jn([...bt],We,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(We,ht))},e[7]=at,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Ee(null)},e[10]=Ye):Ye=e[10];const H=Ye;let ot,de,Qe,ve,it,$e,Be,Ke,se,Y,ee,K,T,fe,He;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==at||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){fe=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Qe=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let We;e[61]!==Ae?(We=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=We):We=e[62];const ht=We;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],fe=bt;break e}T=ie(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Qe,e[57]=ve,e[58]=T}else Qe=e[56],ve=e[57],T=e[58];de=Yl,Ke=we,se=Ql,Y=L,ee=A,K=H,ot=ec,$e=at,Be=tc,He="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Vc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=at,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=ot,e[34]=de,e[35]=Qe,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=K,e[45]=T,e[46]=fe,e[47]=He}else ot=e[33],de=e[34],Qe=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],K=e[44],T=e[45],fe=e[46],He=e[47];if(fe!==Symbol.for("react.early_return_sentinel"))return fe;let et;e[68]!==it||e[69]!==He?(et=r.jsx("div",{className:He,children:it}),e[68]=it,e[69]=He,e[70]=et):et=e[70];let De;e[71]!==ot||e[72]!==$e||e[73]!==Be||e[74]!==et?(De=r.jsx(ot,{items:$e,strategy:Be,children:et}),e[71]=ot,e[72]=$e,e[73]=Be,e[74]=et,e[75]=De):De=e[75];let $;e[76]!==Qe||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:ie("cursor-grabbing shadow-lift",La(ve,!1,I)),children:r.jsx(Ia,{section:ve,raw:Qe,meta:V,decofile:C})}):null,e[76]=Qe,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let oe;e[82]!==$?(oe=ti.createPortal(r.jsx(Ul,{dropAnimation:Hi,children:$}),document.body),e[82]=$,e[83]=oe):oe=e[83];let Ve;e[84]!==de||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==K||e[90]!==De||e[91]!==oe?(Ve=r.jsxs(de,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:K,children:[De,oe]}),e[84]=de,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=K,e[90]=De,e[91]=oe,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Pc(v){return v.id}function Bc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Es(v,p,S)}:{kind:"noop"};const V=Vs(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Gn(x),_=Un(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Na="section-form-stale-save",Kc=3;function Ca(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ka(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Pa=new WeakMap;let Dc=0;function Mc(v){let e=Pa.get(v);return e===void 0&&(e=++Dc,Pa.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=zi(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=kl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Bl(_e),X=Qn(),ze=xe?.virtualMcpId,Pe=vl(ze===e?e:null)?.metadata?.siteSlug??null,st=rc({virtualMcpId:e,branch:p,sandboxUrl:x}),ue=wl(e,p),g=Rl(ue),we=Ei(g),rt=!g,at=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Ye,H]=b.useState(null),[ot,de]=b.useState(0),[Qe,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[K,T]=b.useState([]),fe=b.useRef(null),[He,et]=b.useState(K.length);He!==K.length&&(et(K.length),requestAnimationFrame(()=>{fe.current&&(fe.current.scrollTop=0)}));const[De,$]=b.useState(0),[oe,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,We]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,Oa]=b.useState(!0),[Yt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(Z),[Ns,Cs]=b.useState(Z);Z&&!Ns&&(Cs(!0),un(!0),L(null),A(null),H(null),T([])),!Z&&Ns&&Cs(!1);const[za,dn]=b.useState(null),[Ps,An]=b.useState(void 0),[Bs,Ot]=b.useState([]),[Ks,Qt]=b.useState(0),[Me,lt]=b.useState(0),[$a,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Ds,Ms]=b.useState(null),Fs=oi(),Is=jl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Zi({orgSlug:v,virtualMcpId:e,branch:p}),[Ha,Wa]=b.useState(V),[qa,Ga]=b.useState(C),[Ua,Ja]=b.useState(_);(Ha!==V||qa!==C||Ua!==_)&&(queueMicrotask(()=>fn.flush()),Wa(V),Ga(C),Ja(_),L(null),A(null),H(null),de(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1));const D=Xi({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Nn=Ol({orgSlug:v,virtualMcpId:e,branch:p}),Ls=mc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Cn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),Zn=b.useRef(new WeakSet);El(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,o]){const f=l==null?void 0:s[l],j=l==null?void 0:a[l],h=f&&j?.isSavedBlock?bs(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Cn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Ya,Qa]=b.useState(0),$s=ii(ue,{orgSlug:v,virtualMcpId:e,branch:p}),Hs=li($s,I[0]?.blockKey??null,ci(d,I[0]?.blockKey??null)),[Za,Xa]=b.useState(null),Xn=Vl(v,e).epoch,[eo,to]=b.useState(Xn);oc(Re?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Ws=_??(d&&u?xa(_a(d,u),V,C)?.key??null:null),es=ya({orgSlug:v,virtualMcpId:e,branch:p},Ws?[Ws]:[],{withRefs:!0}),[qs,no]=b.useState(!1),ts=ya({orgSlug:v,virtualMcpId:e,branch:p},qs?Kl:[]),Gs={ready:!(ue.kind==="protocol"&&ue.hosted)||qs&&ts.ready,failed:ts.failed,retry:ts.retry,request:()=>no(!0)};if(es.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:es.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!es.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ui,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const so=_a(d,u),q=!!_,ae=q?null:xa(so,V,C),y=q?_:ae?.key??null,ns=q&&_?d[_]:void 0,Us=q&&_&&ns?Dl(_,ns):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,ss=Re&&d&&u&&y&&ae?oa(d,{kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},u):null,ro=Re?nn?.seo:void 0,Pn=Ps!==void 0?Ps:ro,ao=Re?el(Pn):void 0,Js=ss?.seoTypeOptions??[],Ys=Re&&u?tl(u):"",rs=za??ao??{},Bn=Re&&ss?ic(rs,ss):null,Qs=Re&&Bn&&nl(Pn)?qn(Bn,u):null,Zs=Re?sl(d,u)?.seoData:void 0,me=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ka(nn?.sections,d??{},g),yt=me.length>1,te=Math.min(ot,me.length-1),Se=me[te],M=Se?.sections??[],pe=kn(M,d,g),Kn=!q&&pc(nn?.sections,g);if(q&&_&&Ds!==_){Ms(_);const t=M[0],n=pe[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),H(s.resolveType),qe(null),Fe(null))}}!q&&Ds!==null&&Ms(null),re.current={rawSections:M,parsedSections:pe,decofile:d??{},activePageKey:y,pageVariants:me,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const oo=()=>({multivariate:Kn,index:te,variants:me.map(t=>({rule:t.rule})),lazyValues:g&&Kn&&Ti(nn?.sections?.variants?.[te]?.value)}),as=(t,n)=>{if(!w)return;if(!y||!Kn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},a=g?Sa(y,s):Ta(y,s,d,u);w(a.length>0?a:null)},os=w&&y&&Kn&&yt&&!Oe&&!Ee?y:null;if(os!==Za&&(Xa(os),os)){const t=me.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>as(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const a=oo(),o=g?Sa(y,a):Ta(y,a,d,u);if(!t||n<0){w(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:pe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?Al(i):Sc({...i,decofile:d,meta:u}),f=g?Nl(o,l):[...o,...l];w(f.length>0?f:null)},xt=(t,n,s,a=m??-1,o=!1)=>{const i=pt(t,n);if(!i){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const f=Yr(i,we)[s];if(!f){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const j=pi(f.value,d);A(j?.data??null),H(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),o&&$t(i,a,s)},is=t=>{F(null),de(t),L(null),A(null),H(null),T([]);const n=me[t]?.rule,{resolveType:s,formValue:a}=Ut(n,d??{},u??void 0);ee(s),se(a),as(me.map(o=>({rule:o.rule})),t)},io=(t,n)=>{const s=M[t],a=pe[t];if(!s||!a)return!1;const o=a.isMultivariate?pt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),lt(i),T([]),$(l=>l+1),a.isMultivariate)xt(s,a,i,t);else{const l=wt(s,a,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Qe&&(ve(P?.seq??null),typeof Xs=="number"&&io(Xs,0)),Xn!==eo){to(Xn);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||D.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(fe.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=pe[m];if(T([]),$(o=>o+1),!s||!a)L(null),A(null),H(null);else if(a.isMultivariate)xt(s,a,Me,m);else{const o=wt(s,a,d,g);A(o?.data??null),H(o?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Qt(s=>s+1))}if(Os!==Ya){Qa(Os);const t=m!==null?M[m]:null,n=m!==null?pe[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),H(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Ca(d,n,g),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?ys(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,d,g):null,i=di(ut,o,l=>Qr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Dn=Ye&&u?qn(Ye,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(d,y,t,te,me);D.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},Ht=()=>{Ce?.(null),L(null),Tn(!1),A(null),H(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(fe.current,document.activeElement),ls=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,W.error(t,{id:Na}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=ue.kind==="protocol"&&ue.source==="github",rr=t=>Pl(Fs,Is,t,ue.kind==="protocol"?ue:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},lo=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=re.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Dn}},vn=t=>{ct.current=t,ke(t)},co=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:na(a.plan,a.choices,t.plan),fresh:Fi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||$n(a.plan.theirs)!==$n(t.plan.theirs)}):[...n,{...t,changedAgain:Zn.current.has(t.formBase)}];vn(o)},or=(t,n)=>{const s=ct.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if($n(o.plan.mine)===$n(n))return!0;const i=ta({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:na(o.plan,o.choices,i)})),!0},uo=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},fo=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!or(n,a)&&yn(a,n.sectionIndex,0,s),ct.current[0]??null},mo=()=>{const t=ct.current[0],n=fo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=wi(n.plan,n.choices);ue.kind==="protocol"&&ue.source==="github"&&Ri(n.plan,n.choices)&&Tl(c,!1),vn(ct.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,Zn.current.add(a),(zt.current===a||uo(n))&&(zt.current=a,A(s),$(i=>i+1)),yn(s,a.sectionIndex,0,o)},po=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??lo(n),l=i.sectionVariantIndex,f=i.formBase,j=o||ea(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const B=typeof t=="function"?t():t,z=ea(ct.current,f,i,n,g).base;if(z&&or(z,B))return;const ne=re.current.decofile,{rawSections:U,parsedSections:Ne,pageVariants:J,variantIndex:be}=Ca(ne,i,g),Ie=i.pageKey,he=U[n];if(!he)return;const le=Ne[n];if(!le)return;const Ge=f?.base,Ze=ys(he,le,l,ne,g),Nt=!!Ge&&!!Ze&&Ai(Ge,Ze)&&!(f&&Qr(f,Ze));if(Nt&&Ge&&Ze){if(Ni(Ge,Ze)){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Q=le.isSavedBlock?"here":Ci(Ge,U.map((ce,mt)=>ys(ce,Ne[mt],l,ne,g)),n,f?.sectionCount??U.length);if(Q==="unknown"){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Q=="number"&&f){f.sectionCount=U.length,f.sectionIndex=Q,zt.current===f&&L(Q),yn(B,Q,s,i);return}}const Ct=Nt&&Ge&&Ze?ta({ancestor:Ge,mine:B,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=U.length,co({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Pi(Ct),changedAgain:!1,blockKey:le.isSavedBlock?bs(he,le):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??B,qr=Bi({merged:!!Pt,tracked:f,current:zt.current,saved:B});Pt&&W.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Na}),qr&&f&&(f.emitted=Pt,A(Pt));const vs=qr||!Pt?rn:B;f&&(f.base=vs,f.sectionCount=U.length,Ki(f,vs));const Gr={onSuccess:()=>{f&&Zn.current.delete(f),k?.()},onError:Q=>{if(f?.base===vs&&Ge&&(f.base=Ge),Q instanceof Cl){if(f&&(f.version=void 0),s<Kc){ye.current.delete(R),hn.current=!0;const ce=Ii(s,Q.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:B},n,s+1,i,ce.immediate),ye.current.delete(R),ar(xn(g))},ce.delay)}else ls();return}D.reportError(Q)}},Ur=Q=>{pn.current=!0;let ce=!1;D.mutateAsync(Q).then(()=>Gr.onSuccess(),mt=>{ce=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,ar(ce?xn(g):0),tr()})};if(le.isSavedBlock){const Q=bs(he,le);if(!Q)return;Ur({blockKey:Q,data:rn,...Ge?{base:{value:Di({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:sa({formBase:f,rebased:!!Pt,versionOf:rr,...sr?{copy:{value:ne[Q]}}:{}})});return}if(!Ie)return;const zn={...ne[Ie]},Gt=[...U];if(le.isMultivariate){const Q=pt(he,le);if(!Q||!Ie)return;const ce=Mi(Q,l,rn);Gt[n]=Bt(he,le,ce)}else if(le.isHidden){const Q=As(he.__resolveType),ce=Q?{...he.section}:{...he},mt=Array.isArray(ce.variants)?[...ce.variants]:[];mt[0]&&(mt[0]=ra(ce.__resolveType,mt[0],rn)),ce.variants=mt,Q?Gt[n]={...he,section:ce}:Gt[n]=ce}else le.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(J.length>1){const Q=zn.sections,ce=[...Q?.variants??[]];ce[be]&&(ce[be]=ra(Q?.__resolveType,ce[be],Gt)),zn.sections={...Q,variants:ce}}else zn.sections=Gt;Ur({blockKey:Ie,data:zn,rebaseOnConflict:!1,guard:sa({formBase:null,rebased:!1,versionOf:rr,...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ho=t=>{tn.current=!1,L(t),lt(0),T([]),$(o=>o+1);const n=M[t],s=pe[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const a=wt(n,s,d,g);if(!a){A(null),H(null),qe(null),Fe(null),$t(null,t,0);return}A(a.data),H(a.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=ji(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},cs=t=>{if(!y||!d||!u||!ae)return;const n={kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},s=oa(d,n,u);s&&fn.save(y,()=>{const a=Fs.getQueryData(Vi.decofile(Is))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Cn.current};return Cn.current={},t?.raw!==void 0?lc(o,t.raw,u):t?.inner!==void 0?cc(n,s,o,t.inner):o})},lr=(t,n)=>{y&&(Cn.current[t]=n,cs())},go=(t,n)=>{if(!y)return;const s=Jn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},vo=t=>{if(!y)return;const n=M.filter((s,a)=>a!==t);m===t?Ht():m!==null&&m>t&&L(m-1),dt(n)},yo=t=>{if(!y)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},So=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s)return;const a=s.isHidden?xi(n,g):_i(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},bo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s||s.isMultivariate)return;const a=bi(n);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},xo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s?.isSavedBlock)return;const a=wt(n,s,d,g);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Ht(),dt(l)},_o=t=>{if(!y)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;dt(n,{onError:()=>{re.current.selectedSectionIndex===s&&Ht()}}),We(!1),L(s),lt(0),T([]),$(l=>l+1);const a=n[s],o=kn(n,d,g)[s];if(!a||!o)return;if(o.isMultivariate){xt(a,o,0);return}const i=wt(a,o,d,g);if(!i){A(null),H(null),qe(null),Fe(null);return}A(i.data),H(i.resolveType),qe(null),Fe(null)},cr=t=>{jn.current=t.append,We(!0)},ko=t=>{const n=jn.current;if(!n){_o(t);return}n({__resolveType:t.resolveType}),We(!1),jn.current=null},ur=t=>{if(m===null)return;const n=M[m],s=pe[m];!n||!s?.isMultivariate||(lt(t),T([]),$(a=>a+1),xt(n,s,t,m,!0))},wo=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=yi(a,t);if(!o){W.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Bt(n,s,o);const l=o.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},Ro=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=Si(a,t,g),i=[...M];i[m]=Bt(n,s,o);const l=Xr(a.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},jo=(t,n)=>{if(m===null||!y||t===n)return;const s=M[m],a=pe[m];if(!s||!a?.isMultivariate)return;const o=pt(s,a);if(!o)return;const i=gi(o,t,n),l=[...M];l[m]=Bt(s,a,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],a,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=M[n],a=pe[n];if(!s||!a)return;const o=hi(s,a,void 0,u,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){W.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(o.newVariantIndex),T([]),$(f=>f+1),xt(o.section,l,o.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=M[m],n=pe[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const a=vi(t,n,s);if(!a){W.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=kn(o,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(a,i,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),$t(null,m,0),dt(o)},Eo=async t=>{if(oe===null||!y)return;const n=Un(t,d,u);if(n){W.error(n);return}const s=M[oe],a=pe[oe];if(!s||!a)return;const o=wt(s,a,d,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),f=[...M];f[oe]={__resolveType:t},await D.mutateAsync({blockKey:y,data:on(d,y,f,te,me)}),m===oe&&Ht(),Ve(null),Wn(l)||W.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){W.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Dt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?rl(u):[],us=u&&d?al(u,d):[],Wt=g&&u&&d?uc(u,d):[],ds=(t,n)=>{if(Wt.length===0)return;const s=Ml(t);return{kinds:Wt,selected:s,campaignPrefill:dc(t),onPick:n,load:Gs}},mr=!q&&!!(at&&u&&d),pr=Y&&u?qn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(vc(n,t,u,g))try{await Nn.mutateAsync({blockKey:t})}catch(s){W.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Dt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],f=l[a],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:B,...z}=t;D.mutate({blockKey:h,data:Ft(B??"",z,E)},{onSuccess:()=>k?.(),onError:D.reportError});return}f&&(l[a]={...f,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Va(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},Mn=async(t,n,s)=>{const a=fc(n,t);if(!a.ok)return a.reason==="conflict"&&W.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ba),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Ls.apply({writes:o})).ok?null:(a.blockWrite&&W.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ba,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},yr=Wt.length>0?{kinds:Wt,load:Gs,prepare:async t=>(await Mn(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Fl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Il(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=await Mn(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],B=E[a];return B?(E[a]={...B,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!o)return;const{resolveType:i,formValue:l}=Ut(o.rule,o.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[a];if(!j)return;const h=Mt(j.rule,s,u),R=cn(t);f[a]={...j,rule:R};const E={...s,[n]:{...o,sections:{...l,variants:f}}},{resolveType:B,formValue:z}=Ut(R,E,u??void 0);ee(B),se(z);try{await D.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const J=z?.__resolveType??"",be=i[J],Ie=typeof be?.name=="string"?be.name:J,{__resolveType:he,...le}=t;D.mutate({blockKey:J,data:Ft(he??"",le,Ie)},{onSuccess:()=>k?.(),onError:D.reportError});return}const ne=Ss(E,s,t),U=[...a];U[n]=Bt(h,R,ne);const Ne=on(i,l,U,j,f);D.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g)))},Vo=t=>{qe(t);const n=t?Va(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},To=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Ao=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await Mn(t,i,B=>{const z=a[n],ne=o[n];if(!z||!ne?.isMultivariate)return null;const U=pt(z,ne);if(!U)return null;const Ne=[...a];return Ne[n]=Bt(z,ne,Ss(U,s,B)),{blockKey:l,data:on(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},No=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=Mt(B[s]?.rule,i,u),ne=cn(t),U=Ss(E,s,ne),Ne=[...a];Ne[n]=Bt(h,R,U);const J=on(i,l,Ne,j,f),be={...i,[l]:J},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await D.mutateAsync({blockKey:l,data:J}),z&&z!==t&&await qt(z,be),k?.()}catch(le){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(le))})}};if(!q&&!ae)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!ns)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?pe[m]??null:null,_r=m!==null?M[m]:null,kr=_r&&je?.isMultivariate?pt(_r,je):null,Vt=kr?Yr(kr,we,g):[],Fn=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Fn]??null,Tt=je?.isMultivariate===!0,fs=m!==null&&je!==null,At=fs&&(Tt||!!(Dn&&Xe)),Co=At&&!q&&je?.isSavedBlock===!0,ft=q||Co,wr=q?Us:je?.label??"",Po=Zt&&u?qn(Zt,u):null,Rr=(t,n)=>n&&X?`${t} · ${n}`:t,jr=je?je.variantOf??je.label:"",Bo=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[Rr(jr,t)]:[je.label,t]:[je?.label??""]})(),ms=Rr(ae?.name??"",yt?Se?.label:null),In=At&&(!q||K.length>0)?q?[Us,...K]:[ms,...Bo,...K]:[],Er=Re&&ae?[ae.name,"SEO",...Bs]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Yt&&ae?[ae.name,Vr]:Lt&&ae&&je?[ms,jr,Vr]:[],Ln=Tr.length>0?Tr:Er.length>0?Er:ft?In.length>0?In:[wr]:In.length>0?In:[ms],Ar=fs&&!Tt&&!je?.isHidden&&!!y,Ko=ft||!q&&yt&&!!Se||Ar,Do=fs&&!Tt&&!q&&K.length===0&&!!je&&Ba(je)&&!!y,Mo=X&&At&&!Lt&&Tt&&K.length===0&&!!kt,Nr=X&&K.length>0?ia(K[K.length-1]):null,Fo=K.length>1?ia(K[K.length-2]):null,Cr=ft?wr:At?je?.label??"":ae?.name??"",Io=Yt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?je?.variantOf??je?.label??"":Yt||Re?ae?.name??"":Nr?Fo??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?ae?.name??"":ae?.path??"",ps=!Yt&&!Lt&&!Re&&!At&&!ft,Lo=!X&&!Re&&!q&&Tt&&K.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=hc(t.sections,M,u,g);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{de(a),L(null),A(null),H(null),T([]),se(null),ee(null)},onError:D.reportError})},On=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const a=d[y],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=gc(i,l),j={...d,[y]:{...a,sections:f}};D.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:D.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),de(s);const a=Jn(me.map(o=>({rule:o.rule})),t,n);as(a,s),On(o=>Jn(o,t,n))},Kr=t=>{const n=me[t]?.rule,s=Mt(n,d??{},u??void 0);On(a=>a.length<=1?null:(a.splice(t,1),a),()=>{me.length-1===1?de(0):t<te?de(te-1):t===te&&de(Math.max(0,t-1)),L(null),A(null),H(null),T([]),se(null),ee(null)},s)},Oo=()=>{const t=me.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!ki(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);On(n=>{const s=Li({variants:n}),a=n[s];return a?[{...a,rule:Oi(u)}]:null},()=>{de(0),L(null),A(null),H(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;On(s=>(n=Xr(s,t,g),yc(s,t,g)),()=>{de(n),L(null),A(null),H(null),T([]),se(null),ee(null)})},zo=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,a=re.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,a,u)){F(null);return}const J=h.__resolveType??"";f[t]={...j,rule:Es(h,a,u)};const be={...a,[s]:{...o,sections:{...l,variants:f}}};await D.mutateAsync({blockKey:s,data:be[s]}),await qt(J,be),F(null),k?.();return}const E=Vs(h,a,u);if(!E){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await D.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),F(null),k?.();return}const B=Gn(R),z=Un(B,a,u);if(z){W.error(z);return}const ne=Ft(E.resolveType,E.data,R);let U=null,Ne=!1;try{const J=await D.mutateAsync({blockKey:B,data:ne,create:!0});Ne=Wn(J),U=Ne?null:B,f[t]={...j,rule:cn(B)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:f}}}),U=null}catch(J){throw U&&await Nn.mutateAsync({blockKey:U}).catch(()=>{}),J}F(null),Ne||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(E))})}finally{en(!1)}},$o=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=a[s],R=o[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=B[t];if(!z?.rule||typeof z.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,U=n.trim();en(!0);const Ne=async J=>{const be={...E,variants:J},Ie=[...a];Ie[s]=Bt(h,R,be);const he=on(i,l,Ie,j,f);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!U){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...B];Nt[t]={...z,rule:Es(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const J=Vs(ne,i,u);if(!J){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(J.blockKey){await D.mutateAsync({blockKey:J.blockKey,data:Ft(J.resolveType,J.data,U)}),O(null),k?.();return}const be=Gn(U),Ie=Un(be,i,u);if(Ie){W.error(Ie);return}const he=Ft(J.resolveType,J.data,U);let le=null,Ge=!1;try{const Ze=await D.mutateAsync({blockKey:be,data:he,create:!0});Ge=Wn(Ze),le=Ge?null:be;const Nt=[...B];Nt[t]={...z,rule:cn(be)},await Ne(Nt),le=null}catch(Ze){throw le&&await Nn.mutateAsync({blockKey:le}).catch(()=>{}),Ze}O(null),Ge||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),k?.()}catch(J){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(J))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Ho={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Mr(a,t,E),{...o,[a]:E}},h=Bc(f,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){W.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const B=[...i];B[n]={...l,rule:h.inlinedRule};const z=await j(B);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const B=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Wn(B),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(B){throw R&&await Nn.mutateAsync({blockKey:R}).catch(()=>{}),B}E||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,o,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...o,[a]:j};try{await Mr(a,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;let i=null;!await Mn(s,o,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:a,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Ht(),g&&$t(null,-1,0)},Ir=t=>{dn(t),cs({inner:t})},Lr=t=>{An(t),cs({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Qt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1),ge?.()},Wo=()=>{Vn(!1),Tn(!1),L(null),un(!0)},qo=()=>{Re&&$r(),L(null),Vn(!0)},Go=()=>Tn(!0),hs=t=>{if(Yt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(Re){if(t===0){$r();return}if(t===1){Ot([]),Qt(s=>s+1);return}Ot(Bs.slice(0,t-1)),Qt(s=>s+1);return}if(q){T(K.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(K.slice(0,t-1-n))},gs=Ln.length>1?r.jsx("button",{type:"button",onClick:()=>hs(gl(Ln.length,{isMultivariateSectionTop:Lo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ie("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(_l,{className:"size-4"})}):null,Uo=ft||At||Re?Ko&&r.jsxs("div",{className:ie("border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:ie("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",il),children:[r.jsx(ol,{rule:ks(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(Hn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Hn,{onClick:bn})]}),Jo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(ua,{className:"mt-3",children:r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Hr=r.jsxs(r.Fragment,{children:[r.jsx(ll,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Fn,onSelect:ur,onRename:O,onDuplicate:Ro,onDelete:wo,onRemoveAll:dr,onReorder:jo,onAdd:()=>Sn()}),r.jsx(ua,{children:r.jsx(xs,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:Vo,onSelectGlobal:No,named:ds(kt?.rule,Ao),namedRow:_s(kt?.rule,Wt),rule:kt?.rule,schema:Po,formValue:$a,onChange:To,formKey:`${m??"none"}:${Fn}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr=r.jsx("div",{className:ie(X?"px-2":"p-2 pt-3"),children:r.jsx(Cc,{listKey:`${y??""}-${te}`,rawSections:M,sections:pe,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ho(t),Je?.(t)},onReorder:go,onDelete:vo,onDuplicate:yo,onMakeReusable:Ve,onToggleHidden:So,onToggleLazy:rt?bo:void 0,onAddVariant:Sn,onDetach:xo,onAddSection:()=>We(!0),canAddSection:mr})}),Yo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&ae&&r.jsx(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr}),nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Qo=r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Zo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:ie("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Oa(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(yl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Sl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr]},"editor-section-list");return r.jsx(cl,{value:g,children:r.jsx(ul,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&gs&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:gs}),(X||Ln.length>1)&&r.jsx(dl,{crumbs:Ln,onSelect:hs,onSelectRoot:()=>{fn.flush(),Ue?Ue():hs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ie("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&gs,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Io}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),ps&&yt&&Se&&r.jsx(da,{variants:me,activeIndex:te,onSelect:is,onManage:qo,onRemoveAll:Oo}),Mo&&r.jsx(da,{variants:Vt,activeIndex:Fn,onSelect:ur,onManage:Go,onRemoveAll:dr}),ps&&!yt&&r.jsx(Hn,{onClick:bn}),Do&&r.jsx(Hn,{onClick:()=>Sn()}),r.jsx(fl,{}),ps&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Wo,children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Uo}),ut&&r.jsx(fi,{open:!0,fields:mi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Hs??null,authorPending:Hs===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>po({...ut.choices,[t]:n}),onApply:mo},Mc(ut.formBase)),Lt?r.jsx(fa,{onAdd:()=>Sn(),children:Hr},"editor-section-variants"):At?r.jsxs(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&K.length===0&&Hr,r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Ho:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):Re?X?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Yo})},"editor-seo"):Qo:Yt?r.jsx(fa,{onAdd:bn,children:Jo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Wr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ts,{canAddSection:mr,onAddSection:()=>We(!0)})})]},"editor-section-list"):Zo,r.jsx(ml,{open:oe!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:oe!==null?Gn(pe[oe]?.label??""):"",isPending:D.isPending,onSubmit:Eo}),at&&r.jsx(ac,{open:Ae,onOpenChange:t=>{We(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:ko}),ht&&y&&d&&r.jsx(zl,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(ha,{open:!0,initialName:Jt(me[Te]?.rule,d??{},u??void 0)?_n(me[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(me[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await zo(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(ha,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $o(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{uf as SectionsEditor};
|
|
1
|
+
import{i3 as Xo,bf as ei,c as wn,b as Rn,r as b,m as ie,j as r,bQ as ti,b8 as As,i4 as Ba,B as It,Y as an,au as ni,_ as si,be as ri,Z as ai,q as oi,hB as ii,i5 as li,i6 as ci,h as ui,bg as wt,i7 as Jr,i8 as ys,i9 as di,ia as pt,ib as Yr,ic as fi,bt as mi,id as pi,ie as Qr,ig as hi,t as W,bZ as Zr,ih as gi,ii as Bt,ij as vi,ik as yi,il as Si,bY as Xr,im as Ss,io as bi,ip as xi,iq as _i,bW as ki,bu as wi,ir as Ri,is as ji,bT as Ei,K as Vi,it as ea,fe as Ti,bm as $n,br as ta,iu as na,iv as Ai,iw as Ni,ix as Ci,iy as bs,iz as Pi,iA as Bi,iB as Ki,iC as sa,iD as Di,iE as Mi,bR as ra,iF as Fi,iG as Ii,iH as Li,bV as Oi}from"./index-Bgkjt4vy.js";import{u as zi}from"./chat-context-WEEHZlsn.js";import{a5 as $i,O as Qn,a6 as Hi,a7 as Wi,a8 as qi,a9 as Gi,aa as Ui,ab as Ji,ac as aa,ad as Yi,ae as Qi,A as Gn,y as Un,d as Zi,u as Xi,af as oa,i as el,ag as tl,k as nl,h as sl,ah as Ka,p as kn,ai as rl,aj as al,w as ia,ak as ol,al as il,am as Hn,an as la,ao as ca,ap as ua,aq as xs,ar as ll,F as cl,as as ul,z as dl,at as da,au as fl,av as fa,aw as ma,ax as pa,M as ml,ay as ha,a as pl,az as on,aA as hl,aB as gl,v as Wn,a4 as xn}from"./parse-sections-D-35SZIB.js";import{b as vl}from"./repository-binding-SOF1batH.js";import{n as yl,t as Sl}from"./ChevronUp-DPwvtZ7T.js";import{a7 as Da,b as Yn,am as bl,e as xl,E as _l,a1 as ga,Y as va}from"./agent-icon-BGTckvlP.js";import{S as ln}from"./scroll-area-jAJHvOhj.js";import{c as Rt,T as jt,a as Et}from"./tooltip-BP38juWI.js";import{l as kl,u as wl,m as Rl,U as jl,ai as El,S as Vl,F as ya,aX as Sa,as as Kt,at as Dt,a4 as Tl,aY as Al,aZ as Nl,aT as ba,a7 as Cl,ae as Pl}from"./site-editor-toast-CFZ3g20k.js";import{u as Bl,ao as xa,e as _a,j as Kl,D as Dl,A as qn,a3 as Ml,ae as Fl,ag as Il}from"./blocks-tab-states-Of3CFRB8.js";import{m as Ll,u as Ol,P as zl}from"./mustache-BYgEr74H.js";import{a as Rs,e as Ma}from"./UserSquare-Dfda7sxk.js";import{i as ka,s as wa}from"./Tool01-CAgFzAvv.js";import{s as $l}from"./Plus-BqBCvRtk.js";import{s as Hl}from"./Trash01-C7v1fWGY.js";import{i as js}from"./Zap-CmFvKOKc.js";import{u as Wl,a as Ra,K as ql,P as Gl,b as Ul,C as Jl,D as Yl,c as Ql}from"./core.esm-FUcIa7Fp.js";import{u as Zl,s as Xl,a as Jn,S as ec,v as tc}from"./sortable.esm-DwDHqu2Z.js";import{s as nc,g as sc,u as rc,A as ac}from"./use-section-preview-base-CWdiCrj1.js";import{u as oc,a as ic,P as ja,w as lc,b as cc}from"./seo-editor-CtzJbmZQ.js";import{R as uc,y as _s,T as Ea,x as dc,U as fc}from"./hosted-reconcile-BRk5mz3x.js";import{u as mc}from"./use-apply-named-rule-Cp8bLYtd.js";import{m as Jt,d as Es,y as Vs,n as Ft,e as cn,q as pc,k as Ut,r as ks,j as Mt,h as _n,b as hc,s as Va,z as gc,A as vc,B as yc}from"./section-array-field-DC06wjHY.js";import{b as Ta,a as Sc}from"./variant-matcher-override-DCs6FrU7.js";import"./autosend-DL4CutFR.js";import"./thread-route-B-6djUfH.js";import"./use-project-scope-CxaJ6AcP.js";import"./thread-intent-W-PQxNVd.js";import"./use-mcp-client-IMgoLgFY.js";import"./auth-BExDXNDY.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CjiXfMh2.js";import"./task-board-D_hXj2Vy.js";import"./schema-DJM5djBQ.js";import"./use-entitlements-BWZ6Su0L.js";import"./use-ai-providers-BIh1KBLl.js";import"./use-decopilot-events-Dd92yoAZ.js";import"./use-organization-settings-Ca4qUgyM.js";import"./utils-CnVlph4k.js";import"./Play-UerN5i51.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Ct1xgxut.js";import"./LinkBroken01-a5oI2X-K.js";import"./collapsible-B14xMZuR.js";import"./use-copy-DrB0tWuk.js";import"./usage-stats-C-iZo0BZ.js";import"./tool-namespace-Dwob85yl.js";import"./form-DXyLAoEr.js";import"./label-D25-0Wh6.js";import"./utils-CVEq3hMx.js";import"./markdown-12a9C6gs.js";import"./use-mobile-CW7DCn5M.js";import"./shell-layout-DJhfQde-.js";import"./Globe04-BNjS8hE_.js";import"./use-deployment-admin-DE1jKIDx.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-DaTfQwji.js";import"./CheckCircle-D2qom1Qe.js";import"./Monitor01-D0NO-K1o.js";import"./command-C37DfioB.js";import"./index-BFve9Wi8.js";import"./SearchMd-ip9BTueQ.js";import"./integration-icon-C7bRwcH_.js";import"./project-icon-CzcU3Mqg.js";import"./use-navigate-to-agent-DUsfLcvr.js";import"./use-debounced-value-CekhRquV.js";import"./new-project-dialog-DZScwreb.js";import"./ArrowLeft-2ggpgqb0.js";import"./repository-picker-DL7LhDyE.js";import"./github-icon-DTSso41S.js";import"./useInfiniteQuery-Sda1zjLQ.js";import"./infiniteQueryObserver-X5CcDr9j.js";import"./collection-search-Ck-1gfFY.js";import"./ShoppingBag01-Z5jujKnF.js";import"./required-auth-layout-Bbj3yijQ.js";import"./use-org-sso-BH_ZUFcu.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-D5couJ6l.js";import"./types-8U8D-Y9v.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-Cbs5Ab1P.js";import"./sheet-B-HfTX7L.js";import"./use-connection-BT_OOtuG.js";import"./use-mcp-prompts-Bk_g-v-0.js";import"./use-thread-outputs-Pm3V0nbB.js";import"./file-type-icon-CNDz0hBy.js";import"./switch-Bh4leDQ8.js";import"./textarea-DnFolSR6.js";import"./ChevronSelectorVertical-CSCxxcTv.js";import"./popover-CRX5tFOb.js";import"./monaco-editor-Cn1TEUmq.js";import"./editor-QJRHEQ16.js";import"./calendar-9d4oM3ql.js";import"./SwitchHorizontal01-xah_f_KH.js";import"./Minus-HfQUebB7.js";import"./select-lF0wcoip.js";import"./index-BdQq_4o_.js";import"./index-DP8sH5of.js";import"./editor-classes-B6F-sROj.js";import"./toggle-group-DErjWYXo.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-fgtxpSsO.js";import"./Upload01-7apXt8L7.js";import"./search-input-DVDThqIB.js";import"./tabs-CE50d848.js";import"./use-file-configs-DpxzYxst.js";import"./asset-utils-BO-AcYFX.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-voice-input-DwO5kNPT.js";import"./drawer-C8tQ9pS2.js";import"./index-D3t73ds8.js";import"./checkbox-KpsWsk0_.js";import"./Key01-Bb2fYsyQ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-cgUvwam2.js";import"./CreditCard01-BeIdgKm8.js";import"./Sun-BqxGPQ7c.js";import"./Users01-DGaGzIcz.js";import"./use-blocks-v8-project-iz2iNvo9.js";import"./use-sandbox-events-Bv6EHRzy.js";import"./empty-state-BCvL-1M3.js";import"./slider-DGqHqKd3.js";import"./index-cE8Cg_AR.js";import"./tooltipContext-BmU0TqD4.js";import"./CategoricalChart-B5fszPCD.js";import"./index-D08mzr4H.js";import"./use-move-blocks-DfaBs3sc.js";const bc={escape:$i};function xc(v,e){for(const p of nc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function _c(v,e){if(!e)return;const p=Xo(v,ei(e));if(p)try{const S=xc(p.resolveType,e);return S&&Ll.render(S,p.data,{},bc).trim()||void 0}catch{return}}function kc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=ie("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const wc="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,p)=>({id:crypto.randomUUID(),index:p}))}function Fa(v){return v.map((e,p)=>({...e,index:p}))}function Rc(v,e){if(e===v.length)return v;if(e<v.length)return Fa(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Ia(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=Rn(),_=Qn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?sc(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?_c(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=Ji(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&As(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Yn:k?Da:Ma;let G;e[16]!==k||e[17]!==P?(G=P?{color:ri}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Qi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(bl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Rs,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=ie("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(kc,{icon:js,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(aa,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(aa,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const jc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ec="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 La(v,e,p){if(p)return Yi({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return ie("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?jc:x?Ec:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(v,e){return ie("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 Vc(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=Rn(),c=Qn(),xe=S?As(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Ba(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Nc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Zl(Oe);let Pe;e[4]!==ze?(Pe=Jl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let ue;e[6]!==Pe||e[7]!==st?(ue={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=ue):ue=e[8];const g=ue;let we;e[9]!==p?(we=Wi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,at="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=ie("touch-none transition-colors",Xe,La(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Ye=r.jsx(Ia,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Ye):Ye=e[22];const H=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ie(ws(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Ac,children:r.jsx(js,{className:ie("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ot=c?r.jsx(qi,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ie(ws(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Tc,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),de=si,Qe=Gi;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=ie(ws(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let $e;e[25]!==Qe||e[26]!==ve||e[27]!==it?($e=r.jsx(Qe,{label:ve,classicClassName:it}),e[25]=Qe,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(js,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ni,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(xl,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(an,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let K;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(K=ke&&r.jsxs(an,{className:ie(!c&&Ui),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Da,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=K):K=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(an,{className:ie(!c&&wc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Yn,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let fe;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(fe=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Ma,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=fe):fe=e[58];let He;e[59]!==k?(He=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=He):He=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Hl,{className:"h-4 w-4"}),e[61]=et):et=e[61];let De;e[62]!==w?(De=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=De):De=e[63];let $;e[64]!==He||e[65]!==De?($=r.jsxs(an,{variant:"destructive",onClick:He,children:[et,De]}),e[64]=He,e[65]=De,e[66]=$):$=e[66];let oe;e[67]!==Be||e[68]!==ee||e[69]!==K||e[70]!==T||e[71]!==fe||e[72]!==$?(oe=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,K,T,fe,$]}),e[67]=Be,e[68]=ee,e[69]=K,e[70]=T,e[71]=fe,e[72]=$,e[73]=oe):oe=e[73];let Ve;e[74]!==de||e[75]!==$e||e[76]!==oe?(Ve=r.jsxs(de,{children:[$e,oe]}),e[74]=de,e[75]=$e,e[76]=oe,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Ye||e[85]!==H||e[86]!==ot||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:at,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Ye,H,ot,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Ye,e[85]=H,e[86]=ot,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Tc(v){return v.stopPropagation()}function Ac(v){return v.stopPropagation()}function Nc(){return!1}function Ts(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=Rn();let _;e[0]!==x?(_=ie("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx($l,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Cc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=Rn(),I=Qn();let ke;e[0]!==x.length?(ke=()=>Aa(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Aa(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Rc(tt,x.length)));let ue;e[2]===Symbol.for("react.memo_cache_sentinel")?(ue={activationConstraint:{distance:8}},e[2]=ue):ue=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Xl},e[3]=g):g=e[3];const we=Wl(Ra(Gl,ue),Ra(ql,g));let rt;e[4]!==d?(rt=d.map(Pc),e[4]=d,e[5]=rt):rt=e[5];const at=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==at||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const We=at.indexOf(String(O.id)),ht=at.indexOf(String(Ae.id));We===-1||ht===-1||(Oe(bt=>Fa(Jn([...bt],We,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(We,ht))},e[7]=at,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Ee(null)},e[10]=Ye):Ye=e[10];const H=Ye;let ot,de,Qe,ve,it,$e,Be,Ke,se,Y,ee,K,T,fe,He;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==at||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){fe=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Qe=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let We;e[61]!==Ae?(We=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=We):We=e[62];const ht=We;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],fe=bt;break e}T=ie(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Qe,e[57]=ve,e[58]=T}else Qe=e[56],ve=e[57],T=e[58];de=Yl,Ke=we,se=Ql,Y=L,ee=A,K=H,ot=ec,$e=at,Be=tc,He="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Vc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=at,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=ot,e[34]=de,e[35]=Qe,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=K,e[45]=T,e[46]=fe,e[47]=He}else ot=e[33],de=e[34],Qe=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],K=e[44],T=e[45],fe=e[46],He=e[47];if(fe!==Symbol.for("react.early_return_sentinel"))return fe;let et;e[68]!==it||e[69]!==He?(et=r.jsx("div",{className:He,children:it}),e[68]=it,e[69]=He,e[70]=et):et=e[70];let De;e[71]!==ot||e[72]!==$e||e[73]!==Be||e[74]!==et?(De=r.jsx(ot,{items:$e,strategy:Be,children:et}),e[71]=ot,e[72]=$e,e[73]=Be,e[74]=et,e[75]=De):De=e[75];let $;e[76]!==Qe||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:ie("cursor-grabbing shadow-lift",La(ve,!1,I)),children:r.jsx(Ia,{section:ve,raw:Qe,meta:V,decofile:C})}):null,e[76]=Qe,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let oe;e[82]!==$?(oe=ti.createPortal(r.jsx(Ul,{dropAnimation:Hi,children:$}),document.body),e[82]=$,e[83]=oe):oe=e[83];let Ve;e[84]!==de||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==K||e[90]!==De||e[91]!==oe?(Ve=r.jsxs(de,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:K,children:[De,oe]}),e[84]=de,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=K,e[90]=De,e[91]=oe,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Pc(v){return v.id}function Bc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Es(v,p,S)}:{kind:"noop"};const V=Vs(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Gn(x),_=Un(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Na="section-form-stale-save",Kc=3;function Ca(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ka(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Pa=new WeakMap;let Dc=0;function Mc(v){let e=Pa.get(v);return e===void 0&&(e=++Dc,Pa.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=zi(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=kl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Bl(_e),X=Qn(),ze=xe?.virtualMcpId,Pe=vl(ze===e?e:null)?.metadata?.siteSlug??null,st=rc({virtualMcpId:e,branch:p,sandboxUrl:x}),ue=wl(e,p),g=Rl(ue),we=Ei(g),rt=!g,at=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Ye,H]=b.useState(null),[ot,de]=b.useState(0),[Qe,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[K,T]=b.useState([]),fe=b.useRef(null),[He,et]=b.useState(K.length);He!==K.length&&(et(K.length),requestAnimationFrame(()=>{fe.current&&(fe.current.scrollTop=0)}));const[De,$]=b.useState(0),[oe,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,We]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,Oa]=b.useState(!0),[Yt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(Z),[Ns,Cs]=b.useState(Z);Z&&!Ns&&(Cs(!0),un(!0),L(null),A(null),H(null),T([])),!Z&&Ns&&Cs(!1);const[za,dn]=b.useState(null),[Ps,An]=b.useState(void 0),[Bs,Ot]=b.useState([]),[Ks,Qt]=b.useState(0),[Me,lt]=b.useState(0),[$a,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Ds,Ms]=b.useState(null),Fs=oi(),Is=jl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Zi({orgSlug:v,virtualMcpId:e,branch:p}),[Ha,Wa]=b.useState(V),[qa,Ga]=b.useState(C),[Ua,Ja]=b.useState(_);(Ha!==V||qa!==C||Ua!==_)&&(queueMicrotask(()=>fn.flush()),Wa(V),Ga(C),Ja(_),L(null),A(null),H(null),de(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1));const D=Xi({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Nn=Ol({orgSlug:v,virtualMcpId:e,branch:p}),Ls=mc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Cn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),Zn=b.useRef(new WeakSet);El(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,o]){const f=l==null?void 0:s[l],j=l==null?void 0:a[l],h=f&&j?.isSavedBlock?bs(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Cn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Ya,Qa]=b.useState(0),$s=ii(ue,{orgSlug:v,virtualMcpId:e,branch:p}),Hs=li($s,I[0]?.blockKey??null,ci(d,I[0]?.blockKey??null)),[Za,Xa]=b.useState(null),Xn=Vl(v,e).epoch,[eo,to]=b.useState(Xn);oc(Re?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Ws=_??(d&&u?xa(_a(d,u),V,C)?.key??null:null),es=ya({orgSlug:v,virtualMcpId:e,branch:p},Ws?[Ws]:[],{withRefs:!0}),[qs,no]=b.useState(!1),ts=ya({orgSlug:v,virtualMcpId:e,branch:p},qs?Kl:[]),Gs={ready:!(ue.kind==="protocol"&&ue.hosted)||qs&&ts.ready,failed:ts.failed,retry:ts.retry,request:()=>no(!0)};if(es.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:es.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!es.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ui,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const so=_a(d,u),q=!!_,ae=q?null:xa(so,V,C),y=q?_:ae?.key??null,ns=q&&_?d[_]:void 0,Us=q&&_&&ns?Dl(_,ns):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,ss=Re&&d&&u&&y&&ae?oa(d,{kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},u):null,ro=Re?nn?.seo:void 0,Pn=Ps!==void 0?Ps:ro,ao=Re?el(Pn):void 0,Js=ss?.seoTypeOptions??[],Ys=Re&&u?tl(u):"",rs=za??ao??{},Bn=Re&&ss?ic(rs,ss):null,Qs=Re&&Bn&&nl(Pn)?qn(Bn,u):null,Zs=Re?sl(d,u)?.seoData:void 0,me=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ka(nn?.sections,d??{},g),yt=me.length>1,te=Math.min(ot,me.length-1),Se=me[te],M=Se?.sections??[],pe=kn(M,d,g),Kn=!q&&pc(nn?.sections,g);if(q&&_&&Ds!==_){Ms(_);const t=M[0],n=pe[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),H(s.resolveType),qe(null),Fe(null))}}!q&&Ds!==null&&Ms(null),re.current={rawSections:M,parsedSections:pe,decofile:d??{},activePageKey:y,pageVariants:me,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const oo=()=>({multivariate:Kn,index:te,variants:me.map(t=>({rule:t.rule})),lazyValues:g&&Kn&&Ti(nn?.sections?.variants?.[te]?.value)}),as=(t,n)=>{if(!w)return;if(!y||!Kn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},a=g?Sa(y,s):Ta(y,s,d,u);w(a.length>0?a:null)},os=w&&y&&Kn&&yt&&!Oe&&!Ee?y:null;if(os!==Za&&(Xa(os),os)){const t=me.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>as(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const a=oo(),o=g?Sa(y,a):Ta(y,a,d,u);if(!t||n<0){w(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:pe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?Al(i):Sc({...i,decofile:d,meta:u}),f=g?Nl(o,l):[...o,...l];w(f.length>0?f:null)},xt=(t,n,s,a=m??-1,o=!1)=>{const i=pt(t,n);if(!i){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const f=Yr(i,we)[s];if(!f){A(null),H(null),qe(null),Fe(null),o&&$t(null,a,s);return}const j=pi(f.value,d);A(j?.data??null),H(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),o&&$t(i,a,s)},is=t=>{F(null),de(t),L(null),A(null),H(null),T([]);const n=me[t]?.rule,{resolveType:s,formValue:a}=Ut(n,d??{},u??void 0);ee(s),se(a),as(me.map(o=>({rule:o.rule})),t)},io=(t,n)=>{const s=M[t],a=pe[t];if(!s||!a)return!1;const o=a.isMultivariate?pt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),lt(i),T([]),$(l=>l+1),a.isMultivariate)xt(s,a,i,t);else{const l=wt(s,a,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Qe&&(ve(P?.seq??null),typeof Xs=="number"&&io(Xs,0)),Xn!==eo){to(Xn);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||D.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(fe.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=pe[m];if(T([]),$(o=>o+1),!s||!a)L(null),A(null),H(null);else if(a.isMultivariate)xt(s,a,Me,m);else{const o=wt(s,a,d,g);A(o?.data??null),H(o?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Qt(s=>s+1))}if(Os!==Ya){Qa(Os);const t=m!==null?M[m]:null,n=m!==null?pe[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),H(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Ca(d,n,g),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?ys(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,d,g):null,i=di(ut,o,l=>Qr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Dn=Ye&&u?qn(Ye,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(d,y,t,te,me);D.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},Ht=()=>{Ce?.(null),L(null),Tn(!1),A(null),H(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(fe.current,document.activeElement),ls=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,W.error(t,{id:Na}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=ue.kind==="protocol"&&ue.source==="github",rr=t=>Pl(Fs,Is,t,ue.kind==="protocol"?ue:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},lo=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=re.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Dn}},vn=t=>{ct.current=t,ke(t)},co=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:na(a.plan,a.choices,t.plan),fresh:Fi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||$n(a.plan.theirs)!==$n(t.plan.theirs)}):[...n,{...t,changedAgain:Zn.current.has(t.formBase)}];vn(o)},or=(t,n)=>{const s=ct.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if($n(o.plan.mine)===$n(n))return!0;const i=ta({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:na(o.plan,o.choices,i)})),!0},uo=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},fo=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!or(n,a)&&yn(a,n.sectionIndex,0,s),ct.current[0]??null},mo=()=>{const t=ct.current[0],n=fo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=wi(n.plan,n.choices);ue.kind==="protocol"&&ue.source==="github"&&Ri(n.plan,n.choices)&&Tl(c,!1),vn(ct.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,Zn.current.add(a),(zt.current===a||uo(n))&&(zt.current=a,A(s),$(i=>i+1)),yn(s,a.sectionIndex,0,o)},po=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??lo(n),l=i.sectionVariantIndex,f=i.formBase,j=o||ea(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const B=typeof t=="function"?t():t,z=ea(ct.current,f,i,n,g).base;if(z&&or(z,B))return;const ne=re.current.decofile,{rawSections:U,parsedSections:Ne,pageVariants:J,variantIndex:be}=Ca(ne,i,g),Ie=i.pageKey,he=U[n];if(!he)return;const le=Ne[n];if(!le)return;const Ge=f?.base,Ze=ys(he,le,l,ne,g),Nt=!!Ge&&!!Ze&&Ai(Ge,Ze)&&!(f&&Qr(f,Ze));if(Nt&&Ge&&Ze){if(Ni(Ge,Ze)){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Q=le.isSavedBlock?"here":Ci(Ge,U.map((ce,mt)=>ys(ce,Ne[mt],l,ne,g)),n,f?.sectionCount??U.length);if(Q==="unknown"){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Q=="number"&&f){f.sectionCount=U.length,f.sectionIndex=Q,zt.current===f&&L(Q),yn(B,Q,s,i);return}}const Ct=Nt&&Ge&&Ze?ta({ancestor:Ge,mine:B,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=U.length,co({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Pi(Ct),changedAgain:!1,blockKey:le.isSavedBlock?bs(he,le):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??B,qr=Bi({merged:!!Pt,tracked:f,current:zt.current,saved:B});Pt&&W.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Na}),qr&&f&&(f.emitted=Pt,A(Pt));const vs=qr||!Pt?rn:B;f&&(f.base=vs,f.sectionCount=U.length,Ki(f,vs));const Gr={onSuccess:()=>{f&&Zn.current.delete(f),k?.()},onError:Q=>{if(f?.base===vs&&Ge&&(f.base=Ge),Q instanceof Cl){if(f&&(f.version=void 0),s<Kc){ye.current.delete(R),hn.current=!0;const ce=Ii(s,Q.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:B},n,s+1,i,ce.immediate),ye.current.delete(R),ar(xn(g))},ce.delay)}else ls();return}D.reportError(Q)}},Ur=Q=>{pn.current=!0;let ce=!1;D.mutateAsync(Q).then(()=>Gr.onSuccess(),mt=>{ce=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,ar(ce?xn(g):0),tr()})};if(le.isSavedBlock){const Q=bs(he,le);if(!Q)return;Ur({blockKey:Q,data:rn,...Ge?{base:{value:Di({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:sa({formBase:f,rebased:!!Pt,versionOf:rr,...sr?{copy:{value:ne[Q]}}:{}})});return}if(!Ie)return;const zn={...ne[Ie]},Gt=[...U];if(le.isMultivariate){const Q=pt(he,le);if(!Q||!Ie)return;const ce=Mi(Q,l,rn);Gt[n]=Bt(he,le,ce)}else if(le.isHidden){const Q=As(he.__resolveType),ce=Q?{...he.section}:{...he},mt=Array.isArray(ce.variants)?[...ce.variants]:[];mt[0]&&(mt[0]=ra(ce.__resolveType,mt[0],rn)),ce.variants=mt,Q?Gt[n]={...he,section:ce}:Gt[n]=ce}else le.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(J.length>1){const Q=zn.sections,ce=[...Q?.variants??[]];ce[be]&&(ce[be]=ra(Q?.__resolveType,ce[be],Gt)),zn.sections={...Q,variants:ce}}else zn.sections=Gt;Ur({blockKey:Ie,data:zn,rebaseOnConflict:!1,guard:sa({formBase:null,rebased:!1,versionOf:rr,...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ho=t=>{tn.current=!1,L(t),lt(0),T([]),$(o=>o+1);const n=M[t],s=pe[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const a=wt(n,s,d,g);if(!a){A(null),H(null),qe(null),Fe(null),$t(null,t,0);return}A(a.data),H(a.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=ji(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},cs=t=>{if(!y||!d||!u||!ae)return;const n={kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},s=oa(d,n,u);s&&fn.save(y,()=>{const a=Fs.getQueryData(Vi.decofile(Is))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Cn.current};return Cn.current={},t?.raw!==void 0?lc(o,t.raw,u):t?.inner!==void 0?cc(n,s,o,t.inner):o})},lr=(t,n)=>{y&&(Cn.current[t]=n,cs())},go=(t,n)=>{if(!y)return;const s=Jn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},vo=t=>{if(!y)return;const n=M.filter((s,a)=>a!==t);m===t?Ht():m!==null&&m>t&&L(m-1),dt(n)},yo=t=>{if(!y)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},So=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s)return;const a=s.isHidden?xi(n,g):_i(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},bo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s||s.isMultivariate)return;const a=bi(n);if(!a)return;const o=[...M];o[t]=a,m===t&&Ht(),dt(o)},xo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s?.isSavedBlock)return;const a=wt(n,s,d,g);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Ht(),dt(l)},_o=t=>{if(!y)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;dt(n,{onError:()=>{re.current.selectedSectionIndex===s&&Ht()}}),We(!1),L(s),lt(0),T([]),$(l=>l+1);const a=n[s],o=kn(n,d,g)[s];if(!a||!o)return;if(o.isMultivariate){xt(a,o,0);return}const i=wt(a,o,d,g);if(!i){A(null),H(null),qe(null),Fe(null);return}A(i.data),H(i.resolveType),qe(null),Fe(null)},cr=t=>{jn.current=t.append,We(!0)},ko=t=>{const n=jn.current;if(!n){_o(t);return}n({__resolveType:t.resolveType}),We(!1),jn.current=null},ur=t=>{if(m===null)return;const n=M[m],s=pe[m];!n||!s?.isMultivariate||(lt(t),T([]),$(a=>a+1),xt(n,s,t,m,!0))},wo=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=yi(a,t);if(!o){W.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Bt(n,s,o);const l=o.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},Ro=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=Si(a,t,g),i=[...M];i[m]=Bt(n,s,o);const l=Xr(a.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},jo=(t,n)=>{if(m===null||!y||t===n)return;const s=M[m],a=pe[m];if(!s||!a?.isMultivariate)return;const o=pt(s,a);if(!o)return;const i=gi(o,t,n),l=[...M];l[m]=Bt(s,a,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],a,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=M[n],a=pe[n];if(!s||!a)return;const o=hi(s,a,void 0,u,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){W.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(o.newVariantIndex),T([]),$(f=>f+1),xt(o.section,l,o.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=M[m],n=pe[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const a=vi(t,n,s);if(!a){W.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=kn(o,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(a,i,d,g);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),$t(null,m,0),dt(o)},Eo=async t=>{if(oe===null||!y)return;const n=Un(t,d,u);if(n){W.error(n);return}const s=M[oe],a=pe[oe];if(!s||!a)return;const o=wt(s,a,d,g);if(!o){W.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),f=[...M];f[oe]={__resolveType:t},await D.mutateAsync({blockKey:y,data:on(d,y,f,te,me)}),m===oe&&Ht(),Ve(null),Wn(l)||W.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){W.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Dt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?rl(u):[],us=u&&d?al(u,d):[],Wt=g&&u&&d?uc(u,d):[],ds=(t,n)=>{if(Wt.length===0)return;const s=Ml(t);return{kinds:Wt,selected:s,campaignPrefill:dc(t),onPick:n,load:Gs}},mr=!q&&!!(at&&u&&d),pr=Y&&u?qn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(vc(n,t,u,g))try{await Nn.mutateAsync({blockKey:t})}catch(s){W.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Dt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],f=l[a],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:B,...z}=t;D.mutate({blockKey:h,data:Ft(B??"",z,E)},{onSuccess:()=>k?.(),onError:D.reportError});return}f&&(l[a]={...f,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Va(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},Mn=async(t,n,s)=>{const a=fc(n,t);if(!a.ok)return a.reason==="conflict"&&W.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ba),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Ls.apply({writes:o})).ok?null:(a.blockWrite&&W.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ba,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},yr=Wt.length>0?{kinds:Wt,load:Gs,prepare:async t=>(await Mn(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Fl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Il(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=await Mn(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],B=E[a];return B?(E[a]={...B,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!o)return;const{resolveType:i,formValue:l}=Ut(o.rule,o.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[a];if(!j)return;const h=Mt(j.rule,s,u),R=cn(t);f[a]={...j,rule:R};const E={...s,[n]:{...o,sections:{...l,variants:f}}},{resolveType:B,formValue:z}=Ut(R,E,u??void 0);ee(B),se(z);try{await D.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const J=z?.__resolveType??"",be=i[J],Ie=typeof be?.name=="string"?be.name:J,{__resolveType:he,...le}=t;D.mutate({blockKey:J,data:Ft(he??"",le,Ie)},{onSuccess:()=>k?.(),onError:D.reportError});return}const ne=Ss(E,s,t),U=[...a];U[n]=Bt(h,R,ne);const Ne=on(i,l,U,j,f);D.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g)))},Vo=t=>{qe(t);const n=t?Va(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},To=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Ao=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await Mn(t,i,B=>{const z=a[n],ne=o[n];if(!z||!ne?.isMultivariate)return null;const U=pt(z,ne);if(!U)return null;const Ne=[...a];return Ne[n]=Bt(z,ne,Ss(U,s,B)),{blockKey:l,data:on(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},No=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=Mt(B[s]?.rule,i,u),ne=cn(t),U=Ss(E,s,ne),Ne=[...a];Ne[n]=Bt(h,R,U);const J=on(i,l,Ne,j,f),be={...i,[l]:J},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await D.mutateAsync({blockKey:l,data:J}),z&&z!==t&&await qt(z,be),k?.()}catch(le){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(le))})}};if(!q&&!ae)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!ns)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?pe[m]??null:null,_r=m!==null?M[m]:null,kr=_r&&je?.isMultivariate?pt(_r,je):null,Vt=kr?Yr(kr,we,g):[],Fn=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Fn]??null,Tt=je?.isMultivariate===!0,fs=m!==null&&je!==null,At=fs&&(Tt||!!(Dn&&Xe)),Co=At&&!q&&je?.isSavedBlock===!0,ft=q||Co,wr=q?Us:je?.label??"",Po=Zt&&u?qn(Zt,u):null,Rr=(t,n)=>n&&X?`${t} · ${n}`:t,jr=je?je.variantOf??je.label:"",Bo=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[Rr(jr,t)]:[je.label,t]:[je?.label??""]})(),ms=Rr(ae?.name??"",yt?Se?.label:null),In=At&&(!q||K.length>0)?q?[Us,...K]:[ms,...Bo,...K]:[],Er=Re&&ae?[ae.name,"SEO",...Bs]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Yt&&ae?[ae.name,Vr]:Lt&&ae&&je?[ms,jr,Vr]:[],Ln=Tr.length>0?Tr:Er.length>0?Er:ft?In.length>0?In:[wr]:In.length>0?In:[ms],Ar=fs&&!Tt&&!je?.isHidden&&!!y,Ko=ft||!q&&yt&&!!Se||Ar,Do=fs&&!Tt&&!q&&K.length===0&&!!je&&Ba(je)&&!!y,Mo=X&&At&&!Lt&&Tt&&K.length===0&&!!kt,Nr=X&&K.length>0?ia(K[K.length-1]):null,Fo=K.length>1?ia(K[K.length-2]):null,Cr=ft?wr:At?je?.label??"":ae?.name??"",Io=Yt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?je?.variantOf??je?.label??"":Yt||Re?ae?.name??"":Nr?Fo??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?ae?.name??"":ae?.path??"",ps=!Yt&&!Lt&&!Re&&!At&&!ft,Lo=!X&&!Re&&!q&&Tt&&K.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=hc(t.sections,M,u,g);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{de(a),L(null),A(null),H(null),T([]),se(null),ee(null)},onError:D.reportError})},On=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const a=d[y],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=gc(i,l),j={...d,[y]:{...a,sections:f}};D.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:D.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),de(s);const a=Jn(me.map(o=>({rule:o.rule})),t,n);as(a,s),On(o=>Jn(o,t,n))},Kr=t=>{const n=me[t]?.rule,s=Mt(n,d??{},u??void 0);On(a=>a.length<=1?null:(a.splice(t,1),a),()=>{me.length-1===1?de(0):t<te?de(te-1):t===te&&de(Math.max(0,t-1)),L(null),A(null),H(null),T([]),se(null),ee(null)},s)},Oo=()=>{const t=me.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!ki(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);On(n=>{const s=Li({variants:n}),a=n[s];return a?[{...a,rule:Oi(u)}]:null},()=>{de(0),L(null),A(null),H(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;On(s=>(n=Xr(s,t,g),yc(s,t,g)),()=>{de(n),L(null),A(null),H(null),T([]),se(null),ee(null)})},zo=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,a=re.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,a,u)){F(null);return}const J=h.__resolveType??"";f[t]={...j,rule:Es(h,a,u)};const be={...a,[s]:{...o,sections:{...l,variants:f}}};await D.mutateAsync({blockKey:s,data:be[s]}),await qt(J,be),F(null),k?.();return}const E=Vs(h,a,u);if(!E){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await D.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),F(null),k?.();return}const B=Gn(R),z=Un(B,a,u);if(z){W.error(z);return}const ne=Ft(E.resolveType,E.data,R);let U=null,Ne=!1;try{const J=await D.mutateAsync({blockKey:B,data:ne,create:!0});Ne=Wn(J),U=Ne?null:B,f[t]={...j,rule:cn(B)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:f}}}),U=null}catch(J){throw U&&await Nn.mutateAsync({blockKey:U}).catch(()=>{}),J}F(null),Ne||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(E))})}finally{en(!1)}},$o=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=a[s],R=o[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=B[t];if(!z?.rule||typeof z.rule!="object"){W.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,U=n.trim();en(!0);const Ne=async J=>{const be={...E,variants:J},Ie=[...a];Ie[s]=Bt(h,R,be);const he=on(i,l,Ie,j,f);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!U){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...B];Nt[t]={...z,rule:Es(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const J=Vs(ne,i,u);if(!J){W.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(J.blockKey){await D.mutateAsync({blockKey:J.blockKey,data:Ft(J.resolveType,J.data,U)}),O(null),k?.();return}const be=Gn(U),Ie=Un(be,i,u);if(Ie){W.error(Ie);return}const he=Ft(J.resolveType,J.data,U);let le=null,Ge=!1;try{const Ze=await D.mutateAsync({blockKey:be,data:he,create:!0});Ge=Wn(Ze),le=Ge?null:be;const Nt=[...B];Nt[t]={...z,rule:cn(be)},await Ne(Nt),le=null}catch(Ze){throw le&&await Nn.mutateAsync({blockKey:le}).catch(()=>{}),Ze}O(null),Ge||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),k?.()}catch(J){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(J))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Ho={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Mr(a,t,E),{...o,[a]:E}},h=Bc(f,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){W.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const B=[...i];B[n]={...l,rule:h.inlinedRule};const z=await j(B);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const B=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Wn(B),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(B){throw R&&await Nn.mutateAsync({blockKey:R}).catch(()=>{}),B}E||W.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,o,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...o,[a]:j};try{await Mr(a,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){W.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;let i=null;!await Mn(s,o,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:a,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Ht(),g&&$t(null,-1,0)},Ir=t=>{dn(t),cs({inner:t})},Lr=t=>{An(t),cs({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Qt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1),ge?.()},Wo=()=>{Vn(!1),Tn(!1),L(null),un(!0)},qo=()=>{Re&&$r(),L(null),Vn(!0)},Go=()=>Tn(!0),hs=t=>{if(Yt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(Re){if(t===0){$r();return}if(t===1){Ot([]),Qt(s=>s+1);return}Ot(Bs.slice(0,t-1)),Qt(s=>s+1);return}if(q){T(K.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(K.slice(0,t-1-n))},gs=Ln.length>1?r.jsx("button",{type:"button",onClick:()=>hs(gl(Ln.length,{isMultivariateSectionTop:Lo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ie("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(_l,{className:"size-4"})}):null,Uo=ft||At||Re?Ko&&r.jsxs("div",{className:ie("border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:ie("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",il),children:[r.jsx(ol,{rule:ks(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(Hn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Hn,{onClick:bn})]}),Jo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(ua,{className:"mt-3",children:r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Hr=r.jsxs(r.Fragment,{children:[r.jsx(ll,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Fn,onSelect:ur,onRename:O,onDuplicate:Ro,onDelete:wo,onRemoveAll:dr,onReorder:jo,onAdd:()=>Sn()}),r.jsx(ua,{children:r.jsx(xs,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:Vo,onSelectGlobal:No,named:ds(kt?.rule,Ao),namedRow:_s(kt?.rule,Wt),rule:kt?.rule,schema:Po,formValue:$a,onChange:To,formKey:`${m??"none"}:${Fn}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr=r.jsx("div",{className:ie(X?"px-2":"p-2 pt-3"),children:r.jsx(Cc,{listKey:`${y??""}-${te}`,rawSections:M,sections:pe,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ho(t),Je?.(t)},onReorder:go,onDelete:vo,onDuplicate:yo,onMakeReusable:Ve,onToggleHidden:So,onToggleLazy:rt?bo:void 0,onAddVariant:Sn,onDetach:xo,onAddSection:()=>We(!0),canAddSection:mr})}),Yo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&ae&&r.jsx(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr}),nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Qo=r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Zo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:ie("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Oa(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(yl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Sl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Wt),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Wr]},"editor-section-list");return r.jsx(cl,{value:g,children:r.jsx(ul,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&gs&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:gs}),(X||Ln.length>1)&&r.jsx(dl,{crumbs:Ln,onSelect:hs,onSelectRoot:()=>{fn.flush(),Ue?Ue():hs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ie("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&gs,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Io}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),ps&&yt&&Se&&r.jsx(da,{variants:me,activeIndex:te,onSelect:is,onManage:qo,onRemoveAll:Oo}),Mo&&r.jsx(da,{variants:Vt,activeIndex:Fn,onSelect:ur,onManage:Go,onRemoveAll:dr}),ps&&!yt&&r.jsx(Hn,{onClick:bn}),Do&&r.jsx(Hn,{onClick:()=>Sn()}),r.jsx(fl,{}),ps&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Wo,children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Uo}),ut&&r.jsx(fi,{open:!0,fields:mi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Hs??null,authorPending:Hs===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>po({...ut.choices,[t]:n}),onApply:mo},Mc(ut.formBase)),Lt?r.jsx(fa,{onAdd:()=>Sn(),children:Hr},"editor-section-variants"):At?r.jsxs(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&K.length===0&&Hr,r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Ho:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):Re?X?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Yo})},"editor-seo"):Qo:Yt?r.jsx(fa,{onAdd:bn,children:Jo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Wr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ts,{canAddSection:mr,onAddSection:()=>We(!0)})})]},"editor-section-list"):Zo,r.jsx(ml,{open:oe!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:oe!==null?Gn(pe[oe]?.label??""):"",isPending:D.isPending,onSubmit:Eo}),at&&r.jsx(ac,{open:Ae,onOpenChange:t=>{We(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:ko}),ht&&y&&d&&r.jsx(zl,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(ha,{open:!0,initialName:Jt(me[Te]?.rule,d??{},u??void 0)?_n(me[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(me[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await zo(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(ha,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $o(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{uf as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,cv as rt,cw as _e,j as c,cx as st,cy as be,cz as k,cA as lt,cB as j,cC as N,cD as $,cE as at,bQ as Ee,cF as Re,cG as it,cH as ct,cI as dt,cJ as ut,cK as pt,cL as ft,cM as mt,cN as ht,cO as vt,cP as gt,cQ as xt,cR as St,c as ee,m as oe,bx as wt}from"./index-BpRy7AHp.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-lbygo01z.js";import{t as je,n as yt}from"./ChevronUp-aVrgoYI4.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,Tt]=it(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[_t,G]=ne(Q),[Nt,Pt]=ne(Q),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:Q}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&It.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(J,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of h)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=I=>{h={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{h.x<=10&&h.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=nt(T,h,R);I&&setTimeout(()=>I.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&(U(h),I&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(h.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const b=h.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(J,t),s=Y(J,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=be(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(bt.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Qe=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Qe.displayName=ye;var Je=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var Ie="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(Ie,t),s=Y(Ie,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Ue,Jt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Qe;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Qt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Jt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
1
|
+
import{r as d,cv as rt,cw as _e,j as c,cx as st,cy as be,cz as k,cA as lt,cB as j,cC as N,cD as $,cE as at,bQ as Ee,cF as Re,cG as it,cH as ct,cI as dt,cJ as ut,cK as pt,cL as ft,cM as mt,cN as ht,cO as vt,cP as gt,cQ as xt,cR as St,c as ee,m as oe,bx as wt}from"./index-Bgkjt4vy.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-DP8sH5of.js";import{t as je,n as yt}from"./ChevronUp-DPwvtZ7T.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,Tt]=it(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[_t,G]=ne(Q),[Nt,Pt]=ne(Q),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:Q}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&It.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(J,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of h)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=I=>{h={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{h.x<=10&&h.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=nt(T,h,R);I&&setTimeout(()=>I.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&(U(h),I&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(h.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const b=h.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(J,t),s=Y(J,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=be(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(bt.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Qe=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Qe.displayName=ye;var Je=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var Ie="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(Ie,t),s=Y(Ie,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Ue,Jt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Qe;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Qt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Jt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as A,r as R,m as G,j as s,B as H,s as J,x as K,v as Q,D as U}from"./index-
|
|
1
|
+
import{c as $,b as A,r as R,m as G,j as s,B as H,s as J,x as K,v as Q,D as U}from"./index-Bgkjt4vy.js";import{c as V,b as W,a as X,D as Y}from"./drawer-C8tQ9pS2.js";import{u as Z}from"./use-mobile-CW7DCn5M.js";import{d as ee}from"./chat-context-WEEHZlsn.js";import{S as F,a as se,M as le,c as te}from"./index-D3t73ds8.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==b||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:b,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=s.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=s.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{me as M};
|