decocms 4.528.0 → 4.529.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-Br894ljM.js → ActiveShapeUtils-DemHm_Wd.js} +1 -1
- package/dist/client/assets/{AlertCircle-DwVsFaci.js → AlertCircle-COvusPgV.js} +1 -1
- package/dist/client/assets/{AreaChart-BpoQ8IcB.js → AreaChart-DyTNutvb.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0U_UeWA.js → ArrowLeft-DLvj60sB.js} +1 -1
- package/dist/client/assets/{ArrowUp-BHvj9x12.js → ArrowUp-BUXNFn6K.js} +1 -1
- package/dist/client/assets/{BarChart-DSUrCO19.js → BarChart-pUJx5RZM.js} +1 -1
- package/dist/client/assets/{Building02-4g278Kck.js → Building02-GTlj-q2W.js} +1 -1
- package/dist/client/assets/{CartesianChart-B8sjFfWU.js → CartesianChart-GHKU27xx.js} +1 -1
- package/dist/client/assets/{CategoricalChart-C9NLmvFO.js → CategoricalChart-BYHLRXHR.js} +1 -1
- package/dist/client/assets/{CheckCircle-0mdIkBLG.js → CheckCircle-C512y-MG.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BRbuqJl7.js → ChevronSelectorVertical-BsYzg3zS.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cn8PaBxH.js → ChevronUp-krQUb2vU.js} +1 -1
- package/dist/client/assets/{Copy01-D6STLVd9.js → Copy01-DMa3yAGL.js} +1 -1
- package/dist/client/assets/{CreditCard01-CAW-vU_p.js → CreditCard01-B64VnM4Z.js} +1 -1
- package/dist/client/assets/{DotsVertical-C5Wc2qWf.js → DotsVertical-DcrZktRa.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-ClrUuJb8.js → ErrorBarContext-4lCbO0nP.js} +1 -1
- package/dist/client/assets/{Globe04-COPfJ3z-.js → Globe04-wvLOPSBv.js} +1 -1
- package/dist/client/assets/{Image01-D00jtGx4.js → Image01-C1LM4LI_.js} +1 -1
- package/dist/client/assets/{Key01-CiK2_UxI.js → Key01-DBOKyeyp.js} +1 -1
- package/dist/client/assets/{Link01-CEOBycf2.js → Link01-C15xvQCb.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Bg7pBcuJ.js → LinkBroken01-C-j1r45F.js} +1 -1
- package/dist/client/assets/{Minus-_SQ5lvlh.js → Minus-pd7IxdG4.js} +1 -1
- package/dist/client/assets/{Monitor01-DyqIpSTl.js → Monitor01-DkBo0gFa.js} +1 -1
- package/dist/client/assets/{Play-BnWEmJaV.js → Play-BG4TP59z.js} +1 -1
- package/dist/client/assets/{Plus-BPVKrQFz.js → Plus-CZXpdtEH.js} +1 -1
- package/dist/client/assets/{ReferenceLine-_tT0r7bG.js → ReferenceLine-D8vPnc2l.js} +1 -1
- package/dist/client/assets/{SearchMd-OaBCBVrZ.js → SearchMd-7uzgB_fN.js} +1 -1
- package/dist/client/assets/{Sector-mFZOIMSW.js → Sector-BoQZLv3P.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-GpZCrbBR.js → ShoppingBag01-fwBzMipi.js} +1 -1
- package/dist/client/assets/{Sun-BG4-BfE7.js → Sun-BndYhLEq.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CMpEiSPu.js → SwitchHorizontal01-C8FHYpzr.js} +1 -1
- package/dist/client/assets/{Tool01-CIeMmnyv.js → Tool01-D6wuoLhW.js} +1 -1
- package/dist/client/assets/{Trash01-BLXgUBsw.js → Trash01-fFkz00Bo.js} +1 -1
- package/dist/client/assets/{Upload01-CgYtU1Ux.js → Upload01-B7NXMv4U.js} +1 -1
- package/dist/client/assets/{UserSquare-pnEdx237.js → UserSquare-Dy6q7vGw.js} +1 -1
- package/dist/client/assets/{Users01-D-rlhQmk.js → Users01-Bzd23uge.js} +1 -1
- package/dist/client/assets/{XClose-yFNn0LgD.js → XClose-Bl8OQypT.js} +1 -1
- package/dist/client/assets/{ZoomOut-D8_eDbPl.js → ZoomOut-CbRHTtaG.js} +1 -1
- package/dist/client/assets/{access-gate-CCmKpIU6.js → access-gate-BUmBK35t.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-MrHyqJnn.js → add-connection-dialog-EKB9ifd5.js} +1 -1
- package/dist/client/assets/agent-analytics-BIR7Elpu.js +1 -0
- package/dist/client/assets/agent-app-BY_sxPgf.js +1 -0
- package/dist/client/assets/{agent-assets-DX3JCZz_.js → agent-assets-CLaEj6EO.js} +1 -1
- package/dist/client/assets/{agent-automation-BoPrO5n1.js → agent-automation-DjrvgxKz.js} +1 -1
- package/dist/client/assets/{agent-automations-Dj9SJC8y.js → agent-automations-B_j3JMK5.js} +1 -1
- package/dist/client/assets/{agent-calendar-CFKavSr7.js → agent-calendar-BYK51o6p.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-guJSE0A3.js → agent-connect-sources-CEHAzyyH.js} +1 -1
- package/dist/client/assets/agent-deck-O9lG5hoA.js +1 -0
- package/dist/client/assets/{agent-e2e--KzDh_gU.js → agent-e2e-DC8qsIOa.js} +1 -1
- package/dist/client/assets/agent-experiments-BI2FazYu.js +1 -0
- package/dist/client/assets/{agent-file-Cdm4fL8A.js → agent-file-B2uxKC-F.js} +1 -1
- package/dist/client/assets/{agent-hosting-DewUrxzP.js → agent-hosting-RnWuRGIL.js} +1 -1
- package/dist/client/assets/{agent-icon-I45DkNr8.js → agent-icon-D8I51g86.js} +1 -1
- package/dist/client/assets/agent-library-CkANn3L_.js +1 -0
- package/dist/client/assets/agent-library-file-WsrEoVuH.js +1 -0
- package/dist/client/assets/agent-monitor-B02h5NLr.js +1 -0
- package/dist/client/assets/{agent-overview-D6KewKsA.js → agent-overview-C5NgXH7s.js} +1 -1
- package/dist/client/assets/{agent-releases-K-5ZFdWb.js → agent-releases-BC4vHFHk.js} +1 -1
- package/dist/client/assets/agent-settings-LRXrMwgi.js +1 -0
- package/dist/client/assets/{agent-site-editor-5gjIAuRv.js → agent-site-editor-DxPxTcxt.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CkH40Rf7.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Cr-1q_qf.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BtO7VQJF.js +1 -0
- package/dist/client/assets/agent-view-JeA7v4l-.js +1 -0
- package/dist/client/assets/{agent-view-guard-CiKD3WZM.js → agent-view-guard-DGYTrdB6.js} +1 -1
- package/dist/client/assets/{agents-list-Bm03MUBc.js → agents-list-B3GTSyKF.js} +1 -1
- package/dist/client/assets/{ai-providers--gYjttQ2.js → ai-providers-kbqqFGXw.js} +1 -1
- package/dist/client/assets/{alert-CRToIlco.js → alert-Co4rQNsj.js} +1 -1
- package/dist/client/assets/{analytics-sections-CNk_D8Ba.js → analytics-sections-sv8ClgZ6.js} +1 -1
- package/dist/client/assets/{analytics-tab-BmUlDGzX.js → analytics-tab-CZkiyMbX.js} +1 -1
- package/dist/client/assets/{api-keys-MdTn4EBK.js → api-keys-C1HeQnUq.js} +1 -1
- package/dist/client/assets/api-keys-D5vUfJru.js +1 -0
- package/dist/client/assets/{app-editor-DLDQxSbu.js → app-editor-6n0QxI7G.js} +1 -1
- package/dist/client/assets/{asset-utils-B46ygA_L.js → asset-utils-BVjUn7sv.js} +1 -1
- package/dist/client/assets/{auth-AQB7DTaB.js → auth-D095ELC6.js} +1 -1
- package/dist/client/assets/{auth-catchall-WOw2KABS.js → auth-catchall-CNcTLbQH.js} +1 -1
- package/dist/client/assets/{auth-entry-D8h4o_s7.js → auth-entry-B00ENnh_.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D1niEerJ.js → auth-split-layout-BygL4T3m.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-08aLFUVr.js → authenticate-and-persist-oauth-BWNvTNl4.js} +1 -1
- package/dist/client/assets/{automation-list-row-D9muuYwH.js → automation-list-row-D74lyjQr.js} +1 -1
- package/dist/client/assets/{automation-runs-Cu7hhQJb.js → automation-runs-CBMsjgBs.js} +1 -1
- package/dist/client/assets/{automations-Ct6FcxrV.js → automations-jj-tbLkb.js} +1 -1
- package/dist/client/assets/{autosend-CxxtAFJ_.js → autosend-CBkC989z.js} +1 -1
- package/dist/client/assets/{badge-zxuYXquF.js → badge-NOwFVf79.js} +1 -1
- package/dist/client/assets/{block-document-D4CMkt4c.js → block-document-BHzrJZOA.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-LeIpajCL.js → blocks-preview-workspace-context-BXnXIitx.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BrRgLQ_Y.js → blocks-tab-states-B1baLGbh.js} +1 -1
- package/dist/client/assets/{blog-schema-B4i8W-yj.js → blog-schema-BfjxCL-D.js} +1 -1
- package/dist/client/assets/{buckets-CQWPtT87.js → buckets-DuxgHXni.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CpbAFEGo.js → build-improve-prompt-doc-DfrXi7V7.js} +1 -1
- package/dist/client/assets/{calendar-C7teLmhJ.js → calendar-r-ZqwkU5.js} +1 -1
- package/dist/client/assets/{capability-load-error-lTXihmQk.js → capability-load-error-C_z_eZxA.js} +1 -1
- package/dist/client/assets/category-editor-BVzHX2Tl.js +1 -0
- package/dist/client/assets/{cdn-tab-BstEuIpQ.js → cdn-tab-CqrDuE12.js} +1 -1
- package/dist/client/assets/{chart-DVgatavr.js → chart-CpZD0pzF.js} +1 -1
- package/dist/client/assets/{chat-context-DIvwe-Wr.js → chat-context-CFRPrQEn.js} +1 -1
- package/dist/client/assets/{chat-draft-DByw699W.js → chat-draft-CookMc2A.js} +1 -1
- package/dist/client/assets/{checkbox-CW4Dzojp.js → checkbox-CHAX1Xck.js} +1 -1
- package/dist/client/assets/{choose-editor-zIlz3nud.js → choose-editor-agHDRvWe.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CYE6hkOe.js → cli-auth-success-DiUqDmOP.js} +1 -1
- package/dist/client/assets/{client-icons-DL1p9F4w.js → client-icons-CbLac6SE.js} +1 -1
- package/dist/client/assets/cms-settings-editor-osH6UqMf.js +1 -0
- package/dist/client/assets/{collapsible-zPk-2gi_.js → collapsible-B0-dgkow.js} +1 -1
- package/dist/client/assets/{collection-detail-Drfng1H4.js → collection-detail-DMhjkfO0.js} +1 -1
- package/dist/client/assets/{collection-display-button-DPvQVdd-.js → collection-display-button-VpsslNFN.js} +1 -1
- package/dist/client/assets/{collection-search-kUVZkueq.js → collection-search-CfEbdS6s.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-vDq2vkVG.js → collection-table-wrapper-Bmq1UECe.js} +1 -1
- package/dist/client/assets/{collection-tabs-C3pu5E-Q.js → collection-tabs-CKvYpxHT.js} +1 -1
- package/dist/client/assets/{column-rules-Dz5XFx3r.js → column-rules-DLuTKpTB.js} +1 -1
- package/dist/client/assets/{combobox-BZSt-sf0.js → combobox-B2ABYNJF.js} +1 -1
- package/dist/client/assets/{command-CSPNVB8c.js → command-yWHdaNhz.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-HHphF1lt.js → companion-mcps-section-CzTfnHtf.js} +1 -1
- package/dist/client/assets/{config-B7tLWM1b.js → config-BWRujj0b.js} +1 -1
- package/dist/client/assets/{connect-BK8j-UfV.js → connect-Dd7mHJ3b.js} +1 -1
- package/dist/client/assets/{connect-layout-BC5qZusj.js → connect-layout-CuMi_Lil.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Ch0tynWX.js → connect-source-dialog-CEGXiNKG.js} +1 -1
- package/dist/client/assets/{connection-amzL9L9Z.js → connection-BLQ_zE4V.js} +1 -1
- package/dist/client/assets/{connection-card-D8aS8J6Q.js → connection-card-By3c6kjU.js} +1 -1
- package/dist/client/assets/{connection-detail-Cu7F0ogE.js → connection-detail-shznFsHq.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-TT6AKW6f.js → connection-form-helpers-Z8pfNB14.js} +1 -1
- package/dist/client/assets/{connections-B29MQqZW.js → connections-BPuzvSmY.js} +1 -1
- package/dist/client/assets/content-tab-DneBUwU0.js +22 -0
- package/dist/client/assets/context-CFpk-Oj4.js +1 -0
- package/dist/client/assets/{context-menu-CFt3f_Gb.js → context-menu-DJBtOK1b.js} +1 -1
- package/dist/client/assets/{context-shell-KhGmYnbX.js → context-shell-BmoIxzr5.js} +3 -3
- package/dist/client/assets/{core.esm-Brf7c66K.js → core.esm-n2M8kvjD.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Dshiy6sU.js → create-organization-dialog-CQRec3jk.js} +1 -1
- package/dist/client/assets/{daily-pulse-DglWu2t-.js → daily-pulse-BbNgROp9.js} +1 -1
- package/dist/client/assets/{discover-BLv8PWTL.js → discover-C-nnI3od.js} +1 -1
- package/dist/client/assets/{domain-settings-7tpPEEzB.js → domain-settings-Cc13IWEI.js} +1 -1
- package/dist/client/assets/{drawer-w05H8pBO.js → drawer-CiMnESz2.js} +1 -1
- package/dist/client/assets/{editor-CiOoO-Ym.js → editor-DmuvoJYA.js} +1 -1
- package/dist/client/assets/{editor-classes-DNAm8ZAW.js → editor-classes-BnQ0j7aI.js} +1 -1
- package/dist/client/assets/{empty-state-BiIeVz7z.js → empty-state-TJAbP9DT.js} +1 -1
- package/dist/client/assets/{empty-state-ErDRcN-P.js → empty-state-usXK3Xda.js} +1 -1
- package/dist/client/assets/{experiments-tab-BghFguNv.js → experiments-tab-BP2V1ct9.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CY-Qbhut.js → experiments-tab-choice-0iIRb8Mb.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C02FZ5zb.js → extract-connection-data-w2KZjBRz.js} +1 -1
- package/dist/client/assets/{feature-gate-CE1MLoN2.js → feature-gate-CL9DvP9Y.js} +1 -1
- package/dist/client/assets/{feature-paywall-C560RaP5.js → feature-paywall-DSpW8aNd.js} +1 -1
- package/dist/client/assets/{file-explorer-CVmiakjw.js → file-explorer-p0qSIvAq.js} +1 -1
- package/dist/client/assets/{file-preview-Cc6_BSbv.js → file-preview-BnfIAfXR.js} +1 -1
- package/dist/client/assets/{file-share-button-Do4wEYep.js → file-share-button-D0fIsSP3.js} +1 -1
- package/dist/client/assets/{file-type-icon-CeBZX69W.js → file-type-icon-BMJ3eu8C.js} +1 -1
- package/dist/client/assets/{folder-icon-DgtIAyY7.js → folder-icon-AsglkwKY.js} +1 -1
- package/dist/client/assets/{form-nJy5zMPE.js → form-B15LRu36.js} +1 -1
- package/dist/client/assets/{general-BOPFN5z3.js → general-jGb_G4uN.js} +1 -1
- package/dist/client/assets/{held-block-view-tvHMvR4T.js → held-block-view-OUun6HKW.js} +3 -3
- package/dist/client/assets/{home-CcsI1NKl.js → home-T15wg8dw.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-DxOmBJxT.js → hosted-publish-feedback-CpPg0deS.js} +1 -1
- package/dist/client/assets/{icon-button-Xe7zTqiw.js → icon-button-CdKw1JM7.js} +1 -1
- package/dist/client/assets/{index-DZ7OjEm4.js → index-BCVYESVO.js} +1 -1
- package/dist/client/assets/{index-BJTbyKBB.js → index-BJ0i7OFb.js} +1 -1
- package/dist/client/assets/{index-uE3tVNL6.js → index-Ba639kg_.js} +1 -1
- package/dist/client/assets/{index-tffbmy1v.js → index-BfJfM0M5.js} +1 -1
- package/dist/client/assets/{index-BzwMZ-96.js → index-CPx4iDWN.js} +1 -1
- package/dist/client/assets/{index-xw_Jw9LH.js → index-CYkDIirY.js} +1 -1
- package/dist/client/assets/{index-B8jtRR0H.js → index-Cdp3CJ7S.js} +1 -1
- package/dist/client/assets/{index-ComxOMRa.js → index-Cv-yBusP.js} +1 -1
- package/dist/client/assets/{index-Ce7G0he3.js → index-D6lKvaoF.js} +49 -49
- package/dist/client/assets/{index-DjOPmK0D.js → index-DTPm19J5.js} +1 -1
- package/dist/client/assets/{index-BD0IquFc.js → index-DdjqsLVd.js} +1 -1
- package/dist/client/assets/{index-Cjzst5W1.js → index-DgseJSFR.js} +1 -1
- package/dist/client/assets/{index-BK_RqkJq.js → index-Du8mxU6I.js} +1 -1
- package/dist/client/assets/{index-CcnAFkjW.js → index-ke7VZu6f.js} +1 -1
- package/dist/client/assets/{index-redirect-BRlBNfxv.js → index-redirect-DPkf2M1r.js} +1 -1
- package/dist/client/assets/{index-Dm-21QtS.js → index-suEm9Jo8.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BJujpYxh.js → infiniteQueryObserver-DoO1tFcg.js} +1 -1
- package/dist/client/assets/{infra-billing-C0m6hfZU.js → infra-billing-AOTF4BF9.js} +1 -1
- package/dist/client/assets/{input-B45cW293.js → input-BjDpMhiP.js} +3 -3
- package/dist/client/assets/{input-CzPtcD68.js → input-CGPBEV3I.js} +1 -1
- package/dist/client/assets/{integration-icon-Cs3IASPS.js → integration-icon-DsUtWvNG.js} +1 -1
- package/dist/client/assets/{jira-icon-BuriBSdU.js → jira-icon-ClDodO3R.js} +1 -1
- package/dist/client/assets/{label-ivnVLsJB.js → label-G1B1MWwD.js} +1 -1
- package/dist/client/assets/{layout-CZlIpVTU.js → layout-txEP7eBz.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DMpNnXol.js → legacy-agents-deep-DPRz-ztQ.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CBL3GGt7.js → legacy-main-redirect-D4h2lZ1C.js} +1 -1
- package/dist/client/assets/library-DG80ymId.js +1 -0
- package/dist/client/assets/{login-ByMZv8aL.js → login-BLrZZn8v.js} +1 -1
- package/dist/client/assets/{markdown-UmudOdor.js → markdown-qzRhqGiE.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-PAwZvEJj.js → mcp-app-renderer-BEchnhBH.js} +1 -1
- package/dist/client/assets/{mcp-oauth-qpkBxX91.js → mcp-oauth-C5j0dGpY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cz4RwYAs.js → mcp-oauth-DB3Ehq2l.js} +1 -1
- package/dist/client/assets/{members-DcVu4FNR.js → members-UnOmDr74.js} +1 -1
- package/dist/client/assets/{memory-C_hVYwsN.js → memory-DDcdJq0f.js} +1 -1
- package/dist/client/assets/{mini-report-page-DqysKZ5e.js → mini-report-page-0MJL6jaw.js} +1 -1
- package/dist/client/assets/{mock-board-BSsrmRDS.js → mock-board-BMi5jY8O.js} +3 -3
- package/dist/client/assets/{monaco-editor-Cc-5fhHI.js → monaco-editor-f9CmyWiW.js} +1 -1
- package/dist/client/assets/{monitoring-DVujO52F.js → monitoring-BcfPBOT_.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DosbF5BV.js → monitoring-stats-row-DbGeX6M1.js} +1 -1
- package/dist/client/assets/{multi-select-DHn_nlnM.js → multi-select-DDgBvcml.js} +1 -1
- package/dist/client/assets/{mustache-CKGDjf9j.js → mustache-Dlytn5tt.js} +1 -1
- package/dist/client/assets/{named-rule-uses-Drzf8cgA.js → named-rule-uses-Ce5M9wic.js} +1 -1
- package/dist/client/assets/{new-project-dialog-D3vjD1Ks.js → new-project-dialog-CMq12kc2.js} +1 -1
- package/dist/client/assets/{oauth-callback-D5wWKok2.js → oauth-callback-CHDXWkE_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BKG0BbMN.js → oauth-callback-ai-provider-UMPeP62o.js} +1 -1
- package/dist/client/assets/{onboarding-Ci8OMwC9.js → onboarding-M__h_Gjj.js} +1 -1
- package/dist/client/assets/{openai-conversation-D9RDSbbV.js → openai-conversation-CaIhAnt3.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-L0iLKNqt.js → optimistic-project-sidebar-views-CdaXFXXA.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CYrv-YPX.js → order-monitor-day-EdsSjGDV.js} +1 -1
- package/dist/client/assets/{organization-choice-DS1Td5mt.js → organization-choice-nAa_gubo.js} +1 -1
- package/dist/client/assets/{orgs-BdW5vuy7.js → orgs-Bf_omTy9.js} +1 -1
- package/dist/client/assets/{page-seo-form-4Td1Bwhl.js → page-seo-form-bDCctB_4.js} +1 -1
- package/dist/client/assets/{pair-D40XxJSs.js → pair-DAGOA-DW.js} +1 -1
- package/dist/client/assets/{parse-sections-6LYwkRXc.js → parse-sections-CQtk5pOz.js} +1 -1
- package/dist/client/assets/{plan-B5MpX63p.js → plan-B6ZUDARY.js} +1 -1
- package/dist/client/assets/{plan-ladder-DyKNTGpe.js → plan-ladder-lTkei0Ti.js} +1 -1
- package/dist/client/assets/{popover-BF3N_cWR.js → popover-0uuKFwAZ.js} +1 -1
- package/dist/client/assets/post-calendar-EZk2hClJ.js +1 -0
- package/dist/client/assets/{post-editor-DlfqwxIk.js → post-editor-DBjNxHSS.js} +1 -1
- package/dist/client/assets/{preview-content-BV8Fh5Qw.js → preview-content-QwLJXUTL.js} +1 -1
- package/dist/client/assets/{preview-dialog-BmUPiPPl.js → preview-dialog-COkKtKSn.js} +1 -1
- package/dist/client/assets/{preview-panel-llvMLYPZ.js → preview-panel-CYvbBECE.js} +1 -1
- package/dist/client/assets/{preview-tab-DieLxroc.js → preview-tab-CevrXu6o.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DVInlx3E.js → product-picker-dialog-C4MqsCUp.js} +1 -1
- package/dist/client/assets/{profile-BeQa-VCG.js → profile-BpyEXZc8.js} +1 -1
- package/dist/client/assets/{project-app-view-Cey1t0qJ.js → project-app-view-Be6CnjoI.js} +1 -1
- package/dist/client/assets/{project-apps-B_x_Bovr.js → project-apps-B0ovyypF.js} +1 -1
- package/dist/client/assets/{project-feed-CFTw8-Bu.js → project-feed-C21rLNuW.js} +1 -1
- package/dist/client/assets/{project-icon-Cgbmeoa9.js → project-icon-DSVUD72l.js} +1 -1
- package/dist/client/assets/project-reports-B-dKM4cz.js +1 -0
- package/dist/client/assets/project-tasks-CQ6MOp0o.js +1 -0
- package/dist/client/assets/{projects-Cadx_2S-.js → projects-DVL140KR.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B0sxQqwF.js → projects-empty-state--1SkJcww.js} +1 -1
- package/dist/client/assets/{prompts-B6yRUPTQ.js → prompts-BB-mkKBu.js} +1 -1
- package/dist/client/assets/record-editor-CHzxFRQb.js +1 -0
- package/dist/client/assets/{redirect-editor-UO7ym99V.js → redirect-editor-MSkonkYZ.js} +1 -1
- package/dist/client/assets/{releases-api-Dz4kituq.js → releases-api-XsGA4Jqp.js} +1 -1
- package/dist/client/assets/{reports-BN03l_kE.js → reports-Bs2cZ7-f.js} +1 -1
- package/dist/client/assets/reports-CDn9xmoF.js +1 -0
- package/dist/client/assets/{reports-onboarding-CXYw21hI.js → reports-onboarding-CQDYROlT.js} +1 -1
- package/dist/client/assets/{reports-tab-DNDxSx2i.js → reports-tab-unD6Cc73.js} +2 -2
- package/dist/client/assets/{repositories-DkDpuhbE.js → repositories-D4uDVy59.js} +1 -1
- package/dist/client/assets/repositories-jqcTJr-Z.js +1 -0
- package/dist/client/assets/{repository-binding-Dg4XMxXs.js → repository-binding-DG0YfJ0p.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BZ7PPi9W.js → repository-import-picker-DmsHSDsT.js} +1 -1
- package/dist/client/assets/{repository-picker-aA12wSzy.js → repository-picker-DtHxD0oz.js} +1 -1
- package/dist/client/assets/{require-capability-CXN6JJ5S.js → require-capability-Coznh-2O.js} +1 -1
- package/dist/client/assets/{required-auth-layout-pDiTStrv.js → required-auth-layout-D6rVgMVl.js} +1 -1
- package/dist/client/assets/{reset-password-CRhNEOOs.js → reset-password-T1aKmDxe.js} +1 -1
- package/dist/client/assets/{resizable-HiC69AzM.js → resizable-BToK-_9q.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DdbyVt-l.js → resolve-tab-icon-BZcs-4Ej.js} +1 -1
- package/dist/client/assets/{review-settings-BdnOsmg6.js → review-settings-D8DTqrlS.js} +1 -1
- package/dist/client/assets/{roles-C54CSjKN.js → roles-BjZzPNJU.js} +1 -1
- package/dist/client/assets/{route-19TfZ9Nu.js → route-CGlwPlVk.js} +1 -1
- package/dist/client/assets/route-JsLO4TKF.js +1 -0
- package/dist/client/assets/{route-ChUurj1a.js → route-ZKQ_kRmZ.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-C-6LRZKK.js → sandbox-lifecycle-context-DmhDA6t4.js} +1 -1
- package/dist/client/assets/{schema-4d6JAPZJ.js → schema-DNxvjoV7.js} +1 -1
- package/dist/client/assets/{schema-DjHUnA9X.js → schema-DnX2JCBp.js} +1 -1
- package/dist/client/assets/{scroll-area-DmCvljJ6.js → scroll-area-DuxlLjxF.js} +1 -1
- package/dist/client/assets/{search-input-DuxKe01B.js → search-input-D-Pyf_-v.js} +1 -1
- package/dist/client/assets/{search-toggle-5fjHehxP.js → search-toggle-Dtmn6N5P.js} +1 -1
- package/dist/client/assets/{secret-picker-gnCLcdHl.js → secret-picker-DVVZ5bEr.js} +1 -1
- package/dist/client/assets/{secrets-1Q0KkbT2.js → secrets-cTi-1KGY.js} +1 -1
- package/dist/client/assets/{section-array-field-DJWSUlEO.js → section-array-field-D7M_bj6e.js} +1 -1
- package/dist/client/assets/{sections-BFagCGU_.js → sections-DoIjBnkB.js} +1 -1
- package/dist/client/assets/{sections-editor-Cd0e4qhb.js → sections-editor-Cp3o1WEu.js} +1 -1
- package/dist/client/assets/{select-BU91L4uy.js → select-WYGhjx6Y.js} +1 -1
- package/dist/client/assets/{select-model-CtxoaFb9.js → select-model-7YJABjjD.js} +1 -1
- package/dist/client/assets/{seo-editor-dOpYS1fH.js → seo-editor-DxqL4dEA.js} +1 -1
- package/dist/client/assets/{separator-C2eDbIfB.js → separator-CAQrypmQ.js} +1 -1
- package/dist/client/assets/settings-tab-DBT9iC5q.js +1 -0
- package/dist/client/assets/{sheet-CyFkbR9Y.js → sheet-BXLIoGMZ.js} +1 -1
- package/dist/client/assets/{shell-layout-DjxWvBNL.js → shell-layout-DIzvUuq-.js} +1 -1
- package/dist/client/assets/site-draft-actions-L6qNX2KR.js +3 -0
- package/dist/client/assets/{site-draft-view-DmpsxvZd.js → site-draft-view-CFpMP26D.js} +2 -2
- package/dist/client/assets/site-editor-CFIZ4rer.js +1 -0
- package/dist/client/assets/{site-editor-toast-DwH2UhLV.js → site-editor-toast-DYuw8EYm.js} +1 -1
- package/dist/client/assets/{skills-CEjNG6HD.js → skills-Bs4GOdTG.js} +1 -1
- package/dist/client/assets/{slider-wRMQIU5C.js → slider-CViVuHCu.js} +1 -1
- package/dist/client/assets/{sortable.esm-GfRDqHVM.js → sortable.esm-DEhQR8uW.js} +1 -1
- package/dist/client/assets/{sso-ou3AfF03.js → sso-RbRiEKa0.js} +1 -1
- package/dist/client/assets/{suggestion-GTJqe6wD.js → suggestion-Bx_JdcJG.js} +1 -1
- package/dist/client/assets/{switch-Be6f0Lf5.js → switch-BByo6038.js} +1 -1
- package/dist/client/assets/{symbol-D9upvJXv.js → symbol-Dxfa7ArY.js} +1 -1
- package/dist/client/assets/{synced-repos-BMxqOtvT.js → synced-repos-COUZBGua.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-ixZicBgd.js → tab-icon-glyph-Bk-ZO6Ik.js} +1 -1
- package/dist/client/assets/{table-Sgqiv7ow.js → table-CSNuDYSH.js} +1 -1
- package/dist/client/assets/{tabs-CTBn6AHY.js → tabs-D3JiC-AY.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-CgqfXsXT.js → task-assignee-avatar-BmM5P6_t.js} +1 -1
- package/dist/client/assets/{task-board-B-WXUk04.js → task-board-9JuNZBWk.js} +1 -1
- package/dist/client/assets/{task-route-D7L_AjBa.js → task-route-8N1kEUR4.js} +1 -1
- package/dist/client/assets/{task-status-D47mg_UC.js → task-status-CqFVxY8B.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BXOv_DdG.js → taskboard-analytics-CJlU-oAO.js} +1 -1
- package/dist/client/assets/tasks-BVwsk6i_.js +1 -0
- package/dist/client/assets/{tasks-DRiqBj-N.js → tasks-gqaInVx6.js} +1 -1
- package/dist/client/assets/{textarea-CiBj0MLq.js → textarea-L_ZRNMiO.js} +1 -1
- package/dist/client/assets/{thread-analytics-apzZ--go.js → thread-analytics-BcGg7DjZ.js} +1 -1
- package/dist/client/assets/{thread-intent-ClCyX82j.js → thread-intent-B7fQ4X9a.js} +1 -1
- package/dist/client/assets/{thread-route-CFct_VQa.js → thread-route-P1MEabq1.js} +1 -1
- package/dist/client/assets/{thread-route-D14ghtgQ.js → thread-route-qfZwEURL.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BCarr4x7.js → thread-sheet-body-Brz-5Xzp.js} +1 -1
- package/dist/client/assets/{time-range-picker-C3_uZ5O2.js → time-range-picker-D-N-klXR.js} +1 -1
- package/dist/client/assets/{toggle-group-BVSslRda.js → toggle-group-DGrVpPy5.js} +1 -1
- package/dist/client/assets/{tool-namespace-C-2tGGMF.js → tool-namespace-D6LarB3P.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-3L1Mfrbu.js → toolbar-icon-button-DA7DTn0f.js} +1 -1
- package/dist/client/assets/{tooltip-BHLCIkH9.js → tooltip-LAilTl9w.js} +1 -1
- package/dist/client/assets/{tooltipContext-BMB7e6XT.js → tooltipContext-BD4z8QR3.js} +1 -1
- package/dist/client/assets/{track-DUL7obAK.js → track-BDBNTOtn.js} +1 -1
- package/dist/client/assets/{types-9H7KFAzM.js → types-B-ck70wq.js} +1 -1
- package/dist/client/assets/{url-slug-CrYfl8wu.js → url-slug-hCw666fV.js} +1 -1
- package/dist/client/assets/{usage-stats-CtXF_bWd.js → usage-stats-C7wY64zK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DmHiyABc.js → use-ai-providers-CCh3hgye.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DnrC-2Y6.js → use-apply-named-rule-C3ZZJzlV.js} +1 -1
- package/dist/client/assets/{use-automations-BeX04Bm6.js → use-automations-CRFTJK4f.js} +1 -1
- package/dist/client/assets/{use-autosave-Civ5dqYG.js → use-autosave-DCyEvO0j.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DEHPkPVs.js → use-chat-layout-state-wJjkzkeX.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C1thlLib.js → use-clock-tick-N15XxKsH.js} +1 -1
- package/dist/client/assets/use-cms-publish-actions-Ba42J8md.js +10 -0
- package/dist/client/assets/{use-connect-companion-XN72CB3K.js → use-connect-companion-DnBPIlmE.js} +1 -1
- package/dist/client/assets/{use-connection-DdV5v_sO.js → use-connection-BBWQ1upy.js} +1 -1
- package/dist/client/assets/{use-copy-DGCMROZD.js → use-copy-Bnv2yRR0.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CYamK9uo.js → use-create-virtual-mcp-CLc8yu5S.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-RvTpk_ov.js → use-date-fns-locale-Br988cT0.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CCKD06RC.js → use-debounced-autosave-GFM4KrwH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D4hMc82O.js → use-debounced-value-DLa-riOh.js} +1 -1
- package/dist/client/assets/{use-deco-credits-8Cm_6S2l.js → use-deco-credits-3I0Gmtle.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CMhdGvid.js → use-decopilot-events-C6bScbXe.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DczFLZ2h.js → use-delete-connection-BZQtBcN0.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D33YqaOd.js → use-deployment-admin-D2xZ3EVY.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-5-OqnV1z.js → use-fast-preview-draft-url-DRBVlysi.js} +1 -1
- package/dist/client/assets/{use-file-configs-B-dtUlcn.js → use-file-configs-EhGCWGKO.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DgAPUhXS.js → use-inbox-feed-MI8GAssc.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Boo11DpH.js → use-infinite-scroll-Dl4ppp1T.js} +1 -1
- package/dist/client/assets/{use-join-requests-WGDHodyD.js → use-join-requests-D0RX0KVp.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D8UhTy5h.js → use-main-panel-tabs-Dy6OYkJL.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Ue891t8t.js → use-mcp-auth-status-BLS8Hv4S.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B9-9jnHW.js → use-mcp-client-DwqRqgyq.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Duq-F4uG.js → use-mcp-prompts-l19k-bhU.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DvCVc1NG.js → use-mcp-tools-CNG9BIav.js} +1 -1
- package/dist/client/assets/{use-mobile-BZz7cwuI.js → use-mobile-BwQy16Q6.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DUpXqrhw.js → use-move-blocks-Crj0de_N.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CEpb-TPy.js → use-navigate-to-agent-BK5-GF4Q.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-AHjpaAXa.js → use-open-billing-url-BQr-ZtMF.js} +1 -1
- package/dist/client/assets/{use-org-fs-8kFrjmMH.js → use-org-fs-DLZ1-PTn.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DHiYUCj6.js → use-org-repo-syncs-CDoF8IOA.js} +1 -1
- package/dist/client/assets/{use-org-sso-l3h7LAOC.js → use-org-sso-C-qEDq8K.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DWGBtp2u.js → use-organization-roles-D0H2tUJi.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DAQWwUyU.js → use-organization-settings-kq9jLGY0.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C-mQZt-r.js → use-panel-navigate-BECpOul-.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D2zRgAqZ.js → use-project-native-view-presence-1uAz-ylt.js} +1 -1
- package/dist/client/assets/{use-project-scope-DYBc2cnp.js → use-project-scope-DQZacSdf.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CahLdkOq.js → use-recent-apps-ujQcGW4R.js} +1 -1
- package/dist/client/assets/{use-releases-Drxi11Hn.js → use-releases-Brr6nY5b.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-C0y8CLzl.js → use-reports-diagnostic-CSbUL_Ki.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-DKnAt9WL.js → use-sandbox-events-DDEe74Lx.js} +1 -1
- package/dist/client/assets/{use-secrets-CCJcL_mR.js → use-secrets-B-wd58Sw.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-yGU9kv3R.js → use-section-preview-base-CyvlvXKC.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CL3Ry0XG.js → use-session-runtime-oQf5p7F0.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CbzeRAk-.js → use-sidebar-collapsed-CQxN5Dgl.js} +1 -1
- package/dist/client/assets/{use-tags-Af_mmSB1.js → use-tags-Ckwl5Ic8.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BkPBycom.js → use-task-board-analytics-CxJm3obr.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Bs2sMvhO.js → use-task-board-events-C11vdnOU.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DtKTjCYS.js → use-task-board-item-prs-OoBVrY5e.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CaEOmtPV.js → use-task-metadata-B5vxvrwt.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DFAhXiiU.js → use-thread-analytics-Ccey92kA.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-wHP5lV5E.js → use-thread-outputs-AtJj5nDf.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3ME351M.js +1 -0
- package/dist/client/assets/{useQueries-bayVPMWC.js → useQueries-DwNBQmnp.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DdTGZQmz.js +1 -0
- package/dist/client/assets/{users-BXC7BZTC.js → users-47U5EmUY.js} +1 -1
- package/dist/client/assets/{utils-C_XIOzcP.js → utils-CLU7TQYj.js} +1 -1
- package/dist/client/assets/{variant-calendar-DqsG-wJ9.js → variant-calendar-8QsQaZXX.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BfAJFrjh.js → variant-matcher-override-VqVKqAN8.js} +1 -1
- package/dist/client/assets/{view-header-BlWEzmVd.js → view-header-C8Yesx7u.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BfSfmNNT.js → virtual-mcp-BO25j0IY.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-D5nA1051.js → watch-sse-pool-DZPVglNq.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-wllTP-xB.js +0 -1
- package/dist/client/assets/agent-app-MGvu076D.js +0 -1
- package/dist/client/assets/agent-deck-CdHFig9V.js +0 -1
- package/dist/client/assets/agent-experiments-pgMnsFIB.js +0 -1
- package/dist/client/assets/agent-library-DjU97YsS.js +0 -1
- package/dist/client/assets/agent-library-file-DXHCBJAM.js +0 -1
- package/dist/client/assets/agent-monitor-Bucu2iO3.js +0 -1
- package/dist/client/assets/agent-settings-w-cNQlVy.js +0 -1
- package/dist/client/assets/agent-site-editor-code-B432kGPM.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CQYunysB.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-CLsSdnEd.js +0 -1
- package/dist/client/assets/agent-view-DP6mfHYN.js +0 -1
- package/dist/client/assets/api-keys-8RAAQTX6.js +0 -1
- package/dist/client/assets/category-editor-BrbTG2-B.js +0 -1
- package/dist/client/assets/cms-settings-editor-D8-PKCcN.js +0 -1
- package/dist/client/assets/content-tab-BhOwV-AC.js +0 -22
- package/dist/client/assets/context-CgB14LeY.js +0 -1
- package/dist/client/assets/library-CdY45oa5.js +0 -1
- package/dist/client/assets/post-calendar-BtEPuDia.js +0 -1
- package/dist/client/assets/project-reports-BuglSKY2.js +0 -1
- package/dist/client/assets/project-tasks-CwzdWFfG.js +0 -1
- package/dist/client/assets/record-editor-1SlOHcz4.js +0 -1
- package/dist/client/assets/reports-DuuFM9rE.js +0 -1
- package/dist/client/assets/repositories-Dvbq5CpF.js +0 -1
- package/dist/client/assets/route-CkPY6J06.js +0 -1
- package/dist/client/assets/settings-tab-D7WyDwD7.js +0 -1
- package/dist/client/assets/site-draft-actions-Ck3uf8oy.js +0 -3
- package/dist/client/assets/site-editor-BXDxn3xb.js +0 -1
- package/dist/client/assets/tasks-CDonOW9g.js +0 -1
- package/dist/client/assets/use-cms-publish-actions-Ca_6MHNE.js +0 -10
- package/dist/client/assets/useInfiniteQuery-DAGt4Ai1.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BCXHmK3t.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,H as F,$ as G,a0 as H,a as E,k as P,b as O,n as y,L as M}from"./index-D6lKvaoF.js";import{C as V}from"./chat-context-CFRPrQEn.js";import{C as x}from"./index-Ba639kg_.js";import{L}from"./index-CYkDIirY.js";import{B as K}from"./blocks-preview-workspace-context-BXnXIitx.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as q}from"./site-editor-toast-DYuw8EYm.js";import{u as Q,L as B,P as X,S as Y}from"./preview-tab-CevrXu6o.js";import{C as Z}from"./content-tab-DneBUwU0.js";import{T as tt}from"./tab-icon-glyph-Bk-ZO6Ik.js";import{r as et}from"./resolve-tab-icon-BZcs-4Ej.js";import ot from"./agent-site-editor-DxPxTcxt.js";import"./use-panel-navigate-BECpOul-.js";import"./thread-route-qfZwEURL.js";import"./use-project-scope-DQZacSdf.js";import"./repository-binding-DG0YfJ0p.js";import"./use-mcp-client-DwqRqgyq.js";import"./auth-D095ELC6.js";import"./autosend-CBkC989z.js";import"./thread-intent-B7fQ4X9a.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DZPVglNq.js";import"./task-board-9JuNZBWk.js";import"./schema-DNxvjoV7.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-C6bScbXe.js";import"./use-ai-providers-CCh3hgye.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-kq9jLGY0.js";import"./use-mobile-BwQy16Q6.js";import"./use-sidebar-collapsed-CQxN5Dgl.js";import"./use-chat-layout-state-wJjkzkeX.js";import"./agent-icon-D8I51g86.js";import"./AlertCircle-COvusPgV.js";import"./Tool01-D6wuoLhW.js";import"./ArrowUp-BUXNFn6K.js";import"./ArrowLeft-DLvj60sB.js";import"./LinkBroken01-C-j1r45F.js";import"./ShoppingBag01-fwBzMipi.js";import"./ZoomOut-CbRHTtaG.js";import"./Building02-GTlj-q2W.js";import"./CheckCircle-C512y-MG.js";import"./ChevronUp-krQUb2vU.js";import"./ChevronSelectorVertical-BsYzg3zS.js";import"./UserSquare-Dy6q7vGw.js";import"./Copy01-DMa3yAGL.js";import"./CreditCard01-B64VnM4Z.js";import"./DotsVertical-DcrZktRa.js";import"./Image01-C1LM4LI_.js";import"./Globe04-wvLOPSBv.js";import"./SwitchHorizontal01-C8FHYpzr.js";import"./Key01-DBOKyeyp.js";import"./Link01-C15xvQCb.js";import"./Minus-pd7IxdG4.js";import"./Monitor01-DkBo0gFa.js";import"./Sun-BndYhLEq.js";import"./Play-BG4TP59z.js";import"./Plus-CZXpdtEH.js";import"./SearchMd-7uzgB_fN.js";import"./Trash01-fFkz00Bo.js";import"./Upload01-B7NXMv4U.js";import"./Users01-Bzd23uge.js";import"./XClose-Bl8OQypT.js";import"./tooltip-LAilTl9w.js";import"./index-BCVYESVO.js";import"./toolbar-icon-button-DA7DTn0f.js";import"./shell-layout-DIzvUuq-.js";import"./use-clock-tick-N15XxKsH.js";import"./command-yWHdaNhz.js";import"./index-BJ0i7OFb.js";import"./integration-icon-DsUtWvNG.js";import"./project-icon-DSVUD72l.js";import"./new-project-dialog-CMq12kc2.js";import"./label-G1B1MWwD.js";import"./repository-import-picker-DmsHSDsT.js";import"./use-navigate-to-agent-BK5-GF4Q.js";import"./repository-picker-DtHxD0oz.js";import"./useInfiniteQuery-B3ME351M.js";import"./infiniteQueryObserver-DoO1tFcg.js";import"./collection-search-CfEbdS6s.js";import"./use-debounced-value-DLa-riOh.js";import"./required-auth-layout-D6rVgMVl.js";import"./use-org-sso-C-qEDq8K.js";import"./sheet-BXLIoGMZ.js";import"./resizable-BToK-_9q.js";import"./core.esm-n2M8kvjD.js";import"./sortable.esm-DEhQR8uW.js";import"./context-menu-DJBtOK1b.js";import"./create-organization-dialog-CQRec3jk.js";import"./form-B15LRu36.js";import"./project-apps-B0ovyypF.js";import"./use-recent-apps-ujQcGW4R.js";import"./use-session-runtime-oQf5p7F0.js";import"./experiments-tab-choice-0iIRb8Mb.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-CLU7TQYj.js";import"./use-sandbox-events-DDEe74Lx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./held-block-view-OUun6HKW.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DAGOA-DW.js";import"./collapsible-B0-dgkow.js";import"./use-copy-Bnv2yRR0.js";import"./usage-stats-C7wY64zK.js";import"./tool-namespace-D6LarB3P.js";import"./utils-CVEq3hMx.js";import"./markdown-qzRhqGiE.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BEchnhBH.js";import"./types-B-ck70wq.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-connection-BBWQ1upy.js";import"./use-mcp-prompts-l19k-bhU.js";import"./use-thread-outputs-AtJj5nDf.js";import"./file-type-icon-BMJ3eu8C.js";import"./section-array-field-D7M_bj6e.js";import"./alert-Co4rQNsj.js";import"./parse-sections-CQtk5pOz.js";import"./blocks-tab-states-B1baLGbh.js";import"./slider-CViVuHCu.js";import"./index-DTPm19J5.js";import"./index-BdQq_4o_.js";import"./tooltipContext-BD4z8QR3.js";import"./CategoricalChart-BYHLRXHR.js";import"./index-BfJfM0M5.js";import"./ActiveShapeUtils-DemHm_Wd.js";import"./Sector-BoQZLv3P.js";import"./symbol-Dxfa7ArY.js";import"./empty-state-TJAbP9DT.js";import"./switch-BByo6038.js";import"./textarea-L_ZRNMiO.js";import"./popover-0uuKFwAZ.js";import"./scroll-area-DuxlLjxF.js";import"./monaco-editor-f9CmyWiW.js";import"./editor-DmuvoJYA.js";import"./calendar-r-ZqwkU5.js";import"./select-WYGhjx6Y.js";import"./editor-classes-BnQ0j7aI.js";import"./toggle-group-DGrVpPy5.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-B2ABYNJF.js";import"./search-input-D-Pyf_-v.js";import"./tabs-D3JiC-AY.js";import"./use-file-configs-EhGCWGKO.js";import"./asset-utils-BVjUn7sv.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-DmhDA6t4.js";import"./variant-matcher-override-VqVKqAN8.js";import"./variant-draft-pointer-BeAKcq_c.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-DRBVlysi.js";import"./preview-link-C762yHOt.js";import"./useQueries-DwNBQmnp.js";import"./device-hint-SeLRi17j.js";import"./virtual-mcp-BO25j0IY.js";import"./url-slug-hCw666fV.js";import"./app-preview-url-9Od4s8Sz.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-B5vxvrwt.js";import"./view-header-C8Yesx7u.js";import"./use-cms-publish-actions-Ba42J8md.js";import"./hosted-publish-feedback-CpPg0deS.js";import"./mustache-Dlytn5tt.js";import"./checkbox-CHAX1Xck.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-Crj0de_N.js";import"./badge-NOwFVf79.js";import"./empty-state-usXK3Xda.js";import"./collection-table-wrapper-Bmq1UECe.js";import"./table-CSNuDYSH.js";import"./site-draft-actions-L6qNX2KR.js";import"./separator-CAQrypmQ.js";import"./use-releases-Brr6nY5b.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-Du8mxU6I.js";import"./drawer-CiMnESz2.js";import"./input-BjDpMhiP.js";import"./icon-button-CdKw1JM7.js";import"./chat-draft-CookMc2A.js";import"./use-deco-credits-3I0Gmtle.js";import"./use-open-billing-url-BQr-ZtMF.js";import"./index-Cdp3CJ7S.js";import"./ai-providers-logos-DD3qZ33J.js";import"./input-CGPBEV3I.js";import"./suggestion-Bx_JdcJG.js";import"./use-org-fs-DLZ1-PTn.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DSpW8aNd.js";import"./plan-ladder-lTkei0Ti.js";import"./add-connection-dialog-EKB9ifd5.js";import"./extract-connection-data-w2KZjBRz.js";import"./metadata-D72DunRR.js";import"./connection-BLQ_zE4V.js";import"./connection-card-By3c6kjU.js";import"./connection-slug-CITJ0kGN.js";import"./schema-DnX2JCBp.js";import"./connection-form-helpers-Z8pfNB14.js";import"./authenticate-and-persist-oauth-BWNvTNl4.js";import"./mcp-oauth-DB3Ehq2l.js";import"./mcp-oauth-C5j0dGpY.js";import"./collection-tabs-CKvYpxHT.js";import"./use-infinite-scroll-Dl4ppp1T.js";import"./useSuspenseInfiniteQuery-DdTGZQmz.js";import"./use-task-board-events-C11vdnOU.js";import"./named-rule-uses-Ce5M9wic.js";import"./save-changes-debug-nBi-n9eV.js";import"./releases-api-XsGA4Jqp.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const it=e=>e;function rt(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?it: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(nt,{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 nt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),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 j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=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]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?W(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&J(o),{candidates:U(o,z()),invalidLink:t&&!o}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const e=u.c(6),t=O();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:dt},e[0]=o):o=e[0];const c=P(o);let m;e[1]!==t||e[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{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(tt,{icon:et({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 dt(e){return e.matches.at(-1)?.staticData.siteEditorView}function N(e){const t=u.c(14),{children:o}=e,c=O(),{connection:m}=q(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(Y,{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 ut(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 A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ht},e[0]=o):o=e[0];const c=P(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(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(ot,{}),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,{...A,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 ht(e){return e.matches.at(-1)?.staticData.siteEditorView}function vt(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,{...A,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=()=>{},xt={connection:null,set:b,clear:b};function dr(){const e=u.c(3),[t]=g.useState(at);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function kt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(e){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:e})})}function ur(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(X,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function fr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Z,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{fr as SiteEditorContent,ur as SiteEditorPreview,dr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,q as z,m as L,K as h,eQ as _e,ah as Xt,aK as Zt,aL as qt,r as U,a as Kt,az as pe,a4 as en,eR as ut,eS as Ce,bh as be,eT as ue,eU as Ne,eV as Re,ax as tn,br as ft,bj as F,eW as ee,eX as we,eY as Ge,eZ as nn,t as q,j as J}from"./index-Ce7G0he3.js";import{u as dt}from"./use-session-runtime-CL3Ry0XG.js";import{s as We}from"./thread-intent-ClCyX82j.js";import{u as Pe,b as on}from"./experiments-tab-choice-CY-Qbhut.js";import{b as fe}from"./sandbox-url-D3mC8qhT.js";import{s as rn}from"./utils-C_XIOzcP.js";import{a as sn}from"./repository-binding-Dg4XMxXs.js";import{u as an}from"./chat-context-DIvwe-Wr.js";import{i as cn,u as ln}from"./use-sandbox-events-DKnAt9WL.js";import{a as un}from"./sandbox-git-api-DcqI6XE4.js";import{e as fn}from"./backoff-CrEUbyZT.js";const S={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class D extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new D(t.code,t.message,t.data)}}const Z="deco-content",Se={major:1},ht=1;async function dn(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 ye={major:Se.major,minor:ht},gt=`the endpoint speaks an older ${Z} than this client needs (${ye.major}.${ye.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ne(e,t,n){const o={reason:t,required:{...ye}};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 D(S.Unsupported,e,o)}function vt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==Z)throw ne(`the endpoint speaks ${JSON.stringify(n)}, not ${Z}`,"protocol",t);if(o?.major!==Se.major)throw ne(`the endpoint speaks ${Z} ${String(o?.major)}.x; this client speaks ${Se.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ht)throw ne(gt,"outdated",t);return e}function Ye(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?ne(gt,"outdated"):D.from(t)}function xe(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 c;try{c=await dn(a)}catch{throw new D(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?D.from(l):new D(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Ye(s,c.error);return c.result};return{call:r,describe:async()=>vt(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((l,u)=>({jsonrpc:"2.0",id:i[u],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,u)=>{const f=c.get(l);return f?f.error?{ok:!1,error:Ye(s[u].method,f.error)}:{ok:!0,result:f.result}:{ok:!1,error:new D(S.InternalError,"no response for this call")}})}}}function mt(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const ze=20,Xe=5,Ze=500;function $e(e){return e instanceof D?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function Ee(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function hn(e,t,n){const o=h.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(mt(r)),i=Ee(r,s);if(i)return i;const a=await t.changesList({});return Ee(void 0,a)}async function pt(e,t){const n=[];for(let s=0;s<t.length;s+=ze)n.push(t.slice(s,s+ze));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Xe){const i=await e.batch(n.slice(s,s+Xe).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function qo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Ze){const r=t.slice(o,o+Ze),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 Ko(e){return e instanceof D&&e.code===S.Conflict}function je(e){return e?.kind==="protocol"?e:null}function er(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=z();let a;o[2]!==e?(a=je(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=h.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let f;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(f=l?()=>hn(i,c.client,t):_e,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=f):f=o[10];let g;return o[11]!==u||o[12]!==f?(g={queryKey:u,queryFn:f,staleTime:0},o[11]=u,o[12]=f,o[13]=g):g=o[13],L(g)}function tr(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=je(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,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=h.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let u;o[7]!==c||o[8]!==a||o[9]!==s?(u=c?()=>pt(s.client,a):_e,o[7]=c,o[8]=a,o[9]=s,o[10]=u):u=o[10];let f;return o[11]!==l||o[12]!==u?(f={queryKey:l,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=u,o[13]=f):f=o[13],L(f)}function nr(e,t,n){const o=P.c(16);let r;o[0]!==e?(r=je(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,c,l;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const g=Object.entries(n?.changes??{}).filter(bn).map(pn).sort(mn);a=g.map(vn);const d=JSON.stringify(g.map(gn));i=!!s&&!!t&&a.length>0,l=L,c=h.contentDeletedCopies(t??"",d),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=c,o[8]=l}else i=o[5],a=o[6],c=o[7],l=o[8];let u;o[9]!==i||o[10]!==a||o[11]!==s?(u=i?async()=>{const g=await pt(s.client,a),d=Object.create(null);for(const[v,b]of Object.entries(g.entries))d[v]=b.before&&typeof b.before=="object"?b.before:null;return d}:_e,o[9]=i,o[10]=a,o[11]=s,o[12]=u):u=o[12];let f;return o[13]!==c||o[14]!==u?(f={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY,placeholderData:Xt},o[13]=c,o[14]=u,o[15]=f):f=o[15],l(f)}function gn(e){return[e.name,e.base]}function vn(e){return e.name}function mn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function pn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function bn(e){const[,t]=e;return t.kind==="delete"}function bt(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 ie(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 wt=Zt({endpoint:qt().max(2048).refine(e=>bt(e)&&new URL(e).pathname==="/rpc").transform(ie)});function or(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=wt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function St(e){const t=wt.safeParse(e);return t.success?t.data:null}const yt="studio:deco-serve-last";function rr(e){try{localStorage.setItem(yt,JSON.stringify(e))}catch{}}function sr(){try{const e=localStorage.getItem(yt);return e?St(JSON.parse(e)):null}catch{return null}}function ir(e){try{return new URL(ie(e)).host}catch{return e}}function wn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Sn="http://localhost:4545/rpc",ar="npx @decocms/blocks serve",cr="npx @decocms/blocks schema";class Ae extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function yn(e){if(e instanceof Ae)return{reason:"not-deco-serve"};if(!(e instanceof D))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return $e(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 lr(e,t){if(e)return[ie(e.endpoint)];const n=[t?.endpoint,Sn].filter(o=>!!o).map(ie);return[...new Set(n)]}const Et=U.createContext(null);function En(e){const t=P.c(27),n=U.useContext(Et),o=Pe(n?null:e),{data:r}=Kt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?pe.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ke(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?pe.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[f,g]=Ke(u);if(n)return n;let d;t[8]!==c||t[9]!==i?(d=i?St(c):null,t[8]=c,t[9]=i,t[10]=d):d=t[10];const v=d,b=!!v;let w;t[11]!==o||t[12]!==b?(w=kn(o,b),t[11]=o,t[12]=b,t[13]=w):w=t[13];const{applies:I,undecided:T}=w,x=I?v:null,C=i&&o==="v8"&&typeof f=="string"?f:null;let _;t[14]!==g||t[15]!==l||t[16]!==i?(_=N=>{i&&(l(N),g(N.endpoint))},t[14]=g,t[15]=l,t[16]=i,t[17]=_):_=t[17];let E;t[18]!==l||t[19]!==i?(E=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=E):E=t[20];let k;return t[21]!==x||t[22]!==C||t[23]!==_||t[24]!==E||t[25]!==T?(k={connection:x,undecided:T,lastEndpoint:C,set:_,clear:E},t[21]=x,t[22]=C,t[23]=_,t[24]=E,t[25]=T,t[26]=k):k=t[26],k}function kn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function qe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ke(e){const t=P.c(17),n=z(),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?qe(e):null,a=()=>e?qe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:u}=L(l);let f;t[10]!==e||t[11]!==n||t[12]!==s?(f=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(s,b)}},t[10]=e,t[11]=n,t[12]=s,t[13]=f):f=t[13];const g=f,d=e?u??null:null;let v;return t[14]!==g||t[15]!==d?(v=[d,g],t[14]=g,t[15]=d,t[16]=v):v=t[16],v}function ur(e){return e.kind==="protocol"||e.kind==="unavailable"}function fr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function dr(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function hr(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&bt(t)?t:null}function gr(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function kt(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function On(e){if(!e.hasProject)return"legacy";const t=kt(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function Dn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function et(e){return e.isError||e.errorUpdateCount>0}function Tn(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 In(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 Ot="__noSchema";function _n(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ot]:!0}}function vr(e){return!!e&&e[Ot]===!0}function Dt(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function Cn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const Nn=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function mr(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:Cn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(Nn)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:tt(n.resolveType).localeCompare(tt(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function tt(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function nt(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]=nt(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?nt(s[a],r,n):s[a];return i}return e}function pr(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ot extends Error{}class rt extends Error{}const Tt="site-not-owned";async function Rn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Pn(e,t=r=>fetch(r),n,o){const r=xe({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(ue("v8")))i.headers.set(c,l);const a=await t(i);if(await Rn(a))throw new rt;if(await Ne(a))throw n?.(),new Re;return a}});try{const s=await Ue(r,be(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof rt)return Tt;throw s}}const Le=5e3;function xn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function $n(e){return new URL(fe(e,"rpc"),window.location.origin).href}async function Ue(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==Z)throw new Ae;const s=vt(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:be(t.schema)};if(!o)throw new Error("no schema.get");if(Dt(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:be(i?.schema)}}throw o.error}async function jn(e,t=n=>fetch(n)){const n=xe({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new ot;return r}});try{const o=await Ue(n);return o.v8Schema?o:null}catch(o){if(o instanceof ot)return null;throw o}}function It(e,t){const n=P.c(53),{org:o}=en(),{connection:r,undecided:s}=En(e),{runtime:i}=dt(e),a=U.useContext(Et),c=Pe(a?null:e),l=on(e),u=kt({hasServeConnection:!!r,runtime:i}),f=an()?.taskId??null,g=cn(ln().lifecycle.phase),d=z(),v=Dn({mode:u,mainSchema:c,workingTreeReady:g}),b=v.github&&!!o.slug&&!!e&&!!t;let w;n[0]!==t||n[1]!==o.slug||n[2]!==d||n[3]!==e?(w=()=>Pn(xn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ce(d,o.slug,e),ut(d,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=d,n[3]=e,n[4]=w):w=n[4];const I=L({queryKey:h.contentBackend(o.slug,e??"",t??"","github"),queryFn:w,enabled:b,staleTime:Number.POSITIVE_INFINITY,...st}),T=v.sandbox&&!!o.slug&&!!e&&!!t;let x;n[5]!==t||n[6]!==o.slug||n[7]!==f||n[8]!==e?(x=async()=>jn($n({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[5]=t,n[6]=o.slug,n[7]=f,n[8]=e,n[9]=x):x=n[9];const C=L({queryKey:h.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:x,enabled:T,staleTime:Number.POSITIVE_INFINITY,...st}),_=!!r;let E;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(E=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=E):E=n[13];let k;n[14]!==r?(k=()=>Ue(xe({endpoint:r.endpoint})),n[14]=r,n[15]=k):k=n[15];let N;n[16]!==_||n[17]!==E||n[18]!==k?(N={queryKey:E,queryFn:k,enabled:_,staleTime:Number.POSITIVE_INFINITY,retry:Un,retryDelay:Ln,refetchInterval:An},n[16]=_,n[17]=E,n[18]=k,n[19]=N):N=n[19];const p=L(N);let O;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(O=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=O):O=n[23];const $=O;let y;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(y=h.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=y):y=n[27];let R;n[28]!==p.data||n[29]!==$||n[30]!==d?(R=async()=>{try{return await p.data.client.describe()}catch(m){const Y=m;throw d.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),Y}},n[28]=p.data,n[29]=$,n[30]=d,n[31]=R):R=n[31];const j=!!p.data&&!a;let M;n[32]!==y||n[33]!==R||n[34]!==j?(M={queryKey:y,queryFn:R,enabled:j,refetchInterval:Le,retry:!1},n[32]=y,n[33]=R,n[34]=j,n[35]=M):M=n[35];const B=L(M).data??p.data?.describe,A=On({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:I.data===Tt?"not-owned":I.data?"v8":I.data===null?"v7":et(I)?"error":"loading",sandboxSite:Mn({data:C.data,isError:et(C),workingTreeReady:g}),markedV8:l});if(A==="pending"){let m;return n[36]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[36]=m):m=n[36],m}if(A==="retrying-github"){let m;return n[37]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"github"},n[37]=m):m=n[37],m}if(A==="retrying-sandbox"){let m;return n[38]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[38]=m):m=n[38],m}if(A==="legacy"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[39]=m):m=n[39],m}if(A==="protocol-github"){const m=I.data;let Y;return n[40]!==m?(Y=ke("github",m,""),n[40]=m,n[41]=Y):Y=n[41],Y}if(A==="site-not-owned-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=m):m=n[42],m}if(A==="protocol-sandbox"){let m;return n[43]!==C.data?(m=ke("sandbox",C.data,":sandbox"),n[43]=C.data,n[44]=m):m=n[44],m}if(A==="unavailable-github"){let m;return n[45]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[45]=m):m=n[45],m}const W=p.error??p.failureReason,ve=r?.endpoint??"";let te;return n[46]!==B||n[47]!==p.data||n[48]!==p.failureCount||n[49]!==p.isError||n[50]!==W||n[51]!==ve?(te=Qn({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:W,describe:B,endpoint:ve}),n[46]=B,n[47]=p.data,n[48]=p.failureCount,n[49]=p.isError,n[50]=W,n[51]=ve,n[52]=te):te=n[52],te}function An(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Le:!1}function Ln(e){return wn(e+1)}function Un(e,t){return!(t instanceof D)&&!(t instanceof Ae)}function Mn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const Fn=3;function Qn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ke("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<Fn?t:{kind:"unavailable",source:"local",problem:yn(e.failure)}:t??{kind:"pending"}}const st={retry:2,refetchInterval:e=>e.state.status==="error"?Le:!1};function ke(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function _t(e){const t=P.c(13);let n;t[0]!==e?(n=pe.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=tn(o,null),i=Pe(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const g=e?We(r):null;a=Vn({saved:g,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,u;t[6]!==s?(l=g=>s(We(g)),u=()=>s(null),t[6]=s,t[7]=l,t[8]=u):(l=t[7],u=t[8]);let f;return t[9]!==c||t[10]!==l||t[11]!==u?(f={...c,setUrl:l,clear:u},t[9]=c,t[10]=l,t[11]=u,t[12]=f):f=t[12],f}function Vn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function Bn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function it(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class Me 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 Fe(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function de(e,t,n){return["decofile-write",e,t,n]}function Hn(e,t,n){return{id:de(e,t,n).join(":")}}function Qe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Jn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Gn(e,t,n){e.setQueryData(h.decofileDraft(Fe(t)),n)}function Wn(e,t){return e.getQueryData(h.decofileDraft(Fe(t)))??null}async function Yn(e,t){const n=await fetch(Qe(e),{cache:"no-store",headers:{...ue("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function br(e){const t=P.c(4);let n;t[0]!==e?(n=h.decofileDraft(e?Fe(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:zn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=L(o);return r??null}async function zn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Xn(e,t){const n=await fetch(Qe(t),{cache:"no-store",headers:ue("v7")});if(await Ne(n))throw Ce(e,t.orgSlug,t.virtualMcpId),new Re;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&&Gn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function wr(e,t){const n=await fetch(Qe(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 Me(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Jn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ct=3e3,Zn=15e3,qn=2*6e4,Nt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Kn(e){return e<qn?Ct:Zn}function eo(e,t=Nt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Kn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let u;try{u=c()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const at=()=>0;function to(e,t,n=Nt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>eo(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,at,at)}function Rt(e,t){return fe(e,t)}function no(e,t){return fe(e,"preview-fetch",{path:t})}function Sr(e){return Rt(e,"preview-invoke")}function yr(e){return Rt(e,"catalog-invoke")}function Pt(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 oo(){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&&Pt(n))return n}return null}function ro(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??oo();return n&&Pt(n)?new URL(t,n).toString():no(e,t)}function so(e){return ro(e,"/.decofile")}function io(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function ct(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function ao(e,t){const n=fe(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=io(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:rn(s.content)}}async function co(e,t){const n=await ao(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Er(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 lo(e){return sn(e)?.metadata?.runtime?.path??null}class xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function kr(e){return e instanceof D&&e.code===S.Conflict}function $t(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 Ve extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Be extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function Or(e,t){return(t instanceof Ve||t instanceof Be)&&(t.message=jt(e,t,"github")),t}function jt(e,t,n){if(t instanceof Ve)return e("siteEditor.save.draftUnread");if(t instanceof Be)return e("siteEditor.save.keptChanging");if(t instanceof Me)return t.message;if(n==="local")return fo(e,t);if(t instanceof D)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 Me||e instanceof Ve||e instanceof Be)return null;if(e instanceof D){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?$t(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function fo(e,t){if(t instanceof xt)return e("decoServe.save.serverGone");if(t instanceof D)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:$t(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function ho(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function go(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=ho(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const vo="decocms:content-writes",Oe=new Set;let H;function At(){if(H!==void 0)return H;H=null;try{typeof BroadcastChannel=="function"&&(H=new BroadcastChannel(vo),H.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Oe])n(t)}))}catch{H=null}return H}function mo(e){try{At()?.postMessage({cacheKey:e})}catch{}}function po(e){return At(),Oe.add(e),()=>{Oe.delete(e)}}const Lt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},bo=15e3,ae=new Map;function G(e,t){return`${e}/${t}`}function Q(e){let t=ae.get(e);return t||(t={state:Lt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ae.set(e,t)),t}function V(e,t){const n=Q(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function he(e){e.timer&&clearTimeout(e.timer),e.timer=null}function He(e){return ae.get(e)?.state??Lt}function wo(e,t){const n=Q(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Dr(e){const t=Q(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(he(t),V(e,{phase:"idle"}))}}function Tr(e){const t=ae.get(e);!t||t.state.phase!=="reloading"||(he(t),V(e,{phase:"idle"}))}function Ut(e){const t=Q(e);he(t),V(e,{phase:"saving",inFlight:t.state.inFlight+1})}function oe(e,t){const n=Q(e),o=Math.max(0,n.state.inFlight-1);if(o>0){V(e,{inFlight:o});return}if(!t.ok||n.previews===0){V(e,{phase:"idle",inFlight:o});return}Mt(e,t.navigates,o)}function Mt(e,t,n=0){const o=Q(e);he(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&V(e,{phase:"idle"})},bo),V(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function So(e){return e?.kind==="protocol"&&e.source==="github"}async function re(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:h.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?h.protocolDraftRead(o,r,s):null,u=l?JSON.stringify(n.getQueryData(l)??null):null,f=c?[c]:[];if(a&&t.reread&&f.push(n.invalidateQueries({queryKey:h.decofile(a)})),a&&!t.adopted&&f.push(n.invalidateQueries({queryKey:h.contentChanges(a)})),s&&i.source==="sandbox"&&f.push(n.invalidateQueries({queryKey:un(o,r,s)})),So(i)&&l&&!t.adopted&&f.push(n.invalidateQueries({queryKey:l})),await Promise.all(f),t.kind!=="edit"){const v=G(o,r);V(v,{epoch:He(v).epoch+1})}const g=l?JSON.stringify(n.getQueryData(l)??null):null,d=u!==g;return d&&await new Promise(v=>ft.schedule(v)),{navigates:d}}async function yo(e,t){return Ut(G(e.orgSlug,e.virtualMcpId)),Ft(e,t)}function lt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(h.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Ft(e,t){const n=G(e.orgSlug,e.virtualMcpId),o=t.adopted?lt(e):null;let r;try{r=await t.write()}catch(i){throw oe(n,{ok:!1,navigates:!1}),t.refreshOnError&&re(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&mo(e.cacheKey),t.adopted){const i=lt(e)!==o;return i&&await new Promise(a=>ft.schedule(a)),oe(n,{ok:!0,navigates:i}),t.reread&&re(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await re(e,t))}catch{}finally{oe(n,{ok:!0,navigates:s})}return r}function Ir(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=G(o,r),a=new Set(t.blockKeys);for(const u of[...Q(i).discardListeners])u(a);Ut(i);let c=!1;const l=()=>(c=!0,Ft(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:de(o,r,s),scope:Hn(o,r,s),mutationFn:l}).execute(void 0).catch(u=>{throw c||oe(i,{ok:!1,navigates:!1}),u}):l()}function _r(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=G(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 c=Q(s).discardListeners;return c.add(n),()=>{c.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],U.useEffect(i,a)}function Eo(e){const t=G(e.orgSlug,e.virtualMcpId);He(t).inFlight>0||re(e,{kind:"external"}).then(({navigates:n})=>{const o=Q(t);o.previews>0&&o.state.inFlight===0&&Mt(t,n)}).catch(()=>{})}function ko(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=G(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>wo(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>He(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Oo=500;function Cr(e,t){const{phase:n}=ko(e,t);return go(n!=="idle",Oo)}function Do(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function To(e,t){return h.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function Nr(e,t,n,o){if(o?.source==="github")return Io(e,t,n);const r=e.getQueryData(h.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(h.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function K(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(r=>F(r)===n);return o===void 0?void 0:e.changes[o]}function Io(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(o)return Qt(o,ge(e,t),n)}function Qt(e,t,n){const o=K(e,n);return o?.kind==="delete"?o.version??we:o?o.version:t.has(F(n))?we:null}function Rr(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(!o)return!1;const r=K(o,n);return r?r.kind==="set"&&r.baseVersion===null:ge(e,t).has(F(n))}function Pr(e,t){const n=e.getQueryData(h.decofile(t)),o=e.getQueryData(h.contentChanges(t));if(!n||!o)return null;const r=ge(e,t);return{blocks:n,versionOf:s=>Qt(o,r,s)}}function ge(e,t){return new Set(e.getQueryData(h.contentDraftTombstones(t)))}function ce(e,t,n,o){const r=F(n),s=ge(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),ee(e),e.setQueryData(h.contentDraftTombstones(t),[...s]))}function _o(e,t,n,o){const r=Ge(o.revision),s=e.getQueryData(h.contentRevision(n))?.revision,i=s?Ge(s):null,a=r&&!r.main&&i?nn(i.main,r.draft):o.revision,c=e.getQueryData(h.contentVersions(n)),l=Object.entries(o.versions??{}).map(([d,v])=>[d,v===we?null:v]),u=e.getQueryData(h.contentChanges(n)),f=new Set(l.flatMap(([d])=>{const v=u?K(u,d):void 0;return(v?v.baseVersion:c?.[d]??null)===null?[d]:[]})),g=new Set(l.flatMap(([d,v])=>v===null?[]:[F(d)]));e.setQueryData(h.contentChanges(n),d=>{if(!d)return d;const v={...d.changes};for(const[b,w]of l){const I=K(d,b),T=I?I.baseVersion:c?.[b]??null;w!==null?v[b]={kind:"set",version:w,baseVersion:T}:T!==null?v[b]={kind:"delete",version:null,baseVersion:T}:delete v[b]}return{...d,changes:v,edited:!0}});for(const[d,v]of l)v!==null?ce(e,n,d,!1):!g.has(F(d))&&f.has(d)&&ce(e,n,d,!0);return r&&r.draft!=="none"&&e.setQueryData(h.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),d=>d&&{...d,version:r.draft}),a}function Je(e,t,n){ee(e),e.setQueryData(h.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 Co(e,t){const n=e.getMutationCache().findAll({mutationKey:de(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>In(o.state.variables)))}function De(e,t){e.resetQueries({queryKey:h.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function le(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof D);throw t.source==="local"&&s?(De(e,n),new xt(r)):(t.source==="local"&&$e(r)&&De(e,n),r)}}const se=new Map;function Vt(e,t,n,o){const r=se.get(o);if(r)return r;const s=Bt(e,t,n,o,!0);return se.set(o,s),s.finally(()=>se.delete(o))}const me=new Set;function No(e,t,n){const o=P.c(8),r=z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let c,l;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(c=()=>{if(!e||!s||!i||!a)return;const u={orgSlug:s,virtualMcpId:i,branch:a};return po(f=>{f===n&&(me.has(n)||(me.add(n),Po(r,e,u,n).catch(Ro).finally(()=>me.delete(n))))})},l=[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]=c,o[7]=l):(c=o[6],l=o[7]),U.useEffect(c,l)}function Ro(){}async function Po(e,t,n,o){const r=se.get(o);return r&&await r.catch(()=>{}),Vt(e,t,n,o)}async function Bt(e,t,n,o,r){ee(e);const s=h.decofile(o),i=To(n,t),a=h.contentRevision(o),c=h.contentVersions(o),l=e.getQueryData(s),u=e.getQueryData(c),f=e.getQueryData(i),g=e.getQueryData(a)??void 0,d=t.source==="github"&&!f?ut(e,n.orgSlug,n.virtualMcpId):void 0,v=d?.isV8&&d.schema&&d.version?d:void 0,b=f??v?.schema,w=v?{...g,schemaVersion:v.version}:g,I=r&&l&&u?w?.revision:void 0,T=r&&b?w?.schemaVersion:void 0,x=h.contentChanges(o),C=e.getQueryData(x),[_,E,k]=await le(e,t,n,()=>t.client.batch([{method:"blocks.list",params:I?{ifNoneMatch:I}:{}},{method:"schema.get",params:T?{ifNoneMatch:T}:{}},{method:"changes.list",params:mt(C)}])),N=e.getQueryData(a)?.revision,p=N!==void 0&&N!==w?.revision;if(k?.ok){const X=p?null:Ee(C,k.result);X&&e.setQueryData(x,X)}else k&&t.source==="local"&&$e(k.error)&&De(e,n);if(!_?.ok)throw _?.error??new Error("no blocks.list");if(!E)throw new Error("no schema.get");const O=_.result,$=Dt(E),y=E.ok&&!$?E.result:null;if(O.notModified&&(!l||!u)||y?.notModified&&!b)return Bt(e,t,n,o,!1);const R=O.notModified?new Set:Co(e,n),j=O.notModified?l:Tn(O.blocks,l,R),M=$?_n():y?y.notModified?b:y.schema:E.error;if(e.setQueryData(a,{revision:p?N:O.notModified?w?.revision:O.revision,schemaVersion:y?y.notModified?w?.schemaVersion:y.version??void 0:void 0}),e.setQueryData(s,j),!O.notModified){const X=e.getQueryData(c),B={...O.versions};for(const A of R){const W=X?.[A];W!==void 0?B[A]=W:delete B[A]}e.setQueryData(c,B)}return M instanceof D||e.setQueryData(i,M),!p&&!O.notModified&&l&&w?.revision&&O.revision!==w.revision&&Eo({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:M}}async function xr(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(", ")})`)}return yo({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=await le(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));ee(e);const a=t.source==="github"?_o(e,n,o,i):i.revision;e.setQueryData(h.contentRevision(o),l=>({...l,revision:a}));const c=i.versions??{};return Je(e,o,c),{revision:a,versions:c}}})}function Ht(e,t){if(!(e instanceof D))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 Jt(e,t,n){if(!(n instanceof D))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&ce(e,t,r,!1)}function Gt(e,t,n,o){ee(e);const r=o.block===null,s=e.getQueryData(h.contentVersions(t)),i=e.getQueryData(h.contentChanges(t)),a=i?K(i,n):void 0,c=a?a.baseVersion:s?.[n]??null;if(i){const l=F(n),u=Object.fromEntries(Object.entries(i.changes).filter(([f])=>F(f)!==l));r?c!==null&&(u[n]={kind:"delete",version:null,baseVersion:c}):u[n]={kind:"set",version:o.version,baseVersion:c},e.setQueryData(h.contentChanges(t),{...i,changes:u,edited:!0})}ce(e,t,n,r&&c===null),e.setQueryData(h.decofile(t),l=>{const u={...l};return r?delete u[n]:u[n]=o.block,u}),Je(e,t,{[n]:r?null:o.version})}function $r(e,t,n,o){if(t.source!=="github"||!(o instanceof D))return!1;Jt(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>Ht(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:h.decofile(n)}),s.forEach((a,c)=>{Gt(e,n,a,i[c])}),!0)}async function jr(e,t,n,o,r,s){t.source==="github"&&Jt(e,o,s);const i=t.source==="github"?Ht(s,r):void 0;if(i)return e.cancelQueries({queryKey:h.decofile(o)}),Gt(e,o,r,i),!0;await e.invalidateQueries({queryKey:h.decofile(o)});let a;try{const l=(await le(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(l&&l.after===null&&l.version!==null)return!1;a={value:l?.after??null,version:l?.version??null},t.source==="github"&&e.setQueryData(h.contentChanges(o),u=>{if(!u)return u;const f={...u.changes};return l?.kind?f[r]={kind:l.kind,version:l.version,baseVersion:l.baseVersion}:delete f[r],{...u,changes:f,edited:!0}})}catch{const c=await le(e,t,n,()=>t.client.blocksList({}));if(c.notModified)return!1;a={value:c.blocks[r]??null,version:c.versions[r]??null}}return e.setQueryData(h.decofile(o),c=>{const l={...c};return a.value===null?delete l[r]:l[r]=a.value,l}),Je(e,o,{[r]:a.version}),!1}function xo(e){const t=P.c(15),n=z();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=h.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const d=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ue("v8")});if(await Ne(d))throw Ce(n,e.orgSlug,e.virtualMcpId),new Re;if(!d.ok)throw new Error(`draft pointer read failed: ${d.status}`);return await d.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:c,isError:l}=L(i),u=!!e&&c&&!l;if(!e||!a?.draft||!a.version){let d;return t[11]!==u?(d={pointer:null,pending:u},t[11]=u,t[12]=d):d=t[12],d}const f=`${a.draft}@${a.version}`;let g;return t[13]!==f?(g={pointer:f,pending:!1},t[13]=f,t[14]=g):g=t[14],g}function Ar(e){return xo(e).pointer}function Lr(e){const t=P.c(4);let n;t[0]!==e?(n=h.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:$o,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=L(o);return r?.revision}async function $o(){throw new Error("content revisions are set by reads and writes")}function Te(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Ur(e,t){return Te({...e,protocolSuffix:t.cacheKeySuffix})}function jo(e,t){const n=P.c(6),{url:o}=_t(e?.virtualMcpId),r=It(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"?Te({...e,protocolSuffix:r.cacheKeySuffix}):Te({...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 Mr(e,t){const n=P.c(39),{url:o,undecided:r}=_t(e?.virtualMcpId),s=!!o,i=It(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=jo(e),l=t?.fetchEnabled??!0,u=lo(e?.virtualMcpId),f=dt(e?.virtualMcpId).runtime==="cms",g=z();let d;n[0]!==c?(d=h.decofile(c),n[0]=c,n[1]=d):d=n[1];const v=d;No(a,a&&e?e:null,c);let b;n[2]!==e||n[3]!==g||n[4]!==v?(b=()=>{if(!e||g.isMutating({mutationKey:de(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const p=g.getQueryState(v);return p?.fetchStatus==="fetching"||Date.now()-(p?.dataUpdatedAt??0)<Ct/2},n[2]=e,n[3]=g,n[4]=v,n[5]=b):b=n[5];let w;n[6]!==f||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==g||n[11]!==v?(w=async()=>{if(e){if(!a&&f&&!s){const p=Wn(g,e)?.version;if(p&&!await Yn(e,p))return}await g.refetchQueries({queryKey:v,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=s,n[8]=e,n[9]=a,n[10]=g,n[11]=v,n[12]=w):w=n[12];let I;n[13]!==b||n[14]!==w?(I={skip:b,read:w},n[13]=b,n[14]=w,n[15]=I):I=n[15],to(!!t?.pollWhile&&!!e,I);let T;n[16]!==i.kind||n[17]!==f||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==g?(T=async()=>{if(a)return(await Vt(g,a,e,c)).blocks;if(i.kind==="unavailable")throw Do("decofile");if(s){const y=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Uo),R=y?.ok?it(await y.text()):null;if(R)return R;const j=new Error("decofile unavailable (local tunnel unreachable)");throw j.status=502,j}if(f)return Xn(g,e);const p=()=>co(e,Bn(u,".deco/blocks.gen.json"));if(l){const y=await fetch(so(e),{cache:"no-store"}).catch(Lo);if(y?.ok){const M=it(await y.text());if(M)return M}const R=await p();if(R.kind==="data")return R.data;const j=new Error(`Failed to fetch decofile: ${y?.status??"network error"}`);throw j.status=ct({liveOk:!!y?.ok,liveStatus:y?.status,committedAbsent:R.kind==="absent"}),j}const O=await p();if(O.kind==="data")return O.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=ct({liveOk:!1,committedAbsent:O.kind==="absent"}),$},n[16]=i.kind,n[17]=f,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=g,n[26]=T):T=n[26];const x=!!e&&i.kind!=="pending"&&!r,C=a?0:3e4,_=a?.describe.pollIntervalMs,E=a?"always":void 0;let k;n[27]!==f||n[28]!==s||n[29]!==a?(k=(p,O)=>{if(a||f||s)return p<3;const $=O.status;return $!==502&&$!==404&&p<2},n[27]=f,n[28]=s,n[29]=a,n[30]=k):k=n[30];let N;return n[31]!==v||n[32]!==T||n[33]!==x||n[34]!==C||n[35]!==_||n[36]!==E||n[37]!==k?(N={queryKey:v,queryFn:T,enabled:x,staleTime:C,refetchInterval:_,refetchIntervalInBackground:!1,refetchOnWindowFocus:E,retry:k,retryDelay:Ao},n[31]=v,n[32]=T,n[33]=x,n[34]=C,n[35]=_,n[36]=E,n[37]=k,n[38]=N):N=n[38],L(N)}function Ao(e){return fn(5e3,1e3,e,2,0)}function Lo(){return null}function Uo(){return null}const Mo="site-editor-save",Wt={id:Mo,description:void 0,action:void 0,cancel:void 0},Fr="site-editor-undo",Ie="site-editor-publish";function Fo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=J.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=J.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=J.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Yt(e,t){return t?J.jsx(Fo,{label:e("siteEditor.details"),detail:t}):void 0}function Qr(e,t,n){q.error(jt(e,t,n),{...Wt,description:Yt(e,uo(t,n))})}function Vr(e,t,n=!1){q.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Wt,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const zt={action:void 0,duration:void 0};function Br(e,t){q.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...zt,id:Ie,description:void 0})}function Hr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Yt(e,o??null);q[i](t,{id:Ie,description:n&&a?J.jsxs(J.Fragment,{children:[J.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),q.loading(s??e("thread.publishPopover.publishing"),{...zt,id:Ie,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Jr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Gn as $,Dr as A,ko as B,Tr as C,jo as D,Lr as E,Hn as F,de as G,yo as H,ao as I,Jn as J,Ur as K,er as L,nr as M,Vr as N,Rr as O,Or as P,Me as Q,kr as R,ar as S,Et as T,Po as U,Ve as V,xr as W,jr as X,Qr as Y,Nr as Z,To as _,lr as a,wr as a0,_r as a1,Pr as a2,fr as a3,mr as a4,tt as a5,nt as a6,pr as a7,cr as a8,ro as a9,D as aA,S as aB,yr as aC,gr as aa,Sn as ab,Yt as ac,Jr as ad,tr as ae,hn as af,Fo as ag,Vt as ah,Do as ai,Er as aj,co as ak,Be as al,$r as am,Ir as an,qo as ao,Ko as ap,$e as aq,Br as ar,br as as,Ar as at,Hr as au,Ie as av,zt as aw,Fr as ax,Wt as ay,Co as az,En as b,_t as c,wn as d,ir as e,yn as f,Ue as g,xe as h,bt as i,Sr as j,no as k,Mr as l,ur as m,vr as n,lo as o,or as p,Bn as q,sr as r,rr as s,kt as t,It as u,hr as v,Cr as w,dr as x,xo as y,G as z};
|
|
1
|
+
import{c as P,q as z,m as L,K as h,eQ as _e,ah as Xt,aK as Zt,aL as qt,r as U,a as Kt,az as pe,a4 as en,eR as ut,eS as Ce,bh as be,eT as ue,eU as Ne,eV as Re,ax as tn,br as ft,bj as F,eW as ee,eX as we,eY as Ge,eZ as nn,t as q,j as J}from"./index-D6lKvaoF.js";import{u as dt}from"./use-session-runtime-oQf5p7F0.js";import{s as We}from"./thread-intent-B7fQ4X9a.js";import{u as Pe,b as on}from"./experiments-tab-choice-0iIRb8Mb.js";import{b as fe}from"./sandbox-url-D3mC8qhT.js";import{s as rn}from"./utils-CLU7TQYj.js";import{a as sn}from"./repository-binding-DG0YfJ0p.js";import{u as an}from"./chat-context-CFRPrQEn.js";import{i as cn,u as ln}from"./use-sandbox-events-DDEe74Lx.js";import{a as un}from"./sandbox-git-api-DcqI6XE4.js";import{e as fn}from"./backoff-CrEUbyZT.js";const S={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class D extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new D(t.code,t.message,t.data)}}const Z="deco-content",Se={major:1},ht=1;async function dn(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 ye={major:Se.major,minor:ht},gt=`the endpoint speaks an older ${Z} than this client needs (${ye.major}.${ye.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ne(e,t,n){const o={reason:t,required:{...ye}};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 D(S.Unsupported,e,o)}function vt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==Z)throw ne(`the endpoint speaks ${JSON.stringify(n)}, not ${Z}`,"protocol",t);if(o?.major!==Se.major)throw ne(`the endpoint speaks ${Z} ${String(o?.major)}.x; this client speaks ${Se.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ht)throw ne(gt,"outdated",t);return e}function Ye(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?ne(gt,"outdated"):D.from(t)}function xe(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 c;try{c=await dn(a)}catch{throw new D(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?D.from(l):new D(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Ye(s,c.error);return c.result};return{call:r,describe:async()=>vt(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((l,u)=>({jsonrpc:"2.0",id:i[u],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,u)=>{const f=c.get(l);return f?f.error?{ok:!1,error:Ye(s[u].method,f.error)}:{ok:!0,result:f.result}:{ok:!1,error:new D(S.InternalError,"no response for this call")}})}}}function mt(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const ze=20,Xe=5,Ze=500;function $e(e){return e instanceof D?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function Ee(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function hn(e,t,n){const o=h.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(mt(r)),i=Ee(r,s);if(i)return i;const a=await t.changesList({});return Ee(void 0,a)}async function pt(e,t){const n=[];for(let s=0;s<t.length;s+=ze)n.push(t.slice(s,s+ze));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Xe){const i=await e.batch(n.slice(s,s+Xe).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function qo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Ze){const r=t.slice(o,o+Ze),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 Ko(e){return e instanceof D&&e.code===S.Conflict}function je(e){return e?.kind==="protocol"?e:null}function er(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=z();let a;o[2]!==e?(a=je(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=h.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let f;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(f=l?()=>hn(i,c.client,t):_e,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=f):f=o[10];let g;return o[11]!==u||o[12]!==f?(g={queryKey:u,queryFn:f,staleTime:0},o[11]=u,o[12]=f,o[13]=g):g=o[13],L(g)}function tr(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=je(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,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=h.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let u;o[7]!==c||o[8]!==a||o[9]!==s?(u=c?()=>pt(s.client,a):_e,o[7]=c,o[8]=a,o[9]=s,o[10]=u):u=o[10];let f;return o[11]!==l||o[12]!==u?(f={queryKey:l,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=u,o[13]=f):f=o[13],L(f)}function nr(e,t,n){const o=P.c(16);let r;o[0]!==e?(r=je(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,c,l;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const g=Object.entries(n?.changes??{}).filter(bn).map(pn).sort(mn);a=g.map(vn);const d=JSON.stringify(g.map(gn));i=!!s&&!!t&&a.length>0,l=L,c=h.contentDeletedCopies(t??"",d),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=c,o[8]=l}else i=o[5],a=o[6],c=o[7],l=o[8];let u;o[9]!==i||o[10]!==a||o[11]!==s?(u=i?async()=>{const g=await pt(s.client,a),d=Object.create(null);for(const[v,b]of Object.entries(g.entries))d[v]=b.before&&typeof b.before=="object"?b.before:null;return d}:_e,o[9]=i,o[10]=a,o[11]=s,o[12]=u):u=o[12];let f;return o[13]!==c||o[14]!==u?(f={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY,placeholderData:Xt},o[13]=c,o[14]=u,o[15]=f):f=o[15],l(f)}function gn(e){return[e.name,e.base]}function vn(e){return e.name}function mn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function pn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function bn(e){const[,t]=e;return t.kind==="delete"}function bt(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 ie(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 wt=Zt({endpoint:qt().max(2048).refine(e=>bt(e)&&new URL(e).pathname==="/rpc").transform(ie)});function or(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=wt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function St(e){const t=wt.safeParse(e);return t.success?t.data:null}const yt="studio:deco-serve-last";function rr(e){try{localStorage.setItem(yt,JSON.stringify(e))}catch{}}function sr(){try{const e=localStorage.getItem(yt);return e?St(JSON.parse(e)):null}catch{return null}}function ir(e){try{return new URL(ie(e)).host}catch{return e}}function wn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Sn="http://localhost:4545/rpc",ar="npx @decocms/blocks serve",cr="npx @decocms/blocks schema";class Ae extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function yn(e){if(e instanceof Ae)return{reason:"not-deco-serve"};if(!(e instanceof D))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return $e(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 lr(e,t){if(e)return[ie(e.endpoint)];const n=[t?.endpoint,Sn].filter(o=>!!o).map(ie);return[...new Set(n)]}const Et=U.createContext(null);function En(e){const t=P.c(27),n=U.useContext(Et),o=Pe(n?null:e),{data:r}=Kt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?pe.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ke(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?pe.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[f,g]=Ke(u);if(n)return n;let d;t[8]!==c||t[9]!==i?(d=i?St(c):null,t[8]=c,t[9]=i,t[10]=d):d=t[10];const v=d,b=!!v;let w;t[11]!==o||t[12]!==b?(w=kn(o,b),t[11]=o,t[12]=b,t[13]=w):w=t[13];const{applies:I,undecided:T}=w,x=I?v:null,C=i&&o==="v8"&&typeof f=="string"?f:null;let _;t[14]!==g||t[15]!==l||t[16]!==i?(_=N=>{i&&(l(N),g(N.endpoint))},t[14]=g,t[15]=l,t[16]=i,t[17]=_):_=t[17];let E;t[18]!==l||t[19]!==i?(E=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=E):E=t[20];let k;return t[21]!==x||t[22]!==C||t[23]!==_||t[24]!==E||t[25]!==T?(k={connection:x,undecided:T,lastEndpoint:C,set:_,clear:E},t[21]=x,t[22]=C,t[23]=_,t[24]=E,t[25]=T,t[26]=k):k=t[26],k}function kn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function qe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ke(e){const t=P.c(17),n=z(),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?qe(e):null,a=()=>e?qe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:u}=L(l);let f;t[10]!==e||t[11]!==n||t[12]!==s?(f=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(s,b)}},t[10]=e,t[11]=n,t[12]=s,t[13]=f):f=t[13];const g=f,d=e?u??null:null;let v;return t[14]!==g||t[15]!==d?(v=[d,g],t[14]=g,t[15]=d,t[16]=v):v=t[16],v}function ur(e){return e.kind==="protocol"||e.kind==="unavailable"}function fr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function dr(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function hr(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&bt(t)?t:null}function gr(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function kt(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function On(e){if(!e.hasProject)return"legacy";const t=kt(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function Dn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function et(e){return e.isError||e.errorUpdateCount>0}function Tn(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 In(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 Ot="__noSchema";function _n(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ot]:!0}}function vr(e){return!!e&&e[Ot]===!0}function Dt(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function Cn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const Nn=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function mr(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:Cn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(Nn)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:tt(n.resolveType).localeCompare(tt(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function tt(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function nt(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]=nt(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?nt(s[a],r,n):s[a];return i}return e}function pr(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ot extends Error{}class rt extends Error{}const Tt="site-not-owned";async function Rn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Pn(e,t=r=>fetch(r),n,o){const r=xe({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(ue("v8")))i.headers.set(c,l);const a=await t(i);if(await Rn(a))throw new rt;if(await Ne(a))throw n?.(),new Re;return a}});try{const s=await Ue(r,be(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof rt)return Tt;throw s}}const Le=5e3;function xn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function $n(e){return new URL(fe(e,"rpc"),window.location.origin).href}async function Ue(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==Z)throw new Ae;const s=vt(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:be(t.schema)};if(!o)throw new Error("no schema.get");if(Dt(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:be(i?.schema)}}throw o.error}async function jn(e,t=n=>fetch(n)){const n=xe({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new ot;return r}});try{const o=await Ue(n);return o.v8Schema?o:null}catch(o){if(o instanceof ot)return null;throw o}}function It(e,t){const n=P.c(53),{org:o}=en(),{connection:r,undecided:s}=En(e),{runtime:i}=dt(e),a=U.useContext(Et),c=Pe(a?null:e),l=on(e),u=kt({hasServeConnection:!!r,runtime:i}),f=an()?.taskId??null,g=cn(ln().lifecycle.phase),d=z(),v=Dn({mode:u,mainSchema:c,workingTreeReady:g}),b=v.github&&!!o.slug&&!!e&&!!t;let w;n[0]!==t||n[1]!==o.slug||n[2]!==d||n[3]!==e?(w=()=>Pn(xn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ce(d,o.slug,e),ut(d,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=d,n[3]=e,n[4]=w):w=n[4];const I=L({queryKey:h.contentBackend(o.slug,e??"",t??"","github"),queryFn:w,enabled:b,staleTime:Number.POSITIVE_INFINITY,...st}),T=v.sandbox&&!!o.slug&&!!e&&!!t;let x;n[5]!==t||n[6]!==o.slug||n[7]!==f||n[8]!==e?(x=async()=>jn($n({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[5]=t,n[6]=o.slug,n[7]=f,n[8]=e,n[9]=x):x=n[9];const C=L({queryKey:h.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:x,enabled:T,staleTime:Number.POSITIVE_INFINITY,...st}),_=!!r;let E;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(E=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=E):E=n[13];let k;n[14]!==r?(k=()=>Ue(xe({endpoint:r.endpoint})),n[14]=r,n[15]=k):k=n[15];let N;n[16]!==_||n[17]!==E||n[18]!==k?(N={queryKey:E,queryFn:k,enabled:_,staleTime:Number.POSITIVE_INFINITY,retry:Un,retryDelay:Ln,refetchInterval:An},n[16]=_,n[17]=E,n[18]=k,n[19]=N):N=n[19];const p=L(N);let O;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(O=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=O):O=n[23];const $=O;let y;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(y=h.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=y):y=n[27];let R;n[28]!==p.data||n[29]!==$||n[30]!==d?(R=async()=>{try{return await p.data.client.describe()}catch(m){const Y=m;throw d.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),Y}},n[28]=p.data,n[29]=$,n[30]=d,n[31]=R):R=n[31];const j=!!p.data&&!a;let M;n[32]!==y||n[33]!==R||n[34]!==j?(M={queryKey:y,queryFn:R,enabled:j,refetchInterval:Le,retry:!1},n[32]=y,n[33]=R,n[34]=j,n[35]=M):M=n[35];const B=L(M).data??p.data?.describe,A=On({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:I.data===Tt?"not-owned":I.data?"v8":I.data===null?"v7":et(I)?"error":"loading",sandboxSite:Mn({data:C.data,isError:et(C),workingTreeReady:g}),markedV8:l});if(A==="pending"){let m;return n[36]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[36]=m):m=n[36],m}if(A==="retrying-github"){let m;return n[37]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"github"},n[37]=m):m=n[37],m}if(A==="retrying-sandbox"){let m;return n[38]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[38]=m):m=n[38],m}if(A==="legacy"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[39]=m):m=n[39],m}if(A==="protocol-github"){const m=I.data;let Y;return n[40]!==m?(Y=ke("github",m,""),n[40]=m,n[41]=Y):Y=n[41],Y}if(A==="site-not-owned-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=m):m=n[42],m}if(A==="protocol-sandbox"){let m;return n[43]!==C.data?(m=ke("sandbox",C.data,":sandbox"),n[43]=C.data,n[44]=m):m=n[44],m}if(A==="unavailable-github"){let m;return n[45]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[45]=m):m=n[45],m}const W=p.error??p.failureReason,ve=r?.endpoint??"";let te;return n[46]!==B||n[47]!==p.data||n[48]!==p.failureCount||n[49]!==p.isError||n[50]!==W||n[51]!==ve?(te=Qn({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:W,describe:B,endpoint:ve}),n[46]=B,n[47]=p.data,n[48]=p.failureCount,n[49]=p.isError,n[50]=W,n[51]=ve,n[52]=te):te=n[52],te}function An(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Le:!1}function Ln(e){return wn(e+1)}function Un(e,t){return!(t instanceof D)&&!(t instanceof Ae)}function Mn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const Fn=3;function Qn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ke("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<Fn?t:{kind:"unavailable",source:"local",problem:yn(e.failure)}:t??{kind:"pending"}}const st={retry:2,refetchInterval:e=>e.state.status==="error"?Le:!1};function ke(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function _t(e){const t=P.c(13);let n;t[0]!==e?(n=pe.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=tn(o,null),i=Pe(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const g=e?We(r):null;a=Vn({saved:g,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,u;t[6]!==s?(l=g=>s(We(g)),u=()=>s(null),t[6]=s,t[7]=l,t[8]=u):(l=t[7],u=t[8]);let f;return t[9]!==c||t[10]!==l||t[11]!==u?(f={...c,setUrl:l,clear:u},t[9]=c,t[10]=l,t[11]=u,t[12]=f):f=t[12],f}function Vn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function Bn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function it(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class Me 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 Fe(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function de(e,t,n){return["decofile-write",e,t,n]}function Hn(e,t,n){return{id:de(e,t,n).join(":")}}function Qe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Jn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Gn(e,t,n){e.setQueryData(h.decofileDraft(Fe(t)),n)}function Wn(e,t){return e.getQueryData(h.decofileDraft(Fe(t)))??null}async function Yn(e,t){const n=await fetch(Qe(e),{cache:"no-store",headers:{...ue("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function br(e){const t=P.c(4);let n;t[0]!==e?(n=h.decofileDraft(e?Fe(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:zn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=L(o);return r??null}async function zn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Xn(e,t){const n=await fetch(Qe(t),{cache:"no-store",headers:ue("v7")});if(await Ne(n))throw Ce(e,t.orgSlug,t.virtualMcpId),new Re;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&&Gn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function wr(e,t){const n=await fetch(Qe(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 Me(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Jn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ct=3e3,Zn=15e3,qn=2*6e4,Nt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Kn(e){return e<qn?Ct:Zn}function eo(e,t=Nt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Kn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let u;try{u=c()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const at=()=>0;function to(e,t,n=Nt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>eo(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,at,at)}function Rt(e,t){return fe(e,t)}function no(e,t){return fe(e,"preview-fetch",{path:t})}function Sr(e){return Rt(e,"preview-invoke")}function yr(e){return Rt(e,"catalog-invoke")}function Pt(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 oo(){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&&Pt(n))return n}return null}function ro(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??oo();return n&&Pt(n)?new URL(t,n).toString():no(e,t)}function so(e){return ro(e,"/.decofile")}function io(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function ct(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function ao(e,t){const n=fe(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=io(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:rn(s.content)}}async function co(e,t){const n=await ao(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Er(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 lo(e){return sn(e)?.metadata?.runtime?.path??null}class xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function kr(e){return e instanceof D&&e.code===S.Conflict}function $t(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 Ve extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Be extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function Or(e,t){return(t instanceof Ve||t instanceof Be)&&(t.message=jt(e,t,"github")),t}function jt(e,t,n){if(t instanceof Ve)return e("siteEditor.save.draftUnread");if(t instanceof Be)return e("siteEditor.save.keptChanging");if(t instanceof Me)return t.message;if(n==="local")return fo(e,t);if(t instanceof D)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 Me||e instanceof Ve||e instanceof Be)return null;if(e instanceof D){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?$t(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function fo(e,t){if(t instanceof xt)return e("decoServe.save.serverGone");if(t instanceof D)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:$t(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function ho(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function go(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=ho(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const vo="decocms:content-writes",Oe=new Set;let H;function At(){if(H!==void 0)return H;H=null;try{typeof BroadcastChannel=="function"&&(H=new BroadcastChannel(vo),H.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Oe])n(t)}))}catch{H=null}return H}function mo(e){try{At()?.postMessage({cacheKey:e})}catch{}}function po(e){return At(),Oe.add(e),()=>{Oe.delete(e)}}const Lt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},bo=15e3,ae=new Map;function G(e,t){return`${e}/${t}`}function Q(e){let t=ae.get(e);return t||(t={state:Lt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ae.set(e,t)),t}function V(e,t){const n=Q(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function he(e){e.timer&&clearTimeout(e.timer),e.timer=null}function He(e){return ae.get(e)?.state??Lt}function wo(e,t){const n=Q(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Dr(e){const t=Q(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(he(t),V(e,{phase:"idle"}))}}function Tr(e){const t=ae.get(e);!t||t.state.phase!=="reloading"||(he(t),V(e,{phase:"idle"}))}function Ut(e){const t=Q(e);he(t),V(e,{phase:"saving",inFlight:t.state.inFlight+1})}function oe(e,t){const n=Q(e),o=Math.max(0,n.state.inFlight-1);if(o>0){V(e,{inFlight:o});return}if(!t.ok||n.previews===0){V(e,{phase:"idle",inFlight:o});return}Mt(e,t.navigates,o)}function Mt(e,t,n=0){const o=Q(e);he(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&V(e,{phase:"idle"})},bo),V(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function So(e){return e?.kind==="protocol"&&e.source==="github"}async function re(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:h.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?h.protocolDraftRead(o,r,s):null,u=l?JSON.stringify(n.getQueryData(l)??null):null,f=c?[c]:[];if(a&&t.reread&&f.push(n.invalidateQueries({queryKey:h.decofile(a)})),a&&!t.adopted&&f.push(n.invalidateQueries({queryKey:h.contentChanges(a)})),s&&i.source==="sandbox"&&f.push(n.invalidateQueries({queryKey:un(o,r,s)})),So(i)&&l&&!t.adopted&&f.push(n.invalidateQueries({queryKey:l})),await Promise.all(f),t.kind!=="edit"){const v=G(o,r);V(v,{epoch:He(v).epoch+1})}const g=l?JSON.stringify(n.getQueryData(l)??null):null,d=u!==g;return d&&await new Promise(v=>ft.schedule(v)),{navigates:d}}async function yo(e,t){return Ut(G(e.orgSlug,e.virtualMcpId)),Ft(e,t)}function lt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(h.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Ft(e,t){const n=G(e.orgSlug,e.virtualMcpId),o=t.adopted?lt(e):null;let r;try{r=await t.write()}catch(i){throw oe(n,{ok:!1,navigates:!1}),t.refreshOnError&&re(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&mo(e.cacheKey),t.adopted){const i=lt(e)!==o;return i&&await new Promise(a=>ft.schedule(a)),oe(n,{ok:!0,navigates:i}),t.reread&&re(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await re(e,t))}catch{}finally{oe(n,{ok:!0,navigates:s})}return r}function Ir(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=G(o,r),a=new Set(t.blockKeys);for(const u of[...Q(i).discardListeners])u(a);Ut(i);let c=!1;const l=()=>(c=!0,Ft(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:de(o,r,s),scope:Hn(o,r,s),mutationFn:l}).execute(void 0).catch(u=>{throw c||oe(i,{ok:!1,navigates:!1}),u}):l()}function _r(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=G(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 c=Q(s).discardListeners;return c.add(n),()=>{c.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],U.useEffect(i,a)}function Eo(e){const t=G(e.orgSlug,e.virtualMcpId);He(t).inFlight>0||re(e,{kind:"external"}).then(({navigates:n})=>{const o=Q(t);o.previews>0&&o.state.inFlight===0&&Mt(t,n)}).catch(()=>{})}function ko(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=G(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>wo(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>He(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Oo=500;function Cr(e,t){const{phase:n}=ko(e,t);return go(n!=="idle",Oo)}function Do(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function To(e,t){return h.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function Nr(e,t,n,o){if(o?.source==="github")return Io(e,t,n);const r=e.getQueryData(h.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(h.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function K(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(r=>F(r)===n);return o===void 0?void 0:e.changes[o]}function Io(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(o)return Qt(o,ge(e,t),n)}function Qt(e,t,n){const o=K(e,n);return o?.kind==="delete"?o.version??we:o?o.version:t.has(F(n))?we:null}function Rr(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(!o)return!1;const r=K(o,n);return r?r.kind==="set"&&r.baseVersion===null:ge(e,t).has(F(n))}function Pr(e,t){const n=e.getQueryData(h.decofile(t)),o=e.getQueryData(h.contentChanges(t));if(!n||!o)return null;const r=ge(e,t);return{blocks:n,versionOf:s=>Qt(o,r,s)}}function ge(e,t){return new Set(e.getQueryData(h.contentDraftTombstones(t)))}function ce(e,t,n,o){const r=F(n),s=ge(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),ee(e),e.setQueryData(h.contentDraftTombstones(t),[...s]))}function _o(e,t,n,o){const r=Ge(o.revision),s=e.getQueryData(h.contentRevision(n))?.revision,i=s?Ge(s):null,a=r&&!r.main&&i?nn(i.main,r.draft):o.revision,c=e.getQueryData(h.contentVersions(n)),l=Object.entries(o.versions??{}).map(([d,v])=>[d,v===we?null:v]),u=e.getQueryData(h.contentChanges(n)),f=new Set(l.flatMap(([d])=>{const v=u?K(u,d):void 0;return(v?v.baseVersion:c?.[d]??null)===null?[d]:[]})),g=new Set(l.flatMap(([d,v])=>v===null?[]:[F(d)]));e.setQueryData(h.contentChanges(n),d=>{if(!d)return d;const v={...d.changes};for(const[b,w]of l){const I=K(d,b),T=I?I.baseVersion:c?.[b]??null;w!==null?v[b]={kind:"set",version:w,baseVersion:T}:T!==null?v[b]={kind:"delete",version:null,baseVersion:T}:delete v[b]}return{...d,changes:v,edited:!0}});for(const[d,v]of l)v!==null?ce(e,n,d,!1):!g.has(F(d))&&f.has(d)&&ce(e,n,d,!0);return r&&r.draft!=="none"&&e.setQueryData(h.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),d=>d&&{...d,version:r.draft}),a}function Je(e,t,n){ee(e),e.setQueryData(h.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 Co(e,t){const n=e.getMutationCache().findAll({mutationKey:de(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>In(o.state.variables)))}function De(e,t){e.resetQueries({queryKey:h.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function le(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof D);throw t.source==="local"&&s?(De(e,n),new xt(r)):(t.source==="local"&&$e(r)&&De(e,n),r)}}const se=new Map;function Vt(e,t,n,o){const r=se.get(o);if(r)return r;const s=Bt(e,t,n,o,!0);return se.set(o,s),s.finally(()=>se.delete(o))}const me=new Set;function No(e,t,n){const o=P.c(8),r=z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let c,l;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(c=()=>{if(!e||!s||!i||!a)return;const u={orgSlug:s,virtualMcpId:i,branch:a};return po(f=>{f===n&&(me.has(n)||(me.add(n),Po(r,e,u,n).catch(Ro).finally(()=>me.delete(n))))})},l=[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]=c,o[7]=l):(c=o[6],l=o[7]),U.useEffect(c,l)}function Ro(){}async function Po(e,t,n,o){const r=se.get(o);return r&&await r.catch(()=>{}),Vt(e,t,n,o)}async function Bt(e,t,n,o,r){ee(e);const s=h.decofile(o),i=To(n,t),a=h.contentRevision(o),c=h.contentVersions(o),l=e.getQueryData(s),u=e.getQueryData(c),f=e.getQueryData(i),g=e.getQueryData(a)??void 0,d=t.source==="github"&&!f?ut(e,n.orgSlug,n.virtualMcpId):void 0,v=d?.isV8&&d.schema&&d.version?d:void 0,b=f??v?.schema,w=v?{...g,schemaVersion:v.version}:g,I=r&&l&&u?w?.revision:void 0,T=r&&b?w?.schemaVersion:void 0,x=h.contentChanges(o),C=e.getQueryData(x),[_,E,k]=await le(e,t,n,()=>t.client.batch([{method:"blocks.list",params:I?{ifNoneMatch:I}:{}},{method:"schema.get",params:T?{ifNoneMatch:T}:{}},{method:"changes.list",params:mt(C)}])),N=e.getQueryData(a)?.revision,p=N!==void 0&&N!==w?.revision;if(k?.ok){const X=p?null:Ee(C,k.result);X&&e.setQueryData(x,X)}else k&&t.source==="local"&&$e(k.error)&&De(e,n);if(!_?.ok)throw _?.error??new Error("no blocks.list");if(!E)throw new Error("no schema.get");const O=_.result,$=Dt(E),y=E.ok&&!$?E.result:null;if(O.notModified&&(!l||!u)||y?.notModified&&!b)return Bt(e,t,n,o,!1);const R=O.notModified?new Set:Co(e,n),j=O.notModified?l:Tn(O.blocks,l,R),M=$?_n():y?y.notModified?b:y.schema:E.error;if(e.setQueryData(a,{revision:p?N:O.notModified?w?.revision:O.revision,schemaVersion:y?y.notModified?w?.schemaVersion:y.version??void 0:void 0}),e.setQueryData(s,j),!O.notModified){const X=e.getQueryData(c),B={...O.versions};for(const A of R){const W=X?.[A];W!==void 0?B[A]=W:delete B[A]}e.setQueryData(c,B)}return M instanceof D||e.setQueryData(i,M),!p&&!O.notModified&&l&&w?.revision&&O.revision!==w.revision&&Eo({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:M}}async function xr(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(", ")})`)}return yo({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=await le(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));ee(e);const a=t.source==="github"?_o(e,n,o,i):i.revision;e.setQueryData(h.contentRevision(o),l=>({...l,revision:a}));const c=i.versions??{};return Je(e,o,c),{revision:a,versions:c}}})}function Ht(e,t){if(!(e instanceof D))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 Jt(e,t,n){if(!(n instanceof D))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&ce(e,t,r,!1)}function Gt(e,t,n,o){ee(e);const r=o.block===null,s=e.getQueryData(h.contentVersions(t)),i=e.getQueryData(h.contentChanges(t)),a=i?K(i,n):void 0,c=a?a.baseVersion:s?.[n]??null;if(i){const l=F(n),u=Object.fromEntries(Object.entries(i.changes).filter(([f])=>F(f)!==l));r?c!==null&&(u[n]={kind:"delete",version:null,baseVersion:c}):u[n]={kind:"set",version:o.version,baseVersion:c},e.setQueryData(h.contentChanges(t),{...i,changes:u,edited:!0})}ce(e,t,n,r&&c===null),e.setQueryData(h.decofile(t),l=>{const u={...l};return r?delete u[n]:u[n]=o.block,u}),Je(e,t,{[n]:r?null:o.version})}function $r(e,t,n,o){if(t.source!=="github"||!(o instanceof D))return!1;Jt(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>Ht(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:h.decofile(n)}),s.forEach((a,c)=>{Gt(e,n,a,i[c])}),!0)}async function jr(e,t,n,o,r,s){t.source==="github"&&Jt(e,o,s);const i=t.source==="github"?Ht(s,r):void 0;if(i)return e.cancelQueries({queryKey:h.decofile(o)}),Gt(e,o,r,i),!0;await e.invalidateQueries({queryKey:h.decofile(o)});let a;try{const l=(await le(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(l&&l.after===null&&l.version!==null)return!1;a={value:l?.after??null,version:l?.version??null},t.source==="github"&&e.setQueryData(h.contentChanges(o),u=>{if(!u)return u;const f={...u.changes};return l?.kind?f[r]={kind:l.kind,version:l.version,baseVersion:l.baseVersion}:delete f[r],{...u,changes:f,edited:!0}})}catch{const c=await le(e,t,n,()=>t.client.blocksList({}));if(c.notModified)return!1;a={value:c.blocks[r]??null,version:c.versions[r]??null}}return e.setQueryData(h.decofile(o),c=>{const l={...c};return a.value===null?delete l[r]:l[r]=a.value,l}),Je(e,o,{[r]:a.version}),!1}function xo(e){const t=P.c(15),n=z();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=h.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const d=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ue("v8")});if(await Ne(d))throw Ce(n,e.orgSlug,e.virtualMcpId),new Re;if(!d.ok)throw new Error(`draft pointer read failed: ${d.status}`);return await d.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:c,isError:l}=L(i),u=!!e&&c&&!l;if(!e||!a?.draft||!a.version){let d;return t[11]!==u?(d={pointer:null,pending:u},t[11]=u,t[12]=d):d=t[12],d}const f=`${a.draft}@${a.version}`;let g;return t[13]!==f?(g={pointer:f,pending:!1},t[13]=f,t[14]=g):g=t[14],g}function Ar(e){return xo(e).pointer}function Lr(e){const t=P.c(4);let n;t[0]!==e?(n=h.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:$o,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=L(o);return r?.revision}async function $o(){throw new Error("content revisions are set by reads and writes")}function Te(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Ur(e,t){return Te({...e,protocolSuffix:t.cacheKeySuffix})}function jo(e,t){const n=P.c(6),{url:o}=_t(e?.virtualMcpId),r=It(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"?Te({...e,protocolSuffix:r.cacheKeySuffix}):Te({...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 Mr(e,t){const n=P.c(39),{url:o,undecided:r}=_t(e?.virtualMcpId),s=!!o,i=It(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=jo(e),l=t?.fetchEnabled??!0,u=lo(e?.virtualMcpId),f=dt(e?.virtualMcpId).runtime==="cms",g=z();let d;n[0]!==c?(d=h.decofile(c),n[0]=c,n[1]=d):d=n[1];const v=d;No(a,a&&e?e:null,c);let b;n[2]!==e||n[3]!==g||n[4]!==v?(b=()=>{if(!e||g.isMutating({mutationKey:de(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const p=g.getQueryState(v);return p?.fetchStatus==="fetching"||Date.now()-(p?.dataUpdatedAt??0)<Ct/2},n[2]=e,n[3]=g,n[4]=v,n[5]=b):b=n[5];let w;n[6]!==f||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==g||n[11]!==v?(w=async()=>{if(e){if(!a&&f&&!s){const p=Wn(g,e)?.version;if(p&&!await Yn(e,p))return}await g.refetchQueries({queryKey:v,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=s,n[8]=e,n[9]=a,n[10]=g,n[11]=v,n[12]=w):w=n[12];let I;n[13]!==b||n[14]!==w?(I={skip:b,read:w},n[13]=b,n[14]=w,n[15]=I):I=n[15],to(!!t?.pollWhile&&!!e,I);let T;n[16]!==i.kind||n[17]!==f||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==g?(T=async()=>{if(a)return(await Vt(g,a,e,c)).blocks;if(i.kind==="unavailable")throw Do("decofile");if(s){const y=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Uo),R=y?.ok?it(await y.text()):null;if(R)return R;const j=new Error("decofile unavailable (local tunnel unreachable)");throw j.status=502,j}if(f)return Xn(g,e);const p=()=>co(e,Bn(u,".deco/blocks.gen.json"));if(l){const y=await fetch(so(e),{cache:"no-store"}).catch(Lo);if(y?.ok){const M=it(await y.text());if(M)return M}const R=await p();if(R.kind==="data")return R.data;const j=new Error(`Failed to fetch decofile: ${y?.status??"network error"}`);throw j.status=ct({liveOk:!!y?.ok,liveStatus:y?.status,committedAbsent:R.kind==="absent"}),j}const O=await p();if(O.kind==="data")return O.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=ct({liveOk:!1,committedAbsent:O.kind==="absent"}),$},n[16]=i.kind,n[17]=f,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=g,n[26]=T):T=n[26];const x=!!e&&i.kind!=="pending"&&!r,C=a?0:3e4,_=a?.describe.pollIntervalMs,E=a?"always":void 0;let k;n[27]!==f||n[28]!==s||n[29]!==a?(k=(p,O)=>{if(a||f||s)return p<3;const $=O.status;return $!==502&&$!==404&&p<2},n[27]=f,n[28]=s,n[29]=a,n[30]=k):k=n[30];let N;return n[31]!==v||n[32]!==T||n[33]!==x||n[34]!==C||n[35]!==_||n[36]!==E||n[37]!==k?(N={queryKey:v,queryFn:T,enabled:x,staleTime:C,refetchInterval:_,refetchIntervalInBackground:!1,refetchOnWindowFocus:E,retry:k,retryDelay:Ao},n[31]=v,n[32]=T,n[33]=x,n[34]=C,n[35]=_,n[36]=E,n[37]=k,n[38]=N):N=n[38],L(N)}function Ao(e){return fn(5e3,1e3,e,2,0)}function Lo(){return null}function Uo(){return null}const Mo="site-editor-save",Wt={id:Mo,description:void 0,action:void 0,cancel:void 0},Fr="site-editor-undo",Ie="site-editor-publish";function Fo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=J.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=J.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=J.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Yt(e,t){return t?J.jsx(Fo,{label:e("siteEditor.details"),detail:t}):void 0}function Qr(e,t,n){q.error(jt(e,t,n),{...Wt,description:Yt(e,uo(t,n))})}function Vr(e,t,n=!1){q.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Wt,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const zt={action:void 0,duration:void 0};function Br(e,t){q.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...zt,id:Ie,description:void 0})}function Hr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Yt(e,o??null);q[i](t,{id:Ie,description:n&&a?J.jsxs(J.Fragment,{children:[J.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),q.loading(s??e("thread.publishPopover.publishing"),{...zt,id:Ie,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Jr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Gn as $,Dr as A,ko as B,Tr as C,jo as D,Lr as E,Hn as F,de as G,yo as H,ao as I,Jn as J,Ur as K,er as L,nr as M,Vr as N,Rr as O,Or as P,Me as Q,kr as R,ar as S,Et as T,Po as U,Ve as V,xr as W,jr as X,Qr as Y,Nr as Z,To as _,lr as a,wr as a0,_r as a1,Pr as a2,fr as a3,mr as a4,tt as a5,nt as a6,pr as a7,cr as a8,ro as a9,D as aA,S as aB,yr as aC,gr as aa,Sn as ab,Yt as ac,Jr as ad,tr as ae,hn as af,Fo as ag,Vt as ah,Do as ai,Er as aj,co as ak,Be as al,$r as am,Ir as an,qo as ao,Ko as ap,$e as aq,Br as ar,br as as,Ar as at,Hr as au,Ie as av,zt as aw,Fr as ax,Wt as ay,Co as az,En as b,_t as c,wn as d,ir as e,yn as f,Ue as g,xe as h,bt as i,Sr as j,no as k,Mr as l,ur as m,vr as n,lo as o,or as p,Bn as q,sr as r,rr as s,kt as t,It as u,hr as v,Cr as w,dr as x,xo as y,G as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as te,a4 as se,q as ae,r as M,ad as ce,j as t,B as H,n as $,bB as de,a5 as me,aS as ue,aR as pe,aO as ge,aM as fe,aN as he,aQ as xe,aP as je,bm as ke,t as D,aD as ve,c as ie,l as ye,Z as Se,V as be,Y as we,X as Ce,K as q,gn as De}from"./index-Ce7G0he3.js";import{i as Ne}from"./DotsVertical-C5Wc2qWf.js";import{i as le,a as Pe}from"./ZoomOut-D8_eDbPl.js";import{s as Ae}from"./Trash01-BLXgUBsw.js";import{i as Ee}from"./Upload01-CgYtU1Ux.js";import{S as Me}from"./search-input-DuxKe01B.js";import{S as Te}from"./search-toggle-5fjHehxP.js";import{E as V}from"./empty-state-BiIeVz7z.js";import{C as Oe}from"./collection-tabs-C3pu5E-Q.js";import{p as Ie,S as Re,F as ze}from"./folder-icon-DgtIAyY7.js";import{h as Fe,i as $e,r as _e}from"./use-org-fs-8kFrjmMH.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-OaBCBVrZ.js";import"./icon-button-Xe7zTqiw.js";import"./tooltip-BHLCIkH9.js";import"./index-DZ7OjEm4.js";import"./badge-zxuYXquF.js";import"./markdown-UmudOdor.js";import"./use-copy-DGCMROZD.js";import"./Copy01-D6STLVd9.js";import"./use-mobile-BZz7cwuI.js";import"./use-panel-navigate-C-mQZt-r.js";import"./thread-route-D14ghtgQ.js";import"./use-project-scope-DYBc2cnp.js";import"./repository-binding-Dg4XMxXs.js";import"./use-mcp-client-B9-9jnHW.js";import"./auth-AQB7DTaB.js";import"./file-preview-Cc6_BSbv.js";import"./utils-C_XIOzcP.js";import"./Image01-D00jtGx4.js";import"./editor-CiOoO-Ym.js";import"./file-type-icon-CeBZX69W.js";import"./useInfiniteQuery-DAGt4Ai1.js";import"./infiniteQueryObserver-BJujpYxh.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Qe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function He(s,e){const l=new Map;for(const r of s){const c=G(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function Ge(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ue(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ve:Pe}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:T,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const z=I,R=r?"opacity-60":"hover:bg-accent";let u;e[5]!==R?(u=ye("relative transition-colors group overflow-hidden flex flex-col h-full",R),e[5]=R,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=z?"default":"system",N=!z;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(ze,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(Se,{children:[t.jsx(be,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(Ne,{size:16})})}),t.jsx(we,{align:"end",children:t.jsxs(Ce,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ae,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==T||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):T,e[34]=T,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=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:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(De,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function At(){const s=te(),{org:e}=se(),l=Fe(),{remove:r,upload:c}=$e("home"),a=ae(),o=M.useRef(null),[m,S]=M.useState(""),T=ce(),[O,I]=M.useState(L),[z,R]=M.useState(!1),[u,f]=M.useState(null),[b,N]=M.useState(null),[w,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=i=>a.setQueryData(q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const Q=A.split("/")[0]??"",_=n.filter(Qe),X=_.find(E=>G(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const F=qe(Q),W=`skills/${F}`;let Y=!1;R(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:F}));return}Y=!0;const E=Ue(F,await X.text());j(oe=>[E,...oe]),h(E.id),await Ge(He(_,F),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:F}))}catch(E){Y&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(Q=>Q.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},U=t.jsxs(H,{size:"sm",disabled:z,onClick:()=>o.current?.click(),children:[t.jsx(Ee,{size:14}),s(z?"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?t.jsx($.Actions,{secondary:t.jsx(Te,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:U}):t.jsx($.Title,{actions:U,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!T&&t.jsx(Me,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(Re,{skillPath:u,onClose:()=>f(null)},u),t.jsx(ue,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(pe,{children:[t.jsxs(ge,{children:[t.jsx(fe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(he,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(xe,{children:[t.jsx(je,{children:s("settings.skills.cancel")}),t.jsx(ke,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{At as default};
|
|
1
|
+
import{b as te,a4 as se,q as ae,r as M,ad as ce,j as t,B as H,n as $,bB as de,a5 as me,aS as ue,aR as pe,aO as ge,aM as fe,aN as he,aQ as xe,aP as je,bm as ke,t as D,aD as ve,c as ie,l as ye,Z as Se,V as be,Y as we,X as Ce,K as q,gn as De}from"./index-D6lKvaoF.js";import{i as Ne}from"./DotsVertical-DcrZktRa.js";import{i as le,a as Pe}from"./ZoomOut-CbRHTtaG.js";import{s as Ae}from"./Trash01-fFkz00Bo.js";import{i as Ee}from"./Upload01-B7NXMv4U.js";import{S as Me}from"./search-input-D-Pyf_-v.js";import{S as Te}from"./search-toggle-Dtmn6N5P.js";import{E as V}from"./empty-state-TJAbP9DT.js";import{C as Oe}from"./collection-tabs-CKvYpxHT.js";import{p as Ie,S as Re,F as ze}from"./folder-icon-AsglkwKY.js";import{h as Fe,i as $e,r as _e}from"./use-org-fs-DLZ1-PTn.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-7uzgB_fN.js";import"./icon-button-CdKw1JM7.js";import"./tooltip-LAilTl9w.js";import"./index-BCVYESVO.js";import"./badge-NOwFVf79.js";import"./markdown-qzRhqGiE.js";import"./use-copy-Bnv2yRR0.js";import"./Copy01-DMa3yAGL.js";import"./use-mobile-BwQy16Q6.js";import"./use-panel-navigate-BECpOul-.js";import"./thread-route-qfZwEURL.js";import"./use-project-scope-DQZacSdf.js";import"./repository-binding-DG0YfJ0p.js";import"./use-mcp-client-DwqRqgyq.js";import"./auth-D095ELC6.js";import"./file-preview-BnfIAfXR.js";import"./utils-CLU7TQYj.js";import"./Image01-C1LM4LI_.js";import"./editor-DmuvoJYA.js";import"./file-type-icon-BMJ3eu8C.js";import"./useInfiniteQuery-B3ME351M.js";import"./infiniteQueryObserver-DoO1tFcg.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Qe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function He(s,e){const l=new Map;for(const r of s){const c=G(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function Ge(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ue(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ve:Pe}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:T,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const z=I,R=r?"opacity-60":"hover:bg-accent";let u;e[5]!==R?(u=ye("relative transition-colors group overflow-hidden flex flex-col h-full",R),e[5]=R,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=z?"default":"system",N=!z;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(ze,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(Se,{children:[t.jsx(be,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(Ne,{size:16})})}),t.jsx(we,{align:"end",children:t.jsxs(Ce,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ae,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==T||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):T,e[34]=T,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=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:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(De,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function At(){const s=te(),{org:e}=se(),l=Fe(),{remove:r,upload:c}=$e("home"),a=ae(),o=M.useRef(null),[m,S]=M.useState(""),T=ce(),[O,I]=M.useState(L),[z,R]=M.useState(!1),[u,f]=M.useState(null),[b,N]=M.useState(null),[w,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=i=>a.setQueryData(q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const Q=A.split("/")[0]??"",_=n.filter(Qe),X=_.find(E=>G(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const F=qe(Q),W=`skills/${F}`;let Y=!1;R(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:F}));return}Y=!0;const E=Ue(F,await X.text());j(oe=>[E,...oe]),h(E.id),await Ge(He(_,F),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:F}))}catch(E){Y&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(Q=>Q.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},U=t.jsxs(H,{size:"sm",disabled:z,onClick:()=>o.current?.click(),children:[t.jsx(Ee,{size:14}),s(z?"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?t.jsx($.Actions,{secondary:t.jsx(Te,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:U}):t.jsx($.Title,{actions:U,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!T&&t.jsx(Me,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(Re,{skillPath:u,onClose:()=>f(null)},u),t.jsx(ue,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(pe,{children:[t.jsxs(ge,{children:[t.jsx(fe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(he,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(xe,{children:[t.jsx(je,{children:s("settings.skills.cancel")}),t.jsx(ke,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{At as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,l as N,j}from"./index-
|
|
1
|
+
import{c as _,l as N,j}from"./index-D6lKvaoF.js";import{T as k,R as z,a as D,b as S}from"./index-DTPm19J5.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,fc as K}from"./index-
|
|
1
|
+
import{r as v,fc as K}from"./index-D6lKvaoF.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-n2M8kvjD.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,a4 as B,r as v,j as e,n as x,hd as k,fT as E,fU as y,fV as a,hL as D,B as m,I as d,aS as z,aR as T,aO as O,aM as R,aQ as F,aP as M,bm as U,C,t as c,c as q}from"./index-
|
|
1
|
+
import{b as A,a4 as B,r as v,j as e,n as x,hd as k,fT as E,fU as y,fV as a,hL as D,B as m,I as d,aS as z,aR as T,aO as O,aM as R,aQ as F,aP as M,bm as U,C,t as c,c as q}from"./index-D6lKvaoF.js";import{D as $}from"./domain-settings-Cc13IWEI.js";import{S as H}from"./switch-BByo6038.js";import{a as Q,b as V,c as G,d as J}from"./use-org-sso-C-qEDq8K.js";import{s as K}from"./Trash01-fFkz00Bo.js";import{R as W}from"./require-capability-Coznh-2O.js";import"./badge-NOwFVf79.js";import"./select-WYGhjx6Y.js";import"./index-BdQq_4o_.js";import"./index-BCVYESVO.js";import"./ChevronUp-krQUb2vU.js";import"./access-gate-BUmBK35t.js";import"./capability-load-error-C_z_eZxA.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:P}=Q(o.id,o.slug),f=V(o.id,o.slug),S=G(o.id,o.slug),b=J(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[g,p]=v.useState(!1),[I,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)},w=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"))}},L=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"))}},N=async t=>{try{await b.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($,{}),P?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!g&&e.jsx(E,{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(H,{checked:n.enforced,onCheckedChange:N,disabled:b.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(K,{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||g)&&e.jsx(E,{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(d,{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(d,{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:g&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(d,{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(d,{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(d,{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(d,{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:[g&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:w,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(g?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:I,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(M,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(U,{onClick:L,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function ge(){const s=q.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{ge as default};
|