decocms 4.619.10 → 4.619.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-D1Q8X__K.js → AlertCircle-Cs1GY8F8.js} +1 -1
- package/dist/client/assets/{AreaChart-CZ4CFQOF.js → AreaChart-QpQTWUPA.js} +1 -1
- package/dist/client/assets/{ArrowLeft-a7zQohPB.js → ArrowLeft-D4BHG2IU.js} +1 -1
- package/dist/client/assets/{ArrowRight-CcdemY_e.js → ArrowRight-2Yca8ob-.js} +1 -1
- package/dist/client/assets/{ArrowUp-BjMuYXEC.js → ArrowUp-BnkZAbrQ.js} +1 -1
- package/dist/client/assets/{BookOpen01-Caac9KpE.js → BookOpen01-DLbroUgc.js} +1 -1
- package/dist/client/assets/{CartesianChart-B0jOalhe.js → CartesianChart-DyIDQsKF.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CCxFJJjf.js → CategoricalChart-BK1X9rc1.js} +1 -1
- package/dist/client/assets/{CheckCircle-BygonUdk.js → CheckCircle-DnCMWruE.js} +1 -1
- package/dist/client/assets/{ChevronDown-BDwdJQzR.js → ChevronDown-B0XmH64O.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BAKnniO6.js → ChevronSelectorVertical-BZ3zf3oP.js} +1 -1
- package/dist/client/assets/{ChevronUp-CoA7d7vl.js → ChevronUp-Df8KdpUf.js} +1 -1
- package/dist/client/assets/{CreditCard01-BD4H9Smc.js → CreditCard01-BmPljNra.js} +1 -1
- package/dist/client/assets/{Eye-B8RfELJD.js → Eye-iFhnkrXx.js} +1 -1
- package/dist/client/assets/{File02-CNp6lbfd.js → File02-6A2r8I0L.js} +1 -1
- package/dist/client/assets/{Fingerprint04-CYuFFJ8_.js → Fingerprint04-DXA794ID.js} +1 -1
- package/dist/client/assets/{Globe04-DGpfgXDy.js → Globe04-UxQocYqn.js} +1 -1
- package/dist/client/assets/{Image01-DZ0d0gl4.js → Image01-OM3XLdbd.js} +1 -1
- package/dist/client/assets/{Key01-CCL-qpBw.js → Key01-C0tI-Pm7.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D6A6HKPj.js → LayoutLeft-BFbSxeSu.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DZpjy5h4.js → LinkBroken01-DmINof4G.js} +1 -1
- package/dist/client/assets/{MessageCircle01-Vr9v9ZLf.js → MessageCircle01-BQQ1D-ue.js} +1 -1
- package/dist/client/assets/{Minus-Cdvi1RtF.js → Minus-Deliwjwp.js} +1 -1
- package/dist/client/assets/{Monitor01-BKLXdSAu.js → Monitor01-CcY27iZh.js} +1 -1
- package/dist/client/assets/{Play-KnC-ePg8.js → Play-BZ0FsK6z.js} +1 -1
- package/dist/client/assets/{Plus-fnuC_-Ii.js → Plus-BQ2NGHeJ.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BWtcsB8X.js → ReferenceLine-CwYOI9Uv.js} +1 -1
- package/dist/client/assets/{SearchMd-C7M41YQV.js → SearchMd-DaBWtP1x.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-D27zZ3nR.js → ShoppingBag01-B-k2jEJK.js} +1 -1
- package/dist/client/assets/{Sun-TBLvGE97.js → Sun-C4Ucr11v.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D47eRm9A.js → SwitchHorizontal01-Cm_o4fjT.js} +1 -1
- package/dist/client/assets/{Tool01-eLaAOwHX.js → Tool01-DZ2cyFL-.js} +1 -1
- package/dist/client/assets/{Tooltip-BVDzZkXm.js → Tooltip-BMCG3zk7.js} +1 -1
- package/dist/client/assets/{Trash01-C_glH0wy.js → Trash01-CSAJKZVH.js} +1 -1
- package/dist/client/assets/{Upload01-VrBKSmfZ.js → Upload01-iwKRXiXv.js} +1 -1
- package/dist/client/assets/{UserCheck01-BiEm5Ebz.js → UserCheck01-y0z0QSuq.js} +1 -1
- package/dist/client/assets/{UserSquare-DRonBRNm.js → UserSquare-BkYHs0MO.js} +1 -1
- package/dist/client/assets/{Users01-CYW34Us_.js → Users01-BHrdcphN.js} +1 -1
- package/dist/client/assets/{XClose-xoNzv1jt.js → XClose-BNLvtMZs.js} +1 -1
- package/dist/client/assets/{Zap-Ch4l-t5Z.js → Zap-BFmLvXPu.js} +1 -1
- package/dist/client/assets/{access-gate-CNfTTZux.js → access-gate-Bjcd3xRS.js} +1 -1
- package/dist/client/assets/{add-connection-dialog--_GdeImt.js → add-connection-dialog-D_fqqRpQ.js} +1 -1
- package/dist/client/assets/agent-app-gA0xuPcM.js +1 -0
- package/dist/client/assets/{agent-assets-B9TTg2qM.js → agent-assets-CeFXdCOG.js} +1 -1
- package/dist/client/assets/{agent-automation-Mtl2x19j.js → agent-automation-DI4JVQba.js} +1 -1
- package/dist/client/assets/{agent-automations-8oFrbM5G.js → agent-automations-CvTu1CGX.js} +1 -1
- package/dist/client/assets/{agent-blog-FC7eW83-.js → agent-blog--8wOBh2G.js} +2 -2
- package/dist/client/assets/{agent-blog-post-Dpmyvzzj.js → agent-blog-post-B_VjQGHY.js} +2 -2
- package/dist/client/assets/{agent-business-case-DEp0r6mM.js → agent-business-case-BLWZHdAk.js} +1 -1
- package/dist/client/assets/{agent-calendar-B6FrBIj9.js → agent-calendar-BZE_9zdA.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CkWGD_1I.js → agent-capabilities-DtPetQuj.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-Bc_bs6sE.js → agent-connect-sources-BOYSVsp0.js} +1 -1
- package/dist/client/assets/agent-deck-Dbf-g0M7.js +1 -0
- package/dist/client/assets/{agent-e2e-BxjBBycE.js → agent-e2e-CDnWTUZm.js} +1 -1
- package/dist/client/assets/agent-experiments-CJI29Bm1.js +1 -0
- package/dist/client/assets/agent-file-CDEIX2Al.js +1 -0
- package/dist/client/assets/{agent-hosting-CFqNbgT1.js → agent-hosting-BncAw2MY.js} +1 -1
- package/dist/client/assets/{agent-icon-DFYKaa0c.js → agent-icon-DGqoh_mm.js} +1 -1
- package/dist/client/assets/agent-library-B25iQ7-4.js +1 -0
- package/dist/client/assets/agent-library-file-um-Vup6W.js +1 -0
- package/dist/client/assets/agent-overview-DMIAzofZ.js +1 -0
- package/dist/client/assets/{agent-releases-wE_sFDN-.js → agent-releases-ClxmSCzO.js} +1 -1
- package/dist/client/assets/agent-settings-D_nirr2s.js +1 -0
- package/dist/client/assets/{agent-site-editor-C0q8LvFu.js → agent-site-editor-DwsECBRv.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B_Qmoy40.js +2 -0
- package/dist/client/assets/agent-site-editor-content-OafAgi57.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-qZcRGOEc.js +1 -0
- package/dist/client/assets/agent-view-CmuwHOZz.js +1 -0
- package/dist/client/assets/{agent-view-guard-DKuyN-80.js → agent-view-guard-B9H343Fu.js} +1 -1
- package/dist/client/assets/{ai-providers-qOMkGjqx.js → ai-providers-xU7ccwfI.js} +1 -1
- package/dist/client/assets/{alert-DosQ3gDY.js → alert-Ce3hCpiu.js} +1 -1
- package/dist/client/assets/{analytics-sections-CD1kYfMD.js → analytics-sections-VhGnUZbi.js} +1 -1
- package/dist/client/assets/api-keys-B7tDpKXw.js +1 -0
- package/dist/client/assets/{api-keys-C1SgriUZ.js → api-keys-BY0vcvS6.js} +1 -1
- package/dist/client/assets/{app-editor-BlBVNt7A.js → app-editor-BedQo6g1.js} +1 -1
- package/dist/client/assets/{asset-utils-BK2ot-jO.js → asset-utils-CK9nz9Oh.js} +1 -1
- package/dist/client/assets/{auth-xINlnEh8.js → auth-BTKMvodR.js} +1 -1
- package/dist/client/assets/{auth-catchall-Brs6Xsvy.js → auth-catchall-jQlkmu3o.js} +1 -1
- package/dist/client/assets/{auth-entry-By-AdTxA.js → auth-entry-opmlCigV.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CKfdFrqW.js → auth-split-layout-ZcVYWY9W.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CfAul8ih.js → authenticate-and-persist-oauth-Byr_aUiM.js} +1 -1
- package/dist/client/assets/{automation-list-row-xGe3-vaO.js → automation-list-row-DWcAnuAl.js} +1 -1
- package/dist/client/assets/{automation-runs-DUyTfm-1.js → automation-runs-c8NzeiZ9.js} +1 -1
- package/dist/client/assets/{automations-Cl7RIbcD.js → automations-CfAyNrdc.js} +1 -1
- package/dist/client/assets/{badge-By3J5rC3.js → badge-ByQzdMC7.js} +1 -1
- package/dist/client/assets/{block-document-Bog58LB_.js → block-document-NpJEDJUi.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BEc68w0W.js → blocks-preview-workspace-context-EneOi1lG.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-C-fKJR1R.js → blocks-tab-states-BNuRmFl7.js} +1 -1
- package/dist/client/assets/{blog-preview-url-B9jP2xxs.js → blog-preview-url-BE8ycbzV.js} +1 -1
- package/dist/client/assets/{blog-schema-03G2DeQU.js → blog-schema-CQtG7d90.js} +1 -1
- package/dist/client/assets/{blog-source-gate-D0f9lC6c.js → blog-source-gate-BNocfaly.js} +1 -1
- package/dist/client/assets/{blog-view-gate-Cd7nZI43.js → blog-view-gate-CSK3iby-.js} +1 -1
- package/dist/client/assets/{buckets-DItzj1C4.js → buckets-Cq_22qCK.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DhyvYeik.js → build-improve-prompt-doc-CLURerZM.js} +1 -1
- package/dist/client/assets/{calendar-DhrCDRQ3.js → calendar-CU0G81N_.js} +1 -1
- package/dist/client/assets/{capability-load-error-CDIQe4e8.js → capability-load-error-CfMyukOc.js} +1 -1
- package/dist/client/assets/{category-editor-df2u5p7v.js → category-editor-D8Lg4GN-.js} +1 -1
- package/dist/client/assets/{category-tree-ldYsSWnP.js → category-tree-DoANDlNZ.js} +1 -1
- package/dist/client/assets/{chart-Df8ROyLe.js → chart-B0L87xk-.js} +1 -1
- package/dist/client/assets/{chat-context-CqcR4aAu.js → chat-context-DFYcK8dr.js} +1 -1
- package/dist/client/assets/{chat-draft-D6uyGiuZ.js → chat-draft-B0nOx_1E.js} +1 -1
- package/dist/client/assets/{checkbox-Bg0tGTVi.js → checkbox-DCtlDv4Y.js} +1 -1
- package/dist/client/assets/{choose-editor-Jha1HKKs.js → choose-editor-CqJIFkG9.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DfcdCs0V.js → cli-auth-success-D1hfPJFA.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-WLlijqQA.js → cms-settings-editor-DoGyL8Kz.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-2T-3kouy.js → cms-store-drafts-DLkbKGam.js} +1 -1
- package/dist/client/assets/{collapsible-CxuxAsHp.js → collapsible-C9q8cXKO.js} +1 -1
- package/dist/client/assets/{collection-detail-CpK9gTgl.js → collection-detail-BjSCxrDn.js} +1 -1
- package/dist/client/assets/{collection-display-button-BifT3jIZ.js → collection-display-button-B4RvcaSY.js} +1 -1
- package/dist/client/assets/{collection-search-DhW2WLfL.js → collection-search-D1eJjXvE.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D0qUDiEO.js → collection-table-wrapper-wnksVLpY.js} +1 -1
- package/dist/client/assets/{collection-tabs-D91PU4y3.js → collection-tabs-BQ089vW9.js} +1 -1
- package/dist/client/assets/{combobox-B-vXOMV-.js → combobox--9kh6D-A.js} +1 -1
- package/dist/client/assets/{command-DmBlCsxL.js → command-vEYcGaeE.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DAiOKGeY.js → companion-mcps-section-BMWygD48.js} +1 -1
- package/dist/client/assets/{config-DbV4O0C1.js → config-CppLLZ0s.js} +1 -1
- package/dist/client/assets/{connect-BZ0g82Ew.js → connect-BJUCassX.js} +1 -1
- package/dist/client/assets/{connect-key-MkbzrmMb.js → connect-key-DPsccZoJ.js} +1 -1
- package/dist/client/assets/{connect-layout-Cs5HfFrd.js → connect-layout-DUPdKv86.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-C7Q-kV0F.js → connect-source-dialog-Bja4Zj86.js} +1 -1
- package/dist/client/assets/{connection-B7ZHR3E3.js → connection-BLrmW13k.js} +1 -1
- package/dist/client/assets/{connection-card-C1SHg1dG.js → connection-card-BXTPEaxQ.js} +1 -1
- package/dist/client/assets/{connection-detail-Bc4itFWH.js → connection-detail-k2RRD1j-.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-tazbDTDK.js → connection-form-helpers-BQ8Z8ayq.js} +1 -1
- package/dist/client/assets/{connection-slug-B5tLzvCi.js → connection-slug-DBQlOsgV.js} +1 -1
- package/dist/client/assets/{connections-CSC_xdmG.js → connections-DHVy7vvK.js} +1 -1
- package/dist/client/assets/{content-changes-JBgMg-Ro.js → content-changes-C41bP_ws.js} +1 -1
- package/dist/client/assets/{content-tab-g282UVdE.js → content-tab-DnhqJf-I.js} +3 -3
- package/dist/client/assets/{context-qsn0J_YZ.js → context-DiQuXwVv.js} +1 -1
- package/dist/client/assets/{context-menu-CUYerrUs.js → context-menu-C-D059Ck.js} +1 -1
- package/dist/client/assets/{context-shell-BLRwg1tV.js → context-shell-C7--PIOg.js} +3 -3
- package/dist/client/assets/{create-organization-dialog-BaKKV-VG.js → create-organization-dialog-BciHsuny.js} +1 -1
- package/dist/client/assets/{daily-pulse-UxYLZlxs.js → daily-pulse-2JSqbNge.js} +1 -1
- package/dist/client/assets/{delete-copy-DlW6ZUtG.js → delete-copy-Cf0dOXFU.js} +1 -1
- package/dist/client/assets/{device-hint-0_GHbWqS.js → device-hint-CUaXGRi8.js} +1 -1
- package/dist/client/assets/{discover-F-3cKQP2.js → discover-BMr1bFSy.js} +1 -1
- package/dist/client/assets/{domain-settings-CX6QeizD.js → domain-settings-DWbPi3VM.js} +1 -1
- package/dist/client/assets/{drawer-D_TsrN48.js → drawer-zz476taV.js} +1 -1
- package/dist/client/assets/{editor-DHPR_ozC.js → editor-CV3Xk_AX.js} +1 -1
- package/dist/client/assets/{editor-classes-BLd4hHmH.js → editor-classes-Yp2lW7EX.js} +1 -1
- package/dist/client/assets/{empty-state-L2cTHOLC.js → empty-state-DhjlG78q.js} +1 -1
- package/dist/client/assets/{empty-state-D1phlWfb.js → empty-state-TDalIIG7.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BaZ_leSu.js → experiments-tab-choice-CQacKW-V.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D6-4uHNK.js → extract-connection-data-CkL-dOVb.js} +1 -1
- package/dist/client/assets/{feature-gate-BSqSDhFD.js → feature-gate-DWxphkZV.js} +1 -1
- package/dist/client/assets/{feature-paywall-CzZKQU6l.js → feature-paywall-pxEz5gYf.js} +1 -1
- package/dist/client/assets/{file-explorer-tOnk4J7V.js → file-explorer-DAnvWtIg.js} +1 -1
- package/dist/client/assets/{file-preview-C7hdL4Yc.js → file-preview-C2EECNq9.js} +1 -1
- package/dist/client/assets/{file-share-button-6nZQXE9V.js → file-share-button-DCVwwefO.js} +1 -1
- package/dist/client/assets/{file-type-icon-BIdp66kj.js → file-type-icon-ByQiDqSp.js} +1 -1
- package/dist/client/assets/{folder-icon-BqHfg1r8.js → folder-icon-Do8OZWNq.js} +1 -1
- package/dist/client/assets/{form-W6JWpxT_.js → form-OBSOsh_y.js} +1 -1
- package/dist/client/assets/{frame-navigation-Df_5J1gU.js → frame-navigation-CHBARVjA.js} +1 -1
- package/dist/client/assets/{gateway-client-ekFKMjOy.js → gateway-client-D3wDdufo.js} +1 -1
- package/dist/client/assets/{general-Fd7CN8PL.js → general-BEsIiNjd.js} +1 -1
- package/dist/client/assets/{github-icon-DVLt0ntX.js → github-icon-CE41Sk3J.js} +1 -1
- package/dist/client/assets/{held-block-view-Bdat6dmL.js → held-block-view-DAUZWJdE.js} +1 -1
- package/dist/client/assets/{home-qxlWWins.js → home-LU2c0c9I.js} +1 -1
- package/dist/client/assets/{home-overview-BwTsNcY7.js → home-overview-Cz3Fu_tE.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-4JQ_9bXq.js → hosted-reconcile-Bd7dVm52.js} +1 -1
- package/dist/client/assets/{icon-button-BKSgoP48.js → icon-button-XUAdTHiK.js} +1 -1
- package/dist/client/assets/{index-BsbFaHMN.js → index-6bdDEMjn.js} +1 -1
- package/dist/client/assets/{index-AtaL2JD_.js → index-9GRaJYuB.js} +1 -1
- package/dist/client/assets/{index-_reJwud9.js → index-B4VETtA8.js} +1 -1
- package/dist/client/assets/{index-nmSJ42Ew.js → index-BLxjNGqX.js} +1 -1
- package/dist/client/assets/{index-B7lKid3Y.js → index-ByALg1mC.js} +1 -1
- package/dist/client/assets/{index-DAFFHpVi.js → index-CKn5sRTY.js} +1 -1
- package/dist/client/assets/{index-CXT6KZgX.js → index-CQn2gfDq.js} +1 -1
- package/dist/client/assets/{index-gEUrUJcs.js → index-Cbd7KY3U.js} +1 -1
- package/dist/client/assets/{index-ChDgpo9K.js → index-ChInaK-n.js} +1 -1
- package/dist/client/assets/{index-CjurNK9x.js → index-CnJSu7nG.js} +1 -1
- package/dist/client/assets/{index-BJcrWx9T.js → index-CtHwid4l.js} +1 -1
- package/dist/client/assets/{index-B8xqh-Zd.js → index-D1tua1ay.js} +1 -1
- package/dist/client/assets/{index-WM2yhiyo.js → index-D8C7Rlul.js} +1 -1
- package/dist/client/assets/{index--W2AMK-X.js → index-DJuHOZM7.js} +1 -1
- package/dist/client/assets/{index-CZ_tLRoL.js → index-DLNoQbS6.js} +1 -1
- package/dist/client/assets/{index-DmyPeHtj.js → index-DoNyWviU.js} +3 -3
- package/dist/client/assets/{index-Dcn6CILj.js → index-PkQhQsCX.js} +1 -1
- package/dist/client/assets/{index-redirect-DOqgK536.js → index-redirect-CIMb4lSs.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D9fycF8k.js → infiniteQueryObserver-BLuMJOAh.js} +1 -1
- package/dist/client/assets/{infra-billing-DpYvrDKr.js → infra-billing-kL7Vzgq0.js} +1 -1
- package/dist/client/assets/{input-wtbnNzNz.js → input-CY2YvGQ9.js} +1 -1
- package/dist/client/assets/{input-BqJq_7pW.js → input-DiirBeFw.js} +3 -3
- package/dist/client/assets/{integration-icon-92n5xPlq.js → integration-icon-DbZelBci.js} +1 -1
- package/dist/client/assets/{item-actions-xfXl6n2G.js → item-actions-CdT0KNVh.js} +1 -1
- package/dist/client/assets/{jira-icon-BibTQfLJ.js → jira-icon-DC1Ya5XN.js} +1 -1
- package/dist/client/assets/{label-B61Mm8gW.js → label-leSSTAo9.js} +1 -1
- package/dist/client/assets/{layout-c2hOp6bu.js → layout-GO4Dp9rF.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DPVEA9Z4.js → legacy-admin-welcome-dialog-Byxlfldo.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CALyvn1U.js → legacy-agents-deep-DFBGnUWe.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D7u9pyFK.js → legacy-main-redirect-dckJxWHE.js} +1 -1
- package/dist/client/assets/library-30tEpsnB.js +1 -0
- package/dist/client/assets/{library-tab-BAUunaiM.js → library-tab-DYrHka4o.js} +1 -1
- package/dist/client/assets/{login-DjyyzMPN.js → login-0YhCiIi8.js} +1 -1
- package/dist/client/assets/{markdown-B7FqmO_Q.js → markdown-BJ06ashm.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BsX2Dy6R.js → mcp-app-renderer-BVJAHvsJ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BxD-kgyz.js → mcp-oauth-CRBJUJEQ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BZS2Yc1A.js → mcp-oauth-DyBhb3Wx.js} +1 -1
- package/dist/client/assets/{members-CVRExxW3.js → members-B34FC6qW.js} +1 -1
- package/dist/client/assets/{memory-DncfhJaK.js → memory-FnwQ18c9.js} +1 -1
- package/dist/client/assets/{mock-board-CfGWjmM1.js → mock-board-u3HUs4Fq.js} +3 -3
- package/dist/client/assets/{monaco-editor-DVxpBvnd.js → monaco-editor-B-2vpUUw.js} +1 -1
- package/dist/client/assets/{monitoring-Do3w8SMM.js → monitoring-BmdLx4aj.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CD-LeMDq.js → monitoring-stats-row-SbgTwPCn.js} +1 -1
- package/dist/client/assets/{multi-select-DZx7Z4ko.js → multi-select-IUbySQP9.js} +1 -1
- package/dist/client/assets/{mustache-96ahxbWY.js → mustache-BnQazDNv.js} +1 -1
- package/dist/client/assets/{named-rule-step-DjZE94ti.js → named-rule-step-BshXFzWk.js} +1 -1
- package/dist/client/assets/{named-rule-view-vshmzUJE.js → named-rule-view-C56_DGO_.js} +1 -1
- package/dist/client/assets/{new-project-dialog-zI9XmIIv.js → new-project-dialog-B-MW0XlT.js} +1 -1
- package/dist/client/assets/{new-project-store-BL2Sa0gM.js → new-project-store-CeCsm-UD.js} +1 -1
- package/dist/client/assets/{oauth-callback-BxhTrPGN.js → oauth-callback-DiEjRqUP.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ebziW9F0.js → oauth-callback-ai-provider-5m5h2xsi.js} +1 -1
- package/dist/client/assets/{oauth-consent-CjunKK42.js → oauth-consent-uqS22V95.js} +1 -1
- package/dist/client/assets/{onboarding-BJAPGBBw.js → onboarding-D_bH6cVv.js} +1 -1
- package/dist/client/assets/{openai-conversation-CBnYYe6I.js → openai-conversation-BUNvjSNQ.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BwCyFNBl.js → optimistic-project-sidebar-views-DxYYhncM.js} +1 -1
- package/dist/client/assets/{order-monitor-day-Bu7sDLhj.js → order-monitor-day-CYPgyOx5.js} +1 -1
- package/dist/client/assets/{organization-choice-CtrQA3cq.js → organization-choice-C8eCEb4U.js} +1 -1
- package/dist/client/assets/{orgs-D8itwEwG.js → orgs-DM7Dlnfm.js} +1 -1
- package/dist/client/assets/{own-accounts-section-CPpyw5Ls.js → own-accounts-section-CvvZEBzB.js} +1 -1
- package/dist/client/assets/{pair-CgeeVvss.js → pair-wWrHO2F-.js} +1 -1
- package/dist/client/assets/{parse-sections-C8e6hmLP.js → parse-sections-DuC6_PMs.js} +2 -2
- package/dist/client/assets/plan-CWf2o5bm.js +1 -0
- package/dist/client/assets/{plan-ladder-BuBxtLzi.js → plan-ladder-Du9Oa69h.js} +1 -1
- package/dist/client/assets/{plan-page-DEHjjiXo.js → plan-page-Vr3Muhm6.js} +1 -1
- package/dist/client/assets/{plan-usage-card-CrcTrR82.js → plan-usage-card-DkLyHByl.js} +1 -1
- package/dist/client/assets/{popover-QqVUvEYR.js → popover-CFv2T1Jk.js} +1 -1
- package/dist/client/assets/{post-calendar-C64qCtHG.js → post-calendar-1gLYwSJT.js} +1 -1
- package/dist/client/assets/{post-editor-C5PQD-my.js → post-editor-D0tgj2GI.js} +1 -1
- package/dist/client/assets/{preview-content-BQKPmXGv.js → preview-content-cb43slr4.js} +1 -1
- package/dist/client/assets/{preview-dialog-GL8egC2B.js → preview-dialog-CtbNYP2u.js} +1 -1
- package/dist/client/assets/{preview-panel-DDhAmVzk.js → preview-panel-DEHOBw7o.js} +1 -1
- package/dist/client/assets/{preview-tab-DrwAiPmj.js → preview-tab-BOa5T_EL.js} +3 -3
- package/dist/client/assets/{primitives-yWcLmNO5.js → primitives-DLCk9N_Y.js} +1 -1
- package/dist/client/assets/{product-picker-dialog-Bw4o2LZ9.js → product-picker-dialog-Cwnl7fGC.js} +1 -1
- package/dist/client/assets/{profile-D7IIedH9.js → profile-K6oCswJw.js} +1 -1
- package/dist/client/assets/{project-app-view-D79GKyQK.js → project-app-view-Bw-MBl-8.js} +1 -1
- package/dist/client/assets/{project-apps-Ddelf6K_.js → project-apps-Czflm5l_.js} +1 -1
- package/dist/client/assets/{project-icon-D-KoSfqD.js → project-icon-Detiuajw.js} +1 -1
- package/dist/client/assets/{project-index-Di4hbJe7.js → project-index-C3eYXP5f.js} +1 -1
- package/dist/client/assets/project-reports-CSGRJIWM.js +1 -0
- package/dist/client/assets/project-tasks-B1MhG_lr.js +1 -0
- package/dist/client/assets/{projects-CKVyhU42.js → projects-B0a4eFuF.js} +1 -1
- package/dist/client/assets/{projects-empty-state-ChdeQFYg.js → projects-empty-state-DoKaOLlO.js} +1 -1
- package/dist/client/assets/{prompts-D00CUxnv.js → prompts-x9hDCX_T.js} +1 -1
- package/dist/client/assets/record-editor-BjdRpsoo.js +1 -0
- package/dist/client/assets/{redirect-editor-BiVMh5eW.js → redirect-editor-BWkGxLie.js} +1 -1
- package/dist/client/assets/reports-BMNnlcRG.js +1 -0
- package/dist/client/assets/{reports-Bpi5NgOn.js → reports-D3Sf2i3E.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DFl3ByGh.js → reports-onboarding-5SHMiXFs.js} +1 -1
- package/dist/client/assets/{reports-tab-Cyoilm6-.js → reports-tab-DIkaISBD.js} +2 -2
- package/dist/client/assets/repositories-CXqjT-rx.js +1 -0
- package/dist/client/assets/{repositories-Bvzle7Kd.js → repositories-DVJQtP6q.js} +1 -1
- package/dist/client/assets/{repository-binding-BezKpFog.js → repository-binding-Doos7Tz1.js} +1 -1
- package/dist/client/assets/{repository-picker-BcZZvjJw.js → repository-picker-Ch-iczcS.js} +1 -1
- package/dist/client/assets/{require-capability-1sXrPz2q.js → require-capability-CjfIjpME.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CRS7KXgy.js → required-auth-layout-2q8xhcim.js} +1 -1
- package/dist/client/assets/{reset-password-DI52CgpP.js → reset-password-B5C_zSyx.js} +1 -1
- package/dist/client/assets/{resizable-D3Zb0j0Y.js → resizable-BqOi6q_S.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-lPLw9e6M.js → resolve-tab-icon-DhWbwsJ6.js} +1 -1
- package/dist/client/assets/{review-settings-blIIbEvV.js → review-settings-BPKzyO3_.js} +1 -1
- package/dist/client/assets/{role-color-DFMoaBh_.js → role-color-yp5ualVF.js} +1 -1
- package/dist/client/assets/{roles-Cr_zYAvV.js → roles-BM1a1Dhn.js} +1 -1
- package/dist/client/assets/route-B0Zt3UQe.js +1 -0
- package/dist/client/assets/{route-DhuUeSC5.js → route-B_OWuKPa.js} +1 -1
- package/dist/client/assets/{route-CQadzTnr.js → route-CzqZjiQf.js} +1 -1
- package/dist/client/assets/{route-page-header-BjKtp3iF.js → route-page-header-BufYDes3.js} +1 -1
- package/dist/client/assets/{sandbox-git-api-DZ5qElbf.js → sandbox-git-api-UPazfJoQ.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BukF6MQn.js → sandbox-lifecycle-context-DlgkvKEk.js} +1 -1
- package/dist/client/assets/{save-status-DBCJolXB.js → save-status-DeQTo1sC.js} +1 -1
- package/dist/client/assets/{schema-CRoCQYHH.js → schema-DFjqe0nB.js} +1 -1
- package/dist/client/assets/{schema-D0halWwt.js → schema-kClobtJs.js} +1 -1
- package/dist/client/assets/{scroll-area-DmKBqmqO.js → scroll-area-BtEHygjP.js} +1 -1
- package/dist/client/assets/{search-input-KXpX5gme.js → search-input-C_n9KiwA.js} +1 -1
- package/dist/client/assets/{search-toggle-BHbQYf5Y.js → search-toggle-Dg9s7t2N.js} +1 -1
- package/dist/client/assets/{secret-picker-CMr7uz4L.js → secret-picker-CsyUaCk8.js} +1 -1
- package/dist/client/assets/{secrets-CjUGWgQ8.js → secrets-UpwFjS6G.js} +1 -1
- package/dist/client/assets/{section-array-field-BUwgz_eV.js → section-array-field-CSUw-ouw.js} +1 -1
- package/dist/client/assets/{sections-BO6dARSn.js → sections-F8O-wP8k.js} +1 -1
- package/dist/client/assets/{sections-editor-DhNLoFOR.js → sections-editor-CyXyazEh.js} +1 -1
- package/dist/client/assets/{select-B-VvZR_M.js → select-bVc6DEFP.js} +1 -1
- package/dist/client/assets/{select-model-DTnl9BTI.js → select-model-DQb79McD.js} +1 -1
- package/dist/client/assets/{seo-editor-D-9omBT1.js → seo-editor-C5smsvC3.js} +1 -1
- package/dist/client/assets/{separator-CxWekJLq.js → separator-Bj30vG7V.js} +1 -1
- package/dist/client/assets/{session-runtime-CvClIIGY.js → session-runtime-DKGwvqlm.js} +1 -1
- package/dist/client/assets/settings-tab-D655GTQY.js +1 -0
- package/dist/client/assets/{sheet-C4ApGL6L.js → sheet-C9Ayi1qA.js} +1 -1
- package/dist/client/assets/{shell-layout-DJOHh2NE.js → shell-layout-Ab8lA8KT.js} +1 -1
- package/dist/client/assets/{site-draft-actions-8xVV9dEa.js → site-draft-actions-uv2l5Jx2.js} +1 -1
- package/dist/client/assets/{site-draft-view-DlKOjkMp.js → site-draft-view-DIpxOMiU.js} +1 -1
- package/dist/client/assets/site-editor-BFZP327D.js +1 -0
- package/dist/client/assets/{site-editor-toast-DLSJJb2F.js → site-editor-toast-DHzTFmxl.js} +1 -1
- package/dist/client/assets/{skills-CRsIU-hD.js → skills-Du7f7dC7.js} +1 -1
- package/dist/client/assets/{slider-BIv9sKN-.js → slider-DRITfr0-.js} +1 -1
- package/dist/client/assets/{sortable.esm-C0ThOxD8.js → sortable.esm-eHJ6fl0L.js} +1 -1
- package/dist/client/assets/{sso-Cp0an3Ez.js → sso-CqlKdbcH.js} +1 -1
- package/dist/client/assets/{suggestion-DIf7hFaH.js → suggestion-CBNh6xfc.js} +1 -1
- package/dist/client/assets/{super-agent-icon-DUpkyxXZ.js → super-agent-icon-BKh7mwaZ.js} +1 -1
- package/dist/client/assets/{switch-CfqVcR-v.js → switch-LZFOzceS.js} +1 -1
- package/dist/client/assets/{synced-repos-JXJEMpC7.js → synced-repos-w7luCNJp.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CgCRg2hv.js → tab-icon-glyph-efWK-ktc.js} +1 -1
- package/dist/client/assets/{table-CoF20Hw1.js → table-CUGC7-B7.js} +1 -1
- package/dist/client/assets/{tabs-DBKq274Z.js → tabs-DpLpA4zI.js} +1 -1
- package/dist/client/assets/{task-board-B8wzNBqW.js → task-board-6hCQ4fmc.js} +1 -1
- package/dist/client/assets/{task-key-CpnKPfDS.js → task-key-o7nPsnmG.js} +1 -1
- package/dist/client/assets/{task-route-CkAEJVQF.js → task-route-Cx2HHsSi.js} +1 -1
- package/dist/client/assets/{task-status-Cr1qI7Ux.js → task-status-zBxVKQwp.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BTJCLNi8.js → taskboard-analytics-CcYvEXDi.js} +1 -1
- package/dist/client/assets/{tasks-DuGmmJdD.js → tasks-B03IrEA8.js} +1 -1
- package/dist/client/assets/tasks-C59xZt2e.js +1 -0
- package/dist/client/assets/{textarea-Djiqi_Hb.js → textarea-DXe9GpK8.js} +1 -1
- package/dist/client/assets/{thread-analytics-61rO8zWs.js → thread-analytics-oFsi9qkg.js} +1 -1
- package/dist/client/assets/{thread-button-DRipdtQl.js → thread-button-Cb-cF7Ct.js} +1 -1
- package/dist/client/assets/{thread-intent-1kOP6maa.js → thread-intent-kGrdf_bu.js} +1 -1
- package/dist/client/assets/{thread-route-QjX15zqF.js → thread-route-4MeucFTM.js} +1 -1
- package/dist/client/assets/{thread-route-DHFCXB9E.js → thread-route-eE3fFlDd.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-sdh7Mf7u.js → thread-sheet-body-C_801Wq6.js} +1 -1
- package/dist/client/assets/{time-range-picker-B4sRq8E3.js → time-range-picker-BYVJkNzm.js} +1 -1
- package/dist/client/assets/{toggle-group-BMYX_eGL.js → toggle-group-6ybjHrpO.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CJazFfoM.js → tool-set-selector-BijnbSxX.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BXZ6Fg9k.js → toolbar-icon-button-B-S_60D6.js} +1 -1
- package/dist/client/assets/{tooltip-CnD2gBxQ.js → tooltip-aAZohpqH.js} +1 -1
- package/dist/client/assets/{tooltipContext-B6Z4ndzl.js → tooltipContext-DzttawdX.js} +1 -1
- package/dist/client/assets/{track-C2t9Ju4W.js → track-DCQsLQ2W.js} +1 -1
- package/dist/client/assets/{types-DxV-fZV6.js → types-3jBzmcA7.js} +1 -1
- package/dist/client/assets/{url-slug-cwQb0zdO.js → url-slug-B5BLTyb7.js} +1 -1
- package/dist/client/assets/{usage-stats-DX6ERAU7.js → usage-stats-OB3yK4zm.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DrvsAXJ7.js → use-ai-providers-CsKQ3_jX.js} +1 -1
- package/dist/client/assets/{use-api-keys-WR-MHbKG.js → use-api-keys-D0RjbZLI.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DtVcB2Sd.js → use-apply-named-rule-UDkUQkTy.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BgnG_ElA.js +1 -0
- package/dist/client/assets/{use-automations-CQGktFHE.js → use-automations-BQu3RZK9.js} +1 -1
- package/dist/client/assets/{use-autosave-4o04OWTs.js → use-autosave-rOZUG9Vb.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-9w4Ust2C.js +1 -0
- package/dist/client/assets/use-blog-view-I4eq1t_D.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-OXPATbvD.js → use-chat-layout-state-Ck0L3HMB.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-E5PxzXRo.js → use-cms-publish-actions-Csb4RWkj.js} +1 -1
- package/dist/client/assets/{use-connect-companion-G1Hi_qLO.js → use-connect-companion-BztuQEKf.js} +1 -1
- package/dist/client/assets/{use-connection-G9Us7hRV.js → use-connection-Dh2VvaPm.js} +1 -1
- package/dist/client/assets/{use-content-sync-qLtFKVoY.js → use-content-sync-CgKW2Jef.js} +1 -1
- package/dist/client/assets/{use-copy-DcPGMlZ-.js → use-copy-CchaNgVJ.js} +1 -1
- package/dist/client/assets/{use-current-view-DrUxoucV.js → use-current-view-k2AK3Yej.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-HbSUG1u1.js → use-date-fns-locale-BP1cEclE.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-5uSqKsMY.js → use-debounced-autosave-DeKlPtaY.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Io5mDbSS.js → use-debounced-value-D2pivH_j.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CIEhAz6A.js → use-deco-credits-D7lydUxO.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Be8G8lj7.js → use-decopilot-events-CSLkN4DP.js} +1 -1
- package/dist/client/assets/{use-delete-block-ZSPe1Jt_.js → use-delete-block-B0fmzJDK.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BqwFhFOC.js → use-delete-connection-C597VMaH.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BGJ_CxB1.js → use-deployment-admin-3jFXyFn6.js} +1 -1
- package/dist/client/assets/{use-entitlements-BYhZgO5P.js → use-entitlements-DwVDTkM9.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-C1FIhbN9.js → use-fast-preview-draft-url-D-Nh7Lnb.js} +1 -1
- package/dist/client/assets/{use-file-configs-k_hhBwsx.js → use-file-configs-XA9SVgSB.js} +1 -1
- package/dist/client/assets/{use-id-selection-CMFxpgLZ.js → use-id-selection-Dxhxl4Lc.js} +1 -1
- package/dist/client/assets/{use-in-settings-BhSbV6H8.js → use-in-settings-BItIqEI3.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-B09538_g.js → use-inbox-feed-B-q77BHn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DW5uI5g1.js → use-infinite-scroll-DbJGXO7i.js} +1 -1
- package/dist/client/assets/{use-join-requests-DMhspUtS.js → use-join-requests-Bx6TmQTA.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-COup8C-z.js → use-main-panel-tabs-DRHVFZ-H.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B1ZXOBZo.js → use-mcp-auth-status-CWOBvJa9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DfqrKiZY.js → use-mcp-client-YKRm-IfC.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CxlRUHT-.js → use-mcp-prompts-ButloM5X.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DBXAxSmu.js → use-mcp-tools-Lur1Hk4t.js} +1 -1
- package/dist/client/assets/{use-mobile-BGIYUsLQ.js → use-mobile-BXMehGT-.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CYHOXTJj.js → use-move-blocks-ClwYuHDJ.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-stX_hK-R.js → use-navigate-to-agent-BL48iyFj.js} +1 -1
- package/dist/client/assets/{use-never-published-CJQoljTh.js → use-never-published-DQpGq-eW.js} +1 -1
- package/dist/client/assets/{use-org-fs-j9Hf5idr.js → use-org-fs-Bt2qEGZu.js} +1 -1
- package/dist/client/assets/{use-org-notice-J6OTcXIJ.js → use-org-notice-FaAGxqT5.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-B3V0YVhZ.js → use-org-repo-syncs-DyCRx5Oo.js} +1 -1
- package/dist/client/assets/{use-org-sso-B8YBjAU0.js → use-org-sso-Bmfw_IlN.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DRtlFFBs.js → use-organization-settings-BvHWSa_6.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DLijLDIl.js → use-panel-navigate-Ck-jPDrJ.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-CflbYfyt.js → use-project-native-view-presence-B3kmhDxj.js} +1 -1
- package/dist/client/assets/{use-project-scope-sgJLxDnc.js → use-project-scope-DwgoPCzQ.js} +1 -1
- package/dist/client/assets/{use-recent-apps-C6R-3xzm.js → use-recent-apps-CnLsz9iV.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-D7PJJJR-.js → use-reports-diagnostic-CfDYt9VX.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-D7X3VYGW.js → use-sandbox-events-C9AVtujd.js} +1 -1
- package/dist/client/assets/{use-secrets-DGIBDHGx.js → use-secrets-zv4iOz4u.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DzxwJmmA.js → use-section-preview-base-fJPQdYLH.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BsHAzi2v.js → use-sidebar-collapsed-_MKqd0RQ.js} +1 -1
- package/dist/client/assets/{use-tags-7fim3G8l.js → use-tags-D8VG5R7C.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DR6GAqO0.js → use-task-board-analytics-U9lqVWO6.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DHpJNypU.js → use-task-board-item-prs-BgfgIwvN.js} +1 -1
- package/dist/client/assets/{use-task-board-items-B1Pzgu76.js → use-task-board-items-DCwVsM5m.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-IJgyzOT-.js → use-task-board-prompts-Db22cQEe.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BUNn-khG.js → use-task-metadata-u5r6BHOI.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CtVbBsAG.js → use-thread-outputs-B-4f1Xfc.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-XY0ukhv-.js → use-view-draft-kind-BAcSweMS.js} +1 -1
- package/dist/client/assets/{use-voice-input-DguZp9dH.js → use-voice-input-CCZaSdUm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Df5MUdS4.js +1 -0
- package/dist/client/assets/{useQueries-Di5RfWGT.js → useQueries-Djmsrw3h.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CeNBf4GF.js +1 -0
- package/dist/client/assets/{users-CCYUTU45.js → users-DYdAatzH.js} +1 -1
- package/dist/client/assets/{utils-DgfuCg_0.js → utils-CVhZKcka.js} +1 -1
- package/dist/client/assets/{variant-calendar-B4q2_EtP.js → variant-calendar-A12llovr.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-B7mJIZfR.js → variant-matcher-override-D6LIutzX.js} +1 -1
- package/dist/client/assets/{view-header-CvQldNEQ.js → view-header-C-s46Gy-.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Ci6QcDj7.js → virtual-mcp-BiHaqB0O.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BbbQrIO0.js → watch-sse-pool-D8QQLbcn.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +665 -665
- package/package.json +1 -1
- package/dist/client/assets/agent-app-1gb3fP-R.js +0 -1
- package/dist/client/assets/agent-deck-CmXstFXo.js +0 -1
- package/dist/client/assets/agent-experiments-CDey06Av.js +0 -1
- package/dist/client/assets/agent-file-nF-v4TIq.js +0 -1
- package/dist/client/assets/agent-library-DpY5A561.js +0 -1
- package/dist/client/assets/agent-library-file-CWaKqX-p.js +0 -1
- package/dist/client/assets/agent-overview-DtRPdBry.js +0 -1
- package/dist/client/assets/agent-settings-BAi3GmmG.js +0 -1
- package/dist/client/assets/agent-site-editor-code-MFqRb2Ue.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Bb5YwChE.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DRcDZGPw.js +0 -1
- package/dist/client/assets/agent-view-B24byKnk.js +0 -1
- package/dist/client/assets/api-keys-umCPf2jI.js +0 -1
- package/dist/client/assets/library-CIc0x0ue.js +0 -1
- package/dist/client/assets/plan-rJ9a3K5T.js +0 -1
- package/dist/client/assets/project-reports-BaUD1mSs.js +0 -1
- package/dist/client/assets/project-tasks-IY1SmC3r.js +0 -1
- package/dist/client/assets/record-editor-B4kmxAIk.js +0 -1
- package/dist/client/assets/reports-wttF6ZoA.js +0 -1
- package/dist/client/assets/repositories-3Kf5jKe3.js +0 -1
- package/dist/client/assets/route-CDLTxCaI.js +0 -1
- package/dist/client/assets/settings-tab-CC9OxhsE.js +0 -1
- package/dist/client/assets/site-editor-Ct2iJJKm.js +0 -1
- package/dist/client/assets/tasks-DR6gaCo6.js +0 -1
- package/dist/client/assets/use-ask-in-chat-CxLSAUNx.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DQzOlv_E.js +0 -1
- package/dist/client/assets/use-blog-view-9Y1OwyU5.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CSIthp54.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Z_2IraLh.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aJ as Dt,aK as q,bs as je,bF as _n,dD as Oe,dB as xn,ez as we,c as A,i as F,eA as Rn,eB as Tn,q as Z,r as L,eC as Pn,K as g,eD as Y,eE as X,bE as $n,a as Nn,aw as De,a6 as jn,bA as It,eF as An,eG as _t,au as Mn,bw as B,eh as xt,eH as Ln,eI as Qn,eJ as Un,t as te,j as z}from"./index-DmyPeHtj.js";import{C as j,E as T,i as Ae,P as Bn,b as Fn,c as Me,d as Rt,e as Tt}from"./content-changes-JBgMg-Ro.js";import{b as Le}from"./repository-binding-BezKpFog.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{b as pe}from"./sandbox-url-D3mC8qhT.js";import{u as Cn}from"./chat-context-CqcR4aAu.js";import{i as Vn,u as Hn}from"./use-sandbox-events-D7X3VYGW.js";import{u as Qe}from"./use-blocks-v8-project-DQzOlv_E.js";import{u as $t}from"./use-voice-input-DguZp9dH.js";import{s as ot}from"./session-runtime-CvClIIGY.js";import{s as Jn}from"./utils-DgfuCg_0.js";import{a as Wn}from"./sandbox-git-api-DZ5qElbf.js";function Nt(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 ue(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 jt=Dt({endpoint:q().max(2048).refine(e=>Nt(e)&&new URL(e).pathname==="/rpc").transform(ue)});function vr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=jt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function At(e){const t=jt.safeParse(e);return t.success?t.data:null}const Mt="studio:deco-serve-last";function br(e){try{localStorage.setItem(Mt,JSON.stringify(e))}catch{}}function wr(){try{const e=localStorage.getItem(Mt);return e?At(JSON.parse(e)):null}catch{return null}}function pr(e){try{return new URL(ue(e)).host}catch{return e}}function Yn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Gn="http://localhost:4545/rpc";class Ue extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Ue)return{reason:"not-deco-serve"};if(!(e instanceof j))return{reason:"not-answering"};switch(e.code){case T.Unauthorized:case T.MethodNotFound:return{reason:"outdated"};case T.Unsupported:return Ae(e)?{reason:"outdated"}:{reason:"version-mismatch"};case T.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 mr(e,t){if(e)return[ue(e.endpoint)];const n=[t?.endpoint,Gn].filter(o=>!!o).map(ue);return[...new Set(n)]}const Xn=Dt({blocks:Oe(q(),Oe(q(),xn()).refine(je)),versions:Oe(q(),q().min(1)),missing:_n(q())});function Zn(e,t){const n=Xn.parse(e),o=Object.keys(n.blocks),s=Object.keys(n.versions),r=[...o,...n.missing],i=new Set(t);if(s.length!==o.length||o.some(a=>!Object.hasOwn(n.versions,a))||r.length!==i.size||new Set(r).size!==r.length||r.some(a=>!i.has(a)))throw new Error("The CMS block response did not account for the requested names");return n}function ne(e,t){const n=e.index?.entries[t];return!!n&&je(e.blocks[t])&&e.versions[t]===n.version}function Kn(e,t,n){const o=new Map;let s=!1;for(const[r,i]of Object.entries(n.blocks)){const a=t.index?.entries[r];if(a){if(n.versions[r]!==a.version){s||=a.version===e.index?.entries[r]?.version;continue}t.blocks[r]!==e.blocks[r]||t.versions[r]!==e.versions[r]||o.set(r,i)}}return s||=n.missing.some(r=>!!t.index?.entries[r]),{blocks:o.size?{...t.blocks,...Object.fromEntries(o)}:t.blocks,versions:o.size?{...t.versions,...Object.fromEntries([...o.keys()].map(r=>[r,n.versions[r]]))}:t.versions,refreshIndex:s}}function qn(e,t,n){return!!e.index&&t.every(o=>e.index?.entries[o]?ne(e,o)&&(!n||n[o]===e.blocks[o]):!n||n[o]===void 0)}const st=50,rt=10;function eo(e,t=n=>fetch(n)){let n=1;return{async batch(o){const s=o.map(()=>n++),r=await t(new Request(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",signal:we(),body:JSON.stringify(o.map((l,c)=>({jsonrpc:"2.0",id:s[c],method:l.method,params:l.params??{}})))}));if(!r.ok)throw new j(T.Unavailable,`the hosted CMS answered ${r.status}`);const i=await r.json(),a=new Map((Array.isArray(i)?i:[]).map(l=>[l.id,l]));return s.map(l=>{const c=a.get(l);return c?c.error?{ok:!1,error:j.from(c.error)}:{ok:!0,result:c.result}:{ok:!1,error:new j(T.InternalError,"no response for this call")}})}}}function to(e,t){if(!e)return t??{};const n={};for(const[o,s]of Object.entries(e.entries)){if(t&&Object.hasOwn(t,o)){n[o]=t[o];continue}n[o]={[Tn]:!0,...s.meta?.type?{__resolveType:s.meta.type}:{},...s.meta?.path!==void 0?{path:s.meta.path}:{},...s.meta?.refs?.length?{[Rn]:s.meta.refs}:{}}}for(const[o,s]of Object.entries(t??{}))Object.hasOwn(n,o)||(n[o]=s);return n}function no(e,t){return e?.entries[t]?.meta?.refs??[]}function oo(e,t){return Object.hasOwn(e.draft,t)?e.draft[t]?.version??null:null}function Be(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ie(e,t){if(Array.isArray(e)){for(const n of e)Ie(n,t);return}if(Be(e))for(const[n,o]of Object.entries(e))n==="__resolveType"&&typeof o=="string"?t.add(o):Ie(o,t)}function Lt(e,t){if(!Be(e))return;const n={};typeof e.__resolveType=="string"&&(n.type=e.__resolveType),typeof e.path=="string"&&(n.path=e.path);const o=new Set;Ie(e,o);const s=[...o].filter(r=>t.has(r)).sort();return s.length>0&&(n.refs=s),Object.keys(n).length>0?n:void 0}function Qt(e,t,n,o){Y(e),e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.entries},i={...s.draft},a=new Set([...Object.keys(r),...Object.keys(o)]);for(const[l,c]of Object.entries(n)){const f=i[l]?.editor??null;if(c===null||c===X){delete r[l],i[l]={operation:"delete",version:X,editor:f};continue}const h=Lt(o[l],a);r[l]={version:c,...h?{meta:h}:{}},i[l]={operation:"set",version:c,editor:f}}return{...s,entries:r,draft:i}})}function so(e,t,n,o){e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.draft},i={...s.entries};if(o===null)delete r[n];else if(r[n]={operation:o.block===null?"delete":"set",version:o.version,editor:r[n]?.editor??null},o.block===null)delete i[n];else{const a=new Set([...Object.keys(i),n]),l=Lt(o.block,a);i[n]={version:o.version,...l?{meta:l}:{}}}return{...s,entries:i,draft:r}})}const it=new WeakMap;async function Fe(e,t,n,o,s=new Set){const r=e.getQueryData(g.contentIndex(n));if(!r)throw new j(T.Unavailable,"The CMS index is not loaded yet");let i=it.get(e);i||(i=new Map,it.set(e,i));const a=e.getQueryData(g.decofile(n))??{},l=e.getQueryData(g.contentVersions(n))??{},c=[],f=[];for(const u of new Set(o)){const d=r.entries[u];if(!d||s.has(u)||je(a[u])&&l[u]===d.version)continue;const v=i.get(`${n}\0${u}`);v?c.push(v):f.push(u)}if(f.length>0){const u=io(e,t,n,f);for(const d of f){const v=`${n}\0${d}`;i.set(v,u),u.catch(()=>{}).finally(()=>{i.get(v)===u&&i.delete(v)})}c.push(u)}await Promise.all(c);const h=fe(e,n);if(o.some(u=>h.index?.entries[u]&&!s.has(u)&&!ne(h,u)))throw new j(T.Unavailable,"A CMS block changed while loading; try again")}async function ro(e,t,n,o,s){if(!t){const i=o?.[s];return Be(i)&&!$n(i)?i:void 0}await Fe(e,t,n,[s]);const r=fe(e,n);return r.index?.entries[s]&&ne(r,s)?r.blocks[s]:void 0}function fe(e,t){return{index:e.getQueryData(g.contentIndex(t)),blocks:e.getQueryData(g.decofile(t))??{},versions:e.getQueryData(g.contentVersions(t))??{}}}async function io(e,t,n,o){const s=fe(e,n),r=[];for(let i=0;i<o.length;i+=st)r.push(o.slice(i,i+st));for(let i=0;i<r.length;i+=rt){const a=r.slice(i,i+rt),l=await t.batch(a.map(c=>({method:"cms.blocks",params:{names:c}})));if(l.length!==a.length)throw new j(T.InternalError,"Incomplete CMS batch response");for(const[c,f]of l.entries()){if(!f.ok)throw f.error;const h=Zn(f.result,a[c]),u=fe(e,n),d=Kn(s,u,h);if(Y(e),d.blocks!==u.blocks&&e.setQueryData(g.decofile(n),d.blocks),d.versions!==u.versions&&e.setQueryData(g.contentVersions(n),d.versions),d.refreshIndex)throw e.invalidateQueries({queryKey:g.decofile(n),exact:!0},{cancelRefetch:!1}),new j(T.Unavailable,"The CMS index changed while loading blocks; try again")}}}function Ce(e){const t=A.c(4);let n;t[0]!==e?(n=g.contentIndex(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ao,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s}async function ao(){throw new Error("the content index is set by the poll")}function at(e,t){const n=A.c(8);let o;n[0]!==t?(o=Pn(t),n[0]=t,n[1]=o):o=n[1];const s=o;let r;n[2]!==e||n[3]!==s?(r=a=>e.getQueryCache().subscribe(l=>{l.query.queryHash===s&&a()}),n[2]=e,n[3]=s,n[4]=r):r=n[4];let i;return n[5]!==e||n[6]!==t?(i=()=>e.getQueryData(t),n[5]=e,n[6]=t,n[7]=i):i=n[7],L.useSyncExternalStore(r,i)}const ct=3e4;function co(e){if(!(e instanceof j))return;const t=e.data?.retryAfterMs;return typeof t=="number"&&t>0?t:void 0}function lo(e,t,n,o){const s=A.c(15),r=Z(),i=Ce(t);let a;s[0]!==t?(a=g.decofile(t),s[0]=t,s[1]=a):a=s[1];const l=at(r,a);let c;s[2]!==t?(c=g.contentVersions(t),s[2]=t,s[3]=c):c=s[3];const f=at(r,c),h=o?.withRefs??!1,u=new Set(n);if(h)for(const p of n)for(const k of no(i,p))u.add(k);const d=[...u].filter(p=>!!i?.entries[p]).sort(),v={index:i,blocks:l??{},versions:f??{}},b=d.some(p=>!ne(v,p)),w=JSON.stringify(d.map(p=>[p,i?.entries[p]?.version,ne(v,p)])),[_,S]=L.useState(null),[$,E]=L.useState(0),D=_?.key===w?_:null;L.useEffect(()=>{if(!e||!w)return;let p=!0;const k=JSON.parse(w).map(ho);return Fe(r,e,t,k).then(()=>{p&&S(P=>P?.key===w?null:P)},P=>{p&&S(Q=>({key:w,count:(Q?.key===w?Q.count:0)+1,retryAfterMs:co(P)}))}),()=>{p=!1}},[e,r,t,w,$]);let I;s[4]!==D||s[5]!==E?(I=()=>{if(!D)return;const p=Math.min(ct,D.retryAfterMs??Pt(ct,1e3,D.count-1,2,.5)),k=setTimeout(()=>E(fo),p);return()=>clearTimeout(k)},s[4]=D,s[5]=E,s[6]=I):I=s[6];let m;s[7]!==D?(m=[D],s[7]=D,s[8]=m):m=s[8],L.useEffect(I,m);const y=!e||qn(v,[...u],o?.listing),O=!!e&&b&&D!==null;let x;s[9]!==E?(x=()=>E(uo),s[9]=E,s[10]=x):x=s[10];let N;return s[11]!==y||s[12]!==O||s[13]!==x?(N={ready:y,failed:O,retry:x},s[11]=y,s[12]=O,s[13]=x,s[14]=N):N=s[14],N}function uo(e){return e+1}function fo(e){return e+1}function ho(e){const[t]=e;return t}const Ut=L.createContext(null);function go(e){const t=A.c(24),n=L.useContext(Ut),o=Qe(n?null:e),{data:s}=Nn.useSession(),r=s?.user?.id??"",i=!!e&&!!r;let a;t[0]!==i||t[1]!==r||t[2]!==e?(a=i?De.decoServeConnection(r,e):null,t[0]=i,t[1]=r,t[2]=e,t[3]=a):a=t[3];const[l,c]=ut(a);let f;t[4]!==i||t[5]!==r||t[6]!==e?(f=i?De.decoServeEndpoint(r,e):null,t[4]=i,t[5]=r,t[6]=e,t[7]=f):f=t[7];const[h,u]=ut(f);if(n)return n;let d;t[8]!==l||t[9]!==i||t[10]!==o?(d=i&&o?At(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=d):d=t[11];const v=d,b=i&&o&&typeof h=="string"?h:null;let w;t[12]!==u||t[13]!==c||t[14]!==i?(w=$=>{i&&(c($),u($.endpoint))},t[12]=u,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let S;return t[19]!==v||t[20]!==b||t[21]!==w||t[22]!==_?(S={connection:v,lastEndpoint:b,set:w,clear:_},t[19]=v,t[20]=b,t[21]=w,t[22]=_,t[23]=S):S=t[23],S}function lt(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function ut(e){const t=A.c(17),n=Z(),o=e??"";let s;t[0]!==o?(s=["localStorage",o],t[0]=o,t[1]=s):s=t[1];const r=s;let i,a;t[2]!==e?(i=()=>e?lt(e):null,a=()=>e?lt(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==r||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:r,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=r,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let h;t[10]!==e||t[11]!==n||t[12]!==r?(h=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(r,b)}},t[10]=e,t[11]=n,t[12]=r,t[13]=h):h=t[13];const u=h,d=e?f??null:null;let v;return t[14]!==u||t[15]!==d?(v=[d,u],t[14]=u,t[15]=d,t[16]=v):v=t[16],v}function Bt(e,t=""){return{source:e,cacheKeySuffix:e==="github"?"":e==="sandbox"?":sandbox":`:serve:${t}`}}function vo(e){return JSON.stringify([e.kind==="legacy"?"legacy":"protocol",e.source,e.cacheKeySuffix])}function Sr(e){return e.kind==="protocol"||e.kind==="unavailable"}function yr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function kr(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Or(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&Nt(t)?t:null}function Er(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Ft(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bo(e){if(!e.hasProject)return"legacy";const t=Ft(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function wo(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function ft(e){return e.isError||e.errorUpdateCount>0}function po(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const s of n)Object.hasOwn(t,s)?o[s]=t[s]:delete o[s];return o}function mo(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 Ct="__noSchema";function Vt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ct]:!0}}function Dr(e){return!!e&&e[Ct]===!0}function Ve(e){if(!e.ok)return e.error.code===T.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function So(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const yo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Ir(e){const t=new Map;for(const[n,o]of Object.entries(e)){const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},r=typeof s.__resolveType=="string"?s.__resolveType:null,i=t.get(r)??[];i.push({key:n,label:So(n,s)}),t.set(r,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(yo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:dt(n.resolveType).localeCompare(dt(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function dt(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function ht(e,t,n){if(t.length===0)return n;const[o,...s]=t;if(Array.isArray(e)&&typeof o=="number"){const r=e.slice();return r[o]=ht(e[o],s,n),r}if(e&&typeof e=="object"&&typeof o=="string"){const r=e,i={};for(const a of Object.keys(r))i[a]=a===o?ht(r[a],s,n):r[a];return i}return e}function _r(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class gt extends Error{}const He="site-not-owned";async function ko(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Oo(e,t=n=>fetch(n)){const n=Me({endpoint:e,fetch:async o=>{const s=await t(new Request(o,{signal:we(o.signal)}));if(await ko(s))throw new gt;return s}});try{return await We(n)}catch(o){if(o instanceof gt)return He;throw o}}async function Eo(e,t,n){await t();const o=await Oo(e,n);return o===He?o:{...o,hosted:eo(e,n)}}const Je=5e3;function Do(e){if(!e.site)throw new Error("this project names no site");return An(e.site,e.branch)}function Io(e){return new URL(pe(e,"rpc"),window.location.origin).href}async function We(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==Bn)throw new Ue;const s=Fn(t.result);if(!n)throw new Error("no schema.get");if(Ve(n))return{client:e,describe:s,hasSchema:!1};if(n.ok)return{client:e,describe:s,hasSchema:!0};throw n.error}function _o(e,t=n=>fetch(n)){return We(Me({endpoint:e,fetch:n=>t(new Request(n,{signal:we(n.signal)}))}))}function se(e,t){const n=A.c(40),{org:o}=jn(),{connection:s}=go(e),{runtime:r}=$t(e),i=L.useContext(Ut),a=Qe(e),l=It(Le(e)?.metadata),c=Ft({hasServeConnection:!!s,runtime:r}),f=Bt(c,s?.endpoint??""),h=Cn()?.taskId??null,u=Vn(Hn().lifecycle.phase),d=Z(),v=wo({mode:c,v8:a,workingTreeReady:u}),b=v.github&&!!o.slug&&!!e&&!!t,w=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>Eo(Do({orgSlug:o.slug,site:l,branch:t}),()=>_t(l,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...vt}),_=v.sandbox&&!!o.slug&&!!e&&!!t;let S;n[0]!==t||n[1]!==o.slug||n[2]!==h||n[3]!==e?(S=()=>_o(Io({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:h})),n[0]=t,n[1]=o.slug,n[2]=h,n[3]=e,n[4]=S):S=n[4];const $=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",h??""),queryFn:S,enabled:_,staleTime:Number.POSITIVE_INFINITY,...vt}),E=!!s;let D;n[5]!==s?.endpoint||n[6]!==o.slug||n[7]!==e?(D=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[5]=s?.endpoint,n[6]=o.slug,n[7]=e,n[8]=D):D=n[8];let I;n[9]!==s?(I=()=>jo(s.endpoint),n[9]=s,n[10]=I):I=n[10];let m;n[11]!==E||n[12]!==D||n[13]!==I?(m={queryKey:D,queryFn:I,enabled:E,staleTime:Number.POSITIVE_INFINITY,retry:To,retryDelay:Ro,refetchInterval:xo},n[11]=E,n[12]=D,n[13]=I,n[14]=m):m=n[14];const y=F(m);let O;n[15]!==s?.endpoint||n[16]!==o.slug||n[17]!==e?(O=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[15]=s?.endpoint,n[16]=o.slug,n[17]=e,n[18]=O):O=n[18];const x=O;let N;n[19]!==s?.endpoint||n[20]!==o.slug||n[21]!==e?(N=g.contentBackend(o.slug,e??"","local-describe",s?.endpoint??""),n[19]=s?.endpoint,n[20]=o.slug,n[21]=e,n[22]=N):N=n[22];let p;n[23]!==y.data||n[24]!==x||n[25]!==d?(p=async()=>{try{return await y.data.client.describe()}catch(K){const In=K;throw d.invalidateQueries({queryKey:x,exact:!0},{cancelRefetch:!1}),In}},n[23]=y.data,n[24]=x,n[25]=d,n[26]=p):p=n[26];const k=!!y.data&&!i;let P;n[27]!==N||n[28]!==p||n[29]!==k?(P={queryKey:N,queryFn:p,enabled:k,refetchInterval:Je,retry:!1},n[27]=N,n[28]=p,n[29]=k,n[30]=P):P=n[30];const M=F(P).data??y.data?.describe,U=bo({hasProject:!!e,hasServeConnection:!!s,runtime:r,v8:a,githubSite:w.data===He?"not-owned":w.data?"ready":ft(w)?"error":"loading",sandboxSite:Po({data:$.data,isError:ft($),workingTreeReady:u})});if(U==="pending")return{kind:"pending",...f};if(U==="retrying-sandbox")return{kind:"pending",retrying:"sandbox",...f};if(U==="legacy")return{kind:"legacy"};if(U==="protocol-github")return{..._e(f,w.data),site:l};if(U==="site-not-owned-github")return{kind:"unavailable",...f,siteNotOwned:!0};if(U==="protocol-sandbox")return _e(f,$.data);if(U==="unavailable-github"){let K;return n[31]!==f?(K={kind:"unavailable",...f},n[31]=f,n[32]=K):K=n[32],K}const R=y.error??y.failureReason,H=s?.endpoint??"";let J;return n[33]!==M||n[34]!==y.data||n[35]!==y.failureCount||n[36]!==y.isError||n[37]!==H||n[38]!==R?(J=No({probed:y.data,isError:y.isError,failureCount:y.failureCount,failure:R,describe:M,endpoint:H}),n[33]=M,n[34]=y.data,n[35]=y.failureCount,n[36]=y.isError,n[37]=H,n[38]=R,n[39]=J):J=n[39],J}function xo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Je:!1}function Ro(e){return Yn(e+1)}function To(e,t){return!(t instanceof j)&&!(t instanceof Ue)}function Po(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $o=3;function No(e){const t=Bt("local",e.endpoint),n=e.probed?_e(t,{...e.probed,describe:e.describe??e.probed.describe}):null;return e.isError||e.failureCount>0?n?.kind==="protocol"&&!e.isError&&e.failureCount<$o?n:{kind:"unavailable",...t,problem:zn(e.failure)}:n??{kind:"pending",...t}}const vt={retry:2,refetchInterval:e=>e.state.status==="error"?Je:!1};function _e(e,t){return{kind:"protocol",...e,client:t.client,describe:t.describe,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function jo(e,t){return We(Me({endpoint:e,fetch:n=>fetch(n,{signal:we(t?AbortSignal.any([t,n.signal]):n.signal)})}))}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Ao(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Mo(e,t,n){return e?t==="pending"?{ready:!1,failed:!1}:t==="unavailable"?{ready:!1,failed:!0}:n:{ready:!0,failed:!1}}function Lo(e,t){return JSON.stringify([e?.orgSlug,e?.virtualMcpId,e?.branch,vo(t)])}function Qo(e,t,n){const o=A.c(21),s=Z(),r=se(e?.virtualMcpId,e?.branch),i=e&&r.kind==="protocol"&&r.hosted?r:null;let a;o[0]!==i||o[1]!==e?(a=i&&e?Ao(e,i):"",o[0]=i,o[1]=e,o[2]=a):a=o[2];const l=lo(i?.hosted,a,t,n),c=e!==null;let f;o[3]!==r.kind||o[4]!==l||o[5]!==c?(f=Mo(c,r.kind,l),o[3]=r.kind,o[4]=l,o[5]=c,o[6]=f):f=o[6];const h=f,u=r.kind!=="legacy";let d;o[7]!==r||o[8]!==e?(d=Lo(e,r),o[7]=r,o[8]=e,o[9]=d):d=o[9];let v;o[10]!==r.kind||o[11]!==r.source||o[12]!==l||o[13]!==s||o[14]!==e?(v=()=>{if(l.retry(),!e||r.kind!=="unavailable")return;const w=r.source;s.resetQueries({queryKey:g.contentBackend(e.orgSlug,e.virtualMcpId,...w==="local"?["local"]:[e.branch,w])})},o[10]=r.kind,o[11]=r.source,o[12]=l,o[13]=s,o[14]=e,o[15]=v):v=o[15];let b;return o[16]!==h||o[17]!==u||o[18]!==d||o[19]!==v?(b={...h,v8:u,scopeKey:d,retry:v},o[16]=h,o[17]=u,o[18]=d,o[19]=v,o[20]=b):b=o[20],b}function Ht(e){const t=A.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[s,r]=Mn(o,null),i=Qe(e);let a;t[2]!==s||t[3]!==e?(a=e?ot(s):null,t[2]=s,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,h;t[5]!==r?(f=d=>r(ot(d)),h=()=>r(null),t[5]=r,t[6]=f,t[7]=h):(f=t[6],h=t[7]);let u;return t[8]!==c||t[9]!==f||t[10]!==h?(u={url:c,setUrl:f,clear:h},t[8]=c,t[9]=f,t[10]=h,t[11]=u):u=t[11],u}const bt=6e4,Uo=2147483647;function Bo(e,t){if(e===null||e.trim()==="")return bt;const n=e.trim(),o=/^\d+(?:\.\d+)?$/.test(n)?Number(n)*1e3:/^[A-Za-z]{3}, /.test(n)?Math.max(0,Date.parse(n)-t):Number.NaN;return Number.isFinite(o)&&o>=0&&o<=Uo?o:bt}class Jt extends Error{constructor(t,n,o,s=Date.now()){super(t),this.status=n,this.name="ContentResponseError",this.retryAt=n===429?s+Bo(o,s):null}status;retryAt}function Fo(e,t,n=Date.now()){const o=Pt(5e3,1e3,e,2,0);return t instanceof Jt&&t.retryAt!==null?Math.max(o,t.retryAt-n):o}async function Ye(e,t){const n=await e.json().catch(()=>null),o=n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?n.error:`${t} failed (${e.status})`;throw new Jt(o,e.status,e.headers.get("retry-after"))}function Co(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function wt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function me(e,t,n){return["decofile-write",e,t,n]}function Vo(e,t,n){return{id:me(e,t,n).join(":")}}class Ge extends Error{constructor(t,n,o=[],s=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=s,this.name="BlockConflictError"}blocks;fields;carriedStored}function ze(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Xe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Ho(e,t){return Ye(e,t)}function Jo(e,t,n){e.setQueryData(g.decofileDraft(ze(t)),n)}function Wo(e,t){return e.getQueryData(g.decofileDraft(ze(t)))??null}async function Yo(e,t){return(await fetch(Xe(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function xr(e){const t=A.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?ze(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Go,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s??null}async function Go(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function zo(e,t){const n=await fetch(Xe(t),{cache:"no-store"});if(!n.ok)return Ye(n,"Read decofile");const o=await n.json();return o.token&&Jo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Rr(e,t){const n=await fetch(Xe(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const s=await n.json().catch(()=>({}));throw s.code==="block-conflict"?new Ge(s.blocks??[],s.error??"Block changed"):new Error(s.error??`Save failed (${n.status})`)}if(!n.ok)return Ho(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Wt=3e3,Xo=15e3,Zo=2*6e4,Yt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Ko(e){return e<Zo?Wt:Xo}function qo(e,t=Yt){const n=t.now();let o=!1,s=!1,r=null;const i=()=>{o||(r=t.setTimeout(a,Ko(t.now()-n)))},a=()=>{if(r=null,o)return;const{read:l,skip:c}=e();if(s||t.hidden()||c?.()){i();return}s=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{s=!1}),i()};return i(),()=>{o=!0,r!==null&&t.clearTimeout(r)}}const pt=()=>0;function es(e,t,n=Yt){const o=L.useRef(t);o.current=t;const[s]=L.useState(()=>({polling:()=>qo(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?s.polling:s.idle,pt,pt)}function Gt(e,t){return pe(e,t)}function ts(e,t){return pe(e,"preview-fetch",{path:t})}function Tr(e){return Gt(e,"preview-invoke")}function Pr(e){return Gt(e,"catalog-invoke")}function zt(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 ns(){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&&zt(n))return n}return null}function os(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??ns();return n&&zt(n)?new URL(t,n).toString():ts(e,t)}function ss(e){return os(e,"/.decofile")}function rs(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function mt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function is(e,t){const n=pe(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),s=rs(o.status);if(s==="absent")return{kind:"absent"};if(s==="unavailable")return{kind:"unavailable"};if(s==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const r=await o.json();return typeof r.content!="string"?{kind:"unavailable"}:{kind:"data",data:Jn(r.content)}}async function as(e,t){const n=await is(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function $r(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)return Ye(n,"Read committed meta");try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function cs(e){return Le(e)?.metadata?.runtime?.path??null}function Re(e,t,n,o){const s=B(e),r=Object.keys(n?.changes??{}).find(a=>B(a)===s);if(r!==void 0&&n)return n.changes[r].baseVersion;const i=Object.keys(t?.draft??{}).some(a=>B(a)===s);if(t&&!i){const a=Object.keys(t.entries).find(l=>B(l)===s);return a===void 0?null:t.entries[a].version}return o?.[e]??null}class Xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Nr(e){return e instanceof j&&e.code===T.Conflict}function Zt(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 Ze extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Ke extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function jr(e,t){return(t instanceof Ze||t instanceof Ke)&&(t.message=Kt(e,t,"github")),t}function Kt(e,t,n){if(t instanceof Ze)return e("siteEditor.save.draftUnread");if(t instanceof Ke)return e("siteEditor.save.keptChanging");if(t instanceof Ge)return t.message;if(n==="local")return us(e,t);if(t instanceof j)switch(t.code){case T.Conflict:return e("siteEditor.save.conflict");case T.ReadOnly:return e("siteEditor.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("siteEditor.save.invalid");case T.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ls(e,t){if(t==="local"||e instanceof Ge||e instanceof Ze||e instanceof Ke)return null;if(e instanceof j){const n=e.code===T.InvalidBlock||e.code===T.InvalidParams?Zt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function us(e,t){if(t instanceof Xt)return e("decoServe.save.serverGone");if(t instanceof j)switch(t.code){case T.Conflict:return e("decoServe.save.conflict");case T.ReadOnly:return e("decoServe.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("decoServe.save.invalid",{detail:Zt(t)});case T.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function fs(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ds(e,t){const[n,o]=L.useState(e),s=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){s.current??=Date.now();return}if(!n)return;const r=()=>{s.current=null,o(!1)},i=fs(s.current,Date.now(),t);if(i===0){r();return}const a=setTimeout(r,i);return()=>clearTimeout(a)},[e,n,t]),n}const hs="decocms:content-writes",Te=new Set;let G;function qt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(hs),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function gs(e){try{qt()?.postMessage({cacheKey:e})}catch{}}function vs(e){return qt(),Te.add(e),()=>{Te.delete(e)}}const en="__at=",tn="__test=",bs=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function ws(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function ee(e){return typeof e=="string"&&bs.test(e)}function St(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function ps(e){const t=e.tests??{};return[...e.at!==void 0?[en+St(e.at)]:[],...Object.keys(t).map(n=>tn+St(`${n}=${t[n]?"on":"off"}`))]}function yt(e,t){const o=[...e.split("&").filter(s=>s&&!s.startsWith(en)&&!s.startsWith(tn)),...t];return o.length>0?`?${o.join("&")}`:""}function de(e,t){const n=ps(t),o=e.indexOf("?"),s=o===-1?e:e.slice(0,o);if(ee(s))return s+yt(o===-1?"":e.slice(o+1),n);const r=e.lastIndexOf("@");if(r<=0)return e;const i=e.slice(0,r),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${yt(c,n)}${e.slice(r)}`}function Ar(e,t,n){if(!ws(t))return e;try{const o=new URL(e),s=o.searchParams.get("__draft");return s&&s!=="off"?(o.searchParams.set("__draft",de(s,t)),o.toString()):ee(n)?(o.searchParams.set("__draft",de(n,t)),o.toString()):e}catch{return e}}function Mr(e,t,n="/"){if(!e||!ee(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function nn(e){return btoa(encodeURIComponent(e))}function Lr(e,t,n){const o=ms(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function ms(e,t,n){const o=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return s.searchParams.set("path","/"),s.searchParams.set("pathTemplate","/"),s.searchParams.set("props",nn(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),s}const Ss="__draft";function Qr(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const ys="off";function ks(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Ss,t),n.toString()}function Ur(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:s,...r}=e.pageBlock,i=JSON.stringify({__props:r,__decofile:e.decofile});return{src:o.toString(),body:i}}function Br(e,t,n,o){const s=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,s);r.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),r.searchParams.set("props",nn(JSON.stringify({sections:i}))),r.toString()}function Fr(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const kt="__variant=";function on(e,t,n){return`${e}@${t}=${n}`}function Cr(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[on(e,"sections",t.index)]}function Vr(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[on(e.pageKey,o,e.selectedVariantIndex)]}function Hr(e,t){return[...t,...e]}function Os(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function qe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),s=o.indexOf("?"),r=s===-1?o:o.slice(0,s),a=[...s===-1?[]:o.slice(s+1).split("&").filter(c=>c&&!c.startsWith(kt)),...t.map(c=>kt+Os(c))],l=a.length>0?`?${a.join("&")}`:"";return`${r}${l}${e.slice(n)}`}function Jr(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),s=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return qe(`${s}${o.pathname}@local`,t)}catch{return null}}function Wr(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",qe(o,t)),n.toString())}catch{return e}}function Es(e){const{pointer:t}=e;if(!t||t===ys)return null;const n=t.indexOf("?");return ee(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:ee(e.heldRevision)&&e.forcedVariants.length===0?de(e.heldRevision,e.previewOptions):de(qe(t,e.forcedVariants),e.previewOptions)}function Ds(e,t){if(!e||!t)return null;try{return ks(e,t)}catch{return null}}function Yr(e,t,n){if(!e||!n)return null;try{return Ds(new URL(t,e).toString(),n)}catch{return null}}const he={forcedVariants:[],previewOptions:{}},ie=new Map,ae=new Map,Pe=new Map;function sn(e){for(const t of Pe.get(e)??[])t()}function rn(e,t){const n=ee(t)?t:null;(ae.get(e)??null)!==n&&(n?ae.set(e,n):ae.delete(e),sn(e))}function Is(e){return ae.get(e)??null}function _s(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Gr(e,t){const n=ie.get(e)??he,o=t??he;_s(n,o)||(t?ie.set(e,o):ie.delete(e),sn(e))}function xs(e){return ie.get(e)??he}function an(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function Rs(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>an(e,s),o=()=>xs(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,Ts)}function Ts(){return he}function Ps(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>e?an(e,s):Ns,o=()=>e?Is(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,$s)}function $s(){return null}function Ns(){}function zr(e,t){const n=A.c(4),o=Rs(e),s=Ps(e);let r;return n[0]!==o||n[1]!==s||n[2]!==t?(r=Es({pointer:t,heldRevision:s,...o}),n[0]=o,n[1]=s,n[2]=t,n[3]=r):r=n[3],r}const cn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},js=15e3,ge=new Map;function W(e,t){return`${e}/${t}`}function V(e){let t=ge.get(e);return t||(t={state:cn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ge.set(e,t)),t}function C(e,t){const n=V(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function ve(e){return ge.get(e)?.state??cn}function As(e,t){const n=V(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Xr(e){const t=V(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),C(e,{phase:"idle"}))}}function Zr(e){const t=ge.get(e);!t||t.state.phase!=="reloading"||(Se(t),C(e,{phase:"idle"}))}function ln(e){const t=V(e);Se(t),C(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ce(e,t){const n=V(e),o=Math.max(0,n.state.inFlight-1);if(o>0){C(e,{inFlight:o});return}if(!t.ok||n.previews===0){C(e,{phase:"idle",inFlight:o});return}un(e,t.navigates,o)}function un(e,t,n=0){const o=V(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&C(e,{phase:"idle"})},js),C(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Ms(e){return e?.kind==="protocol"&&e.source==="github"}async function le(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,s)}):null;if(i?.kind!=="protocol"){const v=a&&t.reread?n.invalidateQueries({queryKey:g.decofile(a)}):null;if(await Promise.all([l,v]),v&&t.kind!=="edit"){const b=W(o,s);C(b,{epoch:ve(b).epoch+1})}return{navigates:!1}}const c=r?g.protocolDraftRead(o,s,r):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,h=l?[l]:[];if(a&&t.reread&&h.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&h.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),r&&i.source==="sandbox"&&h.push(n.invalidateQueries({queryKey:Wn(o,s,r)})),Ms(i)&&c&&!t.adopted&&h.push(n.invalidateQueries({queryKey:c})),await Promise.all(h),t.kind!=="edit"){const v=W(o,s);C(v,{epoch:ve(v).epoch+1})}const u=c?JSON.stringify(n.getQueryData(c)??null):null,d=f!==u;return d&&await new Promise(v=>xt.schedule(v)),{navigates:d}}async function Ls(e,t){return ln(W(e.orgSlug,e.virtualMcpId)),fn(e,t)}function Ot(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function fn(e,t){const n=W(e.orgSlug,e.virtualMcpId),o=t.adopted?Ot(e):null;let s;try{s=await t.write()}catch(i){throw ce(n,{ok:!1,navigates:!1}),t.refreshOnError&&le(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&gs(e.cacheKey),rn(n,t.shownRevision?.(s)??null),t.adopted){const i=Ot(e)!==o;return i&&await new Promise(a=>xt.schedule(a)),ce(n,{ok:!0,navigates:i}),t.reread&&le(e,t).catch(()=>{}),s}let r=!1;try{({navigates:r}=await le(e,t))}catch{}finally{ce(n,{ok:!0,navigates:r})}return s}function Kr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r}=e,i=W(o,s),a=new Set(t.blockKeys);for(const f of[...V(i).discardListeners])f(a);ln(i);let l=!1;const c=()=>(l=!0,fn(e,{kind:"discard",reread:!0,write:t.write}));return r?n.getMutationCache().build(n,{mutationKey:me(o,s,r),scope:Vo(o,s,r),mutationFn:c}).execute(void 0).catch(f=>{throw l||ce(i,{ok:!1,navigates:!1}),f}):c()}function qr(e,t,n){const o=A.c(8);let s;o[0]!==e||o[1]!==t?(s=W(e,t),o[0]=e,o[1]=t,o[2]=s):s=o[2];const r=s;let i;o[3]!==n||o[4]!==r?(i=()=>{const l=V(r).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=r,o[5]=i):i=o[5];let a;o[6]!==r?(a=[r],o[6]=r,o[7]=a):a=o[7],L.useEffect(i,a)}function dn(e){const t=W(e.orgSlug,e.virtualMcpId);ve(t).inFlight>0||(rn(t,null),le(e,{kind:"external"}).then(({navigates:n})=>{const o=V(t);o.previews>0&&o.state.inFlight===0&&un(t,n)}).catch(()=>{}))}function Qs(e,t){const n=A.c(7);let o;n[0]!==e||n[1]!==t?(o=W(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const s=o;let r;n[3]!==s?(r=c=>As(s,c),n[3]=s,n[4]=r):r=n[4];const i=r;let a;n[5]!==s?(a=()=>ve(s),n[5]=s,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const Us=500;function ei(e,t){const{phase:n}=Qs(e,t);return ds(n!=="idle",Us)}function Bs(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function hn(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function ti(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?oo(i,n):Fs(e,t,n)}const s=e.getQueryData(g.contentVersions(t));if(!s)return;if(Object.hasOwn(s,n))return s[n];const r=e.getQueryData(g.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function gn(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(s=>B(s)===n);return o===void 0?void 0:e.changes[o]}function Fs(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return vn(o,ye(e,t),n)}function vn(e,t,n){const o=gn(e,n);return o?.kind==="delete"?o.version??X:o?o.version:t.has(B(n))?X:null}function ni(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const s=gn(o,n);return s?s.kind==="set"&&s.baseVersion===null:ye(e,t).has(B(n))}function oi(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const s=ye(e,t);return{blocks:n,versionOf:r=>vn(o,s,r)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function be(e,t,n,o){const s=B(n),r=ye(e,t);r.has(s)!==o&&(o?r.add(s):r.delete(s),Y(e),e.setQueryData(g.contentDraftTombstones(t),[...r]))}function bn(e,t,n,o){const s=o.revision,r=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===X?null:d]),a=e.getQueryData(g.contentChanges(n)),l=e.getQueryData(g.contentIndex(n)),c=new Set(i.flatMap(([u])=>Re(u,l,a,r)===null?[u]:[])),f=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[v,b]of i){const w=Re(v,l,u,r);b!==null?d[v]={kind:"set",version:b,baseVersion:w}:w!==null?d[v]={kind:"delete",version:null,baseVersion:w}:delete d[v]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?be(e,n,u,!1):!f.has(B(u))&&c.has(u)&&be(e,n,u,!0);const h=o.revision;return h&&h!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:h}),s}function ke(e,t,n){Y(e),e.setQueryData(g.contentVersions(t),o=>{const s={...o};for(const[r,i]of Object.entries(n))i===null?delete s[r]:s[r]=i;return s})}function wn(e,t){const n=e.getMutationCache().findAll({mutationKey:me(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>mo(o.state.variables)))}function $e(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function oe(e,t,n,o){try{return await o()}catch(s){const r=!(s instanceof j);throw t.source==="local"&&r?($e(e,n),new Xt(s)):(t.source==="local"&&Ae(s)&&$e(e,n),s)}}const Et=new WeakMap;function et(e){let t=Et.get(e);return t||(t={inFlight:new Map,rereading:new Set},Et.set(e,t)),t}function pn(e,t,n,o){const{inFlight:s}=et(e),r=s.get(o);if(r)return r;const i=tt(e,t,n,o,!0);return s.set(o,i),i.finally(()=>{s.get(o)===i&&s.delete(o)})}function Cs(e,t,n){const o=A.c(8),s=Z(),r=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==r||o[4]!==s||o[5]!==i?(l=()=>{if(!e||!r||!i||!a)return;const f={orgSlug:r,virtualMcpId:i,branch:a},{rereading:h}=et(s);return vs(u=>{u===n&&(h.has(n)||(h.add(n),Hs(s,e,f,n).catch(Vs).finally(()=>h.delete(n))))})},c=[s,e,r,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=r,o[4]=s,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function Vs(){}async function Hs(e,t,n,o){const s=et(e).inFlight.get(o);return s&&await s.catch(()=>{}),pn(e,t,n,o)}async function tt(e,t,n,o,s){Y(e);const r=g.decofile(o),i=hn(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(r),f=e.getQueryData(l),u=e.getQueryData(i),d=e.getQueryData(a)??void 0,v=s&&c&&f?d?.revision:void 0,b=s&&u?d?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return Js(e,t,t.hosted,n,o,{conditional:s,seen:d,currentMeta:u,schemaIfNoneMatch:b,seenChanges:_});const[S,$,E]=await oe(e,t,n,()=>t.client.batch([{method:"blocks.list",params:v?{ifNoneMatch:v}:{}},{method:"schema.get",params:b?{ifNoneMatch:b}:{}},{method:"changes.list",params:Rt(_)}])),D=e.getQueryData(a)?.revision,I=D!==void 0&&D!==d?.revision;if(E?.ok){const k=I?null:Tt(_,E.result);k&&e.setQueryData(w,k)}else E&&t.source==="local"&&Ae(E.error)&&$e(e,n);if(!S?.ok)throw S?.error??new Error("no blocks.list");if(!$)throw new Error("no schema.get");const m=S.result,y=Ve($),O=$.ok&&!y?$.result:null;if(m.notModified&&(!c||!f)||O?.notModified&&!u)return tt(e,t,n,o,!1);const x=m.notModified?new Set:wn(e,n),N=m.notModified?c:po(m.blocks,c,x),p=y?Vt():O?O.notModified?u:O.schema:$.error;if(e.setQueryData(a,{revision:I?D:m.notModified?d?.revision:m.revision,schemaVersion:O?O.notModified?d?.schemaVersion:O.version??void 0:void 0}),e.setQueryData(r,N),!m.notModified){const k=e.getQueryData(l),P={...m.versions};for(const Q of x){const M=k?.[Q];M!==void 0?P[Q]=M:delete P[Q]}e.setQueryData(l,P)}return p instanceof j||e.setQueryData(i,p),!I&&!m.notModified&&c&&d?.revision&&m.revision!==d.revision&&dn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:N,meta:p}}async function Js(e,t,n,o,s,r){const i=g.decofile(s),a=g.contentIndex(s),l=g.contentRevision(s),c=g.contentVersions(s),f=hn(o,t),h=g.contentChanges(s),u=e.getQueryData(a),d=r.conditional&&u?r.seen?.revision:void 0,[v,b,w]=await oe(e,t,o,()=>n.batch([{method:"cms.index",params:d?{ifNoneMatch:d}:{}},{method:"schema.get",params:r.schemaIfNoneMatch?{ifNoneMatch:r.schemaIfNoneMatch}:{}},{method:"changes.list",params:Rt(r.seenChanges)}])),_=e.getQueryData(a)??u,S=e.getQueryData(l)?.revision,$=S!==void 0&&S!==r.seen?.revision;if(w?.ok&&!$){const R=Tt(r.seenChanges,w.result);R&&e.setQueryData(h,R)}if(!v?.ok)throw v?.error??new Error("no cms.index");if(!b)throw new Error("no schema.get");const E=v.result,D=Ve(b),I=b.ok&&!D?b.result:null;if(E.notModified&&!u||I?.notModified&&!r.currentMeta)return tt(e,t,o,s,!1);const m=D?Vt():I?I.notModified?r.currentMeta:I.schema:b.error;m instanceof j||e.setQueryData(f,m);const y=I?I.notModified?r.seen?.schemaVersion:I.version??void 0:void 0,O=e.getQueryData(i)??{};if(E.notModified||$)return e.setQueryData(l,{revision:$?S:r.seen?.revision,schemaVersion:y}),e.setQueryData(i,O),{blocks:O,meta:m};const x={revision:E.revision,resolvedRef:E.resolvedRef,sequence:E.sequence,entries:E.entries,draft:E.draft};e.setQueryData(a,x);const N=!!r.seen?.revision&&x.revision!==r.seen.revision&&(!r.seen.revision.startsWith("s-")||!!u&&mn(u.draft,x.draft));N&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),R=>R&&{...R,version:x.revision}),e.setQueryData(l,{revision:x.revision,schemaVersion:y});const p=wn(e,o),k=e.getQueryData(c)??{},P={},Q={},M=[];for(const[R,H]of Object.entries(O)){const J=x.entries[R];!J&&!p.has(R)||(P[R]=H,k[R]!==void 0&&(Q[R]=k[R]),J&&!p.has(R)&&k[R]!==J.version&&M.push(R))}return e.setQueryData(i,P),e.setQueryData(c,Q),M.length>0&&await Fe(e,n,s,M,p),_&&N&&Ws(_,x)&&dn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:s}),{blocks:e.getQueryData(i)??P,meta:m}}function Ws(e,t){if(mn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function mn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function Ys(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function Ee(e){if(!(e instanceof j)||e.code!==T.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}async function Gs(e,t){if(!(e instanceof j)||e.code!==T.Conflict)return;const n=e.data?.entries;if(!n||typeof n!="object")return;const o=Object.entries(n);if(o.length===0)return;const s=t.set??{},r=new Set(t.delete??[]),i={};for(const[a,l]of o){const c=l?.actual;if(typeof c!="string"||(Object.hasOwn(s,a)?await Un(s[a]):r.has(a)?X:void 0)!==c)return;i[a]=c}return i}function zs(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([s])=>!Object.hasOwn(t,s))),o=(e.delete??[]).filter(s=>!Object.hasOwn(t,s));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function re(e,t,n,o,s){Y(e),bn(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:s}),ke(e,n,Object.fromEntries(Object.entries(s).map(([r,i])=>[r,i===X?null:i]))),Qt(e,n,s,o.set??{})}async function si(e,t,n,o,s,r){if(t.source==="github"){const a=[...Object.keys(s.set??{}),...s.delete??[]].filter(c=>!r||!Object.hasOwn(r,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=Ln(s.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return Ls({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=(f,h=r)=>oe(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...h?{ifMatch:Ys(h,f)}:{}}));let a;try{a=await i(s)}catch(f){const h=t.source==="github"?Ee(f):void 0;if(!h)throw f;const u=zs(s,h);Object.keys(h).length>0&&re(e,n,o,s,h);let d;try{d=await i(u)}catch(v){const b=Ee(v);b&&Object.keys(b).length>0&&re(e,n,o,u,b);const w=await Gs(v,u);if(!w)throw v;re(e,n,o,u,w);try{d=await i(u,{...r,...w})}catch(_){const S=Ee(_);throw S&&Object.keys(S).length>0&&re(e,n,o,u,S),_}}a={...d,versions:{...h,...d.versions}}}Y(e);const l=t.source==="github"?bn(e,n,o,a):a.revision;t.source==="github"&&Qt(e,o,a.versions??{},s.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return ke(e,o,c),{revision:l,versions:c}}})}function Sn(e,t){if(!(e instanceof j))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 yn(e,t,n){if(!(n instanceof j))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[s,r]of Object.entries(o))r===null&&be(e,t,s,!1)}function kn(e,t,n,o){Y(e),Qn(e,n,o);const s=o.block===null,r=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=Re(n,e.getQueryData(g.contentIndex(t)),i,r);if(i){const l=B(n),c=Object.fromEntries(Object.entries(i.changes).filter(([f])=>B(f)!==l));s?a!==null&&(c[n]={kind:"delete",version:null,baseVersion:a}):c[n]={kind:"set",version:o.version,baseVersion:a},e.setQueryData(g.contentChanges(t),{...i,changes:c,edited:!0})}be(e,t,n,s&&a===null),e.setQueryData(g.decofile(t),l=>{const c={...l};return s?delete c[n]:c[n]=o.block,c}),ke(e,t,{[n]:s?null:o.version}),so(e,t,n,o)}function ri(e,t,n,o){if(t.source!=="github"||!(o instanceof j))return!1;yn(e,n,o);const s=o.data?.draft;if(!s||typeof s!="object")return!1;const r=Object.keys(s),i=r.map(a=>Sn(o,a));return r.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),r.forEach((a,l)=>{kn(e,n,a,i[l])}),!0)}async function ii(e,t,n,o,s,r){t.source==="github"&&yn(e,o,r);const i=t.source==="github"?Sn(r,s):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),kn(e,o,s,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await oe(e,t,n,()=>t.client.changesGet({names:[s]}))).entries[s];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const h={...f.changes};return c?.kind?h[s]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete h[s],{...f,changes:h,edited:!0}})}catch{const l=await oe(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[s]??null,version:l.versions[s]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[s]:c[s]=a.value,c}),ke(e,o,{[s]:a.version}),!1}function Xs(e){const t=A.c(17),n=Le(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=It(n),t[0]=n,t[1]=o):o=t[1];const s=o;let r;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(r=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=r):r=t[5];let i;t[6]!==e||t[7]!==s?(i=async()=>{const b=await _t(s,e.branch),w=b.pointer?.lastIndexOf("@")??-1;return{draft:b.pointer&&w>0?b.pointer.slice(0,w):null,version:b.pointer&&w>0?b.pointer.slice(w+1):b.etag}},t[6]=e,t[7]=s,t[8]=i):i=t[8];const a=!!e&&!!s;let l;t[9]!==r||t[10]!==i||t[11]!==a?(l={queryKey:r,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=r,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:h}=F(l),u=!!e&&!!s&&f&&!h;if(!e||!c?.draft||!c.version){let b;return t[13]!==u?(b={pointer:null,pending:u},t[13]=u,t[14]=b):b=t[14],b}const d=`${c.draft}@${c.version}`;let v;return t[15]!==d?(v={pointer:d,pending:!1},t[15]=d,t[16]=v):v=t[16],v}function ai(e){return Xs(e).pointer}function ci(e){const t=A.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Zs,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s?.revision}async function Zs(){throw new Error("content revisions are set by reads and writes")}function nt(e,t){const n=A.c(6),{url:o}=Ht(e?.virtualMcpId),s=se(e?.virtualMcpId,e?.branch);if(!e)return"";let r;return n[0]!==s.cacheKeySuffix||n[1]!==s.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(r=s.kind!=="legacy"&&s.cacheKeySuffix!==void 0?xe({...e,protocolSuffix:s.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=s.cacheKeySuffix,n[1]=s.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=r):r=n[5],r}function li(e,t){const n=A.c(46),{url:o}=Ht(e?.virtualMcpId),s=!!o,r=se(e?.virtualMcpId,e?.branch),i=r.kind==="protocol"?r:null,a=nt(e),l=t?.fetchEnabled??!0,c=cs(e?.virtualMcpId),f=$t(e?.virtualMcpId).runtime==="cms",h=Z();let u;n[0]!==a?(u=g.decofile(a),n[0]=a,n[1]=u):u=n[1];const d=u;Cs(i,i&&e?e:null,a);let v;n[2]!==e||n[3]!==h||n[4]!==d?(v=()=>{if(!e||h.isMutating({mutationKey:me(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const k=h.getQueryState(d);return k?.fetchStatus==="fetching"||Date.now()-(k?.dataUpdatedAt??0)<Wt/2},n[2]=e,n[3]=h,n[4]=d,n[5]=v):v=n[5];let b;n[6]!==f||n[7]!==s||n[8]!==e||n[9]!==i||n[10]!==h||n[11]!==d?(b=async()=>{if(e){if(!i&&f&&!s){const k=Wo(h,e)?.version;if(k&&!await Yo(e,k))return}await h.refetchQueries({queryKey:d,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=s,n[8]=e,n[9]=i,n[10]=h,n[11]=d,n[12]=b):b=n[12];let w;n[13]!==v||n[14]!==b?(w={skip:v,read:b},n[13]=v,n[14]=b,n[15]=w):w=n[15],es(!!t?.pollWhile&&!!e,w);const _=Ce(i?.hosted?a:"");let S;n[16]!==r.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==s||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==h?(S=async()=>{if(i)return(await pn(h,i,e,a)).blocks;if(r.kind==="unavailable")throw Bs("decofile");if(s){const M=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(qs),U=M?.ok?wt(await M.text()):null;if(U)return U;const R=new Error("decofile unavailable (local tunnel unreachable)");throw R.status=502,R}if(f)return zo(h,e);const k=()=>as(e,Co(c,".deco/blocks.gen.json"));if(l){const M=await fetch(ss(e),{cache:"no-store"}).catch(Ks);if(M?.ok){const H=wt(await M.text());if(H)return H}const U=await k();if(U.kind==="data")return U.data;const R=new Error(`Failed to fetch decofile: ${M?.status??"network error"}`);throw R.status=mt({liveOk:!!M?.ok,liveStatus:M?.status,committedAbsent:U.kind==="absent"}),R}const P=await k();if(P.kind==="data")return P.data;const Q=new Error("decofile unavailable (preview down, no committed snapshot)");throw Q.status=mt({liveOk:!1,committedAbsent:P.kind==="absent"}),Q},n[16]=r.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=s,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=h,n[26]=S):S=n[26];const $=!!e&&r.kind!=="pending",E=i?0:3e4,D=i?.describe.pollIntervalMs,I=i?"always":void 0;let m;n[27]!==f||n[28]!==s||n[29]!==i?(m=(k,P)=>{if(i||f||s)return k<3;const Q=P.status;return Q!==502&&Q!==404&&k<2},n[27]=f,n[28]=s,n[29]=i,n[30]=m):m=n[30];let y;n[31]!==d||n[32]!==S||n[33]!==$||n[34]!==E||n[35]!==D||n[36]!==I||n[37]!==m?(y={queryKey:d,queryFn:S,enabled:$,staleTime:E,refetchInterval:D,refetchIntervalInBackground:!1,refetchOnWindowFocus:I,retry:m,retryDelay:Fo},n[31]=d,n[32]=S,n[33]=$,n[34]=E,n[35]=D,n[36]=I,n[37]=m,n[38]=y):y=n[38];const O=F(y);let x;n[39]!==_||n[40]!==O?(x=_&&O.data?to(_,O.data):void 0,n[39]=_,n[40]=O,n[41]=x):x=n[41];const N=x;let p;return n[42]!==N||n[43]!==i?.hosted||n[44]!==O?(p=i?.hosted&&N?{...O,data:N}:O,n[42]=N,n[43]=i?.hosted,n[44]=O,n[45]=p):p=n[45],p}function Ks(){return null}function qs(){return null}function ui(e,t,n){return Qo(e,t,n)}function fi(e){const t=A.c(4),n=Z(),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==s||t[1]!==n||t[2]!==r?(i=(a,l)=>ro(n,r,s,a,l),t[0]=s,t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function di(e,t){const n=A.c(3),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=Ce(o.kind==="protocol"&&o.hosted?s:"");let i;return n[0]!==r?.entries||n[1]!==t?(i=Object.entries(r?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(er),n[0]=r?.entries,n[1]=t,n[2]=i):i=n[2],i}function er(e){const[t]=e;return t}const tr="site-editor-save",On={id:tr,description:void 0,action:void 0,cancel:void 0},hi="site-editor-undo",Ne="site-editor-publish";function nr(e){const t=A.c(7),{label:n,detail:o}=e;let s;t[0]!==n?(s=z.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=s):s=t[1];let r;t[2]!==o?(r=z.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=r):r=t[3];let i;return t[4]!==s||t[5]!==r?(i=z.jsxs("details",{className:"mt-1 text-xs",children:[s,r]}),t[4]=s,t[5]=r,t[6]=i):i=t[6],i}function En(e,t){return t?z.jsx(nr,{label:e("siteEditor.details"),detail:t}):void 0}function gi(e,t,n){te.error(Kt(e,t,n),{...On,description:En(e,ls(t,n))})}function vi(e,t,n=!1){te.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...On,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Dn={action:void 0,duration:void 0};function bi(e,t){te.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Dn,id:Ne,description:void 0})}function wi(e,{headline:t,body:n,detail:o,retry:s,pending:r,tone:i="error"}){const a=En(e,o??null);te[i](t,{id:Ne,description:n&&a?z.jsxs(z.Fragment,{children:[z.jsx("p",{children:n}),a]}):n??a,action:s?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),te.loading(r??e("thread.publishPopover.publishing"),{...Dn,id:Ne,description:void 0}),s()}}:void 0,duration:s?Number.POSITIVE_INFINITY:void 0})}function pi(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Ho as $,Ds as A,ws as B,as as C,Ft as D,Fr as E,kr as F,Xs as G,W as H,Ps as I,Gr as J,Jr as K,de as L,ys as M,ks as N,Ar as O,Wr as P,Lr as Q,Zr as R,Xr as S,Ut as T,Qs as U,ci as V,Ur as W,Vo as X,me as Y,Ls as Z,is as _,mr as a,vo as a0,Ao as a1,Ir as a2,dt as a3,ht as a4,_r as a5,yr as a6,Er as a7,Gn as a8,En as a9,ti as aA,qr as aB,oi as aC,Jo as aD,Rr as aE,Ke as aF,xr as aG,ai as aH,Qr as aI,ri as aJ,ee as aK,Mr as aL,wi as aM,hi as aN,On as aO,Fe as aP,wn as aQ,to as aR,Br as aS,Pr as aT,Cr as aU,Vr as aV,Hr as aW,pi as aa,ms as ab,hn as ac,nr as ad,zr as ae,Yr as af,Qo as ag,os as ah,pn as ai,Bs as aj,Fo as ak,$r as al,Ne as am,Dn as an,bi as ao,Kr as ap,vi as aq,ni as ar,jr as as,Ge as at,Nr as au,Hs as av,Ze as aw,si as ax,ii as ay,gi as az,go as b,Ht as c,fi as d,pr as e,di as f,ei as g,Or as h,Sr as i,li as j,ui as k,Yn as l,zn as m,Nt as n,jo as o,vr as p,Tr as q,wr as r,br as s,ts as t,se as u,nt as v,Dr as w,cs as x,Co as y,Es as z};
|
|
1
|
+
import{aJ as Dt,aK as q,bs as je,bF as _n,dD as Oe,dB as xn,ez as we,c as A,i as F,eA as Rn,eB as Tn,q as Z,r as L,eC as Pn,K as g,eD as Y,eE as X,bE as $n,a as Nn,aw as De,a6 as jn,bA as It,eF as An,eG as _t,au as Mn,bw as B,eh as xt,eH as Ln,eI as Qn,eJ as Un,t as te,j as z}from"./index-DoNyWviU.js";import{C as j,E as T,i as Ae,P as Bn,b as Fn,c as Me,d as Rt,e as Tt}from"./content-changes-C41bP_ws.js";import{b as Le}from"./repository-binding-Doos7Tz1.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{b as pe}from"./sandbox-url-D3mC8qhT.js";import{u as Cn}from"./chat-context-DFYcK8dr.js";import{i as Vn,u as Hn}from"./use-sandbox-events-C9AVtujd.js";import{u as Qe}from"./use-blocks-v8-project-9w4Ust2C.js";import{u as $t}from"./use-voice-input-CCZaSdUm.js";import{s as ot}from"./session-runtime-DKGwvqlm.js";import{s as Jn}from"./utils-CVhZKcka.js";import{a as Wn}from"./sandbox-git-api-UPazfJoQ.js";function Nt(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 ue(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 jt=Dt({endpoint:q().max(2048).refine(e=>Nt(e)&&new URL(e).pathname==="/rpc").transform(ue)});function vr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=jt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function At(e){const t=jt.safeParse(e);return t.success?t.data:null}const Mt="studio:deco-serve-last";function br(e){try{localStorage.setItem(Mt,JSON.stringify(e))}catch{}}function wr(){try{const e=localStorage.getItem(Mt);return e?At(JSON.parse(e)):null}catch{return null}}function pr(e){try{return new URL(ue(e)).host}catch{return e}}function Yn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Gn="http://localhost:4545/rpc";class Ue extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Ue)return{reason:"not-deco-serve"};if(!(e instanceof j))return{reason:"not-answering"};switch(e.code){case T.Unauthorized:case T.MethodNotFound:return{reason:"outdated"};case T.Unsupported:return Ae(e)?{reason:"outdated"}:{reason:"version-mismatch"};case T.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 mr(e,t){if(e)return[ue(e.endpoint)];const n=[t?.endpoint,Gn].filter(o=>!!o).map(ue);return[...new Set(n)]}const Xn=Dt({blocks:Oe(q(),Oe(q(),xn()).refine(je)),versions:Oe(q(),q().min(1)),missing:_n(q())});function Zn(e,t){const n=Xn.parse(e),o=Object.keys(n.blocks),s=Object.keys(n.versions),r=[...o,...n.missing],i=new Set(t);if(s.length!==o.length||o.some(a=>!Object.hasOwn(n.versions,a))||r.length!==i.size||new Set(r).size!==r.length||r.some(a=>!i.has(a)))throw new Error("The CMS block response did not account for the requested names");return n}function ne(e,t){const n=e.index?.entries[t];return!!n&&je(e.blocks[t])&&e.versions[t]===n.version}function Kn(e,t,n){const o=new Map;let s=!1;for(const[r,i]of Object.entries(n.blocks)){const a=t.index?.entries[r];if(a){if(n.versions[r]!==a.version){s||=a.version===e.index?.entries[r]?.version;continue}t.blocks[r]!==e.blocks[r]||t.versions[r]!==e.versions[r]||o.set(r,i)}}return s||=n.missing.some(r=>!!t.index?.entries[r]),{blocks:o.size?{...t.blocks,...Object.fromEntries(o)}:t.blocks,versions:o.size?{...t.versions,...Object.fromEntries([...o.keys()].map(r=>[r,n.versions[r]]))}:t.versions,refreshIndex:s}}function qn(e,t,n){return!!e.index&&t.every(o=>e.index?.entries[o]?ne(e,o)&&(!n||n[o]===e.blocks[o]):!n||n[o]===void 0)}const st=50,rt=10;function eo(e,t=n=>fetch(n)){let n=1;return{async batch(o){const s=o.map(()=>n++),r=await t(new Request(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",signal:we(),body:JSON.stringify(o.map((l,c)=>({jsonrpc:"2.0",id:s[c],method:l.method,params:l.params??{}})))}));if(!r.ok)throw new j(T.Unavailable,`the hosted CMS answered ${r.status}`);const i=await r.json(),a=new Map((Array.isArray(i)?i:[]).map(l=>[l.id,l]));return s.map(l=>{const c=a.get(l);return c?c.error?{ok:!1,error:j.from(c.error)}:{ok:!0,result:c.result}:{ok:!1,error:new j(T.InternalError,"no response for this call")}})}}}function to(e,t){if(!e)return t??{};const n={};for(const[o,s]of Object.entries(e.entries)){if(t&&Object.hasOwn(t,o)){n[o]=t[o];continue}n[o]={[Tn]:!0,...s.meta?.type?{__resolveType:s.meta.type}:{},...s.meta?.path!==void 0?{path:s.meta.path}:{},...s.meta?.refs?.length?{[Rn]:s.meta.refs}:{}}}for(const[o,s]of Object.entries(t??{}))Object.hasOwn(n,o)||(n[o]=s);return n}function no(e,t){return e?.entries[t]?.meta?.refs??[]}function oo(e,t){return Object.hasOwn(e.draft,t)?e.draft[t]?.version??null:null}function Be(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ie(e,t){if(Array.isArray(e)){for(const n of e)Ie(n,t);return}if(Be(e))for(const[n,o]of Object.entries(e))n==="__resolveType"&&typeof o=="string"?t.add(o):Ie(o,t)}function Lt(e,t){if(!Be(e))return;const n={};typeof e.__resolveType=="string"&&(n.type=e.__resolveType),typeof e.path=="string"&&(n.path=e.path);const o=new Set;Ie(e,o);const s=[...o].filter(r=>t.has(r)).sort();return s.length>0&&(n.refs=s),Object.keys(n).length>0?n:void 0}function Qt(e,t,n,o){Y(e),e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.entries},i={...s.draft},a=new Set([...Object.keys(r),...Object.keys(o)]);for(const[l,c]of Object.entries(n)){const f=i[l]?.editor??null;if(c===null||c===X){delete r[l],i[l]={operation:"delete",version:X,editor:f};continue}const h=Lt(o[l],a);r[l]={version:c,...h?{meta:h}:{}},i[l]={operation:"set",version:c,editor:f}}return{...s,entries:r,draft:i}})}function so(e,t,n,o){e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.draft},i={...s.entries};if(o===null)delete r[n];else if(r[n]={operation:o.block===null?"delete":"set",version:o.version,editor:r[n]?.editor??null},o.block===null)delete i[n];else{const a=new Set([...Object.keys(i),n]),l=Lt(o.block,a);i[n]={version:o.version,...l?{meta:l}:{}}}return{...s,entries:i,draft:r}})}const it=new WeakMap;async function Fe(e,t,n,o,s=new Set){const r=e.getQueryData(g.contentIndex(n));if(!r)throw new j(T.Unavailable,"The CMS index is not loaded yet");let i=it.get(e);i||(i=new Map,it.set(e,i));const a=e.getQueryData(g.decofile(n))??{},l=e.getQueryData(g.contentVersions(n))??{},c=[],f=[];for(const u of new Set(o)){const d=r.entries[u];if(!d||s.has(u)||je(a[u])&&l[u]===d.version)continue;const v=i.get(`${n}\0${u}`);v?c.push(v):f.push(u)}if(f.length>0){const u=io(e,t,n,f);for(const d of f){const v=`${n}\0${d}`;i.set(v,u),u.catch(()=>{}).finally(()=>{i.get(v)===u&&i.delete(v)})}c.push(u)}await Promise.all(c);const h=fe(e,n);if(o.some(u=>h.index?.entries[u]&&!s.has(u)&&!ne(h,u)))throw new j(T.Unavailable,"A CMS block changed while loading; try again")}async function ro(e,t,n,o,s){if(!t){const i=o?.[s];return Be(i)&&!$n(i)?i:void 0}await Fe(e,t,n,[s]);const r=fe(e,n);return r.index?.entries[s]&&ne(r,s)?r.blocks[s]:void 0}function fe(e,t){return{index:e.getQueryData(g.contentIndex(t)),blocks:e.getQueryData(g.decofile(t))??{},versions:e.getQueryData(g.contentVersions(t))??{}}}async function io(e,t,n,o){const s=fe(e,n),r=[];for(let i=0;i<o.length;i+=st)r.push(o.slice(i,i+st));for(let i=0;i<r.length;i+=rt){const a=r.slice(i,i+rt),l=await t.batch(a.map(c=>({method:"cms.blocks",params:{names:c}})));if(l.length!==a.length)throw new j(T.InternalError,"Incomplete CMS batch response");for(const[c,f]of l.entries()){if(!f.ok)throw f.error;const h=Zn(f.result,a[c]),u=fe(e,n),d=Kn(s,u,h);if(Y(e),d.blocks!==u.blocks&&e.setQueryData(g.decofile(n),d.blocks),d.versions!==u.versions&&e.setQueryData(g.contentVersions(n),d.versions),d.refreshIndex)throw e.invalidateQueries({queryKey:g.decofile(n),exact:!0},{cancelRefetch:!1}),new j(T.Unavailable,"The CMS index changed while loading blocks; try again")}}}function Ce(e){const t=A.c(4);let n;t[0]!==e?(n=g.contentIndex(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ao,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s}async function ao(){throw new Error("the content index is set by the poll")}function at(e,t){const n=A.c(8);let o;n[0]!==t?(o=Pn(t),n[0]=t,n[1]=o):o=n[1];const s=o;let r;n[2]!==e||n[3]!==s?(r=a=>e.getQueryCache().subscribe(l=>{l.query.queryHash===s&&a()}),n[2]=e,n[3]=s,n[4]=r):r=n[4];let i;return n[5]!==e||n[6]!==t?(i=()=>e.getQueryData(t),n[5]=e,n[6]=t,n[7]=i):i=n[7],L.useSyncExternalStore(r,i)}const ct=3e4;function co(e){if(!(e instanceof j))return;const t=e.data?.retryAfterMs;return typeof t=="number"&&t>0?t:void 0}function lo(e,t,n,o){const s=A.c(15),r=Z(),i=Ce(t);let a;s[0]!==t?(a=g.decofile(t),s[0]=t,s[1]=a):a=s[1];const l=at(r,a);let c;s[2]!==t?(c=g.contentVersions(t),s[2]=t,s[3]=c):c=s[3];const f=at(r,c),h=o?.withRefs??!1,u=new Set(n);if(h)for(const p of n)for(const k of no(i,p))u.add(k);const d=[...u].filter(p=>!!i?.entries[p]).sort(),v={index:i,blocks:l??{},versions:f??{}},b=d.some(p=>!ne(v,p)),w=JSON.stringify(d.map(p=>[p,i?.entries[p]?.version,ne(v,p)])),[_,S]=L.useState(null),[$,E]=L.useState(0),D=_?.key===w?_:null;L.useEffect(()=>{if(!e||!w)return;let p=!0;const k=JSON.parse(w).map(ho);return Fe(r,e,t,k).then(()=>{p&&S(P=>P?.key===w?null:P)},P=>{p&&S(Q=>({key:w,count:(Q?.key===w?Q.count:0)+1,retryAfterMs:co(P)}))}),()=>{p=!1}},[e,r,t,w,$]);let I;s[4]!==D||s[5]!==E?(I=()=>{if(!D)return;const p=Math.min(ct,D.retryAfterMs??Pt(ct,1e3,D.count-1,2,.5)),k=setTimeout(()=>E(fo),p);return()=>clearTimeout(k)},s[4]=D,s[5]=E,s[6]=I):I=s[6];let m;s[7]!==D?(m=[D],s[7]=D,s[8]=m):m=s[8],L.useEffect(I,m);const y=!e||qn(v,[...u],o?.listing),O=!!e&&b&&D!==null;let x;s[9]!==E?(x=()=>E(uo),s[9]=E,s[10]=x):x=s[10];let N;return s[11]!==y||s[12]!==O||s[13]!==x?(N={ready:y,failed:O,retry:x},s[11]=y,s[12]=O,s[13]=x,s[14]=N):N=s[14],N}function uo(e){return e+1}function fo(e){return e+1}function ho(e){const[t]=e;return t}const Ut=L.createContext(null);function go(e){const t=A.c(24),n=L.useContext(Ut),o=Qe(n?null:e),{data:s}=Nn.useSession(),r=s?.user?.id??"",i=!!e&&!!r;let a;t[0]!==i||t[1]!==r||t[2]!==e?(a=i?De.decoServeConnection(r,e):null,t[0]=i,t[1]=r,t[2]=e,t[3]=a):a=t[3];const[l,c]=ut(a);let f;t[4]!==i||t[5]!==r||t[6]!==e?(f=i?De.decoServeEndpoint(r,e):null,t[4]=i,t[5]=r,t[6]=e,t[7]=f):f=t[7];const[h,u]=ut(f);if(n)return n;let d;t[8]!==l||t[9]!==i||t[10]!==o?(d=i&&o?At(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=d):d=t[11];const v=d,b=i&&o&&typeof h=="string"?h:null;let w;t[12]!==u||t[13]!==c||t[14]!==i?(w=$=>{i&&(c($),u($.endpoint))},t[12]=u,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let S;return t[19]!==v||t[20]!==b||t[21]!==w||t[22]!==_?(S={connection:v,lastEndpoint:b,set:w,clear:_},t[19]=v,t[20]=b,t[21]=w,t[22]=_,t[23]=S):S=t[23],S}function lt(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function ut(e){const t=A.c(17),n=Z(),o=e??"";let s;t[0]!==o?(s=["localStorage",o],t[0]=o,t[1]=s):s=t[1];const r=s;let i,a;t[2]!==e?(i=()=>e?lt(e):null,a=()=>e?lt(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==r||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:r,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=r,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let h;t[10]!==e||t[11]!==n||t[12]!==r?(h=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(r,b)}},t[10]=e,t[11]=n,t[12]=r,t[13]=h):h=t[13];const u=h,d=e?f??null:null;let v;return t[14]!==u||t[15]!==d?(v=[d,u],t[14]=u,t[15]=d,t[16]=v):v=t[16],v}function Bt(e,t=""){return{source:e,cacheKeySuffix:e==="github"?"":e==="sandbox"?":sandbox":`:serve:${t}`}}function vo(e){return JSON.stringify([e.kind==="legacy"?"legacy":"protocol",e.source,e.cacheKeySuffix])}function Sr(e){return e.kind==="protocol"||e.kind==="unavailable"}function yr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function kr(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Or(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&Nt(t)?t:null}function Er(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Ft(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bo(e){if(!e.hasProject)return"legacy";const t=Ft(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function wo(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function ft(e){return e.isError||e.errorUpdateCount>0}function po(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const s of n)Object.hasOwn(t,s)?o[s]=t[s]:delete o[s];return o}function mo(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 Ct="__noSchema";function Vt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ct]:!0}}function Dr(e){return!!e&&e[Ct]===!0}function Ve(e){if(!e.ok)return e.error.code===T.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function So(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const yo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Ir(e){const t=new Map;for(const[n,o]of Object.entries(e)){const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},r=typeof s.__resolveType=="string"?s.__resolveType:null,i=t.get(r)??[];i.push({key:n,label:So(n,s)}),t.set(r,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(yo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:dt(n.resolveType).localeCompare(dt(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function dt(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function ht(e,t,n){if(t.length===0)return n;const[o,...s]=t;if(Array.isArray(e)&&typeof o=="number"){const r=e.slice();return r[o]=ht(e[o],s,n),r}if(e&&typeof e=="object"&&typeof o=="string"){const r=e,i={};for(const a of Object.keys(r))i[a]=a===o?ht(r[a],s,n):r[a];return i}return e}function _r(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class gt extends Error{}const He="site-not-owned";async function ko(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Oo(e,t=n=>fetch(n)){const n=Me({endpoint:e,fetch:async o=>{const s=await t(new Request(o,{signal:we(o.signal)}));if(await ko(s))throw new gt;return s}});try{return await We(n)}catch(o){if(o instanceof gt)return He;throw o}}async function Eo(e,t,n){await t();const o=await Oo(e,n);return o===He?o:{...o,hosted:eo(e,n)}}const Je=5e3;function Do(e){if(!e.site)throw new Error("this project names no site");return An(e.site,e.branch)}function Io(e){return new URL(pe(e,"rpc"),window.location.origin).href}async function We(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==Bn)throw new Ue;const s=Fn(t.result);if(!n)throw new Error("no schema.get");if(Ve(n))return{client:e,describe:s,hasSchema:!1};if(n.ok)return{client:e,describe:s,hasSchema:!0};throw n.error}function _o(e,t=n=>fetch(n)){return We(Me({endpoint:e,fetch:n=>t(new Request(n,{signal:we(n.signal)}))}))}function se(e,t){const n=A.c(40),{org:o}=jn(),{connection:s}=go(e),{runtime:r}=$t(e),i=L.useContext(Ut),a=Qe(e),l=It(Le(e)?.metadata),c=Ft({hasServeConnection:!!s,runtime:r}),f=Bt(c,s?.endpoint??""),h=Cn()?.taskId??null,u=Vn(Hn().lifecycle.phase),d=Z(),v=wo({mode:c,v8:a,workingTreeReady:u}),b=v.github&&!!o.slug&&!!e&&!!t,w=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>Eo(Do({orgSlug:o.slug,site:l,branch:t}),()=>_t(l,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...vt}),_=v.sandbox&&!!o.slug&&!!e&&!!t;let S;n[0]!==t||n[1]!==o.slug||n[2]!==h||n[3]!==e?(S=()=>_o(Io({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:h})),n[0]=t,n[1]=o.slug,n[2]=h,n[3]=e,n[4]=S):S=n[4];const $=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",h??""),queryFn:S,enabled:_,staleTime:Number.POSITIVE_INFINITY,...vt}),E=!!s;let D;n[5]!==s?.endpoint||n[6]!==o.slug||n[7]!==e?(D=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[5]=s?.endpoint,n[6]=o.slug,n[7]=e,n[8]=D):D=n[8];let I;n[9]!==s?(I=()=>jo(s.endpoint),n[9]=s,n[10]=I):I=n[10];let m;n[11]!==E||n[12]!==D||n[13]!==I?(m={queryKey:D,queryFn:I,enabled:E,staleTime:Number.POSITIVE_INFINITY,retry:To,retryDelay:Ro,refetchInterval:xo},n[11]=E,n[12]=D,n[13]=I,n[14]=m):m=n[14];const y=F(m);let O;n[15]!==s?.endpoint||n[16]!==o.slug||n[17]!==e?(O=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[15]=s?.endpoint,n[16]=o.slug,n[17]=e,n[18]=O):O=n[18];const x=O;let N;n[19]!==s?.endpoint||n[20]!==o.slug||n[21]!==e?(N=g.contentBackend(o.slug,e??"","local-describe",s?.endpoint??""),n[19]=s?.endpoint,n[20]=o.slug,n[21]=e,n[22]=N):N=n[22];let p;n[23]!==y.data||n[24]!==x||n[25]!==d?(p=async()=>{try{return await y.data.client.describe()}catch(K){const In=K;throw d.invalidateQueries({queryKey:x,exact:!0},{cancelRefetch:!1}),In}},n[23]=y.data,n[24]=x,n[25]=d,n[26]=p):p=n[26];const k=!!y.data&&!i;let P;n[27]!==N||n[28]!==p||n[29]!==k?(P={queryKey:N,queryFn:p,enabled:k,refetchInterval:Je,retry:!1},n[27]=N,n[28]=p,n[29]=k,n[30]=P):P=n[30];const M=F(P).data??y.data?.describe,U=bo({hasProject:!!e,hasServeConnection:!!s,runtime:r,v8:a,githubSite:w.data===He?"not-owned":w.data?"ready":ft(w)?"error":"loading",sandboxSite:Po({data:$.data,isError:ft($),workingTreeReady:u})});if(U==="pending")return{kind:"pending",...f};if(U==="retrying-sandbox")return{kind:"pending",retrying:"sandbox",...f};if(U==="legacy")return{kind:"legacy"};if(U==="protocol-github")return{..._e(f,w.data),site:l};if(U==="site-not-owned-github")return{kind:"unavailable",...f,siteNotOwned:!0};if(U==="protocol-sandbox")return _e(f,$.data);if(U==="unavailable-github"){let K;return n[31]!==f?(K={kind:"unavailable",...f},n[31]=f,n[32]=K):K=n[32],K}const R=y.error??y.failureReason,H=s?.endpoint??"";let J;return n[33]!==M||n[34]!==y.data||n[35]!==y.failureCount||n[36]!==y.isError||n[37]!==H||n[38]!==R?(J=No({probed:y.data,isError:y.isError,failureCount:y.failureCount,failure:R,describe:M,endpoint:H}),n[33]=M,n[34]=y.data,n[35]=y.failureCount,n[36]=y.isError,n[37]=H,n[38]=R,n[39]=J):J=n[39],J}function xo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Je:!1}function Ro(e){return Yn(e+1)}function To(e,t){return!(t instanceof j)&&!(t instanceof Ue)}function Po(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $o=3;function No(e){const t=Bt("local",e.endpoint),n=e.probed?_e(t,{...e.probed,describe:e.describe??e.probed.describe}):null;return e.isError||e.failureCount>0?n?.kind==="protocol"&&!e.isError&&e.failureCount<$o?n:{kind:"unavailable",...t,problem:zn(e.failure)}:n??{kind:"pending",...t}}const vt={retry:2,refetchInterval:e=>e.state.status==="error"?Je:!1};function _e(e,t){return{kind:"protocol",...e,client:t.client,describe:t.describe,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function jo(e,t){return We(Me({endpoint:e,fetch:n=>fetch(n,{signal:we(t?AbortSignal.any([t,n.signal]):n.signal)})}))}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Ao(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Mo(e,t,n){return e?t==="pending"?{ready:!1,failed:!1}:t==="unavailable"?{ready:!1,failed:!0}:n:{ready:!0,failed:!1}}function Lo(e,t){return JSON.stringify([e?.orgSlug,e?.virtualMcpId,e?.branch,vo(t)])}function Qo(e,t,n){const o=A.c(21),s=Z(),r=se(e?.virtualMcpId,e?.branch),i=e&&r.kind==="protocol"&&r.hosted?r:null;let a;o[0]!==i||o[1]!==e?(a=i&&e?Ao(e,i):"",o[0]=i,o[1]=e,o[2]=a):a=o[2];const l=lo(i?.hosted,a,t,n),c=e!==null;let f;o[3]!==r.kind||o[4]!==l||o[5]!==c?(f=Mo(c,r.kind,l),o[3]=r.kind,o[4]=l,o[5]=c,o[6]=f):f=o[6];const h=f,u=r.kind!=="legacy";let d;o[7]!==r||o[8]!==e?(d=Lo(e,r),o[7]=r,o[8]=e,o[9]=d):d=o[9];let v;o[10]!==r.kind||o[11]!==r.source||o[12]!==l||o[13]!==s||o[14]!==e?(v=()=>{if(l.retry(),!e||r.kind!=="unavailable")return;const w=r.source;s.resetQueries({queryKey:g.contentBackend(e.orgSlug,e.virtualMcpId,...w==="local"?["local"]:[e.branch,w])})},o[10]=r.kind,o[11]=r.source,o[12]=l,o[13]=s,o[14]=e,o[15]=v):v=o[15];let b;return o[16]!==h||o[17]!==u||o[18]!==d||o[19]!==v?(b={...h,v8:u,scopeKey:d,retry:v},o[16]=h,o[17]=u,o[18]=d,o[19]=v,o[20]=b):b=o[20],b}function Ht(e){const t=A.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[s,r]=Mn(o,null),i=Qe(e);let a;t[2]!==s||t[3]!==e?(a=e?ot(s):null,t[2]=s,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,h;t[5]!==r?(f=d=>r(ot(d)),h=()=>r(null),t[5]=r,t[6]=f,t[7]=h):(f=t[6],h=t[7]);let u;return t[8]!==c||t[9]!==f||t[10]!==h?(u={url:c,setUrl:f,clear:h},t[8]=c,t[9]=f,t[10]=h,t[11]=u):u=t[11],u}const bt=6e4,Uo=2147483647;function Bo(e,t){if(e===null||e.trim()==="")return bt;const n=e.trim(),o=/^\d+(?:\.\d+)?$/.test(n)?Number(n)*1e3:/^[A-Za-z]{3}, /.test(n)?Math.max(0,Date.parse(n)-t):Number.NaN;return Number.isFinite(o)&&o>=0&&o<=Uo?o:bt}class Jt extends Error{constructor(t,n,o,s=Date.now()){super(t),this.status=n,this.name="ContentResponseError",this.retryAt=n===429?s+Bo(o,s):null}status;retryAt}function Fo(e,t,n=Date.now()){const o=Pt(5e3,1e3,e,2,0);return t instanceof Jt&&t.retryAt!==null?Math.max(o,t.retryAt-n):o}async function Ye(e,t){const n=await e.json().catch(()=>null),o=n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?n.error:`${t} failed (${e.status})`;throw new Jt(o,e.status,e.headers.get("retry-after"))}function Co(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function wt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function me(e,t,n){return["decofile-write",e,t,n]}function Vo(e,t,n){return{id:me(e,t,n).join(":")}}class Ge extends Error{constructor(t,n,o=[],s=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=s,this.name="BlockConflictError"}blocks;fields;carriedStored}function ze(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Xe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Ho(e,t){return Ye(e,t)}function Jo(e,t,n){e.setQueryData(g.decofileDraft(ze(t)),n)}function Wo(e,t){return e.getQueryData(g.decofileDraft(ze(t)))??null}async function Yo(e,t){return(await fetch(Xe(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function xr(e){const t=A.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?ze(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Go,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s??null}async function Go(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function zo(e,t){const n=await fetch(Xe(t),{cache:"no-store"});if(!n.ok)return Ye(n,"Read decofile");const o=await n.json();return o.token&&Jo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Rr(e,t){const n=await fetch(Xe(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const s=await n.json().catch(()=>({}));throw s.code==="block-conflict"?new Ge(s.blocks??[],s.error??"Block changed"):new Error(s.error??`Save failed (${n.status})`)}if(!n.ok)return Ho(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Wt=3e3,Xo=15e3,Zo=2*6e4,Yt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Ko(e){return e<Zo?Wt:Xo}function qo(e,t=Yt){const n=t.now();let o=!1,s=!1,r=null;const i=()=>{o||(r=t.setTimeout(a,Ko(t.now()-n)))},a=()=>{if(r=null,o)return;const{read:l,skip:c}=e();if(s||t.hidden()||c?.()){i();return}s=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{s=!1}),i()};return i(),()=>{o=!0,r!==null&&t.clearTimeout(r)}}const pt=()=>0;function es(e,t,n=Yt){const o=L.useRef(t);o.current=t;const[s]=L.useState(()=>({polling:()=>qo(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?s.polling:s.idle,pt,pt)}function Gt(e,t){return pe(e,t)}function ts(e,t){return pe(e,"preview-fetch",{path:t})}function Tr(e){return Gt(e,"preview-invoke")}function Pr(e){return Gt(e,"catalog-invoke")}function zt(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 ns(){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&&zt(n))return n}return null}function os(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??ns();return n&&zt(n)?new URL(t,n).toString():ts(e,t)}function ss(e){return os(e,"/.decofile")}function rs(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function mt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function is(e,t){const n=pe(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),s=rs(o.status);if(s==="absent")return{kind:"absent"};if(s==="unavailable")return{kind:"unavailable"};if(s==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const r=await o.json();return typeof r.content!="string"?{kind:"unavailable"}:{kind:"data",data:Jn(r.content)}}async function as(e,t){const n=await is(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function $r(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)return Ye(n,"Read committed meta");try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function cs(e){return Le(e)?.metadata?.runtime?.path??null}function Re(e,t,n,o){const s=B(e),r=Object.keys(n?.changes??{}).find(a=>B(a)===s);if(r!==void 0&&n)return n.changes[r].baseVersion;const i=Object.keys(t?.draft??{}).some(a=>B(a)===s);if(t&&!i){const a=Object.keys(t.entries).find(l=>B(l)===s);return a===void 0?null:t.entries[a].version}return o?.[e]??null}class Xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Nr(e){return e instanceof j&&e.code===T.Conflict}function Zt(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 Ze extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Ke extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function jr(e,t){return(t instanceof Ze||t instanceof Ke)&&(t.message=Kt(e,t,"github")),t}function Kt(e,t,n){if(t instanceof Ze)return e("siteEditor.save.draftUnread");if(t instanceof Ke)return e("siteEditor.save.keptChanging");if(t instanceof Ge)return t.message;if(n==="local")return us(e,t);if(t instanceof j)switch(t.code){case T.Conflict:return e("siteEditor.save.conflict");case T.ReadOnly:return e("siteEditor.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("siteEditor.save.invalid");case T.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ls(e,t){if(t==="local"||e instanceof Ge||e instanceof Ze||e instanceof Ke)return null;if(e instanceof j){const n=e.code===T.InvalidBlock||e.code===T.InvalidParams?Zt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function us(e,t){if(t instanceof Xt)return e("decoServe.save.serverGone");if(t instanceof j)switch(t.code){case T.Conflict:return e("decoServe.save.conflict");case T.ReadOnly:return e("decoServe.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("decoServe.save.invalid",{detail:Zt(t)});case T.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function fs(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ds(e,t){const[n,o]=L.useState(e),s=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){s.current??=Date.now();return}if(!n)return;const r=()=>{s.current=null,o(!1)},i=fs(s.current,Date.now(),t);if(i===0){r();return}const a=setTimeout(r,i);return()=>clearTimeout(a)},[e,n,t]),n}const hs="decocms:content-writes",Te=new Set;let G;function qt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(hs),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function gs(e){try{qt()?.postMessage({cacheKey:e})}catch{}}function vs(e){return qt(),Te.add(e),()=>{Te.delete(e)}}const en="__at=",tn="__test=",bs=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function ws(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function ee(e){return typeof e=="string"&&bs.test(e)}function St(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function ps(e){const t=e.tests??{};return[...e.at!==void 0?[en+St(e.at)]:[],...Object.keys(t).map(n=>tn+St(`${n}=${t[n]?"on":"off"}`))]}function yt(e,t){const o=[...e.split("&").filter(s=>s&&!s.startsWith(en)&&!s.startsWith(tn)),...t];return o.length>0?`?${o.join("&")}`:""}function de(e,t){const n=ps(t),o=e.indexOf("?"),s=o===-1?e:e.slice(0,o);if(ee(s))return s+yt(o===-1?"":e.slice(o+1),n);const r=e.lastIndexOf("@");if(r<=0)return e;const i=e.slice(0,r),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${yt(c,n)}${e.slice(r)}`}function Ar(e,t,n){if(!ws(t))return e;try{const o=new URL(e),s=o.searchParams.get("__draft");return s&&s!=="off"?(o.searchParams.set("__draft",de(s,t)),o.toString()):ee(n)?(o.searchParams.set("__draft",de(n,t)),o.toString()):e}catch{return e}}function Mr(e,t,n="/"){if(!e||!ee(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function nn(e){return btoa(encodeURIComponent(e))}function Lr(e,t,n){const o=ms(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function ms(e,t,n){const o=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return s.searchParams.set("path","/"),s.searchParams.set("pathTemplate","/"),s.searchParams.set("props",nn(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),s}const Ss="__draft";function Qr(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const ys="off";function ks(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Ss,t),n.toString()}function Ur(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:s,...r}=e.pageBlock,i=JSON.stringify({__props:r,__decofile:e.decofile});return{src:o.toString(),body:i}}function Br(e,t,n,o){const s=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,s);r.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),r.searchParams.set("props",nn(JSON.stringify({sections:i}))),r.toString()}function Fr(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const kt="__variant=";function on(e,t,n){return`${e}@${t}=${n}`}function Cr(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[on(e,"sections",t.index)]}function Vr(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[on(e.pageKey,o,e.selectedVariantIndex)]}function Hr(e,t){return[...t,...e]}function Os(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function qe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),s=o.indexOf("?"),r=s===-1?o:o.slice(0,s),a=[...s===-1?[]:o.slice(s+1).split("&").filter(c=>c&&!c.startsWith(kt)),...t.map(c=>kt+Os(c))],l=a.length>0?`?${a.join("&")}`:"";return`${r}${l}${e.slice(n)}`}function Jr(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),s=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return qe(`${s}${o.pathname}@local`,t)}catch{return null}}function Wr(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",qe(o,t)),n.toString())}catch{return e}}function Es(e){const{pointer:t}=e;if(!t||t===ys)return null;const n=t.indexOf("?");return ee(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:ee(e.heldRevision)&&e.forcedVariants.length===0?de(e.heldRevision,e.previewOptions):de(qe(t,e.forcedVariants),e.previewOptions)}function Ds(e,t){if(!e||!t)return null;try{return ks(e,t)}catch{return null}}function Yr(e,t,n){if(!e||!n)return null;try{return Ds(new URL(t,e).toString(),n)}catch{return null}}const he={forcedVariants:[],previewOptions:{}},ie=new Map,ae=new Map,Pe=new Map;function sn(e){for(const t of Pe.get(e)??[])t()}function rn(e,t){const n=ee(t)?t:null;(ae.get(e)??null)!==n&&(n?ae.set(e,n):ae.delete(e),sn(e))}function Is(e){return ae.get(e)??null}function _s(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Gr(e,t){const n=ie.get(e)??he,o=t??he;_s(n,o)||(t?ie.set(e,o):ie.delete(e),sn(e))}function xs(e){return ie.get(e)??he}function an(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function Rs(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>an(e,s),o=()=>xs(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,Ts)}function Ts(){return he}function Ps(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>e?an(e,s):Ns,o=()=>e?Is(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,$s)}function $s(){return null}function Ns(){}function zr(e,t){const n=A.c(4),o=Rs(e),s=Ps(e);let r;return n[0]!==o||n[1]!==s||n[2]!==t?(r=Es({pointer:t,heldRevision:s,...o}),n[0]=o,n[1]=s,n[2]=t,n[3]=r):r=n[3],r}const cn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},js=15e3,ge=new Map;function W(e,t){return`${e}/${t}`}function V(e){let t=ge.get(e);return t||(t={state:cn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ge.set(e,t)),t}function C(e,t){const n=V(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function ve(e){return ge.get(e)?.state??cn}function As(e,t){const n=V(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Xr(e){const t=V(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),C(e,{phase:"idle"}))}}function Zr(e){const t=ge.get(e);!t||t.state.phase!=="reloading"||(Se(t),C(e,{phase:"idle"}))}function ln(e){const t=V(e);Se(t),C(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ce(e,t){const n=V(e),o=Math.max(0,n.state.inFlight-1);if(o>0){C(e,{inFlight:o});return}if(!t.ok||n.previews===0){C(e,{phase:"idle",inFlight:o});return}un(e,t.navigates,o)}function un(e,t,n=0){const o=V(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&C(e,{phase:"idle"})},js),C(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Ms(e){return e?.kind==="protocol"&&e.source==="github"}async function le(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,s)}):null;if(i?.kind!=="protocol"){const v=a&&t.reread?n.invalidateQueries({queryKey:g.decofile(a)}):null;if(await Promise.all([l,v]),v&&t.kind!=="edit"){const b=W(o,s);C(b,{epoch:ve(b).epoch+1})}return{navigates:!1}}const c=r?g.protocolDraftRead(o,s,r):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,h=l?[l]:[];if(a&&t.reread&&h.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&h.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),r&&i.source==="sandbox"&&h.push(n.invalidateQueries({queryKey:Wn(o,s,r)})),Ms(i)&&c&&!t.adopted&&h.push(n.invalidateQueries({queryKey:c})),await Promise.all(h),t.kind!=="edit"){const v=W(o,s);C(v,{epoch:ve(v).epoch+1})}const u=c?JSON.stringify(n.getQueryData(c)??null):null,d=f!==u;return d&&await new Promise(v=>xt.schedule(v)),{navigates:d}}async function Ls(e,t){return ln(W(e.orgSlug,e.virtualMcpId)),fn(e,t)}function Ot(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function fn(e,t){const n=W(e.orgSlug,e.virtualMcpId),o=t.adopted?Ot(e):null;let s;try{s=await t.write()}catch(i){throw ce(n,{ok:!1,navigates:!1}),t.refreshOnError&&le(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&gs(e.cacheKey),rn(n,t.shownRevision?.(s)??null),t.adopted){const i=Ot(e)!==o;return i&&await new Promise(a=>xt.schedule(a)),ce(n,{ok:!0,navigates:i}),t.reread&&le(e,t).catch(()=>{}),s}let r=!1;try{({navigates:r}=await le(e,t))}catch{}finally{ce(n,{ok:!0,navigates:r})}return s}function Kr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r}=e,i=W(o,s),a=new Set(t.blockKeys);for(const f of[...V(i).discardListeners])f(a);ln(i);let l=!1;const c=()=>(l=!0,fn(e,{kind:"discard",reread:!0,write:t.write}));return r?n.getMutationCache().build(n,{mutationKey:me(o,s,r),scope:Vo(o,s,r),mutationFn:c}).execute(void 0).catch(f=>{throw l||ce(i,{ok:!1,navigates:!1}),f}):c()}function qr(e,t,n){const o=A.c(8);let s;o[0]!==e||o[1]!==t?(s=W(e,t),o[0]=e,o[1]=t,o[2]=s):s=o[2];const r=s;let i;o[3]!==n||o[4]!==r?(i=()=>{const l=V(r).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=r,o[5]=i):i=o[5];let a;o[6]!==r?(a=[r],o[6]=r,o[7]=a):a=o[7],L.useEffect(i,a)}function dn(e){const t=W(e.orgSlug,e.virtualMcpId);ve(t).inFlight>0||(rn(t,null),le(e,{kind:"external"}).then(({navigates:n})=>{const o=V(t);o.previews>0&&o.state.inFlight===0&&un(t,n)}).catch(()=>{}))}function Qs(e,t){const n=A.c(7);let o;n[0]!==e||n[1]!==t?(o=W(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const s=o;let r;n[3]!==s?(r=c=>As(s,c),n[3]=s,n[4]=r):r=n[4];const i=r;let a;n[5]!==s?(a=()=>ve(s),n[5]=s,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const Us=500;function ei(e,t){const{phase:n}=Qs(e,t);return ds(n!=="idle",Us)}function Bs(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function hn(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function ti(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?oo(i,n):Fs(e,t,n)}const s=e.getQueryData(g.contentVersions(t));if(!s)return;if(Object.hasOwn(s,n))return s[n];const r=e.getQueryData(g.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function gn(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(s=>B(s)===n);return o===void 0?void 0:e.changes[o]}function Fs(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return vn(o,ye(e,t),n)}function vn(e,t,n){const o=gn(e,n);return o?.kind==="delete"?o.version??X:o?o.version:t.has(B(n))?X:null}function ni(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const s=gn(o,n);return s?s.kind==="set"&&s.baseVersion===null:ye(e,t).has(B(n))}function oi(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const s=ye(e,t);return{blocks:n,versionOf:r=>vn(o,s,r)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function be(e,t,n,o){const s=B(n),r=ye(e,t);r.has(s)!==o&&(o?r.add(s):r.delete(s),Y(e),e.setQueryData(g.contentDraftTombstones(t),[...r]))}function bn(e,t,n,o){const s=o.revision,r=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===X?null:d]),a=e.getQueryData(g.contentChanges(n)),l=e.getQueryData(g.contentIndex(n)),c=new Set(i.flatMap(([u])=>Re(u,l,a,r)===null?[u]:[])),f=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[v,b]of i){const w=Re(v,l,u,r);b!==null?d[v]={kind:"set",version:b,baseVersion:w}:w!==null?d[v]={kind:"delete",version:null,baseVersion:w}:delete d[v]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?be(e,n,u,!1):!f.has(B(u))&&c.has(u)&&be(e,n,u,!0);const h=o.revision;return h&&h!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:h}),s}function ke(e,t,n){Y(e),e.setQueryData(g.contentVersions(t),o=>{const s={...o};for(const[r,i]of Object.entries(n))i===null?delete s[r]:s[r]=i;return s})}function wn(e,t){const n=e.getMutationCache().findAll({mutationKey:me(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>mo(o.state.variables)))}function $e(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function oe(e,t,n,o){try{return await o()}catch(s){const r=!(s instanceof j);throw t.source==="local"&&r?($e(e,n),new Xt(s)):(t.source==="local"&&Ae(s)&&$e(e,n),s)}}const Et=new WeakMap;function et(e){let t=Et.get(e);return t||(t={inFlight:new Map,rereading:new Set},Et.set(e,t)),t}function pn(e,t,n,o){const{inFlight:s}=et(e),r=s.get(o);if(r)return r;const i=tt(e,t,n,o,!0);return s.set(o,i),i.finally(()=>{s.get(o)===i&&s.delete(o)})}function Cs(e,t,n){const o=A.c(8),s=Z(),r=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==r||o[4]!==s||o[5]!==i?(l=()=>{if(!e||!r||!i||!a)return;const f={orgSlug:r,virtualMcpId:i,branch:a},{rereading:h}=et(s);return vs(u=>{u===n&&(h.has(n)||(h.add(n),Hs(s,e,f,n).catch(Vs).finally(()=>h.delete(n))))})},c=[s,e,r,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=r,o[4]=s,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function Vs(){}async function Hs(e,t,n,o){const s=et(e).inFlight.get(o);return s&&await s.catch(()=>{}),pn(e,t,n,o)}async function tt(e,t,n,o,s){Y(e);const r=g.decofile(o),i=hn(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(r),f=e.getQueryData(l),u=e.getQueryData(i),d=e.getQueryData(a)??void 0,v=s&&c&&f?d?.revision:void 0,b=s&&u?d?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return Js(e,t,t.hosted,n,o,{conditional:s,seen:d,currentMeta:u,schemaIfNoneMatch:b,seenChanges:_});const[S,$,E]=await oe(e,t,n,()=>t.client.batch([{method:"blocks.list",params:v?{ifNoneMatch:v}:{}},{method:"schema.get",params:b?{ifNoneMatch:b}:{}},{method:"changes.list",params:Rt(_)}])),D=e.getQueryData(a)?.revision,I=D!==void 0&&D!==d?.revision;if(E?.ok){const k=I?null:Tt(_,E.result);k&&e.setQueryData(w,k)}else E&&t.source==="local"&&Ae(E.error)&&$e(e,n);if(!S?.ok)throw S?.error??new Error("no blocks.list");if(!$)throw new Error("no schema.get");const m=S.result,y=Ve($),O=$.ok&&!y?$.result:null;if(m.notModified&&(!c||!f)||O?.notModified&&!u)return tt(e,t,n,o,!1);const x=m.notModified?new Set:wn(e,n),N=m.notModified?c:po(m.blocks,c,x),p=y?Vt():O?O.notModified?u:O.schema:$.error;if(e.setQueryData(a,{revision:I?D:m.notModified?d?.revision:m.revision,schemaVersion:O?O.notModified?d?.schemaVersion:O.version??void 0:void 0}),e.setQueryData(r,N),!m.notModified){const k=e.getQueryData(l),P={...m.versions};for(const Q of x){const M=k?.[Q];M!==void 0?P[Q]=M:delete P[Q]}e.setQueryData(l,P)}return p instanceof j||e.setQueryData(i,p),!I&&!m.notModified&&c&&d?.revision&&m.revision!==d.revision&&dn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:N,meta:p}}async function Js(e,t,n,o,s,r){const i=g.decofile(s),a=g.contentIndex(s),l=g.contentRevision(s),c=g.contentVersions(s),f=hn(o,t),h=g.contentChanges(s),u=e.getQueryData(a),d=r.conditional&&u?r.seen?.revision:void 0,[v,b,w]=await oe(e,t,o,()=>n.batch([{method:"cms.index",params:d?{ifNoneMatch:d}:{}},{method:"schema.get",params:r.schemaIfNoneMatch?{ifNoneMatch:r.schemaIfNoneMatch}:{}},{method:"changes.list",params:Rt(r.seenChanges)}])),_=e.getQueryData(a)??u,S=e.getQueryData(l)?.revision,$=S!==void 0&&S!==r.seen?.revision;if(w?.ok&&!$){const R=Tt(r.seenChanges,w.result);R&&e.setQueryData(h,R)}if(!v?.ok)throw v?.error??new Error("no cms.index");if(!b)throw new Error("no schema.get");const E=v.result,D=Ve(b),I=b.ok&&!D?b.result:null;if(E.notModified&&!u||I?.notModified&&!r.currentMeta)return tt(e,t,o,s,!1);const m=D?Vt():I?I.notModified?r.currentMeta:I.schema:b.error;m instanceof j||e.setQueryData(f,m);const y=I?I.notModified?r.seen?.schemaVersion:I.version??void 0:void 0,O=e.getQueryData(i)??{};if(E.notModified||$)return e.setQueryData(l,{revision:$?S:r.seen?.revision,schemaVersion:y}),e.setQueryData(i,O),{blocks:O,meta:m};const x={revision:E.revision,resolvedRef:E.resolvedRef,sequence:E.sequence,entries:E.entries,draft:E.draft};e.setQueryData(a,x);const N=!!r.seen?.revision&&x.revision!==r.seen.revision&&(!r.seen.revision.startsWith("s-")||!!u&&mn(u.draft,x.draft));N&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),R=>R&&{...R,version:x.revision}),e.setQueryData(l,{revision:x.revision,schemaVersion:y});const p=wn(e,o),k=e.getQueryData(c)??{},P={},Q={},M=[];for(const[R,H]of Object.entries(O)){const J=x.entries[R];!J&&!p.has(R)||(P[R]=H,k[R]!==void 0&&(Q[R]=k[R]),J&&!p.has(R)&&k[R]!==J.version&&M.push(R))}return e.setQueryData(i,P),e.setQueryData(c,Q),M.length>0&&await Fe(e,n,s,M,p),_&&N&&Ws(_,x)&&dn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:s}),{blocks:e.getQueryData(i)??P,meta:m}}function Ws(e,t){if(mn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function mn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function Ys(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function Ee(e){if(!(e instanceof j)||e.code!==T.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}async function Gs(e,t){if(!(e instanceof j)||e.code!==T.Conflict)return;const n=e.data?.entries;if(!n||typeof n!="object")return;const o=Object.entries(n);if(o.length===0)return;const s=t.set??{},r=new Set(t.delete??[]),i={};for(const[a,l]of o){const c=l?.actual;if(typeof c!="string"||(Object.hasOwn(s,a)?await Un(s[a]):r.has(a)?X:void 0)!==c)return;i[a]=c}return i}function zs(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([s])=>!Object.hasOwn(t,s))),o=(e.delete??[]).filter(s=>!Object.hasOwn(t,s));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function re(e,t,n,o,s){Y(e),bn(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:s}),ke(e,n,Object.fromEntries(Object.entries(s).map(([r,i])=>[r,i===X?null:i]))),Qt(e,n,s,o.set??{})}async function si(e,t,n,o,s,r){if(t.source==="github"){const a=[...Object.keys(s.set??{}),...s.delete??[]].filter(c=>!r||!Object.hasOwn(r,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=Ln(s.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return Ls({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=(f,h=r)=>oe(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...h?{ifMatch:Ys(h,f)}:{}}));let a;try{a=await i(s)}catch(f){const h=t.source==="github"?Ee(f):void 0;if(!h)throw f;const u=zs(s,h);Object.keys(h).length>0&&re(e,n,o,s,h);let d;try{d=await i(u)}catch(v){const b=Ee(v);b&&Object.keys(b).length>0&&re(e,n,o,u,b);const w=await Gs(v,u);if(!w)throw v;re(e,n,o,u,w);try{d=await i(u,{...r,...w})}catch(_){const S=Ee(_);throw S&&Object.keys(S).length>0&&re(e,n,o,u,S),_}}a={...d,versions:{...h,...d.versions}}}Y(e);const l=t.source==="github"?bn(e,n,o,a):a.revision;t.source==="github"&&Qt(e,o,a.versions??{},s.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return ke(e,o,c),{revision:l,versions:c}}})}function Sn(e,t){if(!(e instanceof j))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 yn(e,t,n){if(!(n instanceof j))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[s,r]of Object.entries(o))r===null&&be(e,t,s,!1)}function kn(e,t,n,o){Y(e),Qn(e,n,o);const s=o.block===null,r=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=Re(n,e.getQueryData(g.contentIndex(t)),i,r);if(i){const l=B(n),c=Object.fromEntries(Object.entries(i.changes).filter(([f])=>B(f)!==l));s?a!==null&&(c[n]={kind:"delete",version:null,baseVersion:a}):c[n]={kind:"set",version:o.version,baseVersion:a},e.setQueryData(g.contentChanges(t),{...i,changes:c,edited:!0})}be(e,t,n,s&&a===null),e.setQueryData(g.decofile(t),l=>{const c={...l};return s?delete c[n]:c[n]=o.block,c}),ke(e,t,{[n]:s?null:o.version}),so(e,t,n,o)}function ri(e,t,n,o){if(t.source!=="github"||!(o instanceof j))return!1;yn(e,n,o);const s=o.data?.draft;if(!s||typeof s!="object")return!1;const r=Object.keys(s),i=r.map(a=>Sn(o,a));return r.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),r.forEach((a,l)=>{kn(e,n,a,i[l])}),!0)}async function ii(e,t,n,o,s,r){t.source==="github"&&yn(e,o,r);const i=t.source==="github"?Sn(r,s):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),kn(e,o,s,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await oe(e,t,n,()=>t.client.changesGet({names:[s]}))).entries[s];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const h={...f.changes};return c?.kind?h[s]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete h[s],{...f,changes:h,edited:!0}})}catch{const l=await oe(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[s]??null,version:l.versions[s]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[s]:c[s]=a.value,c}),ke(e,o,{[s]:a.version}),!1}function Xs(e){const t=A.c(17),n=Le(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=It(n),t[0]=n,t[1]=o):o=t[1];const s=o;let r;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(r=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=r):r=t[5];let i;t[6]!==e||t[7]!==s?(i=async()=>{const b=await _t(s,e.branch),w=b.pointer?.lastIndexOf("@")??-1;return{draft:b.pointer&&w>0?b.pointer.slice(0,w):null,version:b.pointer&&w>0?b.pointer.slice(w+1):b.etag}},t[6]=e,t[7]=s,t[8]=i):i=t[8];const a=!!e&&!!s;let l;t[9]!==r||t[10]!==i||t[11]!==a?(l={queryKey:r,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=r,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:h}=F(l),u=!!e&&!!s&&f&&!h;if(!e||!c?.draft||!c.version){let b;return t[13]!==u?(b={pointer:null,pending:u},t[13]=u,t[14]=b):b=t[14],b}const d=`${c.draft}@${c.version}`;let v;return t[15]!==d?(v={pointer:d,pending:!1},t[15]=d,t[16]=v):v=t[16],v}function ai(e){return Xs(e).pointer}function ci(e){const t=A.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Zs,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s?.revision}async function Zs(){throw new Error("content revisions are set by reads and writes")}function nt(e,t){const n=A.c(6),{url:o}=Ht(e?.virtualMcpId),s=se(e?.virtualMcpId,e?.branch);if(!e)return"";let r;return n[0]!==s.cacheKeySuffix||n[1]!==s.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(r=s.kind!=="legacy"&&s.cacheKeySuffix!==void 0?xe({...e,protocolSuffix:s.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=s.cacheKeySuffix,n[1]=s.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=r):r=n[5],r}function li(e,t){const n=A.c(46),{url:o}=Ht(e?.virtualMcpId),s=!!o,r=se(e?.virtualMcpId,e?.branch),i=r.kind==="protocol"?r:null,a=nt(e),l=t?.fetchEnabled??!0,c=cs(e?.virtualMcpId),f=$t(e?.virtualMcpId).runtime==="cms",h=Z();let u;n[0]!==a?(u=g.decofile(a),n[0]=a,n[1]=u):u=n[1];const d=u;Cs(i,i&&e?e:null,a);let v;n[2]!==e||n[3]!==h||n[4]!==d?(v=()=>{if(!e||h.isMutating({mutationKey:me(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const k=h.getQueryState(d);return k?.fetchStatus==="fetching"||Date.now()-(k?.dataUpdatedAt??0)<Wt/2},n[2]=e,n[3]=h,n[4]=d,n[5]=v):v=n[5];let b;n[6]!==f||n[7]!==s||n[8]!==e||n[9]!==i||n[10]!==h||n[11]!==d?(b=async()=>{if(e){if(!i&&f&&!s){const k=Wo(h,e)?.version;if(k&&!await Yo(e,k))return}await h.refetchQueries({queryKey:d,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=s,n[8]=e,n[9]=i,n[10]=h,n[11]=d,n[12]=b):b=n[12];let w;n[13]!==v||n[14]!==b?(w={skip:v,read:b},n[13]=v,n[14]=b,n[15]=w):w=n[15],es(!!t?.pollWhile&&!!e,w);const _=Ce(i?.hosted?a:"");let S;n[16]!==r.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==s||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==h?(S=async()=>{if(i)return(await pn(h,i,e,a)).blocks;if(r.kind==="unavailable")throw Bs("decofile");if(s){const M=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(qs),U=M?.ok?wt(await M.text()):null;if(U)return U;const R=new Error("decofile unavailable (local tunnel unreachable)");throw R.status=502,R}if(f)return zo(h,e);const k=()=>as(e,Co(c,".deco/blocks.gen.json"));if(l){const M=await fetch(ss(e),{cache:"no-store"}).catch(Ks);if(M?.ok){const H=wt(await M.text());if(H)return H}const U=await k();if(U.kind==="data")return U.data;const R=new Error(`Failed to fetch decofile: ${M?.status??"network error"}`);throw R.status=mt({liveOk:!!M?.ok,liveStatus:M?.status,committedAbsent:U.kind==="absent"}),R}const P=await k();if(P.kind==="data")return P.data;const Q=new Error("decofile unavailable (preview down, no committed snapshot)");throw Q.status=mt({liveOk:!1,committedAbsent:P.kind==="absent"}),Q},n[16]=r.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=s,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=h,n[26]=S):S=n[26];const $=!!e&&r.kind!=="pending",E=i?0:3e4,D=i?.describe.pollIntervalMs,I=i?"always":void 0;let m;n[27]!==f||n[28]!==s||n[29]!==i?(m=(k,P)=>{if(i||f||s)return k<3;const Q=P.status;return Q!==502&&Q!==404&&k<2},n[27]=f,n[28]=s,n[29]=i,n[30]=m):m=n[30];let y;n[31]!==d||n[32]!==S||n[33]!==$||n[34]!==E||n[35]!==D||n[36]!==I||n[37]!==m?(y={queryKey:d,queryFn:S,enabled:$,staleTime:E,refetchInterval:D,refetchIntervalInBackground:!1,refetchOnWindowFocus:I,retry:m,retryDelay:Fo},n[31]=d,n[32]=S,n[33]=$,n[34]=E,n[35]=D,n[36]=I,n[37]=m,n[38]=y):y=n[38];const O=F(y);let x;n[39]!==_||n[40]!==O?(x=_&&O.data?to(_,O.data):void 0,n[39]=_,n[40]=O,n[41]=x):x=n[41];const N=x;let p;return n[42]!==N||n[43]!==i?.hosted||n[44]!==O?(p=i?.hosted&&N?{...O,data:N}:O,n[42]=N,n[43]=i?.hosted,n[44]=O,n[45]=p):p=n[45],p}function Ks(){return null}function qs(){return null}function ui(e,t,n){return Qo(e,t,n)}function fi(e){const t=A.c(4),n=Z(),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==s||t[1]!==n||t[2]!==r?(i=(a,l)=>ro(n,r,s,a,l),t[0]=s,t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function di(e,t){const n=A.c(3),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=Ce(o.kind==="protocol"&&o.hosted?s:"");let i;return n[0]!==r?.entries||n[1]!==t?(i=Object.entries(r?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(er),n[0]=r?.entries,n[1]=t,n[2]=i):i=n[2],i}function er(e){const[t]=e;return t}const tr="site-editor-save",On={id:tr,description:void 0,action:void 0,cancel:void 0},hi="site-editor-undo",Ne="site-editor-publish";function nr(e){const t=A.c(7),{label:n,detail:o}=e;let s;t[0]!==n?(s=z.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=s):s=t[1];let r;t[2]!==o?(r=z.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=r):r=t[3];let i;return t[4]!==s||t[5]!==r?(i=z.jsxs("details",{className:"mt-1 text-xs",children:[s,r]}),t[4]=s,t[5]=r,t[6]=i):i=t[6],i}function En(e,t){return t?z.jsx(nr,{label:e("siteEditor.details"),detail:t}):void 0}function gi(e,t,n){te.error(Kt(e,t,n),{...On,description:En(e,ls(t,n))})}function vi(e,t,n=!1){te.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...On,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Dn={action:void 0,duration:void 0};function bi(e,t){te.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Dn,id:Ne,description:void 0})}function wi(e,{headline:t,body:n,detail:o,retry:s,pending:r,tone:i="error"}){const a=En(e,o??null);te[i](t,{id:Ne,description:n&&a?z.jsxs(z.Fragment,{children:[z.jsx("p",{children:n}),a]}):n??a,action:s?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),te.loading(r??e("thread.publishPopover.publishing"),{...Dn,id:Ne,description:void 0}),s()}}:void 0,duration:s?Number.POSITIVE_INFINITY:void 0})}function pi(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Ho as $,Ds as A,ws as B,as as C,Ft as D,Fr as E,kr as F,Xs as G,W as H,Ps as I,Gr as J,Jr as K,de as L,ys as M,ks as N,Ar as O,Wr as P,Lr as Q,Zr as R,Xr as S,Ut as T,Qs as U,ci as V,Ur as W,Vo as X,me as Y,Ls as Z,is as _,mr as a,vo as a0,Ao as a1,Ir as a2,dt as a3,ht as a4,_r as a5,yr as a6,Er as a7,Gn as a8,En as a9,ti as aA,qr as aB,oi as aC,Jo as aD,Rr as aE,Ke as aF,xr as aG,ai as aH,Qr as aI,ri as aJ,ee as aK,Mr as aL,wi as aM,hi as aN,On as aO,Fe as aP,wn as aQ,to as aR,Br as aS,Pr as aT,Cr as aU,Vr as aV,Hr as aW,pi as aa,ms as ab,hn as ac,nr as ad,zr as ae,Yr as af,Qo as ag,os as ah,pn as ai,Bs as aj,Fo as ak,$r as al,Ne as am,Dn as an,bi as ao,Kr as ap,vi as aq,ni as ar,jr as as,Ge as at,Nr as au,Hs as av,Ze as aw,si as ax,ii as ay,gi as az,go as b,Ht as c,fi as d,pr as e,di as f,ei as g,Or as h,Sr as i,li as j,ui as k,Yn as l,zn as m,Nt as n,jo as o,vr as p,Tr as q,wr as r,br as s,ts as t,se as u,nt as v,Dr as w,cs as x,Co as y,Es as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ee,a6 as te,q as ne,r as E,j as t,B as G,n as F,e3 as ae,a7 as ce,aR as me,aQ as pe,aN as de,aL as ue,aM as ge,aP as fe,aO as he,bc as xe,t as C,dR as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as q,gK as Ce}from"./index-DmyPeHtj.js";import{a as De}from"./SwitchHorizontal01-D47eRm9A.js";import{E as we}from"./agent-icon-DFYKaa0c.js";import{s as Ne}from"./Trash01-C_glH0wy.js";import{i as Pe}from"./Upload01-VrBKSmfZ.js";import{i as ie}from"./Zap-Ch4l-t5Z.js";import{S as Ae}from"./search-toggle-BHbQYf5Y.js";import{E as Y}from"./empty-state-L2cTHOLC.js";import{C as Ee}from"./collection-tabs-D91PU4y3.js";import{S as Me,F as Oe}from"./folder-icon-BqHfg1r8.js";import{j as Te,k as Re,n as Ie}from"./use-org-fs-j9Hf5idr.js";import{af as ze,R as Z,Z as $e}from"./chat-context-CqcR4aAu.js";import{c as _e}from"./context-shell-BLRwg1tV.js";import"./AlertCircle-D1Q8X__K.js";import"./UserCheck01-BiEm5Ebz.js";import"./Tool01-eLaAOwHX.js";import"./ArrowUp-BjMuYXEC.js";import"./ArrowLeft-a7zQohPB.js";import"./ArrowRight-CcdemY_e.js";import"./BookOpen01-Caac9KpE.js";import"./Globe04-DGpfgXDy.js";import"./CheckCircle-BygonUdk.js";import"./ChevronDown-BDwdJQzR.js";import"./ChevronSelectorVertical-BAKnniO6.js";import"./ChevronUp-CoA7d7vl.js";import"./UserSquare-DRonBRNm.js";import"./LinkBroken01-DZpjy5h4.js";import"./CreditCard01-BD4H9Smc.js";import"./File02-CNp6lbfd.js";import"./MessageCircle01-Vr9v9ZLf.js";import"./Eye-B8RfELJD.js";import"./Fingerprint04-CYuFFJ8_.js";import"./Image01-DZ0d0gl4.js";import"./Key01-CCL-qpBw.js";import"./LayoutLeft-D6A6HKPj.js";import"./Minus-Cdvi1RtF.js";import"./Monitor01-BKLXdSAu.js";import"./Sun-TBLvGE97.js";import"./Play-KnC-ePg8.js";import"./Plus-fnuC_-Ii.js";import"./SearchMd-C7M41YQV.js";import"./ShoppingBag01-D27zZ3nR.js";import"./Users01-CYW34Us_.js";import"./XClose-xoNzv1jt.js";import"./icon-button-BKSgoP48.js";import"./tooltip-CnD2gBxQ.js";import"./index-DAFFHpVi.js";import"./badge-By3J5rC3.js";import"./markdown-B7FqmO_Q.js";import"./use-copy-DcPGMlZ-.js";import"./use-mobile-BGIYUsLQ.js";import"./use-panel-navigate-DLijLDIl.js";import"./thread-route-QjX15zqF.js";import"./use-project-scope-sgJLxDnc.js";import"./repository-binding-BezKpFog.js";import"./use-mcp-client-DfqrKiZY.js";import"./auth-xINlnEh8.js";import"./task-board-B8wzNBqW.js";import"./schema-CRoCQYHH.js";import"./file-preview-C7hdL4Yc.js";import"./utils-DgfuCg_0.js";import"./editor-DHPR_ozC.js";import"./file-type-icon-BIdp66kj.js";import"./useInfiniteQuery-CSIthp54.js";import"./infiniteQueryObserver-D9fycF8k.js";import"./use-view-draft-kind-XY0ukhv-.js";import"./use-blog-view-9Y1OwyU5.js";import"./use-organization-settings-DRtlFFBs.js";import"./thread-intent-1kOP6maa.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BbbQrIO0.js";import"./session-runtime-CvClIIGY.js";import"./use-entitlements-BYhZgO5P.js";import"./use-ai-providers-DrvsAXJ7.js";import"./use-current-view-DrUxoucV.js";import"./use-in-settings-BhSbV6H8.js";import"./use-decopilot-events-Be8G8lj7.js";import"./require-capability-1sXrPz2q.js";import"./access-gate-CNfTTZux.js";import"./capability-load-error-CDIQe4e8.js";import"./sections-BO6dARSn.js";import"./textarea-Djiqi_Hb.js";import"./use-ask-in-chat-CxLSAUNx.js";import"./shell-layout-DJOHh2NE.js";import"./use-deployment-admin-BGJ_CxB1.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-J6OTcXIJ.js";import"./command-DmBlCsxL.js";import"./index-_reJwud9.js";import"./integration-icon-92n5xPlq.js";import"./project-icon-D-KoSfqD.js";import"./use-navigate-to-agent-stX_hK-R.js";import"./use-debounced-value-Io5mDbSS.js";import"./new-project-dialog-zI9XmIIv.js";import"./label-B61Mm8gW.js";import"./repository-picker-BcZZvjJw.js";import"./github-icon-DVLt0ntX.js";import"./collection-search-DhW2WLfL.js";import"./new-project-store-BL2Sa0gM.js";import"./legacy-admin-welcome-dialog-DPVEA9Z4.js";import"./drawer-D_TsrN48.js";import"./required-auth-layout-CRS7KXgy.js";import"./use-org-sso-B8YBjAU0.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function H(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return H(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=H(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function Qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function qe(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function Ge(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:R}=M;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const I=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=I?"default":"system",z=!I;let h;e[11]!==R||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:R,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=R,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ks(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Re("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,R]=E.useState(L),[D,I]=E.useState(!1),[w,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=r=>a.setQueryData(q.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const Q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>H(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(Q),X=`skills/${$}`;let W=!1;I(!0);try{if(await Ie(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=qe($,await U.text());j(le=>[A,...le]),h(A.id),await Qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),I(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(Q=>Q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(G,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:M,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Ee,{placement:"page",tabs:y,activeTab:u,onTabChange:R}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(G,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Ge,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Me,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ks as default};
|
|
1
|
+
import{b as ee,a6 as te,q as ne,r as E,j as t,B as G,n as F,e3 as ae,a7 as ce,aR as me,aQ as pe,aN as de,aL as ue,aM as ge,aP as fe,aO as he,bc as xe,t as C,dR as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as q,gK as Ce}from"./index-DoNyWviU.js";import{a as De}from"./SwitchHorizontal01-Cm_o4fjT.js";import{E as we}from"./agent-icon-DGqoh_mm.js";import{s as Ne}from"./Trash01-CSAJKZVH.js";import{i as Pe}from"./Upload01-iwKRXiXv.js";import{i as ie}from"./Zap-BFmLvXPu.js";import{S as Ae}from"./search-toggle-Dg9s7t2N.js";import{E as Y}from"./empty-state-DhjlG78q.js";import{C as Ee}from"./collection-tabs-BQ089vW9.js";import{S as Me,F as Oe}from"./folder-icon-Do8OZWNq.js";import{j as Te,k as Re,n as Ie}from"./use-org-fs-Bt2qEGZu.js";import{af as ze,R as Z,Z as $e}from"./chat-context-DFYcK8dr.js";import{c as _e}from"./context-shell-C7--PIOg.js";import"./AlertCircle-Cs1GY8F8.js";import"./UserCheck01-y0z0QSuq.js";import"./Tool01-DZ2cyFL-.js";import"./ArrowUp-BnkZAbrQ.js";import"./ArrowLeft-D4BHG2IU.js";import"./ArrowRight-2Yca8ob-.js";import"./BookOpen01-DLbroUgc.js";import"./Globe04-UxQocYqn.js";import"./CheckCircle-DnCMWruE.js";import"./ChevronDown-B0XmH64O.js";import"./ChevronSelectorVertical-BZ3zf3oP.js";import"./ChevronUp-Df8KdpUf.js";import"./UserSquare-BkYHs0MO.js";import"./LinkBroken01-DmINof4G.js";import"./CreditCard01-BmPljNra.js";import"./File02-6A2r8I0L.js";import"./MessageCircle01-BQQ1D-ue.js";import"./Eye-iFhnkrXx.js";import"./Fingerprint04-DXA794ID.js";import"./Image01-OM3XLdbd.js";import"./Key01-C0tI-Pm7.js";import"./LayoutLeft-BFbSxeSu.js";import"./Minus-Deliwjwp.js";import"./Monitor01-CcY27iZh.js";import"./Sun-C4Ucr11v.js";import"./Play-BZ0FsK6z.js";import"./Plus-BQ2NGHeJ.js";import"./SearchMd-DaBWtP1x.js";import"./ShoppingBag01-B-k2jEJK.js";import"./Users01-BHrdcphN.js";import"./XClose-BNLvtMZs.js";import"./icon-button-XUAdTHiK.js";import"./tooltip-aAZohpqH.js";import"./index-CKn5sRTY.js";import"./badge-ByQzdMC7.js";import"./markdown-BJ06ashm.js";import"./use-copy-CchaNgVJ.js";import"./use-mobile-BXMehGT-.js";import"./use-panel-navigate-Ck-jPDrJ.js";import"./thread-route-4MeucFTM.js";import"./use-project-scope-DwgoPCzQ.js";import"./repository-binding-Doos7Tz1.js";import"./use-mcp-client-YKRm-IfC.js";import"./auth-BTKMvodR.js";import"./task-board-6hCQ4fmc.js";import"./schema-DFjqe0nB.js";import"./file-preview-C2EECNq9.js";import"./utils-CVhZKcka.js";import"./editor-CV3Xk_AX.js";import"./file-type-icon-ByQiDqSp.js";import"./useInfiniteQuery-Df5MUdS4.js";import"./infiniteQueryObserver-BLuMJOAh.js";import"./use-view-draft-kind-BAcSweMS.js";import"./use-blog-view-I4eq1t_D.js";import"./use-organization-settings-BvHWSa_6.js";import"./thread-intent-kGrdf_bu.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-D8QQLbcn.js";import"./session-runtime-DKGwvqlm.js";import"./use-entitlements-DwVDTkM9.js";import"./use-ai-providers-CsKQ3_jX.js";import"./use-current-view-k2AK3Yej.js";import"./use-in-settings-BItIqEI3.js";import"./use-decopilot-events-CSLkN4DP.js";import"./require-capability-CjfIjpME.js";import"./access-gate-Bjcd3xRS.js";import"./capability-load-error-CfMyukOc.js";import"./sections-F8O-wP8k.js";import"./textarea-DXe9GpK8.js";import"./use-ask-in-chat-BgnG_ElA.js";import"./shell-layout-Ab8lA8KT.js";import"./use-deployment-admin-3jFXyFn6.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-FaAGxqT5.js";import"./command-vEYcGaeE.js";import"./index-B4VETtA8.js";import"./integration-icon-DbZelBci.js";import"./project-icon-Detiuajw.js";import"./use-navigate-to-agent-BL48iyFj.js";import"./use-debounced-value-D2pivH_j.js";import"./new-project-dialog-B-MW0XlT.js";import"./label-leSSTAo9.js";import"./repository-picker-Ch-iczcS.js";import"./github-icon-CE41Sk3J.js";import"./collection-search-D1eJjXvE.js";import"./new-project-store-CeCsm-UD.js";import"./legacy-admin-welcome-dialog-Byxlfldo.js";import"./drawer-zz476taV.js";import"./required-auth-layout-2q8xhcim.js";import"./use-org-sso-Bmfw_IlN.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function H(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return H(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=H(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function Qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function qe(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function Ge(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:R}=M;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const I=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=I?"default":"system",z=!I;let h;e[11]!==R||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:R,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=R,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ks(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Re("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,R]=E.useState(L),[D,I]=E.useState(!1),[w,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=r=>a.setQueryData(q.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const Q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>H(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(Q),X=`skills/${$}`;let W=!1;I(!0);try{if(await Ie(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=qe($,await U.text());j(le=>[A,...le]),h(A.id),await Qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),I(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(Q=>Q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(G,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:M,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Ee,{placement:"page",tabs:y,activeTab:u,onTabChange:R}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(G,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Ge,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Me,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ks as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,m as N,j}from"./index-
|
|
1
|
+
import{c as _,m as N,j}from"./index-DoNyWviU.js";import{T as k,R as z,a as D,b as S}from"./index-9GRaJYuB.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,eX as G}from"./index-
|
|
1
|
+
import{r as v,eX as G}from"./index-DoNyWviU.js";import{b as de,d as fe,e as U,f as ge,g as pe,h as be,i as ve,C as Y,j as he,K as y,k as me,l as xe,m as Ie,s as ye}from"./task-key-o7nPsnmG.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},Ke=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=G.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function Pe(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 G.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 _e(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:$,isOver:W,setNodeRef:z}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:K,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(z,K),S=!!T,P=S&&!R&&O(d)&&O(h),_=!w&&M,j=_&&P?oe:null,ie=P?j??(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,F=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}),X=Oe({disabled:!F,index:b,node:$,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:$,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:z,setDraggableNodeRef:K,transform:X??ie,transition:le()};function le(){if(X||ce&&p.current.newIndex===b)return Ee;if(!(_&&!ve(Z)||!u)&&(S||F))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],je=(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{Pe as S,q as a,B as r,je as s,_e as u,Ke as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A,a6 as B,r as v,j as e,n as x,hx as k,gZ as b,gl as y,gm as a,ig as D,B as u,I as g,aR as z,aQ as O,aN as R,aL as T,aP as F,aO as q,bc as M,E as C,t as c,c as U}from"./index-
|
|
1
|
+
import{b as A,a6 as B,r as v,j as e,n as x,hx as k,gZ as b,gl as y,gm as a,ig as D,B as u,I as g,aR as z,aQ as O,aN as R,aL as T,aP as F,aO as q,bc as M,E as C,t as c,c as U}from"./index-DoNyWviU.js";import{D as $}from"./domain-settings-DWbPi3VM.js";import{S as H}from"./switch-LZFOzceS.js";import{a as Q,b as Z,c as G,d as J}from"./use-org-sso-Bmfw_IlN.js";import{s as K}from"./Trash01-CSAJKZVH.js";import{R as V}from"./require-capability-CjfIjpME.js";import"./badge-ByQzdMC7.js";import"./select-bVc6DEFP.js";import"./index-BdQq_4o_.js";import"./index-CKn5sRTY.js";import"./ChevronDown-B0XmH64O.js";import"./ChevronUp-Df8KdpUf.js";import"./access-gate-Bjcd3xRS.js";import"./capability-load-error-CfMyukOc.js";function W(){const s=A(),{org:o}=B(),{data:h,isLoading:P}=Q(o.id,o.slug),f=Z(o.id,o.slug),S=G(o.id,o.slug),E=J(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[I,j]=v.useState(!1),m=h?.configured&&h.config,n=h?.config,N=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},_=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!m&&!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(m?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},w=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},L=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx($,{}),P?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[m&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx(H,{checked:n.enforced,onCheckedChange:L,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(u,{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(u,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(u,{variant:"outline",size:"sm",onClick:N,children:s("settings.orgSso.editConfigButton")})]})]})}),(!m||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&m?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(u,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(u,{onClick:_,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:I,onOpenChange:j,children:e.jsxs(O,{children:[e.jsx(R,{children:e.jsx(T,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(q,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(M,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function me(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(V,{capability:"org:manage",area:"security",children:e.jsx(W,{})}),s[0]=o):o=s[0],o}export{me as default};
|