decocms 4.562.1 → 4.562.2
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-Cwj2JDLb.js → AlertCircle-BPGyk76P.js} +1 -1
- package/dist/client/assets/{AreaChart-M71cxP0N.js → AreaChart-Dwi8bZZ1.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D6im8CSl.js → ArrowLeft-DRdw9Nza.js} +1 -1
- package/dist/client/assets/{ArrowUp-zoWFBt83.js → ArrowUp-BJTv4ddc.js} +1 -1
- package/dist/client/assets/{CartesianChart-CkRq1ukN.js → CartesianChart-DHyrpR7F.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CJyVrm-b.js → CategoricalChart-CVu6TY4_.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dycaqr3_.js → CheckCircle-y3P873c6.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Cq__IjWt.js → ChevronSelectorVertical-TIONA5Zl.js} +1 -1
- package/dist/client/assets/{ChevronUp-B0uKxpVg.js → ChevronUp-CDe5Gfov.js} +1 -1
- package/dist/client/assets/{CreditCard01-CMHPxKus.js → CreditCard01-abk_vBBR.js} +1 -1
- package/dist/client/assets/{Globe04-BLpPYUUd.js → Globe04-Dr1jk8eS.js} +1 -1
- package/dist/client/assets/{Key01-KS2Cdqso.js → Key01-DzZgIVqE.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CFo-1erV.js → LinkBroken01-4j6Z2AOF.js} +1 -1
- package/dist/client/assets/{Minus-CR14C6Ew.js → Minus-B2u_zm0f.js} +1 -1
- package/dist/client/assets/{Monitor01-PjSuNm4O.js → Monitor01-DWylBoOJ.js} +1 -1
- package/dist/client/assets/{Play-DAD0wkps.js → Play-CV8_Sy8a.js} +1 -1
- package/dist/client/assets/{Plus-Caq968Zm.js → Plus-BtfY7EHX.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DEAQfOjW.js → ReferenceLine-DN9gAkkU.js} +1 -1
- package/dist/client/assets/{SearchMd-BionSqTl.js → SearchMd-DD6kw-fs.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DUpALglE.js → ShoppingBag01-CY137tVP.js} +1 -1
- package/dist/client/assets/{Sun-x19ShBxe.js → Sun-CyYLfv8E.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dghq_Bvd.js → SwitchHorizontal01-C3qdjyVX.js} +1 -1
- package/dist/client/assets/{Tool01-GdBdG6P_.js → Tool01-CyX9Nllj.js} +1 -1
- package/dist/client/assets/{Tooltip-CDDThlKy.js → Tooltip-DVBICxdG.js} +1 -1
- package/dist/client/assets/{Trash01-DhMVlpac.js → Trash01-DSJ1LUhI.js} +1 -1
- package/dist/client/assets/{Upload01-hsehoAUh.js → Upload01-DC0joCKG.js} +1 -1
- package/dist/client/assets/{UserSquare-T5uOviXx.js → UserSquare-DmeGszKa.js} +1 -1
- package/dist/client/assets/{Users01-DDaeVlhF.js → Users01-B-OacssU.js} +1 -1
- package/dist/client/assets/{XClose-NmocES7U.js → XClose-avSrIpAi.js} +1 -1
- package/dist/client/assets/{Zap-aTbgq59l.js → Zap--C2rij07.js} +1 -1
- package/dist/client/assets/{access-gate-CpAtBb_h.js → access-gate-Bd3vMxaX.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BFqv_pWT.js → add-connection-dialog-uIVnUFji.js} +1 -1
- package/dist/client/assets/agent-app-BkJxaBM5.js +1 -0
- package/dist/client/assets/{agent-assets-kQe7VufN.js → agent-assets-CWN2kTtA.js} +1 -1
- package/dist/client/assets/{agent-automation-7-KjK-1c.js → agent-automation-BgD0bRSV.js} +1 -1
- package/dist/client/assets/{agent-automations-DnNwxwTt.js → agent-automations-DfordlM0.js} +1 -1
- package/dist/client/assets/{agent-calendar-CbAiDaBT.js → agent-calendar-z2j3yA6d.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DKq2l6j_.js → agent-capabilities-4Kae1N0E.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-SuTyB8Qe.js → agent-connect-sources-C33PwxBc.js} +1 -1
- package/dist/client/assets/agent-deck-Lf3f7IO8.js +1 -0
- package/dist/client/assets/{agent-e2e-C9FJgu1a.js → agent-e2e-C44IfVz9.js} +1 -1
- package/dist/client/assets/{agent-file-D5ZobkO7.js → agent-file-D8S6ohDB.js} +1 -1
- package/dist/client/assets/{agent-hosting-Df5G-pNf.js → agent-hosting-D6CnE5uR.js} +1 -1
- package/dist/client/assets/{agent-icon-DD6O0sln.js → agent-icon-Nkid6y9z.js} +1 -1
- package/dist/client/assets/agent-library-Co5WQMIF.js +1 -0
- package/dist/client/assets/agent-library-file-BPJi6RfX.js +1 -0
- package/dist/client/assets/agent-overview-D73rnnSU.js +1 -0
- package/dist/client/assets/{agent-releases-6IDVzk1I.js → agent-releases-WO1DzowK.js} +1 -1
- package/dist/client/assets/agent-settings-DK2xDr1_.js +1 -0
- package/dist/client/assets/{agent-site-editor-YGSo4JHf.js → agent-site-editor-CVSVIfgT.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-21UDx-VP.js +2 -0
- package/dist/client/assets/agent-site-editor-content-ycS9Pz-a.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CM8uT3ZM.js +1 -0
- package/dist/client/assets/agent-view-CnIONLQC.js +1 -0
- package/dist/client/assets/{agent-view-guard-Ud9RVhUT.js → agent-view-guard-BkTiwrL7.js} +1 -1
- package/dist/client/assets/{ai-providers-CdWvTe6E.js → ai-providers-C77po6hX.js} +1 -1
- package/dist/client/assets/{alert-rSlkmSpl.js → alert-8ZKgnOi9.js} +1 -1
- package/dist/client/assets/{analytics-sections-CdJGMHGj.js → analytics-sections-D2pjEazH.js} +1 -1
- package/dist/client/assets/api-keys-CJdXbN4c.js +1 -0
- package/dist/client/assets/{api-keys-CgV7T2W3.js → api-keys-CalFVYGL.js} +1 -1
- package/dist/client/assets/{app-editor-DQrUb2qq.js → app-editor--cZ0paPb.js} +1 -1
- package/dist/client/assets/{asset-utils-DJaTbmOK.js → asset-utils-CwwYcMA6.js} +1 -1
- package/dist/client/assets/{auth-catchall-BzI646tE.js → auth-catchall--6gbNuLd.js} +1 -1
- package/dist/client/assets/{auth-entry-BA2dv7O1.js → auth-entry-CsdiTapN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-3t1_TKos.js → auth-split-layout-BqtGBv-Q.js} +1 -1
- package/dist/client/assets/{auth-Dfx2bf9S.js → auth-xvjttF9D.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-EuyAX3Gy.js → authenticate-and-persist-oauth-DdntocF2.js} +1 -1
- package/dist/client/assets/{automation-list-row-BK5XD6ZY.js → automation-list-row-DtkMgEsK.js} +1 -1
- package/dist/client/assets/{automation-runs-BekfbsHI.js → automation-runs-DxsRwY7z.js} +1 -1
- package/dist/client/assets/{automations-ocOVuWpR.js → automations-DXGl5rDB.js} +1 -1
- package/dist/client/assets/{autosend-BLYIlkXq.js → autosend-DbfDzqlB.js} +1 -1
- package/dist/client/assets/{badge-9UZ-oy57.js → badge-BLk85LCv.js} +1 -1
- package/dist/client/assets/{block-document-B5Xpou_B.js → block-document-CSsqtozZ.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CGoI0EUn.js → blocks-preview-workspace-context-C59bKt9w.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CNkB95lx.js → blocks-tab-states-DP3rjaHt.js} +1 -1
- package/dist/client/assets/{blog-schema-DMB79fe6.js → blog-schema-B65cUy5G.js} +1 -1
- package/dist/client/assets/{buckets-C5e8GKB5.js → buckets-CNCQh0A_.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-aExDV9Mz.js → build-improve-prompt-doc-DUmEW7kR.js} +1 -1
- package/dist/client/assets/{calendar-CKcdkgh5.js → calendar-CDcnOKeY.js} +1 -1
- package/dist/client/assets/{capability-load-error-D8AT7eAw.js → capability-load-error-BZMPli2s.js} +1 -1
- package/dist/client/assets/{category-editor-DDFXYf_d.js → category-editor-BFW4v6Zt.js} +1 -1
- package/dist/client/assets/{chart-Ch4wXn1G.js → chart-W6WUctG8.js} +1 -1
- package/dist/client/assets/{chat-context-tsaqCp6v.js → chat-context-yHOaM07v.js} +1 -1
- package/dist/client/assets/{chat-draft-DeOYn8wH.js → chat-draft-BKLG-IxC.js} +1 -1
- package/dist/client/assets/{checkbox-bO8ZnM7n.js → checkbox-Dv6iFznu.js} +1 -1
- package/dist/client/assets/{choose-editor-B-1DX2pl.js → choose-editor-BbaXuEWm.js} +1 -1
- package/dist/client/assets/{cli-auth-success-WUcj8Laj.js → cli-auth-success-CINmtrn-.js} +1 -1
- package/dist/client/assets/{client-icons-CJKwmsS5.js → client-icons-CRCSqe4B.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-CL1HXF3j.js → cms-settings-editor-BKSzHFaJ.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-C_ZG08jQ.js → cms-store-drafts-BRph2qKQ.js} +1 -1
- package/dist/client/assets/{collapsible-CehJ-xlR.js → collapsible-WPiOb2df.js} +1 -1
- package/dist/client/assets/{collection-detail-w7NYTWNb.js → collection-detail-DeLh0iGu.js} +1 -1
- package/dist/client/assets/{collection-display-button-CVOVdzmi.js → collection-display-button-X03nm1ka.js} +1 -1
- package/dist/client/assets/{collection-search-Lm88VC-w.js → collection-search-CPadQqKp.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-LUTykEyP.js → collection-table-wrapper-DbE8PRZm.js} +1 -1
- package/dist/client/assets/{collection-tabs-BW9NTpao.js → collection-tabs-B05-I-04.js} +1 -1
- package/dist/client/assets/{combobox-C8IS_aP5.js → combobox-AFeNX90_.js} +1 -1
- package/dist/client/assets/{command-B42vqDSm.js → command-CSFENWMV.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-gN7svOR8.js → companion-mcps-section-DByl9EP4.js} +1 -1
- package/dist/client/assets/{config--cZAprAj.js → config-BuNaSsQb.js} +1 -1
- package/dist/client/assets/{connect-BAZtz6qy.js → connect-B5ODvCMk.js} +1 -1
- package/dist/client/assets/{connect-layout-FGHNVpHc.js → connect-layout-CrQKfs54.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BlacChCY.js → connect-source-dialog-dT9CEaaL.js} +1 -1
- package/dist/client/assets/{connection-Brtus8mh.js → connection-9Wtillpb.js} +1 -1
- package/dist/client/assets/{connection-card-CSkWTxJN.js → connection-card-B7mEOoWU.js} +1 -1
- package/dist/client/assets/{connection-detail-Dz92Js40.js → connection-detail-CVkLDsqd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CQaJSXmJ.js → connection-form-helpers-ZOfZ5xVa.js} +1 -1
- package/dist/client/assets/{connection-slug-DREkgXeA.js → connection-slug-BCjSI_lE.js} +1 -1
- package/dist/client/assets/{connections-BZUJ_roU.js → connections-B2Pjgwb4.js} +1 -1
- package/dist/client/assets/{content-tab-Bc_Tg1a4.js → content-tab-D6POg5eV.js} +3 -3
- package/dist/client/assets/{context-2NK4t-Lg.js → context-D9Jnu7vN.js} +1 -1
- package/dist/client/assets/{context-menu-D-JkcRvL.js → context-menu-Cgl4PGwR.js} +1 -1
- package/dist/client/assets/{context-shell-Bwve3xDx.js → context-shell-xJwj29nG.js} +3 -3
- package/dist/client/assets/{core.esm-ByTukYOF.js → core.esm-C3kzKmQL.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BIe1f-Sz.js → create-organization-dialog-C6jgiT68.js} +1 -1
- package/dist/client/assets/{device-hint-Djy4F7LR.js → device-hint-B0gKGTHi.js} +1 -1
- package/dist/client/assets/{discover-D050EtE3.js → discover-hzv5-quf.js} +1 -1
- package/dist/client/assets/{domain-settings-DPbJEdjs.js → domain-settings-CUR5XLBa.js} +1 -1
- package/dist/client/assets/{drawer-Dijofbhl.js → drawer-1kqkgpFK.js} +1 -1
- package/dist/client/assets/{editor-BODVgWYK.js → editor-CrG4V3zO.js} +1 -1
- package/dist/client/assets/{editor-classes-BdpfcKyR.js → editor-classes-LBX4QjrW.js} +1 -1
- package/dist/client/assets/{empty-state-CwfRxt_B.js → empty-state-CVOGmYU9.js} +1 -1
- package/dist/client/assets/{empty-state-Drt9QRbX.js → empty-state-CbRq3C3n.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Pe-Tip3g.js → extract-connection-data-C6MDLhDM.js} +1 -1
- package/dist/client/assets/{feature-gate-2Z3FyCIy.js → feature-gate-Uh4gtHbP.js} +1 -1
- package/dist/client/assets/{feature-paywall-CpM-erQe.js → feature-paywall-BVXAF3Vl.js} +1 -1
- package/dist/client/assets/{feedback-DcWPFhR_.js → feedback-Bx6uae5t.js} +1 -1
- package/dist/client/assets/{file-explorer-xWdf34ip.js → file-explorer-B33pnQXI.js} +1 -1
- package/dist/client/assets/{file-preview-Ca_4k6rv.js → file-preview-DifPTXD4.js} +1 -1
- package/dist/client/assets/{file-share-button-DgOCZ5mM.js → file-share-button-OD6j_Xmo.js} +1 -1
- package/dist/client/assets/{file-type-icon-DiS0iV28.js → file-type-icon-jLU7FJUL.js} +1 -1
- package/dist/client/assets/{folder-icon-swAD3bQU.js → folder-icon-Bk-fEOJa.js} +1 -1
- package/dist/client/assets/{form-CRja9i9j.js → form-DE5X7SPR.js} +1 -1
- package/dist/client/assets/{general-C7SfdAAF.js → general-DxPCrqDE.js} +1 -1
- package/dist/client/assets/{github-icon-tpEVyIwD.js → github-icon-Bvc_Uep-.js} +1 -1
- package/dist/client/assets/{home-overview-CMI03yPH.js → home-overview-3LLMJPVW.js} +1 -1
- package/dist/client/assets/{home-DsrjQvGT.js → home-z2EXALAZ.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-BnVn2LVL.js → hosted-reconcile-gHkwH1BF.js} +1 -1
- package/dist/client/assets/{icon-button-BZ9f2Pt9.js → icon-button-1xC_JQLB.js} +1 -1
- package/dist/client/assets/{index-Dt7ZIwRY.js → index-BHtZ5LOo.js} +1 -1
- package/dist/client/assets/{index-BW7-bbk0.js → index-BJKjGJrF.js} +1 -1
- package/dist/client/assets/{index-D-DRzVEB.js → index-BtlZo3IV.js} +1 -1
- package/dist/client/assets/{index-C2wTYLQr.js → index-C1iaIX-s.js} +1 -1
- package/dist/client/assets/{index-B8Pa92mK.js → index-Chg--78J.js} +1 -1
- package/dist/client/assets/{index-DQAtcq3Z.js → index-Czm9RrRY.js} +1 -1
- package/dist/client/assets/{index-68Cr2r1N.js → index-DOaDUx72.js} +1 -1
- package/dist/client/assets/{index-Cvc22Qvh.js → index-DWvRfTwV.js} +3 -3
- package/dist/client/assets/{index-BGom2FnM.js → index-DyoVCnKR.js} +1 -1
- package/dist/client/assets/{index-LnWr599j.js → index-J6dVRDZu.js} +1 -1
- package/dist/client/assets/{index-D0G5dFqT.js → index-KGPpyCdi.js} +1 -1
- package/dist/client/assets/{index-Dw1u8oXT.js → index-L3rSytXD.js} +1 -1
- package/dist/client/assets/{index-CbuCRTrW.js → index-Wodin-tK.js} +1 -1
- package/dist/client/assets/{index-Z8XjhDCo.js → index-eKAZ8rFQ.js} +1 -1
- package/dist/client/assets/{index-CcZq_9Fb.js → index-pqEXXiDC.js} +1 -1
- package/dist/client/assets/{index-redirect-PbFd_QHU.js → index-redirect-D52J_8O4.js} +1 -1
- package/dist/client/assets/{index-CZXPJi4-.js → index-xAQMjVHe.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CmujZk55.js → infiniteQueryObserver-O1nZgTsK.js} +1 -1
- package/dist/client/assets/{infra-billing-BlZrBUYP.js → infra-billing-CsrcHH3z.js} +1 -1
- package/dist/client/assets/{input-C7_FCkgY.js → input-Lv9puCyJ.js} +3 -3
- package/dist/client/assets/{input-D6ZRMHIB.js → input-Z4x7UYYS.js} +1 -1
- package/dist/client/assets/{integration-icon-DMt85Vdd.js → integration-icon-BCp7DD7C.js} +1 -1
- package/dist/client/assets/{jira-icon-C0C7R9Uf.js → jira-icon-Cgp_nHIG.js} +1 -1
- package/dist/client/assets/{label-RB5C5N6z.js → label-BkzEUDUr.js} +1 -1
- package/dist/client/assets/{layout-CBfnb3CZ.js → layout-pqxzJsxG.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-zWqSTSjP.js → legacy-agents-deep-C88GLYmw.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BZlpoESe.js → legacy-main-redirect-DcmC8SjE.js} +1 -1
- package/dist/client/assets/library-D4o0AtWq.js +1 -0
- package/dist/client/assets/{library-tab-C7gKe5iN.js → library-tab-DI44ELWs.js} +1 -1
- package/dist/client/assets/{login-D9zRzHBo.js → login-DQICOGIE.js} +1 -1
- package/dist/client/assets/{markdown-HhU9_nSI.js → markdown-DkmjrNqn.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DeLjk14w.js → mcp-app-renderer-CIky1nBi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-i6IZ7F.js → mcp-oauth-CNMWqwMp.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DLwsgkOm.js → mcp-oauth-SAUpfbwO.js} +1 -1
- package/dist/client/assets/{members-DocomT72.js → members-BT1BIG15.js} +1 -1
- package/dist/client/assets/{memory-BP3-K3oo.js → memory-BDRH6Og0.js} +1 -1
- package/dist/client/assets/{mock-board-CoWf0eSd.js → mock-board-BF-mAr4y.js} +3 -3
- package/dist/client/assets/{monaco-editor-oUmtqDLR.js → monaco-editor-Dff4ZjU3.js} +1 -1
- package/dist/client/assets/{monitoring-DKfNSCeR.js → monitoring-BPV_CuUX.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-XSvwSWAi.js → monitoring-stats-row-ZCTbL6bH.js} +1 -1
- package/dist/client/assets/{multi-select-CISJC82c.js → multi-select-B4WkKxx8.js} +1 -1
- package/dist/client/assets/{mustache-D4zVU9iA.js → mustache-DCgM4RQC.js} +1 -1
- package/dist/client/assets/{named-rule-view-BTwHmZ5L.js → named-rule-view-D8WSLrw8.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BA0jmhgS.js → new-project-dialog-Kvs8XyHN.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1NevZMJ.js → oauth-callback-CIFexUJN.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BJwoy8qA.js → oauth-callback-ai-provider-3-_RChJi.js} +1 -1
- package/dist/client/assets/{oauth-consent-BTT41r6l.js → oauth-consent-vlJReqsl.js} +1 -1
- package/dist/client/assets/{onboarding-C2uIwwWY.js → onboarding-CC0xFJ-5.js} +1 -1
- package/dist/client/assets/{openai-conversation-pUSF1vof.js → openai-conversation-D9tyQTXT.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BnUNFsLR.js → optimistic-project-sidebar-views-BmsZ-Me-.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BzMajB7Y.js → order-monitor-day-Cxsz6w2q.js} +1 -1
- package/dist/client/assets/{organization-choice-5ra3ZqkQ.js → organization-choice-4fOAxXZj.js} +1 -1
- package/dist/client/assets/{orgs-ZeqGcjOU.js → orgs-nKU8niHO.js} +1 -1
- package/dist/client/assets/{own-accounts-section-Dd8ELrvu.js → own-accounts-section-B2chKMQ0.js} +1 -1
- package/dist/client/assets/{pair-Bx1LbJmC.js → pair-BwCxrq_f.js} +1 -1
- package/dist/client/assets/{parse-sections-BTDQNPKy.js → parse-sections-CK6AHU3E.js} +3 -3
- package/dist/client/assets/{plan-bz8_rmrJ.js → plan-C4kJq3a0.js} +1 -1
- package/dist/client/assets/{plan-ladder-CZUMQESY.js → plan-ladder-wSfhs4No.js} +1 -1
- package/dist/client/assets/{plan-usage-card-SygAb3OS.js → plan-usage-card-CBlBUX6I.js} +1 -1
- package/dist/client/assets/{popover-D5YX99Kp.js → popover-CpDRMXBS.js} +1 -1
- package/dist/client/assets/{post-calendar-BIBU13NF.js → post-calendar-C4WCdLXl.js} +1 -1
- package/dist/client/assets/{post-editor-BAf1z147.js → post-editor-BHEvn_Zz.js} +1 -1
- package/dist/client/assets/{preview-content-TDEad-bh.js → preview-content-C4WlFzcj.js} +1 -1
- package/dist/client/assets/{preview-dialog-BkHpQdXG.js → preview-dialog-CSGQDL5A.js} +1 -1
- package/dist/client/assets/{preview-panel-DduOnxXk.js → preview-panel-BMN_Ysm9.js} +1 -1
- package/dist/client/assets/{preview-tab-Cgfndmyh.js → preview-tab-sRIuk4Ej.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DDkB9ByB.js → product-picker-dialog-DzFQlf9n.js} +1 -1
- package/dist/client/assets/{profile-DHJVxDvo.js → profile-DGzRd8vX.js} +1 -1
- package/dist/client/assets/{project-app-view-BfcPf6du.js → project-app-view-ByacUDvM.js} +1 -1
- package/dist/client/assets/{project-apps-Bny6_T2A.js → project-apps-DzbYoXyd.js} +1 -1
- package/dist/client/assets/{project-icon-eZOGIGwj.js → project-icon-DTA6ZXhl.js} +1 -1
- package/dist/client/assets/{project-index-BSMjLbxc.js → project-index-BmalKoU9.js} +1 -1
- package/dist/client/assets/project-reports-DPgVezio.js +1 -0
- package/dist/client/assets/{project-sidebar-views-CrRbPbLq.js → project-sidebar-views-BxNR4pgO.js} +1 -1
- package/dist/client/assets/project-tasks-C8oeh0BH.js +1 -0
- package/dist/client/assets/{projects-D7HB1QKY.js → projects-BIj_kuAC.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DBWek16Y.js → projects-empty-state-DVir8yX9.js} +1 -1
- package/dist/client/assets/{prompts-MMmII7eb.js → prompts-BmgauEg8.js} +1 -1
- package/dist/client/assets/record-editor-BZSwvkut.js +1 -0
- package/dist/client/assets/{redirect-editor-cm3-huyu.js → redirect-editor-BxlqORGw.js} +1 -1
- package/dist/client/assets/{reports-D0VzI1C_.js → reports-7rmI992n.js} +1 -1
- package/dist/client/assets/reports-Be7TvXFw.js +1 -0
- package/dist/client/assets/{reports-onboarding-DonafHiF.js → reports-onboarding-DPzdd7qa.js} +1 -1
- package/dist/client/assets/{reports-tab-Wl9IyKm6.js → reports-tab-C_NZHfzv.js} +2 -2
- package/dist/client/assets/{repositories-9kTJbSW8.js → repositories-D3yxw4y-.js} +1 -1
- package/dist/client/assets/repositories-DFHveJlo.js +1 -0
- package/dist/client/assets/{repository-binding-B7A7NBUB.js → repository-binding-CeErFm4l.js} +1 -1
- package/dist/client/assets/{repository-picker-CI7xSsin.js → repository-picker-C3C3_E5g.js} +1 -1
- package/dist/client/assets/{require-capability-BTBUQsVM.js → require-capability-BOrIzed0.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ClYF4eFR.js → required-auth-layout-nGThcCwM.js} +1 -1
- package/dist/client/assets/{reset-password-Ah3K7D-l.js → reset-password-xu4Q0lXY.js} +1 -1
- package/dist/client/assets/{resizable-DzzgKGKP.js → resizable-gNSqe3KZ.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DMbVCUvi.js → resolve-tab-icon-D4I4sh6v.js} +1 -1
- package/dist/client/assets/{review-settings-Fxdols3J.js → review-settings-CjrtYBLa.js} +1 -1
- package/dist/client/assets/{role-color-CEkb11P4.js → role-color-DQHx1mqZ.js} +1 -1
- package/dist/client/assets/{roles-CqJ0hOtT.js → roles-C_hPZ63M.js} +1 -1
- package/dist/client/assets/route-04y-cUhL.js +1 -0
- package/dist/client/assets/{route-BA7jjOjA.js → route-CijJVC7q.js} +1 -1
- package/dist/client/assets/{route-DGCMYgfH.js → route-D7Ke7Nww.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-WaQV2LhH.js → sandbox-lifecycle-context-CuiD9fGV.js} +1 -1
- package/dist/client/assets/{schema-DHahXPsT.js → schema-DiUKA_SL.js} +1 -1
- package/dist/client/assets/{schema-BH82js-o.js → schema-DvxWNZKz.js} +1 -1
- package/dist/client/assets/{scroll-area-BN87AboJ.js → scroll-area-CUevVS4T.js} +1 -1
- package/dist/client/assets/{search-input-BBYghT-z.js → search-input-DWWqDlal.js} +1 -1
- package/dist/client/assets/{search-toggle-pLnMgrhP.js → search-toggle-Z6tLdJtz.js} +1 -1
- package/dist/client/assets/{secret-picker-DWWFQJzg.js → secret-picker-BK4dq3ip.js} +1 -1
- package/dist/client/assets/{secrets-CM4b3_qA.js → secrets-DrGLagdz.js} +1 -1
- package/dist/client/assets/{sections-CgO1w_IT.js → sections-CC9QneUq.js} +1 -1
- package/dist/client/assets/{sections-editor-Uk83RbMN.js → sections-editor-CEHFL2VN.js} +1 -1
- package/dist/client/assets/{select-GzsOSPza.js → select-gJgQvQZg.js} +1 -1
- package/dist/client/assets/{select-model-BU2ssn1V.js → select-model-ivosxEc9.js} +1 -1
- package/dist/client/assets/{seo-editor-dMXY0ofk.js → seo-editor-CaLY6KkG.js} +1 -1
- package/dist/client/assets/{separator-CuwdHpjW.js → separator-PY5RFBB-.js} +1 -1
- package/dist/client/assets/settings-tab-DeCOk8kh.js +1 -0
- package/dist/client/assets/{sheet-BIQm-3An.js → sheet-BKUVqko3.js} +1 -1
- package/dist/client/assets/{shell-layout-CH0j9rog.js → shell-layout-Bx4AZ_YV.js} +1 -1
- package/dist/client/assets/{site-draft-view-C74WkBDm.js → site-draft-view-B8TmuovZ.js} +1 -1
- package/dist/client/assets/site-editor-BeO4XfO2.js +1 -0
- package/dist/client/assets/{site-editor-toast-DrW9VMK5.js → site-editor-toast-B-FxlfJP.js} +1 -1
- package/dist/client/assets/{skills-C71x-yhC.js → skills-CZlPyCDI.js} +1 -1
- package/dist/client/assets/{slider-BTgIuWj6.js → slider-CnnTZZH8.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dd1EVaQb.js → sortable.esm-YReNzob1.js} +1 -1
- package/dist/client/assets/{sso-BfwIPTh8.js → sso-B0Izx2rk.js} +1 -1
- package/dist/client/assets/{suggestion-CsEyXKDY.js → suggestion-D-YZpsQl.js} +1 -1
- package/dist/client/assets/{switch-BRZA_xq0.js → switch-UpbwlQtZ.js} +1 -1
- package/dist/client/assets/{synced-repos-Do7bESqI.js → synced-repos-DJZhlM-5.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BsVyyg_A.js → tab-icon-glyph-BA8eumIA.js} +1 -1
- package/dist/client/assets/{table-DJd8n4EY.js → table-D9nZzqmf.js} +1 -1
- package/dist/client/assets/{tabs-D5AMuciq.js → tabs-BFXzZPNk.js} +1 -1
- package/dist/client/assets/{task-board-DN88kD7h.js → task-board-CzrPT-OZ.js} +1 -1
- package/dist/client/assets/{task-route-4C0M-4XY.js → task-route-DrqrKj8M.js} +1 -1
- package/dist/client/assets/{task-status-B2JNuBbQ.js → task-status-B5fYlW4s.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D_AXxVNg.js → taskboard-analytics-Bo8Bxm9q.js} +1 -1
- package/dist/client/assets/{tasks-dMEgvkta.js → tasks-BFPPo49C.js} +1 -1
- package/dist/client/assets/tasks-CI7wGKXW.js +1 -0
- package/dist/client/assets/{textarea-D7HQlMVo.js → textarea-BVq0fBVJ.js} +1 -1
- package/dist/client/assets/{thread-analytics-BQjHh_yV.js → thread-analytics-j4C-4XbM.js} +1 -1
- package/dist/client/assets/{thread-intent-Bs-Q7fma.js → thread-intent-BONVdhUb.js} +1 -1
- package/dist/client/assets/{thread-route-C-uX4C4C.js → thread-route-CDlnAMQ3.js} +1 -1
- package/dist/client/assets/{thread-route-B44higRI.js → thread-route-DMWye38f.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BNo76_XD.js → thread-sheet-body-C1Yi4Tsp.js} +1 -1
- package/dist/client/assets/{time-range-picker-D4sglVBw.js → time-range-picker-DuQ-XfqJ.js} +1 -1
- package/dist/client/assets/{toggle-group-BBgjmF6C.js → toggle-group-Bw4R79dp.js} +1 -1
- package/dist/client/assets/{tool-namespace-l4eN7YZ5.js → tool-namespace-CmEhPnkj.js} +1 -1
- package/dist/client/assets/{tool-set-selector-Bi-Sw2KD.js → tool-set-selector-DAvZ69Ky.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-nrUHQe-I.js → toolbar-icon-button-CRZySHtx.js} +1 -1
- package/dist/client/assets/{tooltip-C0GWPsi8.js → tooltip-BVv5wAeF.js} +1 -1
- package/dist/client/assets/{tooltipContext-DdEokZtY.js → tooltipContext-DwFHeBjZ.js} +1 -1
- package/dist/client/assets/{track-29FVOdFL.js → track-CHjUqURA.js} +1 -1
- package/dist/client/assets/{types-DKuFfsqr.js → types-7R44AYrk.js} +1 -1
- package/dist/client/assets/{url-slug-5t39ocbn.js → url-slug-CoT8zovb.js} +1 -1
- package/dist/client/assets/{usage-stats-CHeI7dPd.js → usage-stats-qZh3WQDj.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BbVlPdZd.js → use-ai-providers-CCcuLCZt.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CnOcORn0.js → use-apply-named-rule-BRjLBznN.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-DQs0YHUB.js +1 -0
- package/dist/client/assets/{use-automations-BoyfX_H0.js → use-automations-jhigzQzP.js} +1 -1
- package/dist/client/assets/{use-autosave-CZD-Fkyk.js → use-autosave--xoi8yhU.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BC5WrKKn.js → use-chat-layout-state-Dnl_7DMo.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BbDVRUuf.js → use-cms-publish-actions-CgLBJwXN.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DEAJWvqA.js → use-connect-companion-BVtzi_36.js} +1 -1
- package/dist/client/assets/{use-connection-Dqyf1wn8.js → use-connection-BQpfU6u4.js} +1 -1
- package/dist/client/assets/{use-content-sync-vr73v2b2.js → use-content-sync-DjDHeqFk.js} +1 -1
- package/dist/client/assets/{use-copy-BGfQrJIh.js → use-copy-CMfnyhoo.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-C4jbLuwI.js → use-date-fns-locale-CRoKnCN9.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BrjHHNNB.js → use-debounced-autosave-D1fE_-TK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BF84eZeF.js → use-debounced-value-DiJ2aJN8.js} +1 -1
- package/dist/client/assets/{use-deco-credits-MCc3vHir.js → use-deco-credits-D1bpdE32.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-uSeDcfUe.js → use-decopilot-events-CZSx1Itd.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CLe-XFxn.js → use-delete-connection-BFOvb9ed.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-ShnoFTNr.js → use-deployment-admin-DQ5wNSYp.js} +1 -1
- package/dist/client/assets/{use-entitlements-wE65MYfi.js → use-entitlements-BChYmsyZ.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BmUgrEyk.js → use-fast-preview-draft-url-CO3Nwa6o.js} +1 -1
- package/dist/client/assets/{use-file-configs-D9BR1kJU.js → use-file-configs-DRzFKzj4.js} +1 -1
- package/dist/client/assets/{use-id-selection-BcfcmGZl.js → use-id-selection-DexUoI58.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-EYADn16y.js → use-inbox-feed-BvqULLI3.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Ds1Wd1cw.js → use-infinite-scroll-C7IQ9e5j.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkWiAH0i.js → use-join-requests-Dr_qAJ4N.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DTMcBtUc.js → use-main-panel-tabs-DZKpYMQg.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DhFx8XVQ.js → use-mcp-auth-status-D0-JLgq9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BfCmeMHR.js → use-mcp-client-Z8a6jg-w.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DoojBZhS.js → use-mcp-prompts-KWx0e75o.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DwTtnjNb.js → use-mcp-tools-C4Fqpw4S.js} +1 -1
- package/dist/client/assets/{use-mobile-C1stVK0E.js → use-mobile-B7UqukPG.js} +1 -1
- package/dist/client/assets/{use-move-blocks-Bclcq-Qe.js → use-move-blocks-DqXCo5PB.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D2d0cpFU.js → use-navigate-to-agent-9BOtBFjV.js} +1 -1
- package/dist/client/assets/{use-org-fs-DHnEDbF9.js → use-org-fs-DU8c86TB.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CcoLGdUP.js → use-org-repo-syncs-DGuZeud_.js} +1 -1
- package/dist/client/assets/{use-org-sso-d82WgyRM.js → use-org-sso-nKgxHjqa.js} +1 -1
- package/dist/client/assets/{use-organization-settings-a6mUKPHv.js → use-organization-settings-DqaBVcmT.js} +1 -1
- package/dist/client/assets/{use-project-scope-C0EKXyqg.js → use-project-scope-B4B7p1mj.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DEMyNf2W.js → use-recent-apps-CQ2MLxK5.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-rjeHGSYu.js → use-reports-diagnostic-MABLwKiU.js} +1 -1
- package/dist/client/assets/{use-secrets-CifnNbah.js → use-secrets-DP80TxaK.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-SkN8HQaB.js → use-section-preview-base-C7kw5vsr.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DwcGl0-e.js → use-sidebar-collapsed-Dz5RfxtZ.js} +1 -1
- package/dist/client/assets/{use-tags-CgXVAtG9.js → use-tags-BMj-zonr.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BTZNDNnK.js → use-task-board-analytics-Bxag-9wC.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DCguN7A5.js → use-task-board-events-B8bEY6A0.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CnqmEndd.js → use-task-board-item-prs-JXA8OC5C.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BmpaMZkF.js → use-task-board-items-DFDnaPnO.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DdSO4gLi.js → use-task-board-prompts-CeCaGQl-.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D3xqf4sH.js → use-task-metadata-D6_-qyJw.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D6sQTVJo.js → use-thread-outputs-DIlmUcwz.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DAm-dYuC.js +1 -0
- package/dist/client/assets/{useQueries-BuMODvFG.js → useQueries-DlmzJSx8.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BTqieOpO.js +1 -0
- package/dist/client/assets/{users-Ct3PwBMT.js → users-BIMbDMRH.js} +1 -1
- package/dist/client/assets/{utils-DA49HMaO.js → utils-B-ZZ1C4f.js} +1 -1
- package/dist/client/assets/{variant-calendar-CPtUMCAS.js → variant-calendar-CPbvwCiJ.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DnlLYEoa.js → variant-matcher-override-BDeSqmx4.js} +1 -1
- package/dist/client/assets/{view-header-CAO18iqy.js → view-header-BTUnAkrc.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C4mAz3N8.js → virtual-mcp-D-xL-K_P.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BI4P-Lkx.js → watch-sse-pool-B6ObjuCT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +464 -464
- package/package.json +1 -1
- package/dist/client/assets/agent-app-ZW_Vm-c7.js +0 -1
- package/dist/client/assets/agent-deck-8VVMhl7J.js +0 -1
- package/dist/client/assets/agent-library-C_HTRhOS.js +0 -1
- package/dist/client/assets/agent-library-file-8gKy0Im-.js +0 -1
- package/dist/client/assets/agent-overview-CSsPaJjm.js +0 -1
- package/dist/client/assets/agent-settings-uWS3yWiw.js +0 -1
- package/dist/client/assets/agent-site-editor-code-wtgSW_Bw.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BC5jgNMj.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Dd0H-yKP.js +0 -1
- package/dist/client/assets/agent-view-C4jCWfsN.js +0 -1
- package/dist/client/assets/api-keys-CmWPTVBS.js +0 -1
- package/dist/client/assets/library-pMQg4GCR.js +0 -1
- package/dist/client/assets/project-reports-BzA8d8hO.js +0 -1
- package/dist/client/assets/project-tasks-BCE2SgoF.js +0 -1
- package/dist/client/assets/record-editor-DVouiUmR.js +0 -1
- package/dist/client/assets/reports-BHAVwnBG.js +0 -1
- package/dist/client/assets/repositories-bPxFm30V.js +0 -1
- package/dist/client/assets/route-DJbiUXJl.js +0 -1
- package/dist/client/assets/settings-tab-FvtSSyQC.js +0 -1
- package/dist/client/assets/site-editor-CazX9Ijc.js +0 -1
- package/dist/client/assets/tasks-BlrmxtrG.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Cp_wqFIx.js +0 -1
- package/dist/client/assets/useInfiniteQuery-P9--kf7E.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2ZhOGvp.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,J as G,a0 as F,a as E,l as O,b as P,n as y,L as H}from"./index-DWvRfTwV.js";import{C as M}from"./chat-context-yHOaM07v.js";import{C as x}from"./index-DyoVCnKR.js";import{L}from"./index-DOaDUx72.js";import{B as V}from"./blocks-preview-workspace-context-C59bKt9w.js";import{e as T,p as J,s as K,a as W,r as U,T as $,u as R,b as z}from"./site-editor-toast-B-FxlfJP.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-sRIuk4Ej.js";import{C as Y}from"./content-tab-D6POg5eV.js";import{T as Z}from"./tab-icon-glyph-BA8eumIA.js";import{r as tt}from"./resolve-tab-icon-D4I4sh6v.js";import et from"./agent-site-editor-CVSVIfgT.js";import"./autosend-DbfDzqlB.js";import"./thread-route-DMWye38f.js";import"./use-project-scope-B4B7p1mj.js";import"./repository-binding-CeErFm4l.js";import"./use-mcp-client-Z8a6jg-w.js";import"./auth-xvjttF9D.js";import"./thread-intent-BONVdhUb.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-B6ObjuCT.js";import"./task-board-CzrPT-OZ.js";import"./schema-DvxWNZKz.js";import"./use-entitlements-BChYmsyZ.js";import"./use-ai-providers-CCcuLCZt.js";import"./use-decopilot-events-CZSx1Itd.js";import"./use-organization-settings-DqaBVcmT.js";import"./use-mobile-B7UqukPG.js";import"./use-sidebar-collapsed-Dz5RfxtZ.js";import"./use-chat-layout-state-Dnl_7DMo.js";import"./agent-icon-Nkid6y9z.js";import"./AlertCircle-BPGyk76P.js";import"./Tool01-CyX9Nllj.js";import"./ArrowUp-BJTv4ddc.js";import"./ArrowLeft-DRdw9Nza.js";import"./LinkBroken01-4j6Z2AOF.js";import"./ShoppingBag01-CY137tVP.js";import"./Globe04-Dr1jk8eS.js";import"./CheckCircle-y3P873c6.js";import"./ChevronUp-CDe5Gfov.js";import"./ChevronSelectorVertical-TIONA5Zl.js";import"./UserSquare-DmeGszKa.js";import"./CreditCard01-abk_vBBR.js";import"./SwitchHorizontal01-C3qdjyVX.js";import"./Key01-DzZgIVqE.js";import"./Minus-B2u_zm0f.js";import"./Monitor01-DWylBoOJ.js";import"./Sun-CyYLfv8E.js";import"./Play-CV8_Sy8a.js";import"./Plus-BtfY7EHX.js";import"./SearchMd-DD6kw-fs.js";import"./Trash01-DSJ1LUhI.js";import"./Upload01-DC0joCKG.js";import"./Users01-B-OacssU.js";import"./XClose-avSrIpAi.js";import"./Zap--C2rij07.js";import"./tooltip-BVv5wAeF.js";import"./index-J6dVRDZu.js";import"./toolbar-icon-button-CRZySHtx.js";import"./shell-layout-Bx4AZ_YV.js";import"./use-deployment-admin-DQ5wNSYp.js";import"./admin-fetch-BhTJlAsX.js";import"./command-CSFENWMV.js";import"./index-Czm9RrRY.js";import"./integration-icon-BCp7DD7C.js";import"./project-icon-DTA6ZXhl.js";import"./use-navigate-to-agent-9BOtBFjV.js";import"./new-project-dialog-Kvs8XyHN.js";import"./label-BkzEUDUr.js";import"./repository-picker-C3C3_E5g.js";import"./github-icon-Bvc_Uep-.js";import"./useInfiniteQuery-DAm-dYuC.js";import"./infiniteQueryObserver-O1nZgTsK.js";import"./collection-search-CPadQqKp.js";import"./use-debounced-value-DiJ2aJN8.js";import"./required-auth-layout-nGThcCwM.js";import"./use-org-sso-nKgxHjqa.js";import"./sheet-BKUVqko3.js";import"./resizable-gNSqe3KZ.js";import"./core.esm-C3kzKmQL.js";import"./sortable.esm-YReNzob1.js";import"./context-menu-Cgl4PGwR.js";import"./create-organization-dialog-C6jgiT68.js";import"./form-DE5X7SPR.js";import"./project-apps-DzbYoXyd.js";import"./use-recent-apps-CQ2MLxK5.js";import"./input-Lv9puCyJ.js";import"./usage-stats-qZh3WQDj.js";import"./tool-namespace-CmEhPnkj.js";import"./utils-CVEq3hMx.js";import"./markdown-DkmjrNqn.js";import"./use-copy-CMfnyhoo.js";import"./icon-button-1xC_JQLB.js";import"./file-type-icon-jLU7FJUL.js";import"./chat-draft-BKLG-IxC.js";import"./select-gJgQvQZg.js";import"./index-BdQq_4o_.js";import"./tabs-BFXzZPNk.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-D1bpdE32.js";import"./toggle-group-Bw4R79dp.js";import"./index-KGPpyCdi.js";import"./checkbox-Dv6iFznu.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./popover-CpDRMXBS.js";import"./drawer-1kqkgpFK.js";import"./input-Z4x7UYYS.js";import"./suggestion-D-YZpsQl.js";import"./use-mcp-prompts-KWx0e75o.js";import"./use-org-fs-DU8c86TB.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-BVXAF3Vl.js";import"./plan-ladder-wSfhs4No.js";import"./add-connection-dialog-uIVnUFji.js";import"./extract-connection-data-C6MDLhDM.js";import"./metadata-D72DunRR.js";import"./connection-9Wtillpb.js";import"./url-slug-CoT8zovb.js";import"./connection-card-B7mEOoWU.js";import"./connection-slug-BCjSI_lE.js";import"./textarea-BVq0fBVJ.js";import"./use-connection-BQpfU6u4.js";import"./schema-DiUKA_SL.js";import"./connection-form-helpers-ZOfZ5xVa.js";import"./authenticate-and-persist-oauth-DdntocF2.js";import"./mcp-oauth-SAUpfbwO.js";import"./mcp-oauth-CNMWqwMp.js";import"./collection-tabs-B05-I-04.js";import"./badge-BLk85LCv.js";import"./use-infinite-scroll-C7IQ9e5j.js";import"./useSuspenseInfiniteQuery-BTqieOpO.js";import"./use-task-board-events-B8bEY6A0.js";import"./agent-capabilities-4Kae1N0E.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-B-ZZ1C4f.js";import"./index-BtlZo3IV.js";import"./pair-BwCxrq_f.js";import"./collapsible-WPiOb2df.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CIky1nBi.js";import"./types-7R44AYrk.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-thread-outputs-DIlmUcwz.js";import"./sandbox-git-api-DcqI6XE4.js";import"./parse-sections-CK6AHU3E.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./blocks-tab-states-DP3rjaHt.js";import"./empty-state-CbRq3C3n.js";import"./hosted-reconcile-gHkwH1BF.js";import"./slider-CnnTZZH8.js";import"./index-BJKjGJrF.js";import"./tooltipContext-DwFHeBjZ.js";import"./CategoricalChart-CVu6TY4_.js";import"./index-L3rSytXD.js";import"./switch-UpbwlQtZ.js";import"./scroll-area-CUevVS4T.js";import"./monaco-editor-Dff4ZjU3.js";import"./editor-CrG4V3zO.js";import"./calendar-CDcnOKeY.js";import"./editor-classes-LBX4QjrW.js";import"./combobox-AFeNX90_.js";import"./search-input-DWWqDlal.js";import"./use-file-configs-DRzFKzj4.js";import"./asset-utils-CwwYcMA6.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-CuiD9fGV.js";import"./variant-matcher-override-BDeSqmx4.js";import"./use-fast-preview-draft-url-CO3Nwa6o.js";import"./useQueries-DlmzJSx8.js";import"./device-hint-B0gKGTHi.js";import"./alert-8ZKgnOi9.js";import"./virtual-mcp-D-xL-K_P.js";import"./app-preview-url-9Od4s8Sz.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-D6_-qyJw.js";import"./view-header-BTUnAkrc.js";import"./use-cms-publish-actions-CgLBJwXN.js";import"./use-content-sync-DjDHeqFk.js";import"./mustache-DCgM4RQC.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-DqXCo5PB.js";import"./empty-state-CVOGmYU9.js";import"./collection-table-wrapper-DbE8PRZm.js";import"./table-D9nZzqmf.js";import"./site-draft-view-B8TmuovZ.js";import"./separator-PY5RFBB-.js";import"./cms-store-drafts-BRph2qKQ.js";import"./serial-task-queue-CGOeQgpr.js";import"./save-changes-debug-nBi-n9eV.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const ot=e=>e;function it(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?ot:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(rt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function rt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=G(),{language:s}=r;let p;t[0]!==m?(p=N=>m({endpoint:N}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let S;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(S=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=S):S=t[12];const _=S;let j;return t[13]!==C||t[14]!==i||t[15]!==_?(j=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=j):j=t[16],j}const v="deco-serve",w="working-tree",nt={id:"",slug:"",name:"",logo:null},st={id:v,slug:v},mt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function pt(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?J(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&K(o),{candidates:W(o,U()),invalidLink:t&&!o}}const at=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function ct(){const e=u.c(6),t=P();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:lt},e[0]=o):o=e[0];const c=O(o);let m;e[1]!==t||e[2]!==c?(m=at.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(H,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Z,{icon:tt({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function lt(e){return e.matches.at(-1)?.staticData.siteEditorView}function A(e){const t=u.c(14),{children:o}=e,c=P(),{connection:m}=z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function dt(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const D={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ut(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ft},e[0]=o):o=e[0];const c=O(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ct,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(et,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ft(e){return e.matches.at(-1)?.staticData.siteEditorView}function ht(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},vt={connection:null,set:b,clear:b};function Ui(){const e=u.c(3),[t]=g.useState(pt);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(F,{org:nt,project:st,children:n.jsx(it,{candidates:t.candidates,invalidLink:t.invalidLink,shell:kt,editor:xt})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function xt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(dt,{onLost:t}),n.jsx(M,{value:mt,children:n.jsx(V,{children:n.jsx(ut,{})})})]})}function kt(e){return n.jsx($.Provider,{value:vt,children:n.jsx(ht,{children:e})})}function zi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function qi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{qi as SiteEditorContent,zi as SiteEditorPreview,Ui as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eP as P,eQ as S,c as $,q as ne,i as F,K as g,eR as Ne,aB as wn,aF as Sn,aG as yn,r as L,a as En,at as De,a5 as On,by as yt,eS as Dn,eT as kn,eU as Et,ar as _n,bo as Ot,bh as B,eV as In,eW as Tn,eX as Z,eY as Pn,eZ as Rn,e_ as ue,e$ as xn,f0 as Dt,f1 as kt,f2 as $n,f3 as Nn,a3 as jn,t as K,j as Y}from"./index-Cvc22Qvh.js";import{a as _t}from"./input-C7_FCkgY.js";import{s as et}from"./thread-intent-Bs-Q7fma.js";import{u as je}from"./agent-capabilities-DKq2l6j_.js";import{b as be}from"./sandbox-url-D3mC8qhT.js";import{s as Cn}from"./utils-DA49HMaO.js";import{u as Ce}from"./repository-binding-B7A7NBUB.js";import{u as An}from"./chat-context-tsaqCp6v.js";import{i as Un,u as Mn}from"./index-D-DRzVEB.js";import{a as Ln}from"./sandbox-git-api-DcqI6XE4.js";const q="deco-content",ke={major:1},It=1;async function Fn(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const _e={major:ke.major,minor:It},Tt=`the endpoint speaks an older ${q} than this client needs (${_e.major}.${_e.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function re(e,t,n){const o={reason:t,required:{..._e}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new P(S.Unsupported,e,o)}function Pt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==q)throw re(`the endpoint speaks ${JSON.stringify(n)}, not ${q}`,"protocol",t);if(o?.major!==ke.major)throw re(`the endpoint speaks ${q} ${String(o?.major)}.x; this client speaks ${ke.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<It)throw re(Tt,"outdated",t);return e}function tt(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?re(Tt,"outdated"):P.from(t)}function Ae(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let l;try{l=await Fn(a)}catch{throw new P(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?P.from(c):new P(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw tt(s,l.error);return l.result};return{call:r,describe:async()=>Pt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,f)=>({jsonrpc:"2.0",id:i[f],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,f)=>{const u=l.get(c);return u?u.error?{ok:!1,error:tt(s[f].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new P(S.InternalError,"no response for this call")}})}}}function Ue(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const nt=20,ot=5,rt=500;function Me(e){return e instanceof P?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function fe(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Qn(e,t,n){const o=g.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(Ue(r)),i=fe(r,s);if(i)return i;const a=await t.changesList({});return fe(void 0,a)}async function Rt(e,t){const n=[];for(let s=0;s<t.length;s+=nt)n.push(t.slice(s,s+nt));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=ot){const i=await e.batch(n.slice(s,s+ot).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Qr(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=rt){const r=t.slice(o,o+rt),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Vr(e){return e instanceof P&&e.code===S.Conflict}function Le(e){return e?.kind==="protocol"?e:null}function Br(e,t,n){const o=$.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=ne();let a;o[2]!==e?(a=Le(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let f;o[4]!==t?(f=g.contentChanges(t??""),o[4]=t,o[5]=f):f=o[5];let u;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(u=c?()=>Qn(i,l.client,t):Ne,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=u):u=o[10];let d;return o[11]!==f||o[12]!==u?(d={queryKey:f,queryFn:u,staleTime:0},o[11]=f,o[12]=u,o[13]=d):d=o[13],F(d)}function Hr(e,t,n){const o=$.c(14);let r;o[0]!==e?(r=Le(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=g.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let f;o[7]!==l||o[8]!==a||o[9]!==s?(f=l?()=>Rt(s.client,a):Ne,o[7]=l,o[8]=a,o[9]=s,o[10]=f):f=o[10];let u;return o[11]!==c||o[12]!==f?(u={queryKey:c,queryFn:f,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=f,o[13]=u):u=o[13],F(u)}function Jr(e,t,n){const o=$.c(16);let r;o[0]!==e?(r=Le(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,l,c;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const d=Object.entries(n?.changes??{}).filter(Wn).map(Jn).sort(Hn);a=d.map(Bn);const h=JSON.stringify(d.map(Vn));i=!!s&&!!t&&a.length>0,c=F,l=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=l,o[8]=c}else i=o[5],a=o[6],l=o[7],c=o[8];let f;o[9]!==i||o[10]!==a||o[11]!==s?(f=i?async()=>{const d=await Rt(s.client,a),h=Object.create(null);for(const[p,v]of Object.entries(d.entries))h[p]=v.before&&typeof v.before=="object"?v.before:null;return h}:Ne,o[9]=i,o[10]=a,o[11]=s,o[12]=f):f=o[12];let u;return o[13]!==l||o[14]!==f?(u={queryKey:l,queryFn:f,staleTime:Number.POSITIVE_INFINITY,placeholderData:wn},o[13]=l,o[14]=f,o[15]=u):u=o[15],c(u)}function Vn(e){return[e.name,e.base]}function Bn(e){return e.name}function Hn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function Jn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function Wn(e){const[,t]=e;return t.kind==="delete"}function xt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function de(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const $t=Sn({endpoint:yn().max(2048).refine(e=>xt(e)&&new URL(e).pathname==="/rpc").transform(de)});function Wr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=$t.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function Nt(e){const t=$t.safeParse(e);return t.success?t.data:null}const jt="studio:deco-serve-last";function Gr(e){try{localStorage.setItem(jt,JSON.stringify(e))}catch{}}function Yr(){try{const e=localStorage.getItem(jt);return e?Nt(JSON.parse(e)):null}catch{return null}}function zr(e){try{return new URL(de(e)).host}catch{return e}}function Gn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Yn="http://localhost:4545/rpc";class Fe extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Fe)return{reason:"not-deco-serve"};if(!(e instanceof P))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Me(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Xr(e,t){if(e)return[de(e.endpoint)];const n=[t?.endpoint,Yn].filter(o=>!!o).map(de);return[...new Set(n)]}const Ct=L.createContext(null);function Xn(e){const t=$.c(24),n=L.useContext(Ct),o=je(n?null:e),{data:r}=En.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?De.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=it(a);let f;t[4]!==i||t[5]!==s||t[6]!==e?(f=i?De.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=f):f=t[7];const[u,d]=it(f);if(n)return n;let h;t[8]!==l||t[9]!==i||t[10]!==o?(h=i&&o?Nt(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=h):h=t[11];const p=h,v=i&&o&&typeof u=="string"?u:null;let w;t[12]!==d||t[13]!==c||t[14]!==i?(w=R=>{i&&(c(R),d(R.endpoint))},t[12]=d,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let E;return t[19]!==p||t[20]!==v||t[21]!==w||t[22]!==_?(E={connection:p,lastEndpoint:v,set:w,clear:_},t[19]=p,t[20]=v,t[21]=w,t[22]=_,t[23]=E):E=t[23],E}function st(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function it(e){const t=$.c(17),n=ne(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?st(e):null,a=()=>e?st(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=v=>{if(e){try{v===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(v))}catch{}n.setQueryData(s,v)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const d=u,h=e?f??null:null;let p;return t[14]!==d||t[15]!==h?(p=[h,d],t[14]=d,t[15]=h,t[16]=p):p=t[16],p}function Zr(e){return e.kind==="protocol"||e.kind==="unavailable"}function qr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function Kr(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function es(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&xt(t)?t:null}function ts(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function At(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function Zn(e){if(!e.hasProject)return"legacy";const t=At(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function qn(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function at(e){return e.isError||e.errorUpdateCount>0}function Kn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function eo(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const Ut="__noSchema";function Mt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ut]:!0}}function ns(e){return!!e&&e[Ut]===!0}function Qe(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function to(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const no=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function os(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:to(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(no)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:ct(n.resolveType).localeCompare(ct(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function ct(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function lt(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=lt(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?lt(s[a],r,n):s[a];return i}return e}function rs(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ut extends Error{}const Ve="site-not-owned";async function oo(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function ro(e,t=n=>fetch(n)){const n=Ae({endpoint:e,fetch:async o=>{const r=await t(o);if(await oo(r))throw new ut;return r}});try{return await He(n)}catch(o){if(o instanceof ut)return Ve;throw o}}async function so(e,t,n){await t();const o=await ro(e,n);return o===Ve?o:{...o,hosted:Dn(e,n)}}const Be=5e3;function io(e){if(!e.site)throw new Error("this project names no site");return kn(e.site,e.branch)}function ao(e){return new URL(be(e,"rpc"),window.location.origin).href}async function He(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==q)throw new Fe;const r=Pt(t.result);if(!n)throw new Error("no schema.get");if(Qe(n))return{client:e,describe:r,hasSchema:!1};if(n.ok)return{client:e,describe:r,hasSchema:!0};throw n.error}function co(e,t=n=>fetch(n)){return He(Ae({endpoint:e,fetch:t}))}function me(e,t){const n=$.c(50),{org:o}=On(),{connection:r}=Xn(e),{runtime:s}=_t(e),i=L.useContext(Ct),a=je(e),l=yt(Ce(e)?.metadata),c=At({hasServeConnection:!!r,runtime:s}),f=An()?.taskId??null,u=Un(Mn().lifecycle.phase),d=ne(),h=qn({mode:c,v8:a,workingTreeReady:u}),p=h.github&&!!o.slug&&!!e&&!!t,v=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>so(io({orgSlug:o.slug,site:l,branch:t}),()=>Et(l,t)),enabled:p,staleTime:Number.POSITIVE_INFINITY,...ft}),w=h.sandbox&&!!o.slug&&!!e&&!!t;let _;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(_=()=>co(ao({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=_):_=n[4];const E=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:_,enabled:w,staleTime:Number.POSITIVE_INFINITY,...ft}),R=!!r;let I;n[5]!==r?.endpoint||n[6]!==o.slug||n[7]!==e?(I=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[5]=r?.endpoint,n[6]=o.slug,n[7]=e,n[8]=I):I=n[8];let N;n[9]!==r?(N=()=>He(Ae({endpoint:r.endpoint})),n[9]=r,n[10]=N):N=n[10];let x;n[11]!==R||n[12]!==I||n[13]!==N?(x={queryKey:I,queryFn:N,enabled:R,staleTime:Number.POSITIVE_INFINITY,retry:fo,retryDelay:uo,refetchInterval:lo},n[11]=R,n[12]=I,n[13]=N,n[14]=x):x=n[14];const b=F(x);let U;n[15]!==r?.endpoint||n[16]!==o.slug||n[17]!==e?(U=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[15]=r?.endpoint,n[16]=o.slug,n[17]=e,n[18]=U):U=n[18];const D=U;let T;n[19]!==r?.endpoint||n[20]!==o.slug||n[21]!==e?(T=g.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[19]=r?.endpoint,n[20]=o.slug,n[21]=e,n[22]=T):T=n[22];let j;n[23]!==b.data||n[24]!==D||n[25]!==d?(j=async()=>{try{return await b.data.client.describe()}catch(m){const J=m;throw d.invalidateQueries({queryKey:D,exact:!0},{cancelRefetch:!1}),J}},n[23]=b.data,n[24]=D,n[25]=d,n[26]=j):j=n[26];const C=!!b.data&&!i;let O;n[27]!==T||n[28]!==j||n[29]!==C?(O={queryKey:T,queryFn:j,enabled:C,refetchInterval:Be,retry:!1},n[27]=T,n[28]=j,n[29]=C,n[30]=O):O=n[30];const A=F(O).data??b.data?.describe,k=Zn({hasProject:!!e,hasServeConnection:!!r,runtime:s,v8:a,githubSite:v.data===Ve?"not-owned":v.data?"ready":at(v)?"error":"loading",sandboxSite:ho({data:E.data,isError:at(E),workingTreeReady:u})});if(k==="pending"){let m;return n[31]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[31]=m):m=n[31],m}if(k==="retrying-sandbox"){let m;return n[32]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[32]=m):m=n[32],m}if(k==="legacy"){let m;return n[33]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[33]=m):m=n[33],m}if(k==="protocol-github"){const m=v.data;let J;n[34]!==m?(J=Ie("github",m,""),n[34]=m,n[35]=J):J=n[35];let oe;return n[36]!==l||n[37]!==J?(oe={...J,site:l},n[36]=l,n[37]=J,n[38]=oe):oe=n[38],oe}if(k==="site-not-owned-github"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[39]=m):m=n[39],m}if(k==="protocol-sandbox"){let m;return n[40]!==E.data?(m=Ie("sandbox",E.data,":sandbox"),n[40]=E.data,n[41]=m):m=n[41],m}if(k==="unavailable-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[42]=m):m=n[42],m}const Q=b.error??b.failureReason,y=r?.endpoint??"";let V;return n[43]!==A||n[44]!==b.data||n[45]!==b.failureCount||n[46]!==b.isError||n[47]!==y||n[48]!==Q?(V=vo({probed:b.data,isError:b.isError,failureCount:b.failureCount,failure:Q,describe:A,endpoint:y}),n[43]=A,n[44]=b.data,n[45]=b.failureCount,n[46]=b.isError,n[47]=y,n[48]=Q,n[49]=V):V=n[49],V}function lo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Be:!1}function uo(e){return Gn(e+1)}function fo(e,t){return!(t instanceof P)&&!(t instanceof Fe)}function ho(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const go=3;function vo(e){const t=e.probed?Ie("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<go?t:{kind:"unavailable",source:"local",problem:zn(e.failure)}:t??{kind:"pending"}}const ft={retry:2,refetchInterval:e=>e.state.status==="error"?Be:!1};function Ie(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function Lt(e){const t=$.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=_n(o,null),i=je(e);let a;t[2]!==r||t[3]!==e?(a=e?et(r):null,t[2]=r,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,u;t[5]!==s?(f=h=>s(et(h)),u=()=>s(null),t[5]=s,t[6]=f,t[7]=u):(f=t[6],u=t[7]);let d;return t[8]!==c||t[9]!==f||t[10]!==u?(d={url:c,setUrl:f,clear:u},t[8]=c,t[9]=f,t[10]=u,t[11]=d):d=t[11],d}function po(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function dt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function we(e,t,n){return["decofile-write",e,t,n]}function bo(e,t,n){return{id:we(e,t,n).join(":")}}class Je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function We(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ge(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function mo(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function wo(e,t,n){e.setQueryData(g.decofileDraft(We(t)),n)}function So(e,t){return e.getQueryData(g.decofileDraft(We(t)))??null}async function yo(e,t){return(await fetch(Ge(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function ss(e){const t=$.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?We(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Eo,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Eo(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Oo(e,t){const n=await fetch(Ge(t),{cache:"no-store"});if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&wo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function is(e,t){const n=await fetch(Ge(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return mo(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ft=3e3,Do=15e3,ko=2*6e4,Qt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function _o(e){return e<ko?Ft:Do}function Io(e,t=Qt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,_o(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const ht=()=>0;function To(e,t,n=Qt){const o=L.useRef(t);o.current=t;const[r]=L.useState(()=>({polling:()=>Io(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?r.polling:r.idle,ht,ht)}function Vt(e,t){return be(e,t)}function Po(e,t){return be(e,"preview-fetch",{path:t})}function as(e){return Vt(e,"preview-invoke")}function cs(e){return Vt(e,"catalog-invoke")}function Bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function Ro(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&Bt(n))return n}return null}function xo(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Ro();return n&&Bt(n)?new URL(t,n).toString():Po(e,t)}function $o(e){return xo(e,"/.decofile")}function No(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function gt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function jo(e,t){const n=be(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=No(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Cn(s.content)}}async function Co(e,t){const n=await jo(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function ls(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Ao(e){return Ce(e)?.metadata?.runtime?.path??null}class Ht extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function us(e){return e instanceof P&&e.code===S.Conflict}function Jt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class Ye extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class ze extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function fs(e,t){return(t instanceof Ye||t instanceof ze)&&(t.message=Wt(e,t,"github")),t}function Wt(e,t,n){if(t instanceof Ye)return e("siteEditor.save.draftUnread");if(t instanceof ze)return e("siteEditor.save.keptChanging");if(t instanceof Je)return t.message;if(n==="local")return Mo(e,t);if(t instanceof P)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Uo(e,t){if(t==="local"||e instanceof Je||e instanceof Ye||e instanceof ze)return null;if(e instanceof P){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Jt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Mo(e,t){if(t instanceof Ht)return e("decoServe.save.serverGone");if(t instanceof P)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Jt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Lo(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Fo(e,t){const[n,o]=L.useState(e),r=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Lo(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const Qo="decocms:content-writes",Te=new Set;let G;function Gt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(Qo),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function Vo(e){try{Gt()?.postMessage({cacheKey:e})}catch{}}function Bo(e){return Gt(),Te.add(e),()=>{Te.delete(e)}}const Yt="__at=",zt="__test=",Ho=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Jo(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function X(e){return typeof e=="string"&&Ho.test(e)}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Wo(e){const t=e.tests??{};return[...e.at!==void 0?[Yt+vt(e.at)]:[],...Object.keys(t).map(n=>zt+vt(`${n}=${t[n]?"on":"off"}`))]}function pt(e,t){const o=[...e.split("&").filter(r=>r&&!r.startsWith(Yt)&&!r.startsWith(zt)),...t];return o.length>0?`?${o.join("&")}`:""}function he(e,t){const n=Wo(t),o=e.indexOf("?"),r=o===-1?e:e.slice(0,o);if(X(r))return r+pt(o===-1?"":e.slice(o+1),n);const s=e.lastIndexOf("@");if(s<=0)return e;const i=e.slice(0,s),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${pt(c,n)}${e.slice(s)}`}function ds(e,t,n){if(!Jo(t))return e;try{const o=new URL(e),r=o.searchParams.get("__draft");return r&&r!=="off"?(o.searchParams.set("__draft",he(r,t)),o.toString()):X(n)?(o.searchParams.set("__draft",he(n,t)),o.toString()):e}catch{return e}}function hs(e,t,n="/"){if(!e||!X(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function Xt(e){return btoa(encodeURIComponent(e))}function gs(e,t,n){const o=Go(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function Go(e,t,n){const o=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return r.searchParams.set("path","/"),r.searchParams.set("pathTemplate","/"),r.searchParams.set("props",Xt(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),r}const Yo="__draft";function vs(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const zo="off";function Xo(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Yo,t),n.toString()}function ps(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:r,...s}=e.pageBlock,i=JSON.stringify({__props:s,__decofile:e.decofile});return{src:o.toString(),body:i}}function bs(e,t,n,o){const r=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,r);s.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),s.searchParams.set("props",Xt(JSON.stringify({sections:i}))),s.toString()}function ms(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const bt="__variant=";function Zt(e,t,n){return`${e}@${t}=${n}`}function ws(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[Zt(e,"sections",t.index)]}function Ss(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[Zt(e.pageKey,o,e.selectedVariantIndex)]}function ys(e,t){return[...t,...e]}function Zo(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Xe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),r=o.indexOf("?"),s=r===-1?o:o.slice(0,r),a=[...r===-1?[]:o.slice(r+1).split("&").filter(c=>c&&!c.startsWith(bt)),...t.map(c=>bt+Zo(c))],l=a.length>0?`?${a.join("&")}`:"";return`${s}${l}${e.slice(n)}`}function Es(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),r=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return Xe(`${r}${o.pathname}@local`,t)}catch{return null}}function Os(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",Xe(o,t)),n.toString())}catch{return e}}function qo(e){const{pointer:t}=e;if(!t||t===zo)return null;const n=t.indexOf("?");return X(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:X(e.heldRevision)&&e.forcedVariants.length===0?he(e.heldRevision,e.previewOptions):he(Xe(t,e.forcedVariants),e.previewOptions)}function Ko(e,t){if(!e||!t)return null;try{return Xo(e,t)}catch{return null}}function Ds(e,t,n){if(!e||!n)return null;try{return Ko(new URL(t,e).toString(),n)}catch{return null}}const ge={forcedVariants:[],previewOptions:{}},se=new Map,ie=new Map,Pe=new Map;function qt(e){for(const t of Pe.get(e)??[])t()}function Kt(e,t){const n=X(t)?t:null;(ie.get(e)??null)!==n&&(n?ie.set(e,n):ie.delete(e),qt(e))}function er(e){return ie.get(e)??null}function tr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ks(e,t){const n=se.get(e)??ge,o=t??ge;tr(n,o)||(t?se.set(e,o):se.delete(e),qt(e))}function nr(e){return se.get(e)??ge}function en(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function or(e){const t=$.c(3);let n,o;return t[0]!==e?(n=r=>en(e,r),o=()=>nr(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,rr)}function rr(){return ge}function sr(e){const t=$.c(3);let n,o;return t[0]!==e?(n=r=>e?en(e,r):ar,o=()=>e?er(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,ir)}function ir(){return null}function ar(){}function _s(e,t){const n=$.c(4),o=or(e),r=sr(e);let s;return n[0]!==o||n[1]!==r||n[2]!==t?(s=qo({pointer:t,heldRevision:r,...o}),n[0]=o,n[1]=r,n[2]=t,n[3]=s):s=n[3],s}const tn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},cr=15e3,ve=new Map;function z(e,t){return`${e}/${t}`}function H(e){let t=ve.get(e);return t||(t={state:tn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ve.set(e,t)),t}function W(e,t){const n=H(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Ze(e){return ve.get(e)?.state??tn}function lr(e,t){const n=H(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Is(e){const t=H(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),W(e,{phase:"idle"}))}}function Ts(e){const t=ve.get(e);!t||t.state.phase!=="reloading"||(Se(t),W(e,{phase:"idle"}))}function nn(e){const t=H(e);Se(t),W(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ae(e,t){const n=H(e),o=Math.max(0,n.state.inFlight-1);if(o>0){W(e,{inFlight:o});return}if(!t.ok||n.previews===0){W(e,{phase:"idle",inFlight:o});return}on(e,t.navigates,o)}function on(e,t,n=0){const o=H(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&W(e,{phase:"idle"})},cr),W(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function ur(e){return e?.kind==="protocol"&&e.source==="github"}async function ce(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?g.protocolDraftRead(o,r,s):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,u=l?[l]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&u.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Ln(o,r,s)})),ur(i)&&c&&!t.adopted&&u.push(n.invalidateQueries({queryKey:c})),await Promise.all(u),t.kind!=="edit"){const p=z(o,r);W(p,{epoch:Ze(p).epoch+1})}const d=c?JSON.stringify(n.getQueryData(c)??null):null,h=f!==d;return h&&await new Promise(p=>Ot.schedule(p)),{navigates:h}}async function fr(e,t){return nn(z(e.orgSlug,e.virtualMcpId)),rn(e,t)}function mt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function rn(e,t){const n=z(e.orgSlug,e.virtualMcpId),o=t.adopted?mt(e):null;let r;try{r=await t.write()}catch(i){throw ae(n,{ok:!1,navigates:!1}),t.refreshOnError&&ce(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&Vo(e.cacheKey),Kt(n,t.shownRevision?.(r)??null),t.adopted){const i=mt(e)!==o;return i&&await new Promise(a=>Ot.schedule(a)),ae(n,{ok:!0,navigates:i}),t.reread&&ce(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await ce(e,t))}catch{}finally{ae(n,{ok:!0,navigates:s})}return r}function Ps(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=z(o,r),a=new Set(t.blockKeys);for(const f of[...H(i).discardListeners])f(a);nn(i);let l=!1;const c=()=>(l=!0,rn(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:we(o,r,s),scope:bo(o,r,s),mutationFn:c}).execute(void 0).catch(f=>{throw l||ae(i,{ok:!1,navigates:!1}),f}):c()}function Rs(e,t,n){const o=$.c(8);let r;o[0]!==e||o[1]!==t?(r=z(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=H(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],L.useEffect(i,a)}function sn(e){const t=z(e.orgSlug,e.virtualMcpId);Ze(t).inFlight>0||(Kt(t,null),ce(e,{kind:"external"}).then(({navigates:n})=>{const o=H(t);o.previews>0&&o.state.inFlight===0&&on(t,n)}).catch(()=>{}))}function dr(e,t){const n=$.c(7);let o;n[0]!==e||n[1]!==t?(o=z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>lr(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Ze(r),n[5]=r,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const hr=500;function xs(e,t){const{phase:n}=dr(e,t);return Fo(n!=="idle",hr)}function gr(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function an(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function $s(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Tn(i,n):vr(e,t,n)}const r=e.getQueryData(g.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(g.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function ee(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(r=>B(r)===n);return o===void 0?void 0:e.changes[o]}function vr(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return cn(o,ye(e,t),n)}function cn(e,t,n){const o=ee(e,n);return o?.kind==="delete"?o.version??ue:o?o.version:t.has(B(n))?ue:null}function Ns(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const r=ee(o,n);return r?r.kind==="set"&&r.baseVersion===null:ye(e,t).has(B(n))}function js(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const r=ye(e,t);return{blocks:n,versionOf:s=>cn(o,r,s)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const r=B(n),s=ye(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),Z(e),e.setQueryData(g.contentDraftTombstones(t),[...s]))}function ln(e,t,n,o){const r=o.revision,s=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===ue?null:d]),a=e.getQueryData(g.contentChanges(n)),l=new Set(i.flatMap(([u])=>{const d=a?ee(a,u):void 0;return(d?d.baseVersion:s?.[u]??null)===null?[u]:[]})),c=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[h,p]of i){const v=ee(u,h),w=v?v.baseVersion:s?.[h]??null;p!==null?d[h]={kind:"set",version:p,baseVersion:w}:w!==null?d[h]={kind:"delete",version:null,baseVersion:w}:delete d[h]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?pe(e,n,u,!1):!c.has(B(u))&&l.has(u)&&pe(e,n,u,!0);const f=o.revision;return f&&f!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:f}),r}function Ee(e,t,n){Z(e),e.setQueryData(g.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function un(e,t){const n=e.getMutationCache().findAll({mutationKey:we(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>eo(o.state.variables)))}function Re(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof P);throw t.source==="local"&&s?(Re(e,n),new Ht(r)):(t.source==="local"&&Me(r)&&Re(e,n),r)}}const le=new Map;function fn(e,t,n,o){const r=le.get(o);if(r)return r;const s=qe(e,t,n,o,!0);return le.set(o,s),s.finally(()=>le.delete(o))}const Oe=new Set;function pr(e,t,n){const o=$.c(8),r=ne(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const f={orgSlug:s,virtualMcpId:i,branch:a};return Bo(u=>{u===n&&(Oe.has(n)||(Oe.add(n),mr(r,e,f,n).catch(br).finally(()=>Oe.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function br(){}async function mr(e,t,n,o){const r=le.get(o);return r&&await r.catch(()=>{}),fn(e,t,n,o)}async function qe(e,t,n,o,r){Z(e);const s=g.decofile(o),i=an(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(s),f=e.getQueryData(l),d=e.getQueryData(i),h=e.getQueryData(a)??void 0,p=r&&c&&f?h?.revision:void 0,v=r&&d?h?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return wr(e,t,t.hosted,n,o,{conditional:r,seen:h,currentMeta:d,schemaIfNoneMatch:v,seenChanges:_});const[E,R,I]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:p?{ifNoneMatch:p}:{}},{method:"schema.get",params:v?{ifNoneMatch:v}:{}},{method:"changes.list",params:Ue(_)}])),N=e.getQueryData(a)?.revision,x=N!==void 0&&N!==h?.revision;if(I?.ok){const O=x?null:fe(_,I.result);O&&e.setQueryData(w,O)}else I&&t.source==="local"&&Me(I.error)&&Re(e,n);if(!E?.ok)throw E?.error??new Error("no blocks.list");if(!R)throw new Error("no schema.get");const b=E.result,U=Qe(R),D=R.ok&&!U?R.result:null;if(b.notModified&&(!c||!f)||D?.notModified&&!d)return qe(e,t,n,o,!1);const T=b.notModified?new Set:un(e,n),j=b.notModified?c:Kn(b.blocks,c,T),C=U?Mt():D?D.notModified?d:D.schema:R.error;if(e.setQueryData(a,{revision:x?N:b.notModified?h?.revision:b.revision,schemaVersion:D?D.notModified?h?.schemaVersion:D.version??void 0:void 0}),e.setQueryData(s,j),!b.notModified){const O=e.getQueryData(l),M={...b.versions};for(const A of T){const k=O?.[A];k!==void 0?M[A]=k:delete M[A]}e.setQueryData(l,M)}return C instanceof P||e.setQueryData(i,C),!x&&!b.notModified&&c&&h?.revision&&b.revision!==h.revision&&sn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:C}}async function wr(e,t,n,o,r,s){const i=g.decofile(r),a=g.contentIndex(r),l=g.contentRevision(r),c=g.contentVersions(r),f=an(o,t),u=g.contentChanges(r),d=e.getQueryData(a),h=s.conditional&&d?s.seen?.revision:void 0,[p,v,w]=await te(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:s.schemaIfNoneMatch?{ifNoneMatch:s.schemaIfNoneMatch}:{}},{method:"changes.list",params:Ue(s.seenChanges)}])),_=e.getQueryData(a)??d,E=e.getQueryData(l)?.revision,R=E!==void 0&&E!==s.seen?.revision;if(w?.ok&&!R){const y=fe(s.seenChanges,w.result);y&&e.setQueryData(u,y)}if(!p?.ok)throw p?.error??new Error("no cms.index");if(!v)throw new Error("no schema.get");const I=p.result,N=Qe(v),x=v.ok&&!N?v.result:null;if(I.notModified&&!d||x?.notModified&&!s.currentMeta)return qe(e,t,o,r,!1);const b=N?Mt():x?x.notModified?s.currentMeta:x.schema:v.error;b instanceof P||e.setQueryData(f,b);const U=x?x.notModified?s.seen?.schemaVersion:x.version??void 0:void 0,D=e.getQueryData(i)??{};if(I.notModified||R)return e.setQueryData(l,{revision:R?E:s.seen?.revision,schemaVersion:U}),e.setQueryData(i,D),{blocks:D,meta:b};const T={revision:I.revision,resolvedRef:I.resolvedRef,sequence:I.sequence,entries:I.entries,draft:I.draft};e.setQueryData(a,T);const j=!!s.seen?.revision&&T.revision!==s.seen.revision&&(!s.seen.revision.startsWith("s-")||!!d&&dn(d.draft,T.draft));j&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),y=>y&&{...y,version:T.revision}),e.setQueryData(l,{revision:T.revision,schemaVersion:U});const C=un(e,o),O=e.getQueryData(c)??{},M={},A={},k=[];for(const[y,V]of Object.entries(D)){const m=T.entries[y];!m&&!C.has(y)||(M[y]=V,O[y]!==void 0&&(A[y]=O[y]),m&&!C.has(y)&&O[y]!==m.version&&k.push(y))}return e.setQueryData(i,M),e.setQueryData(c,A),k.length>0&&await xn(e,n,r,k,C),_&&j&&Sr(_,T)&&sn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:r}),{blocks:e.getQueryData(i)??M,meta:b}}function Sr(e,t){if(dn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function dn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function yr(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function wt(e){if(!(e instanceof P)||e.code!==S.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}function Er(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([r])=>!Object.hasOwn(t,r))),o=(e.delete??[]).filter(r=>!Object.hasOwn(t,r));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function St(e,t,n,o,r){Z(e),ln(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:r}),Ee(e,n,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,i===ue?null:i]))),Dt(e,n,r,o.set??{})}async function Cs(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(c=>!s||!Object.hasOwn(s,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=In(r.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return fr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=f=>te(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...s?{ifMatch:yr(s,f)}:{}}));let a;try{a=await i(r)}catch(f){const u=t.source==="github"?wt(f):void 0;if(!u)throw f;const d=Er(r,u);Object.keys(u).length>0&&St(e,n,o,r,u);let h;try{h=await i(d)}catch(p){const v=wt(p);throw v&&Object.keys(v).length>0&&St(e,n,o,d,v),p}a={...h,versions:{...u,...h.versions}}}Z(e);const l=t.source==="github"?ln(e,n,o,a):a.revision;t.source==="github"&&Dt(e,o,a.versions??{},r.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return Ee(e,o,c),{revision:l,versions:c}}})}function hn(e,t){if(!(e instanceof P))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function gn(e,t,n){if(!(n instanceof P))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&pe(e,t,r,!1)}function vn(e,t,n,o){Z(e),Pn(e,n,o);const r=o.block===null,s=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=i?ee(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=B(n),f=Object.fromEntries(Object.entries(i.changes).filter(([u])=>B(u)!==c));r?l!==null&&(f[n]={kind:"delete",version:null,baseVersion:l}):f[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(g.contentChanges(t),{...i,changes:f,edited:!0})}pe(e,t,n,r&&l===null),e.setQueryData(g.decofile(t),c=>{const f={...c};return r?delete f[n]:f[n]=o.block,f}),Ee(e,t,{[n]:r?null:o.version}),Rn(e,t,n,o)}function As(e,t,n,o){if(t.source!=="github"||!(o instanceof P))return!1;gn(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>hn(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),s.forEach((a,l)=>{vn(e,n,a,i[l])}),!0)}async function Us(e,t,n,o,r,s){t.source==="github"&&gn(e,o,s);const i=t.source==="github"?hn(s,r):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),vn(e,o,r,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const u={...f.changes};return c?.kind?u[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete u[r],{...f,changes:u,edited:!0}})}catch{const l=await te(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ee(e,o,{[r]:a.version}),!1}function Or(e){const t=$.c(17),n=Ce(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=yt(n),t[0]=n,t[1]=o):o=t[1];const r=o;let s;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(s=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=s):s=t[5];let i;t[6]!==e||t[7]!==r?(i=async()=>{const v=await Et(r,e.branch),w=v.pointer?.lastIndexOf("@")??-1;return{draft:v.pointer&&w>0?v.pointer.slice(0,w):null,version:v.pointer&&w>0?v.pointer.slice(w+1):v.etag}},t[6]=e,t[7]=r,t[8]=i):i=t[8];const a=!!e&&!!r;let l;t[9]!==s||t[10]!==i||t[11]!==a?(l={queryKey:s,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=s,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:u}=F(l),d=!!e&&!!r&&f&&!u;if(!e||!c?.draft||!c.version){let v;return t[13]!==d?(v={pointer:null,pending:d},t[13]=d,t[14]=v):v=t[14],v}const h=`${c.draft}@${c.version}`;let p;return t[15]!==h?(p={pointer:h,pending:!1},t[15]=h,t[16]=p):p=t[16],p}function Ms(e){return Or(e).pointer}function Ls(e){const t=$.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Dr,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function Dr(){throw new Error("content revisions are set by reads and writes")}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Fs(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Ke(e,t){const n=$.c(6),{url:o}=Lt(e?.virtualMcpId),r=me(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?xe({...e,protocolSuffix:r.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function Qs(e,t){const n=$.c(46),{url:o}=Lt(e?.virtualMcpId),r=!!o,s=me(e?.virtualMcpId,e?.branch),i=s.kind==="protocol"?s:null,a=Ke(e),l=t?.fetchEnabled??!0,c=Ao(e?.virtualMcpId),f=_t(e?.virtualMcpId).runtime==="cms",u=ne();let d;n[0]!==a?(d=g.decofile(a),n[0]=a,n[1]=d):d=n[1];const h=d;pr(i,i&&e?e:null,a);let p;n[2]!==e||n[3]!==u||n[4]!==h?(p=()=>{if(!e||u.isMutating({mutationKey:we(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const O=u.getQueryState(h);return O?.fetchStatus==="fetching"||Date.now()-(O?.dataUpdatedAt??0)<Ft/2},n[2]=e,n[3]=u,n[4]=h,n[5]=p):p=n[5];let v;n[6]!==f||n[7]!==r||n[8]!==e||n[9]!==i||n[10]!==u||n[11]!==h?(v=async()=>{if(e){if(!i&&f&&!r){const O=So(u,e)?.version;if(O&&!await yo(e,O))return}await u.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=r,n[8]=e,n[9]=i,n[10]=u,n[11]=h,n[12]=v):v=n[12];let w;n[13]!==p||n[14]!==v?(w={skip:p,read:v},n[13]=p,n[14]=v,n[15]=w):w=n[15],To(!!t?.pollWhile&&!!e,w);const _=kt(i?.hosted?a:"");let E;n[16]!==s.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==r||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==u?(E=async()=>{if(i)return(await fn(u,i,e,a)).blocks;if(s.kind==="unavailable")throw gr("decofile");if(r){const k=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Ir),Q=k?.ok?dt(await k.text()):null;if(Q)return Q;const y=new Error("decofile unavailable (local tunnel unreachable)");throw y.status=502,y}if(f)return Oo(u,e);const O=()=>Co(e,po(c,".deco/blocks.gen.json"));if(l){const k=await fetch($o(e),{cache:"no-store"}).catch(_r);if(k?.ok){const V=dt(await k.text());if(V)return V}const Q=await O();if(Q.kind==="data")return Q.data;const y=new Error(`Failed to fetch decofile: ${k?.status??"network error"}`);throw y.status=gt({liveOk:!!k?.ok,liveStatus:k?.status,committedAbsent:Q.kind==="absent"}),y}const M=await O();if(M.kind==="data")return M.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=gt({liveOk:!1,committedAbsent:M.kind==="absent"}),A},n[16]=s.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=r,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=u,n[26]=E):E=n[26];const R=!!e&&s.kind!=="pending",I=i?0:3e4,N=i?.describe.pollIntervalMs,x=i?"always":void 0;let b;n[27]!==f||n[28]!==r||n[29]!==i?(b=(O,M)=>{if(i||f||r)return O<3;const A=M.status;return A!==502&&A!==404&&O<2},n[27]=f,n[28]=r,n[29]=i,n[30]=b):b=n[30];let U;n[31]!==h||n[32]!==E||n[33]!==R||n[34]!==I||n[35]!==N||n[36]!==x||n[37]!==b?(U={queryKey:h,queryFn:E,enabled:R,staleTime:I,refetchInterval:N,refetchIntervalInBackground:!1,refetchOnWindowFocus:x,retry:b,retryDelay:kr},n[31]=h,n[32]=E,n[33]=R,n[34]=I,n[35]=N,n[36]=x,n[37]=b,n[38]=U):U=n[38];const D=F(U);let T;n[39]!==_||n[40]!==D?(T=_&&D.data?$n(_,D.data):void 0,n[39]=_,n[40]=D,n[41]=T):T=n[41];const j=T;let C;return n[42]!==j||n[43]!==i?.hosted||n[44]!==D?(C=i?.hosted&&j?{...D,data:j}:D,n[42]=j,n[43]=i?.hosted,n[44]=D,n[45]=C):C=n[45],C}function kr(e){return jn(5e3,1e3,e,2,0)}function _r(){return null}function Ir(){return null}function Vs(e,t,n){const o=me(e?.virtualMcpId,e?.branch),r=Ke(e),s=o.kind==="protocol"?o.hosted:void 0;return Nn(s,r,t,n)}function Bs(e,t){const n=$.c(3),o=me(e?.virtualMcpId,e?.branch),r=Ke(e),s=kt(o.kind==="protocol"&&o.hosted?r:"");let i;return n[0]!==s?.entries||n[1]!==t?(i=Object.entries(s?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(Tr),n[0]=s?.entries,n[1]=t,n[2]=i):i=n[2],i}function Tr(e){const[t]=e;return t}const Pr="site-editor-save",pn={id:Pr,description:void 0,action:void 0,cancel:void 0},Hs="site-editor-undo",$e="site-editor-publish";function Rr(e){const t=$.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=Y.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=Y.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=Y.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function bn(e,t){return t?Y.jsx(Rr,{label:e("siteEditor.details"),detail:t}):void 0}function Js(e,t,n){K.error(Wt(e,t,n),{...pn,description:bn(e,Uo(t,n))})}function Ws(e,t,n=!1){K.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...pn,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const mn={action:void 0,duration:void 0};function Gs(e,t){K.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...mn,id:$e,description:void 0})}function Ys(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=bn(e,o??null);K[i](t,{id:$e,description:n&&a?Y.jsxs(Y.Fragment,{children:[Y.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),K.loading(s??e("thread.publishPopover.publishing"),{...mn,id:$e,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function zs(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Fs as $,ms as A,xs as B,Kr as C,Or as D,Vs as E,z as F,sr as G,ks as H,Es as I,he as J,zo as K,Xo as L,ds as M,Os as N,gs as O,Ts as P,Is as Q,dr as R,Ke as S,Ct as T,Ls as U,ps as V,bo as W,we as X,fr as Y,jo as Z,mo as _,Xr as a,Br as a0,Jr as a1,Bs as a2,Ws as a3,Ns as a4,fs as a5,Je as a6,us as a7,mr as a8,Ye as a9,gr as aA,ls as aB,ze as aC,As as aD,$e as aE,mn as aF,Gs as aG,Ps as aH,Qr as aI,Vr as aJ,Me as aK,ss as aL,Ms as aM,vs as aN,X as aO,hs as aP,Ys as aQ,Hs as aR,pn as aS,un as aT,bs as aU,cs as aV,ws as aW,Ss as aX,ys as aY,Cs as aa,Us as ab,Js as ac,$s as ad,an as ae,wo as af,is as ag,Rs as ah,js as ai,qr as aj,os as ak,ct as al,lt as am,rs as an,xo as ao,ts as ap,Yn as aq,bn as ar,zs as as,Go as at,Hr as au,Qn as av,Rr as aw,_s as ax,Ds as ay,fn as az,Xn as b,Lt as c,Gn as d,zr as e,zn as f,He as g,Ae as h,xt as i,as as j,Po as k,Qs as l,Zr as m,ns as n,Ao as o,Wr as p,po as q,Yr as r,Gr as s,qo as t,me as u,Ko as v,Jo as w,Co as x,At as y,es as z};
|
|
1
|
+
import{eP as P,eQ as S,c as $,q as ne,i as F,K as g,eR as Ne,aB as wn,aF as Sn,aG as yn,r as L,a as En,at as De,a5 as On,by as yt,eS as Dn,eT as kn,eU as Et,ar as _n,bo as Ot,bh as B,eV as In,eW as Tn,eX as Z,eY as Pn,eZ as Rn,e_ as ue,e$ as xn,f0 as Dt,f1 as kt,f2 as $n,f3 as Nn,a3 as jn,t as K,j as Y}from"./index-DWvRfTwV.js";import{a as _t}from"./input-Lv9puCyJ.js";import{s as et}from"./thread-intent-BONVdhUb.js";import{u as je}from"./agent-capabilities-4Kae1N0E.js";import{b as be}from"./sandbox-url-D3mC8qhT.js";import{s as Cn}from"./utils-B-ZZ1C4f.js";import{u as Ce}from"./repository-binding-CeErFm4l.js";import{u as An}from"./chat-context-yHOaM07v.js";import{i as Un,u as Mn}from"./index-BtlZo3IV.js";import{a as Ln}from"./sandbox-git-api-DcqI6XE4.js";const q="deco-content",ke={major:1},It=1;async function Fn(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const _e={major:ke.major,minor:It},Tt=`the endpoint speaks an older ${q} than this client needs (${_e.major}.${_e.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function re(e,t,n){const o={reason:t,required:{..._e}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new P(S.Unsupported,e,o)}function Pt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==q)throw re(`the endpoint speaks ${JSON.stringify(n)}, not ${q}`,"protocol",t);if(o?.major!==ke.major)throw re(`the endpoint speaks ${q} ${String(o?.major)}.x; this client speaks ${ke.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<It)throw re(Tt,"outdated",t);return e}function tt(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?re(Tt,"outdated"):P.from(t)}function Ae(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let l;try{l=await Fn(a)}catch{throw new P(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?P.from(c):new P(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw tt(s,l.error);return l.result};return{call:r,describe:async()=>Pt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,f)=>({jsonrpc:"2.0",id:i[f],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,f)=>{const u=l.get(c);return u?u.error?{ok:!1,error:tt(s[f].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new P(S.InternalError,"no response for this call")}})}}}function Ue(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const nt=20,ot=5,rt=500;function Me(e){return e instanceof P?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function fe(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Qn(e,t,n){const o=g.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(Ue(r)),i=fe(r,s);if(i)return i;const a=await t.changesList({});return fe(void 0,a)}async function Rt(e,t){const n=[];for(let s=0;s<t.length;s+=nt)n.push(t.slice(s,s+nt));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=ot){const i=await e.batch(n.slice(s,s+ot).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Qr(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=rt){const r=t.slice(o,o+rt),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Vr(e){return e instanceof P&&e.code===S.Conflict}function Le(e){return e?.kind==="protocol"?e:null}function Br(e,t,n){const o=$.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=ne();let a;o[2]!==e?(a=Le(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let f;o[4]!==t?(f=g.contentChanges(t??""),o[4]=t,o[5]=f):f=o[5];let u;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(u=c?()=>Qn(i,l.client,t):Ne,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=u):u=o[10];let d;return o[11]!==f||o[12]!==u?(d={queryKey:f,queryFn:u,staleTime:0},o[11]=f,o[12]=u,o[13]=d):d=o[13],F(d)}function Hr(e,t,n){const o=$.c(14);let r;o[0]!==e?(r=Le(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=g.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let f;o[7]!==l||o[8]!==a||o[9]!==s?(f=l?()=>Rt(s.client,a):Ne,o[7]=l,o[8]=a,o[9]=s,o[10]=f):f=o[10];let u;return o[11]!==c||o[12]!==f?(u={queryKey:c,queryFn:f,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=f,o[13]=u):u=o[13],F(u)}function Jr(e,t,n){const o=$.c(16);let r;o[0]!==e?(r=Le(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,l,c;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const d=Object.entries(n?.changes??{}).filter(Wn).map(Jn).sort(Hn);a=d.map(Bn);const h=JSON.stringify(d.map(Vn));i=!!s&&!!t&&a.length>0,c=F,l=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=l,o[8]=c}else i=o[5],a=o[6],l=o[7],c=o[8];let f;o[9]!==i||o[10]!==a||o[11]!==s?(f=i?async()=>{const d=await Rt(s.client,a),h=Object.create(null);for(const[p,v]of Object.entries(d.entries))h[p]=v.before&&typeof v.before=="object"?v.before:null;return h}:Ne,o[9]=i,o[10]=a,o[11]=s,o[12]=f):f=o[12];let u;return o[13]!==l||o[14]!==f?(u={queryKey:l,queryFn:f,staleTime:Number.POSITIVE_INFINITY,placeholderData:wn},o[13]=l,o[14]=f,o[15]=u):u=o[15],c(u)}function Vn(e){return[e.name,e.base]}function Bn(e){return e.name}function Hn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function Jn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function Wn(e){const[,t]=e;return t.kind==="delete"}function xt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function de(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const $t=Sn({endpoint:yn().max(2048).refine(e=>xt(e)&&new URL(e).pathname==="/rpc").transform(de)});function Wr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=$t.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function Nt(e){const t=$t.safeParse(e);return t.success?t.data:null}const jt="studio:deco-serve-last";function Gr(e){try{localStorage.setItem(jt,JSON.stringify(e))}catch{}}function Yr(){try{const e=localStorage.getItem(jt);return e?Nt(JSON.parse(e)):null}catch{return null}}function zr(e){try{return new URL(de(e)).host}catch{return e}}function Gn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Yn="http://localhost:4545/rpc";class Fe extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Fe)return{reason:"not-deco-serve"};if(!(e instanceof P))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Me(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Xr(e,t){if(e)return[de(e.endpoint)];const n=[t?.endpoint,Yn].filter(o=>!!o).map(de);return[...new Set(n)]}const Ct=L.createContext(null);function Xn(e){const t=$.c(24),n=L.useContext(Ct),o=je(n?null:e),{data:r}=En.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?De.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=it(a);let f;t[4]!==i||t[5]!==s||t[6]!==e?(f=i?De.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=f):f=t[7];const[u,d]=it(f);if(n)return n;let h;t[8]!==l||t[9]!==i||t[10]!==o?(h=i&&o?Nt(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=h):h=t[11];const p=h,v=i&&o&&typeof u=="string"?u:null;let w;t[12]!==d||t[13]!==c||t[14]!==i?(w=R=>{i&&(c(R),d(R.endpoint))},t[12]=d,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let E;return t[19]!==p||t[20]!==v||t[21]!==w||t[22]!==_?(E={connection:p,lastEndpoint:v,set:w,clear:_},t[19]=p,t[20]=v,t[21]=w,t[22]=_,t[23]=E):E=t[23],E}function st(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function it(e){const t=$.c(17),n=ne(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?st(e):null,a=()=>e?st(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=v=>{if(e){try{v===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(v))}catch{}n.setQueryData(s,v)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const d=u,h=e?f??null:null;let p;return t[14]!==d||t[15]!==h?(p=[h,d],t[14]=d,t[15]=h,t[16]=p):p=t[16],p}function Zr(e){return e.kind==="protocol"||e.kind==="unavailable"}function qr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function Kr(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function es(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&xt(t)?t:null}function ts(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function At(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function Zn(e){if(!e.hasProject)return"legacy";const t=At(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function qn(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function at(e){return e.isError||e.errorUpdateCount>0}function Kn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function eo(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const Ut="__noSchema";function Mt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ut]:!0}}function ns(e){return!!e&&e[Ut]===!0}function Qe(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function to(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const no=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function os(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:to(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(no)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:ct(n.resolveType).localeCompare(ct(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function ct(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function lt(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=lt(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?lt(s[a],r,n):s[a];return i}return e}function rs(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ut extends Error{}const Ve="site-not-owned";async function oo(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function ro(e,t=n=>fetch(n)){const n=Ae({endpoint:e,fetch:async o=>{const r=await t(o);if(await oo(r))throw new ut;return r}});try{return await He(n)}catch(o){if(o instanceof ut)return Ve;throw o}}async function so(e,t,n){await t();const o=await ro(e,n);return o===Ve?o:{...o,hosted:Dn(e,n)}}const Be=5e3;function io(e){if(!e.site)throw new Error("this project names no site");return kn(e.site,e.branch)}function ao(e){return new URL(be(e,"rpc"),window.location.origin).href}async function He(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==q)throw new Fe;const r=Pt(t.result);if(!n)throw new Error("no schema.get");if(Qe(n))return{client:e,describe:r,hasSchema:!1};if(n.ok)return{client:e,describe:r,hasSchema:!0};throw n.error}function co(e,t=n=>fetch(n)){return He(Ae({endpoint:e,fetch:t}))}function me(e,t){const n=$.c(50),{org:o}=On(),{connection:r}=Xn(e),{runtime:s}=_t(e),i=L.useContext(Ct),a=je(e),l=yt(Ce(e)?.metadata),c=At({hasServeConnection:!!r,runtime:s}),f=An()?.taskId??null,u=Un(Mn().lifecycle.phase),d=ne(),h=qn({mode:c,v8:a,workingTreeReady:u}),p=h.github&&!!o.slug&&!!e&&!!t,v=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>so(io({orgSlug:o.slug,site:l,branch:t}),()=>Et(l,t)),enabled:p,staleTime:Number.POSITIVE_INFINITY,...ft}),w=h.sandbox&&!!o.slug&&!!e&&!!t;let _;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(_=()=>co(ao({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=_):_=n[4];const E=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:_,enabled:w,staleTime:Number.POSITIVE_INFINITY,...ft}),R=!!r;let I;n[5]!==r?.endpoint||n[6]!==o.slug||n[7]!==e?(I=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[5]=r?.endpoint,n[6]=o.slug,n[7]=e,n[8]=I):I=n[8];let N;n[9]!==r?(N=()=>He(Ae({endpoint:r.endpoint})),n[9]=r,n[10]=N):N=n[10];let x;n[11]!==R||n[12]!==I||n[13]!==N?(x={queryKey:I,queryFn:N,enabled:R,staleTime:Number.POSITIVE_INFINITY,retry:fo,retryDelay:uo,refetchInterval:lo},n[11]=R,n[12]=I,n[13]=N,n[14]=x):x=n[14];const b=F(x);let U;n[15]!==r?.endpoint||n[16]!==o.slug||n[17]!==e?(U=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[15]=r?.endpoint,n[16]=o.slug,n[17]=e,n[18]=U):U=n[18];const D=U;let T;n[19]!==r?.endpoint||n[20]!==o.slug||n[21]!==e?(T=g.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[19]=r?.endpoint,n[20]=o.slug,n[21]=e,n[22]=T):T=n[22];let j;n[23]!==b.data||n[24]!==D||n[25]!==d?(j=async()=>{try{return await b.data.client.describe()}catch(m){const J=m;throw d.invalidateQueries({queryKey:D,exact:!0},{cancelRefetch:!1}),J}},n[23]=b.data,n[24]=D,n[25]=d,n[26]=j):j=n[26];const C=!!b.data&&!i;let O;n[27]!==T||n[28]!==j||n[29]!==C?(O={queryKey:T,queryFn:j,enabled:C,refetchInterval:Be,retry:!1},n[27]=T,n[28]=j,n[29]=C,n[30]=O):O=n[30];const A=F(O).data??b.data?.describe,k=Zn({hasProject:!!e,hasServeConnection:!!r,runtime:s,v8:a,githubSite:v.data===Ve?"not-owned":v.data?"ready":at(v)?"error":"loading",sandboxSite:ho({data:E.data,isError:at(E),workingTreeReady:u})});if(k==="pending"){let m;return n[31]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[31]=m):m=n[31],m}if(k==="retrying-sandbox"){let m;return n[32]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[32]=m):m=n[32],m}if(k==="legacy"){let m;return n[33]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[33]=m):m=n[33],m}if(k==="protocol-github"){const m=v.data;let J;n[34]!==m?(J=Ie("github",m,""),n[34]=m,n[35]=J):J=n[35];let oe;return n[36]!==l||n[37]!==J?(oe={...J,site:l},n[36]=l,n[37]=J,n[38]=oe):oe=n[38],oe}if(k==="site-not-owned-github"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[39]=m):m=n[39],m}if(k==="protocol-sandbox"){let m;return n[40]!==E.data?(m=Ie("sandbox",E.data,":sandbox"),n[40]=E.data,n[41]=m):m=n[41],m}if(k==="unavailable-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[42]=m):m=n[42],m}const Q=b.error??b.failureReason,y=r?.endpoint??"";let V;return n[43]!==A||n[44]!==b.data||n[45]!==b.failureCount||n[46]!==b.isError||n[47]!==y||n[48]!==Q?(V=vo({probed:b.data,isError:b.isError,failureCount:b.failureCount,failure:Q,describe:A,endpoint:y}),n[43]=A,n[44]=b.data,n[45]=b.failureCount,n[46]=b.isError,n[47]=y,n[48]=Q,n[49]=V):V=n[49],V}function lo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Be:!1}function uo(e){return Gn(e+1)}function fo(e,t){return!(t instanceof P)&&!(t instanceof Fe)}function ho(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const go=3;function vo(e){const t=e.probed?Ie("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<go?t:{kind:"unavailable",source:"local",problem:zn(e.failure)}:t??{kind:"pending"}}const ft={retry:2,refetchInterval:e=>e.state.status==="error"?Be:!1};function Ie(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function Lt(e){const t=$.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=_n(o,null),i=je(e);let a;t[2]!==r||t[3]!==e?(a=e?et(r):null,t[2]=r,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,u;t[5]!==s?(f=h=>s(et(h)),u=()=>s(null),t[5]=s,t[6]=f,t[7]=u):(f=t[6],u=t[7]);let d;return t[8]!==c||t[9]!==f||t[10]!==u?(d={url:c,setUrl:f,clear:u},t[8]=c,t[9]=f,t[10]=u,t[11]=d):d=t[11],d}function po(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function dt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function we(e,t,n){return["decofile-write",e,t,n]}function bo(e,t,n){return{id:we(e,t,n).join(":")}}class Je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function We(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ge(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function mo(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function wo(e,t,n){e.setQueryData(g.decofileDraft(We(t)),n)}function So(e,t){return e.getQueryData(g.decofileDraft(We(t)))??null}async function yo(e,t){return(await fetch(Ge(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function ss(e){const t=$.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?We(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Eo,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Eo(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Oo(e,t){const n=await fetch(Ge(t),{cache:"no-store"});if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&wo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function is(e,t){const n=await fetch(Ge(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return mo(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ft=3e3,Do=15e3,ko=2*6e4,Qt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function _o(e){return e<ko?Ft:Do}function Io(e,t=Qt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,_o(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const ht=()=>0;function To(e,t,n=Qt){const o=L.useRef(t);o.current=t;const[r]=L.useState(()=>({polling:()=>Io(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?r.polling:r.idle,ht,ht)}function Vt(e,t){return be(e,t)}function Po(e,t){return be(e,"preview-fetch",{path:t})}function as(e){return Vt(e,"preview-invoke")}function cs(e){return Vt(e,"catalog-invoke")}function Bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function Ro(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&Bt(n))return n}return null}function xo(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Ro();return n&&Bt(n)?new URL(t,n).toString():Po(e,t)}function $o(e){return xo(e,"/.decofile")}function No(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function gt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function jo(e,t){const n=be(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=No(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Cn(s.content)}}async function Co(e,t){const n=await jo(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function ls(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Ao(e){return Ce(e)?.metadata?.runtime?.path??null}class Ht extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function us(e){return e instanceof P&&e.code===S.Conflict}function Jt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class Ye extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class ze extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function fs(e,t){return(t instanceof Ye||t instanceof ze)&&(t.message=Wt(e,t,"github")),t}function Wt(e,t,n){if(t instanceof Ye)return e("siteEditor.save.draftUnread");if(t instanceof ze)return e("siteEditor.save.keptChanging");if(t instanceof Je)return t.message;if(n==="local")return Mo(e,t);if(t instanceof P)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Uo(e,t){if(t==="local"||e instanceof Je||e instanceof Ye||e instanceof ze)return null;if(e instanceof P){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Jt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Mo(e,t){if(t instanceof Ht)return e("decoServe.save.serverGone");if(t instanceof P)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Jt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Lo(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Fo(e,t){const[n,o]=L.useState(e),r=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Lo(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const Qo="decocms:content-writes",Te=new Set;let G;function Gt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(Qo),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function Vo(e){try{Gt()?.postMessage({cacheKey:e})}catch{}}function Bo(e){return Gt(),Te.add(e),()=>{Te.delete(e)}}const Yt="__at=",zt="__test=",Ho=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Jo(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function X(e){return typeof e=="string"&&Ho.test(e)}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Wo(e){const t=e.tests??{};return[...e.at!==void 0?[Yt+vt(e.at)]:[],...Object.keys(t).map(n=>zt+vt(`${n}=${t[n]?"on":"off"}`))]}function pt(e,t){const o=[...e.split("&").filter(r=>r&&!r.startsWith(Yt)&&!r.startsWith(zt)),...t];return o.length>0?`?${o.join("&")}`:""}function he(e,t){const n=Wo(t),o=e.indexOf("?"),r=o===-1?e:e.slice(0,o);if(X(r))return r+pt(o===-1?"":e.slice(o+1),n);const s=e.lastIndexOf("@");if(s<=0)return e;const i=e.slice(0,s),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${pt(c,n)}${e.slice(s)}`}function ds(e,t,n){if(!Jo(t))return e;try{const o=new URL(e),r=o.searchParams.get("__draft");return r&&r!=="off"?(o.searchParams.set("__draft",he(r,t)),o.toString()):X(n)?(o.searchParams.set("__draft",he(n,t)),o.toString()):e}catch{return e}}function hs(e,t,n="/"){if(!e||!X(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function Xt(e){return btoa(encodeURIComponent(e))}function gs(e,t,n){const o=Go(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function Go(e,t,n){const o=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return r.searchParams.set("path","/"),r.searchParams.set("pathTemplate","/"),r.searchParams.set("props",Xt(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),r}const Yo="__draft";function vs(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const zo="off";function Xo(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Yo,t),n.toString()}function ps(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:r,...s}=e.pageBlock,i=JSON.stringify({__props:s,__decofile:e.decofile});return{src:o.toString(),body:i}}function bs(e,t,n,o){const r=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,r);s.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),s.searchParams.set("props",Xt(JSON.stringify({sections:i}))),s.toString()}function ms(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const bt="__variant=";function Zt(e,t,n){return`${e}@${t}=${n}`}function ws(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[Zt(e,"sections",t.index)]}function Ss(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[Zt(e.pageKey,o,e.selectedVariantIndex)]}function ys(e,t){return[...t,...e]}function Zo(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Xe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),r=o.indexOf("?"),s=r===-1?o:o.slice(0,r),a=[...r===-1?[]:o.slice(r+1).split("&").filter(c=>c&&!c.startsWith(bt)),...t.map(c=>bt+Zo(c))],l=a.length>0?`?${a.join("&")}`:"";return`${s}${l}${e.slice(n)}`}function Es(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),r=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return Xe(`${r}${o.pathname}@local`,t)}catch{return null}}function Os(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",Xe(o,t)),n.toString())}catch{return e}}function qo(e){const{pointer:t}=e;if(!t||t===zo)return null;const n=t.indexOf("?");return X(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:X(e.heldRevision)&&e.forcedVariants.length===0?he(e.heldRevision,e.previewOptions):he(Xe(t,e.forcedVariants),e.previewOptions)}function Ko(e,t){if(!e||!t)return null;try{return Xo(e,t)}catch{return null}}function Ds(e,t,n){if(!e||!n)return null;try{return Ko(new URL(t,e).toString(),n)}catch{return null}}const ge={forcedVariants:[],previewOptions:{}},se=new Map,ie=new Map,Pe=new Map;function qt(e){for(const t of Pe.get(e)??[])t()}function Kt(e,t){const n=X(t)?t:null;(ie.get(e)??null)!==n&&(n?ie.set(e,n):ie.delete(e),qt(e))}function er(e){return ie.get(e)??null}function tr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ks(e,t){const n=se.get(e)??ge,o=t??ge;tr(n,o)||(t?se.set(e,o):se.delete(e),qt(e))}function nr(e){return se.get(e)??ge}function en(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function or(e){const t=$.c(3);let n,o;return t[0]!==e?(n=r=>en(e,r),o=()=>nr(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,rr)}function rr(){return ge}function sr(e){const t=$.c(3);let n,o;return t[0]!==e?(n=r=>e?en(e,r):ar,o=()=>e?er(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,ir)}function ir(){return null}function ar(){}function _s(e,t){const n=$.c(4),o=or(e),r=sr(e);let s;return n[0]!==o||n[1]!==r||n[2]!==t?(s=qo({pointer:t,heldRevision:r,...o}),n[0]=o,n[1]=r,n[2]=t,n[3]=s):s=n[3],s}const tn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},cr=15e3,ve=new Map;function z(e,t){return`${e}/${t}`}function H(e){let t=ve.get(e);return t||(t={state:tn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ve.set(e,t)),t}function W(e,t){const n=H(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Ze(e){return ve.get(e)?.state??tn}function lr(e,t){const n=H(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Is(e){const t=H(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),W(e,{phase:"idle"}))}}function Ts(e){const t=ve.get(e);!t||t.state.phase!=="reloading"||(Se(t),W(e,{phase:"idle"}))}function nn(e){const t=H(e);Se(t),W(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ae(e,t){const n=H(e),o=Math.max(0,n.state.inFlight-1);if(o>0){W(e,{inFlight:o});return}if(!t.ok||n.previews===0){W(e,{phase:"idle",inFlight:o});return}on(e,t.navigates,o)}function on(e,t,n=0){const o=H(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&W(e,{phase:"idle"})},cr),W(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function ur(e){return e?.kind==="protocol"&&e.source==="github"}async function ce(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?g.protocolDraftRead(o,r,s):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,u=l?[l]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&u.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Ln(o,r,s)})),ur(i)&&c&&!t.adopted&&u.push(n.invalidateQueries({queryKey:c})),await Promise.all(u),t.kind!=="edit"){const p=z(o,r);W(p,{epoch:Ze(p).epoch+1})}const d=c?JSON.stringify(n.getQueryData(c)??null):null,h=f!==d;return h&&await new Promise(p=>Ot.schedule(p)),{navigates:h}}async function fr(e,t){return nn(z(e.orgSlug,e.virtualMcpId)),rn(e,t)}function mt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function rn(e,t){const n=z(e.orgSlug,e.virtualMcpId),o=t.adopted?mt(e):null;let r;try{r=await t.write()}catch(i){throw ae(n,{ok:!1,navigates:!1}),t.refreshOnError&&ce(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&Vo(e.cacheKey),Kt(n,t.shownRevision?.(r)??null),t.adopted){const i=mt(e)!==o;return i&&await new Promise(a=>Ot.schedule(a)),ae(n,{ok:!0,navigates:i}),t.reread&&ce(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await ce(e,t))}catch{}finally{ae(n,{ok:!0,navigates:s})}return r}function Ps(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=z(o,r),a=new Set(t.blockKeys);for(const f of[...H(i).discardListeners])f(a);nn(i);let l=!1;const c=()=>(l=!0,rn(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:we(o,r,s),scope:bo(o,r,s),mutationFn:c}).execute(void 0).catch(f=>{throw l||ae(i,{ok:!1,navigates:!1}),f}):c()}function Rs(e,t,n){const o=$.c(8);let r;o[0]!==e||o[1]!==t?(r=z(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=H(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],L.useEffect(i,a)}function sn(e){const t=z(e.orgSlug,e.virtualMcpId);Ze(t).inFlight>0||(Kt(t,null),ce(e,{kind:"external"}).then(({navigates:n})=>{const o=H(t);o.previews>0&&o.state.inFlight===0&&on(t,n)}).catch(()=>{}))}function dr(e,t){const n=$.c(7);let o;n[0]!==e||n[1]!==t?(o=z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>lr(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Ze(r),n[5]=r,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const hr=500;function xs(e,t){const{phase:n}=dr(e,t);return Fo(n!=="idle",hr)}function gr(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function an(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function $s(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Tn(i,n):vr(e,t,n)}const r=e.getQueryData(g.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(g.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function ee(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(r=>B(r)===n);return o===void 0?void 0:e.changes[o]}function vr(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return cn(o,ye(e,t),n)}function cn(e,t,n){const o=ee(e,n);return o?.kind==="delete"?o.version??ue:o?o.version:t.has(B(n))?ue:null}function Ns(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const r=ee(o,n);return r?r.kind==="set"&&r.baseVersion===null:ye(e,t).has(B(n))}function js(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const r=ye(e,t);return{blocks:n,versionOf:s=>cn(o,r,s)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const r=B(n),s=ye(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),Z(e),e.setQueryData(g.contentDraftTombstones(t),[...s]))}function ln(e,t,n,o){const r=o.revision,s=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===ue?null:d]),a=e.getQueryData(g.contentChanges(n)),l=new Set(i.flatMap(([u])=>{const d=a?ee(a,u):void 0;return(d?d.baseVersion:s?.[u]??null)===null?[u]:[]})),c=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[h,p]of i){const v=ee(u,h),w=v?v.baseVersion:s?.[h]??null;p!==null?d[h]={kind:"set",version:p,baseVersion:w}:w!==null?d[h]={kind:"delete",version:null,baseVersion:w}:delete d[h]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?pe(e,n,u,!1):!c.has(B(u))&&l.has(u)&&pe(e,n,u,!0);const f=o.revision;return f&&f!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:f}),r}function Ee(e,t,n){Z(e),e.setQueryData(g.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function un(e,t){const n=e.getMutationCache().findAll({mutationKey:we(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>eo(o.state.variables)))}function Re(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof P);throw t.source==="local"&&s?(Re(e,n),new Ht(r)):(t.source==="local"&&Me(r)&&Re(e,n),r)}}const le=new Map;function fn(e,t,n,o){const r=le.get(o);if(r)return r;const s=qe(e,t,n,o,!0);return le.set(o,s),s.finally(()=>le.delete(o))}const Oe=new Set;function pr(e,t,n){const o=$.c(8),r=ne(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const f={orgSlug:s,virtualMcpId:i,branch:a};return Bo(u=>{u===n&&(Oe.has(n)||(Oe.add(n),mr(r,e,f,n).catch(br).finally(()=>Oe.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function br(){}async function mr(e,t,n,o){const r=le.get(o);return r&&await r.catch(()=>{}),fn(e,t,n,o)}async function qe(e,t,n,o,r){Z(e);const s=g.decofile(o),i=an(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(s),f=e.getQueryData(l),d=e.getQueryData(i),h=e.getQueryData(a)??void 0,p=r&&c&&f?h?.revision:void 0,v=r&&d?h?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return wr(e,t,t.hosted,n,o,{conditional:r,seen:h,currentMeta:d,schemaIfNoneMatch:v,seenChanges:_});const[E,R,I]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:p?{ifNoneMatch:p}:{}},{method:"schema.get",params:v?{ifNoneMatch:v}:{}},{method:"changes.list",params:Ue(_)}])),N=e.getQueryData(a)?.revision,x=N!==void 0&&N!==h?.revision;if(I?.ok){const O=x?null:fe(_,I.result);O&&e.setQueryData(w,O)}else I&&t.source==="local"&&Me(I.error)&&Re(e,n);if(!E?.ok)throw E?.error??new Error("no blocks.list");if(!R)throw new Error("no schema.get");const b=E.result,U=Qe(R),D=R.ok&&!U?R.result:null;if(b.notModified&&(!c||!f)||D?.notModified&&!d)return qe(e,t,n,o,!1);const T=b.notModified?new Set:un(e,n),j=b.notModified?c:Kn(b.blocks,c,T),C=U?Mt():D?D.notModified?d:D.schema:R.error;if(e.setQueryData(a,{revision:x?N:b.notModified?h?.revision:b.revision,schemaVersion:D?D.notModified?h?.schemaVersion:D.version??void 0:void 0}),e.setQueryData(s,j),!b.notModified){const O=e.getQueryData(l),M={...b.versions};for(const A of T){const k=O?.[A];k!==void 0?M[A]=k:delete M[A]}e.setQueryData(l,M)}return C instanceof P||e.setQueryData(i,C),!x&&!b.notModified&&c&&h?.revision&&b.revision!==h.revision&&sn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:C}}async function wr(e,t,n,o,r,s){const i=g.decofile(r),a=g.contentIndex(r),l=g.contentRevision(r),c=g.contentVersions(r),f=an(o,t),u=g.contentChanges(r),d=e.getQueryData(a),h=s.conditional&&d?s.seen?.revision:void 0,[p,v,w]=await te(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:s.schemaIfNoneMatch?{ifNoneMatch:s.schemaIfNoneMatch}:{}},{method:"changes.list",params:Ue(s.seenChanges)}])),_=e.getQueryData(a)??d,E=e.getQueryData(l)?.revision,R=E!==void 0&&E!==s.seen?.revision;if(w?.ok&&!R){const y=fe(s.seenChanges,w.result);y&&e.setQueryData(u,y)}if(!p?.ok)throw p?.error??new Error("no cms.index");if(!v)throw new Error("no schema.get");const I=p.result,N=Qe(v),x=v.ok&&!N?v.result:null;if(I.notModified&&!d||x?.notModified&&!s.currentMeta)return qe(e,t,o,r,!1);const b=N?Mt():x?x.notModified?s.currentMeta:x.schema:v.error;b instanceof P||e.setQueryData(f,b);const U=x?x.notModified?s.seen?.schemaVersion:x.version??void 0:void 0,D=e.getQueryData(i)??{};if(I.notModified||R)return e.setQueryData(l,{revision:R?E:s.seen?.revision,schemaVersion:U}),e.setQueryData(i,D),{blocks:D,meta:b};const T={revision:I.revision,resolvedRef:I.resolvedRef,sequence:I.sequence,entries:I.entries,draft:I.draft};e.setQueryData(a,T);const j=!!s.seen?.revision&&T.revision!==s.seen.revision&&(!s.seen.revision.startsWith("s-")||!!d&&dn(d.draft,T.draft));j&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),y=>y&&{...y,version:T.revision}),e.setQueryData(l,{revision:T.revision,schemaVersion:U});const C=un(e,o),O=e.getQueryData(c)??{},M={},A={},k=[];for(const[y,V]of Object.entries(D)){const m=T.entries[y];!m&&!C.has(y)||(M[y]=V,O[y]!==void 0&&(A[y]=O[y]),m&&!C.has(y)&&O[y]!==m.version&&k.push(y))}return e.setQueryData(i,M),e.setQueryData(c,A),k.length>0&&await xn(e,n,r,k,C),_&&j&&Sr(_,T)&&sn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:r}),{blocks:e.getQueryData(i)??M,meta:b}}function Sr(e,t){if(dn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function dn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function yr(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function wt(e){if(!(e instanceof P)||e.code!==S.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}function Er(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([r])=>!Object.hasOwn(t,r))),o=(e.delete??[]).filter(r=>!Object.hasOwn(t,r));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function St(e,t,n,o,r){Z(e),ln(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:r}),Ee(e,n,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,i===ue?null:i]))),Dt(e,n,r,o.set??{})}async function Cs(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(c=>!s||!Object.hasOwn(s,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=In(r.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return fr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=f=>te(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...s?{ifMatch:yr(s,f)}:{}}));let a;try{a=await i(r)}catch(f){const u=t.source==="github"?wt(f):void 0;if(!u)throw f;const d=Er(r,u);Object.keys(u).length>0&&St(e,n,o,r,u);let h;try{h=await i(d)}catch(p){const v=wt(p);throw v&&Object.keys(v).length>0&&St(e,n,o,d,v),p}a={...h,versions:{...u,...h.versions}}}Z(e);const l=t.source==="github"?ln(e,n,o,a):a.revision;t.source==="github"&&Dt(e,o,a.versions??{},r.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return Ee(e,o,c),{revision:l,versions:c}}})}function hn(e,t){if(!(e instanceof P))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function gn(e,t,n){if(!(n instanceof P))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&pe(e,t,r,!1)}function vn(e,t,n,o){Z(e),Pn(e,n,o);const r=o.block===null,s=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=i?ee(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=B(n),f=Object.fromEntries(Object.entries(i.changes).filter(([u])=>B(u)!==c));r?l!==null&&(f[n]={kind:"delete",version:null,baseVersion:l}):f[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(g.contentChanges(t),{...i,changes:f,edited:!0})}pe(e,t,n,r&&l===null),e.setQueryData(g.decofile(t),c=>{const f={...c};return r?delete f[n]:f[n]=o.block,f}),Ee(e,t,{[n]:r?null:o.version}),Rn(e,t,n,o)}function As(e,t,n,o){if(t.source!=="github"||!(o instanceof P))return!1;gn(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>hn(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),s.forEach((a,l)=>{vn(e,n,a,i[l])}),!0)}async function Us(e,t,n,o,r,s){t.source==="github"&&gn(e,o,s);const i=t.source==="github"?hn(s,r):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),vn(e,o,r,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const u={...f.changes};return c?.kind?u[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete u[r],{...f,changes:u,edited:!0}})}catch{const l=await te(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ee(e,o,{[r]:a.version}),!1}function Or(e){const t=$.c(17),n=Ce(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=yt(n),t[0]=n,t[1]=o):o=t[1];const r=o;let s;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(s=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=s):s=t[5];let i;t[6]!==e||t[7]!==r?(i=async()=>{const v=await Et(r,e.branch),w=v.pointer?.lastIndexOf("@")??-1;return{draft:v.pointer&&w>0?v.pointer.slice(0,w):null,version:v.pointer&&w>0?v.pointer.slice(w+1):v.etag}},t[6]=e,t[7]=r,t[8]=i):i=t[8];const a=!!e&&!!r;let l;t[9]!==s||t[10]!==i||t[11]!==a?(l={queryKey:s,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=s,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:u}=F(l),d=!!e&&!!r&&f&&!u;if(!e||!c?.draft||!c.version){let v;return t[13]!==d?(v={pointer:null,pending:d},t[13]=d,t[14]=v):v=t[14],v}const h=`${c.draft}@${c.version}`;let p;return t[15]!==h?(p={pointer:h,pending:!1},t[15]=h,t[16]=p):p=t[16],p}function Ms(e){return Or(e).pointer}function Ls(e){const t=$.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Dr,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function Dr(){throw new Error("content revisions are set by reads and writes")}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Fs(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Ke(e,t){const n=$.c(6),{url:o}=Lt(e?.virtualMcpId),r=me(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?xe({...e,protocolSuffix:r.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function Qs(e,t){const n=$.c(46),{url:o}=Lt(e?.virtualMcpId),r=!!o,s=me(e?.virtualMcpId,e?.branch),i=s.kind==="protocol"?s:null,a=Ke(e),l=t?.fetchEnabled??!0,c=Ao(e?.virtualMcpId),f=_t(e?.virtualMcpId).runtime==="cms",u=ne();let d;n[0]!==a?(d=g.decofile(a),n[0]=a,n[1]=d):d=n[1];const h=d;pr(i,i&&e?e:null,a);let p;n[2]!==e||n[3]!==u||n[4]!==h?(p=()=>{if(!e||u.isMutating({mutationKey:we(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const O=u.getQueryState(h);return O?.fetchStatus==="fetching"||Date.now()-(O?.dataUpdatedAt??0)<Ft/2},n[2]=e,n[3]=u,n[4]=h,n[5]=p):p=n[5];let v;n[6]!==f||n[7]!==r||n[8]!==e||n[9]!==i||n[10]!==u||n[11]!==h?(v=async()=>{if(e){if(!i&&f&&!r){const O=So(u,e)?.version;if(O&&!await yo(e,O))return}await u.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=r,n[8]=e,n[9]=i,n[10]=u,n[11]=h,n[12]=v):v=n[12];let w;n[13]!==p||n[14]!==v?(w={skip:p,read:v},n[13]=p,n[14]=v,n[15]=w):w=n[15],To(!!t?.pollWhile&&!!e,w);const _=kt(i?.hosted?a:"");let E;n[16]!==s.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==r||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==u?(E=async()=>{if(i)return(await fn(u,i,e,a)).blocks;if(s.kind==="unavailable")throw gr("decofile");if(r){const k=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Ir),Q=k?.ok?dt(await k.text()):null;if(Q)return Q;const y=new Error("decofile unavailable (local tunnel unreachable)");throw y.status=502,y}if(f)return Oo(u,e);const O=()=>Co(e,po(c,".deco/blocks.gen.json"));if(l){const k=await fetch($o(e),{cache:"no-store"}).catch(_r);if(k?.ok){const V=dt(await k.text());if(V)return V}const Q=await O();if(Q.kind==="data")return Q.data;const y=new Error(`Failed to fetch decofile: ${k?.status??"network error"}`);throw y.status=gt({liveOk:!!k?.ok,liveStatus:k?.status,committedAbsent:Q.kind==="absent"}),y}const M=await O();if(M.kind==="data")return M.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=gt({liveOk:!1,committedAbsent:M.kind==="absent"}),A},n[16]=s.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=r,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=u,n[26]=E):E=n[26];const R=!!e&&s.kind!=="pending",I=i?0:3e4,N=i?.describe.pollIntervalMs,x=i?"always":void 0;let b;n[27]!==f||n[28]!==r||n[29]!==i?(b=(O,M)=>{if(i||f||r)return O<3;const A=M.status;return A!==502&&A!==404&&O<2},n[27]=f,n[28]=r,n[29]=i,n[30]=b):b=n[30];let U;n[31]!==h||n[32]!==E||n[33]!==R||n[34]!==I||n[35]!==N||n[36]!==x||n[37]!==b?(U={queryKey:h,queryFn:E,enabled:R,staleTime:I,refetchInterval:N,refetchIntervalInBackground:!1,refetchOnWindowFocus:x,retry:b,retryDelay:kr},n[31]=h,n[32]=E,n[33]=R,n[34]=I,n[35]=N,n[36]=x,n[37]=b,n[38]=U):U=n[38];const D=F(U);let T;n[39]!==_||n[40]!==D?(T=_&&D.data?$n(_,D.data):void 0,n[39]=_,n[40]=D,n[41]=T):T=n[41];const j=T;let C;return n[42]!==j||n[43]!==i?.hosted||n[44]!==D?(C=i?.hosted&&j?{...D,data:j}:D,n[42]=j,n[43]=i?.hosted,n[44]=D,n[45]=C):C=n[45],C}function kr(e){return jn(5e3,1e3,e,2,0)}function _r(){return null}function Ir(){return null}function Vs(e,t,n){const o=me(e?.virtualMcpId,e?.branch),r=Ke(e),s=o.kind==="protocol"?o.hosted:void 0;return Nn(s,r,t,n)}function Bs(e,t){const n=$.c(3),o=me(e?.virtualMcpId,e?.branch),r=Ke(e),s=kt(o.kind==="protocol"&&o.hosted?r:"");let i;return n[0]!==s?.entries||n[1]!==t?(i=Object.entries(s?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(Tr),n[0]=s?.entries,n[1]=t,n[2]=i):i=n[2],i}function Tr(e){const[t]=e;return t}const Pr="site-editor-save",pn={id:Pr,description:void 0,action:void 0,cancel:void 0},Hs="site-editor-undo",$e="site-editor-publish";function Rr(e){const t=$.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=Y.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=Y.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=Y.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function bn(e,t){return t?Y.jsx(Rr,{label:e("siteEditor.details"),detail:t}):void 0}function Js(e,t,n){K.error(Wt(e,t,n),{...pn,description:bn(e,Uo(t,n))})}function Ws(e,t,n=!1){K.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...pn,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const mn={action:void 0,duration:void 0};function Gs(e,t){K.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...mn,id:$e,description:void 0})}function Ys(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=bn(e,o??null);K[i](t,{id:$e,description:n&&a?Y.jsxs(Y.Fragment,{children:[Y.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),K.loading(s??e("thread.publishPopover.publishing"),{...mn,id:$e,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function zs(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Fs as $,ms as A,xs as B,Kr as C,Or as D,Vs as E,z as F,sr as G,ks as H,Es as I,he as J,zo as K,Xo as L,ds as M,Os as N,gs as O,Ts as P,Is as Q,dr as R,Ke as S,Ct as T,Ls as U,ps as V,bo as W,we as X,fr as Y,jo as Z,mo as _,Xr as a,Br as a0,Jr as a1,Bs as a2,Ws as a3,Ns as a4,fs as a5,Je as a6,us as a7,mr as a8,Ye as a9,gr as aA,ls as aB,ze as aC,As as aD,$e as aE,mn as aF,Gs as aG,Ps as aH,Qr as aI,Vr as aJ,Me as aK,ss as aL,Ms as aM,vs as aN,X as aO,hs as aP,Ys as aQ,Hs as aR,pn as aS,un as aT,bs as aU,cs as aV,ws as aW,Ss as aX,ys as aY,Cs as aa,Us as ab,Js as ac,$s as ad,an as ae,wo as af,is as ag,Rs as ah,js as ai,qr as aj,os as ak,ct as al,lt as am,rs as an,xo as ao,ts as ap,Yn as aq,bn as ar,zs as as,Go as at,Hr as au,Qn as av,Rr as aw,_s as ax,Ds as ay,fn as az,Xn as b,Lt as c,Gn as d,zr as e,zn as f,He as g,Ae as h,xt as i,as as j,Po as k,Qs as l,Zr as m,ns as n,Ao as o,Wr as p,po as q,Yr as r,Gr as s,qo as t,me as u,Ko as v,Jo as w,Co as x,At as y,es as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ee,a5 as te,q as ne,r as E,j as t,B as Q,n as _,bB as ae,a6 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,bj as xe,t as C,c6 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gw as Ce}from"./index-Cvc22Qvh.js";import{a as we}from"./SwitchHorizontal01-Dghq_Bvd.js";import{L as De}from"./agent-icon-DD6O0sln.js";import{s as Ne}from"./Trash01-DhMVlpac.js";import{i as Pe}from"./Upload01-hsehoAUh.js";import{i as ie}from"./Zap-aTbgq59l.js";import{S as Ae}from"./search-toggle-pLnMgrhP.js";import{E as Y}from"./empty-state-Drt9QRbX.js";import{C as Ee}from"./collection-tabs-BW9NTpao.js";import{S as Me,F as Oe}from"./folder-icon-swAD3bQU.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-DHnEDbF9.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-tsaqCp6v.js";import{c as Le}from"./context-shell-Bwve3xDx.js";import"./AlertCircle-Cwj2JDLb.js";import"./Tool01-GdBdG6P_.js";import"./ArrowUp-zoWFBt83.js";import"./ArrowLeft-D6im8CSl.js";import"./LinkBroken01-CFo-1erV.js";import"./ShoppingBag01-DUpALglE.js";import"./Globe04-BLpPYUUd.js";import"./CheckCircle-Dycaqr3_.js";import"./ChevronUp-B0uKxpVg.js";import"./ChevronSelectorVertical-Cq__IjWt.js";import"./UserSquare-T5uOviXx.js";import"./CreditCard01-CMHPxKus.js";import"./Key01-KS2Cdqso.js";import"./Minus-CR14C6Ew.js";import"./Monitor01-PjSuNm4O.js";import"./Sun-x19ShBxe.js";import"./Play-DAD0wkps.js";import"./Plus-Caq968Zm.js";import"./SearchMd-BionSqTl.js";import"./Users01-DDaeVlhF.js";import"./XClose-NmocES7U.js";import"./icon-button-BZ9f2Pt9.js";import"./tooltip-C0GWPsi8.js";import"./index-LnWr599j.js";import"./badge-9UZ-oy57.js";import"./markdown-HhU9_nSI.js";import"./use-copy-BGfQrJIh.js";import"./use-mobile-C1stVK0E.js";import"./autosend-BLYIlkXq.js";import"./thread-route-B44higRI.js";import"./use-project-scope-C0EKXyqg.js";import"./repository-binding-B7A7NBUB.js";import"./use-mcp-client-BfCmeMHR.js";import"./auth-Dfx2bf9S.js";import"./task-board-DN88kD7h.js";import"./schema-BH82js-o.js";import"./file-preview-Ca_4k6rv.js";import"./utils-DA49HMaO.js";import"./editor-BODVgWYK.js";import"./file-type-icon-DiS0iV28.js";import"./useInfiniteQuery-P9--kf7E.js";import"./infiniteQueryObserver-CmujZk55.js";import"./thread-intent-Bs-Q7fma.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-BI4P-Lkx.js";import"./use-entitlements-wE65MYfi.js";import"./use-ai-providers-BbVlPdZd.js";import"./use-decopilot-events-uSeDcfUe.js";import"./use-organization-settings-a6mUKPHv.js";import"./require-capability-BTBUQsVM.js";import"./access-gate-CpAtBb_h.js";import"./capability-load-error-D8AT7eAw.js";import"./sections-CgO1w_IT.js";import"./textarea-D7HQlMVo.js";import"./use-ask-in-chat-Cp_wqFIx.js";import"./shell-layout-CH0j9rog.js";import"./use-deployment-admin-ShnoFTNr.js";import"./admin-fetch-BhTJlAsX.js";import"./command-B42vqDSm.js";import"./index-DQAtcq3Z.js";import"./integration-icon-DMt85Vdd.js";import"./project-icon-eZOGIGwj.js";import"./use-navigate-to-agent-D2d0cpFU.js";import"./new-project-dialog-BA0jmhgS.js";import"./label-RB5C5N6z.js";import"./repository-picker-CI7xSsin.js";import"./github-icon-tpEVyIwD.js";import"./collection-search-Lm88VC-w.js";import"./use-debounced-value-BF84eZeF.js";import"./required-auth-layout-ClYF4eFR.js";import"./use-org-sso-d82WgyRM.js";const J=200,_e=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Fe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!_e.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=G(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function He(s,e){const i=Le(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const F="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:De}}function Qe(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:I}=M;let w;e[3]!==i?(w=B(i),e[3]=i,e[4]=w):w=e[4];const R=w,D=o?"opacity-60":"hover:bg-accent";let f;e[5]!==D?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",D),e[5]=D,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"icon",children:t.jsx(we,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ss(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,I]=E.useState(F),[w,R]=E.useState(!1),[D,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.useState(null),x=()=>{a.invalidateQueries({queryKey:H.slashSkills(e.id)}),a.invalidateQueries({queryKey:H.orgFsSkills(e.id)})},j=r=>a.setQueryData(H.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",L=l.filter(Fe),U=L.find(A=>G(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(L.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(L.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=He($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(L,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:F,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:F,S=u===F?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(Q,{size:"sm",disabled:w,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(w?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(_,{children:[t.jsx(_.Content,{children:t.jsx(_.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(_.Actions,{secondary:t.jsx(Ae,{value:g,onChange:M,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Ee,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Qe,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),D&&t.jsx(Me,{skillPath:D,onClose:()=>f(null)},D),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ss as default};
|
|
1
|
+
import{b as ee,a5 as te,q as ne,r as E,j as t,B as Q,n as _,bB as ae,a6 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,bj as xe,t as C,c6 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gw as Ce}from"./index-DWvRfTwV.js";import{a as we}from"./SwitchHorizontal01-C3qdjyVX.js";import{L as De}from"./agent-icon-Nkid6y9z.js";import{s as Ne}from"./Trash01-DSJ1LUhI.js";import{i as Pe}from"./Upload01-DC0joCKG.js";import{i as ie}from"./Zap--C2rij07.js";import{S as Ae}from"./search-toggle-Z6tLdJtz.js";import{E as Y}from"./empty-state-CbRq3C3n.js";import{C as Ee}from"./collection-tabs-B05-I-04.js";import{S as Me,F as Oe}from"./folder-icon-Bk-fEOJa.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-DU8c86TB.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-yHOaM07v.js";import{c as Le}from"./context-shell-xJwj29nG.js";import"./AlertCircle-BPGyk76P.js";import"./Tool01-CyX9Nllj.js";import"./ArrowUp-BJTv4ddc.js";import"./ArrowLeft-DRdw9Nza.js";import"./LinkBroken01-4j6Z2AOF.js";import"./ShoppingBag01-CY137tVP.js";import"./Globe04-Dr1jk8eS.js";import"./CheckCircle-y3P873c6.js";import"./ChevronUp-CDe5Gfov.js";import"./ChevronSelectorVertical-TIONA5Zl.js";import"./UserSquare-DmeGszKa.js";import"./CreditCard01-abk_vBBR.js";import"./Key01-DzZgIVqE.js";import"./Minus-B2u_zm0f.js";import"./Monitor01-DWylBoOJ.js";import"./Sun-CyYLfv8E.js";import"./Play-CV8_Sy8a.js";import"./Plus-BtfY7EHX.js";import"./SearchMd-DD6kw-fs.js";import"./Users01-B-OacssU.js";import"./XClose-avSrIpAi.js";import"./icon-button-1xC_JQLB.js";import"./tooltip-BVv5wAeF.js";import"./index-J6dVRDZu.js";import"./badge-BLk85LCv.js";import"./markdown-DkmjrNqn.js";import"./use-copy-CMfnyhoo.js";import"./use-mobile-B7UqukPG.js";import"./autosend-DbfDzqlB.js";import"./thread-route-DMWye38f.js";import"./use-project-scope-B4B7p1mj.js";import"./repository-binding-CeErFm4l.js";import"./use-mcp-client-Z8a6jg-w.js";import"./auth-xvjttF9D.js";import"./task-board-CzrPT-OZ.js";import"./schema-DvxWNZKz.js";import"./file-preview-DifPTXD4.js";import"./utils-B-ZZ1C4f.js";import"./editor-CrG4V3zO.js";import"./file-type-icon-jLU7FJUL.js";import"./useInfiniteQuery-DAm-dYuC.js";import"./infiniteQueryObserver-O1nZgTsK.js";import"./thread-intent-BONVdhUb.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-B6ObjuCT.js";import"./use-entitlements-BChYmsyZ.js";import"./use-ai-providers-CCcuLCZt.js";import"./use-decopilot-events-CZSx1Itd.js";import"./use-organization-settings-DqaBVcmT.js";import"./require-capability-BOrIzed0.js";import"./access-gate-Bd3vMxaX.js";import"./capability-load-error-BZMPli2s.js";import"./sections-CC9QneUq.js";import"./textarea-BVq0fBVJ.js";import"./use-ask-in-chat-DQs0YHUB.js";import"./shell-layout-Bx4AZ_YV.js";import"./use-deployment-admin-DQ5wNSYp.js";import"./admin-fetch-BhTJlAsX.js";import"./command-CSFENWMV.js";import"./index-Czm9RrRY.js";import"./integration-icon-BCp7DD7C.js";import"./project-icon-DTA6ZXhl.js";import"./use-navigate-to-agent-9BOtBFjV.js";import"./new-project-dialog-Kvs8XyHN.js";import"./label-BkzEUDUr.js";import"./repository-picker-C3C3_E5g.js";import"./github-icon-Bvc_Uep-.js";import"./collection-search-CPadQqKp.js";import"./use-debounced-value-DiJ2aJN8.js";import"./required-auth-layout-nGThcCwM.js";import"./use-org-sso-nKgxHjqa.js";const J=200,_e=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Fe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!_e.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=G(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function He(s,e){const i=Le(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const F="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:De}}function Qe(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:I}=M;let w;e[3]!==i?(w=B(i),e[3]=i,e[4]=w):w=e[4];const R=w,D=o?"opacity-60":"hover:bg-accent";let f;e[5]!==D?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",D),e[5]=D,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"icon",children:t.jsx(we,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ss(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,I]=E.useState(F),[w,R]=E.useState(!1),[D,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.useState(null),x=()=>{a.invalidateQueries({queryKey:H.slashSkills(e.id)}),a.invalidateQueries({queryKey:H.orgFsSkills(e.id)})},j=r=>a.setQueryData(H.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",L=l.filter(Fe),U=L.find(A=>G(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(L.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(L.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=He($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(L,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:F,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:F,S=u===F?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(Q,{size:"sm",disabled:w,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(w?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(_,{children:[t.jsx(_.Content,{children:t.jsx(_.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(_.Actions,{secondary:t.jsx(Ae,{value:g,onChange:M,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Ee,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Qe,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),D&&t.jsx(Me,{skillPath:D,onClose:()=>f(null)},D),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ss as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,m as N,j}from"./index-
|
|
1
|
+
import{c as _,m as N,j}from"./index-DWvRfTwV.js";import{T as k,R as z,a as D,b as S}from"./index-BJKjGJrF.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,fk as K}from"./index-
|
|
1
|
+
import{r as v,fk as K}from"./index-DWvRfTwV.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-C3kzKmQL.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A,a5 as B,r as v,j as e,n as x,hj as k,gM as b,g1 as y,g2 as a,h_ as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as M,aK as F,bj as q,E as C,t as c,c as U}from"./index-
|
|
1
|
+
import{b as A,a5 as B,r as v,j as e,n as x,hj as k,gM as b,g1 as y,g2 as a,h_ as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as M,aK as F,bj as q,E as C,t as c,c as U}from"./index-DWvRfTwV.js";import{D as H}from"./domain-settings-CUR5XLBa.js";import{S as $}from"./switch-UpbwlQtZ.js";import{a as J,b as K,c as G,d as Q}from"./use-org-sso-nKgxHjqa.js";import{s as V}from"./Trash01-DSJ1LUhI.js";import{R as W}from"./require-capability-BOrIzed0.js";import"./badge-BLk85LCv.js";import"./select-gJgQvQZg.js";import"./index-BdQq_4o_.js";import"./index-J6dVRDZu.js";import"./ChevronUp-CDe5Gfov.js";import"./access-gate-Bd3vMxaX.js";import"./capability-load-error-BZMPli2s.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:I}=J(o.id,o.slug),f=K(o.id,o.slug),S=G(o.id,o.slug),E=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[P,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,_=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},N=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!u&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(u?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},w=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},L=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx(H,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx($,{checked:n.enforced,onCheckedChange:L,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(m,{variant:"outline",size:"sm",onClick:_,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:N,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:P,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(M,{children:[e.jsx(F,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(q,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function de(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{de as default};
|