decocms 4.12.0 → 4.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-ClgAhfOn.js → AlertCircle-CoC6NNi4.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-B862Up1l.js → ArrowUpRight-N57ebzBw.js} +1 -1
- package/dist/client/assets/{CheckCircle-D6Zd00g5.js → CheckCircle-kHQ2dQaQ.js} +1 -1
- package/dist/client/assets/{ChevronDown-CavzOb2e.js → ChevronDown-P5eS_rdB.js} +1 -1
- package/dist/client/assets/{ChevronRight-DgXTGSyd.js → ChevronRight-CTea8Vrz.js} +1 -1
- package/dist/client/assets/{ChevronUp-DWl02poJ.js → ChevronUp-BoULmO5v.js} +1 -1
- package/dist/client/assets/{DotsVertical-BXUN7i-s.js → DotsVertical-pUzhcHbw.js} +1 -1
- package/dist/client/assets/{Eye-BfxF3_NG.js → Eye-XrixTuLa.js} +1 -1
- package/dist/client/assets/{FilterLines-CHINsit0.js → FilterLines-JU5CW8t2.js} +1 -1
- package/dist/client/assets/{Globe01-7w14Dv0L.js → Globe01-DA12A_gX.js} +1 -1
- package/dist/client/assets/{Globe04-BmVvGcdk.js → Globe04-DNnzQTTy.js} +1 -1
- package/dist/client/assets/{HardDrive-C3esngx2.js → HardDrive-A9TGjU2B.js} +1 -1
- package/dist/client/assets/{Key01-D84zmw8T.js → Key01-C3y_5bqB.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BzG5LgFk.js → LayoutLeft-CuSrrdEU.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DwRUHK9K.js → LinkExternal01-Cwj3iuhi.js} +1 -1
- package/dist/client/assets/{Monitor01-D6j19kcU.js → Monitor01-Cb1N7DaM.js} +1 -1
- package/dist/client/assets/{Palette-DVeyHPSn.js → Palette-B_aebYLe.js} +1 -1
- package/dist/client/assets/{Play-DnC6BFen.js → Play-DDWMuBvQ.js} +1 -1
- package/dist/client/assets/{Plus-DE2oM9NP.js → Plus-CqV2jOMI.js} +1 -1
- package/dist/client/assets/{SearchLg-wiFmsHKn.js → SearchLg-Dvo924kw.js} +1 -1
- package/dist/client/assets/{SearchMd-3hwS3MeL.js → SearchMd-5ihP7yVQ.js} +1 -1
- package/dist/client/assets/{Settings02-D77UEQ2p.js → Settings02-iYAu_otv.js} +1 -1
- package/dist/client/assets/{Shield01-DGllkrSj.js → Shield01-BzDwMZxQ.js} +1 -1
- package/dist/client/assets/{Star01-tqRKmSvv.js → Star01-BkFl7Mhr.js} +1 -1
- package/dist/client/assets/{Stars01-BcSQPbwD.js → Stars01-D1UrqdL4.js} +1 -1
- package/dist/client/assets/{Stars02-C-4lNJ_k.js → Stars02-COayjfFf.js} +1 -1
- package/dist/client/assets/{Sun-CWsRADe_.js → Sun-Brrmn0Wt.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DcPy-VUg.js → SwitchHorizontal01-dqeKRNpy.js} +1 -1
- package/dist/client/assets/{Tool01-Cl2bl9JY.js → Tool01-BWmMjNUF.js} +1 -1
- package/dist/client/assets/{Trash01-D75-03uB.js → Trash01-66NrnGrm.js} +1 -1
- package/dist/client/assets/{Upload01-Z-VVijrs.js → Upload01-DZiCAA30.js} +1 -1
- package/dist/client/assets/{User01-BgkBgTes.js → User01-BU4AVwNl.js} +1 -1
- package/dist/client/assets/{Users01-Cmsl-eTQ.js → Users01-rcwVvUtr.js} +1 -1
- package/dist/client/assets/{Users03-DT08k8_1.js → Users03-DvCgevzn.js} +1 -1
- package/dist/client/assets/{X-BVAUYa_T.js → X-DBy4i4Lp.js} +1 -1
- package/dist/client/assets/{XCircle-QoSkb3Jx.js → XCircle-IJc8zbrl.js} +1 -1
- package/dist/client/assets/{XClose-CPn-2iye.js → XClose-CtyL8bYf.js} +1 -1
- package/dist/client/assets/{Zap-B36bkz1F.js → Zap-fhgO5dDS.js} +1 -1
- package/dist/client/assets/{ZapSquare-ogfO4bZI.js → ZapSquare-CfbyrH4x.js} +1 -1
- package/dist/client/assets/{ZoomOut-5HsDnkoy.js → ZoomOut-C0N4ehtv.js} +1 -1
- package/dist/client/assets/{access-gate-BRNjXWYe.js → access-gate-Cp9GeAB2.js} +1 -1
- package/dist/client/assets/{add-section-modal-BOqz-964.js → add-section-modal-L1hZYDnC.js} +1 -1
- package/dist/client/assets/{agent-icon-aNPmoaPd.js → agent-icon-CWPBFzIp.js} +1 -1
- package/dist/client/assets/{agents-list-B7j1GcyH.js → agents-list-BSN0z_rH.js} +1 -1
- package/dist/client/assets/{ai-providers-CYCuk9h-.js → ai-providers-DD1AOaea.js} +1 -1
- package/dist/client/assets/{alert-CuDjX_qg.js → alert-Ddy80ofE.js} +1 -1
- package/dist/client/assets/{alert-dialog-ac9d9PM5.js → alert-dialog-CNwxdflX.js} +1 -1
- package/dist/client/assets/{app-editor-0CPOfgpn.js → app-editor-2eTZe4V8.js} +1 -1
- package/dist/client/assets/{auth-CiRpWlv5.js → auth-DnBe9AUC.js} +1 -1
- package/dist/client/assets/{auth-catchall-DOctWB-A.js → auth-catchall-BX9JI1QT.js} +1 -1
- package/dist/client/assets/{auth-entry-Am18NSNg.js → auth-entry-BHvc520u.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CO3AbWz1.js → auth-split-layout-BXqARZ71.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C7yk75O_.js → authenticate-and-persist-oauth-u3Bd-L7u.js} +1 -1
- package/dist/client/assets/{automation-list-row-D2B_rh4A.js → automation-list-row-B4HURQxP.js} +1 -1
- package/dist/client/assets/{automation-runs-8_dybPHZ.js → automation-runs-CqWPoh43.js} +1 -1
- package/dist/client/assets/{automations-CeEWyIs5.js → automations-f7OFHAXD.js} +1 -1
- package/dist/client/assets/{avatar-BjKWRNVB.js → avatar-Dx8vsnte.js} +1 -1
- package/dist/client/assets/{badge-BJNy0wyL.js → badge-BzEWqz_j.js} +1 -1
- package/dist/client/assets/{block-document-Bq8rRDx4.js → block-document-DzMywRI1.js} +1 -1
- package/dist/client/assets/{brand-context-BIrrLjGn.js → brand-context-CyctFpS3.js} +1 -1
- package/dist/client/assets/{buckets-obXQMBpg.js → buckets-DNWd4v4G.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Cod4y6Ks.js → bulk-category-panel-Bj5wuN0i.js} +1 -1
- package/dist/client/assets/{capability-load-error-D8MHuUCF.js → capability-load-error-BehOb5ja.js} +1 -1
- package/dist/client/assets/{card-BmW79tCv.js → card-go8Ic7Q5.js} +1 -1
- package/dist/client/assets/{category-editor-BJepbxNv.js → category-editor-DApO1Yn8.js} +1 -1
- package/dist/client/assets/{chat-context-B5hrLcwj.js → chat-context-BvVy1XII.js} +1 -1
- package/dist/client/assets/{checkbox-Kg4LLU9D.js → checkbox-D_sfTX5R.js} +1 -1
- package/dist/client/assets/{cli-auth-success-gObPiJa8.js → cli-auth-success-PaSH5Vkc.js} +1 -1
- package/dist/client/assets/{collection-detail-B0-T4ILL.js → collection-detail-BJ1XKRbv.js} +1 -1
- package/dist/client/assets/{collection-display-button-BvXYTAAP.js → collection-display-button-gz2ZuERS.js} +1 -1
- package/dist/client/assets/{collection-search-DwhBerSk.js → collection-search-C001GdqX.js} +1 -1
- package/dist/client/assets/{collection-tabs-BQDCpcYC.js → collection-tabs-B_vVgFOt.js} +1 -1
- package/dist/client/assets/{command-SyxeX2nl.js → command-B1GcRSWc.js} +1 -1
- package/dist/client/assets/commerce-onboarding-DB5OC1v0.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-DlP4AIXL.js → connect-desktop-dialog-DKo4CQJQ.js} +1 -1
- package/dist/client/assets/{connection-card-C4oOxnQb.js → connection-card-Bx0N6sI4.js} +1 -1
- package/dist/client/assets/{connection-detail-DBJW-Pxx.js → connection-detail-Bbou6ZUd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-FkUfzqP1.js → connection-form-helpers-B8AytMOg.js} +1 -1
- package/dist/client/assets/{connections-CM5IOfmS.js → connections-C-x_DlaR.js} +1 -1
- package/dist/client/assets/{context-menu-NrhGe5Oj.js → context-menu-DKP9RpkZ.js} +1 -1
- package/dist/client/assets/{decopilot-Cj_SKATh.js → decopilot-DdwBW5Gf.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Bxsm1x-g.js → decopilot-sse-pool-DCzhBR7p.js} +1 -1
- package/dist/client/assets/{dialog-DsOssLqX.js → dialog-DBpjZOCu.js} +1 -1
- package/dist/client/assets/{domain-settings-Dkt1DWnP.js → domain-settings-BknARBcV.js} +1 -1
- package/dist/client/assets/{drawer-AyckCMmd.js → drawer-DPby2hn2.js} +1 -1
- package/dist/client/assets/{dropdown-menu-wQ-uELKw.js → dropdown-menu-EKQ6fenT.js} +1 -1
- package/dist/client/assets/{empty-state-CNU5O4hk.js → empty-state-YIcxVemW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-wL-0uC4r.js → extract-connection-data-CPBy2fVV.js} +1 -1
- package/dist/client/assets/{file-explorer-BEoaplFh.js → file-explorer-B8ZjgRCr.js} +1 -1
- package/dist/client/assets/{file-type-icon-B0qdUvEN.js → file-type-icon-BoZkRxIi.js} +1 -1
- package/dist/client/assets/{files-dNTrWuZj.js → files-D-C7vNw1.js} +1 -1
- package/dist/client/assets/{form-BHvZi-GZ.js → form-x1EJEVpQ.js} +1 -1
- package/dist/client/assets/{general-Dp9n9ALL.js → general-DQG7TPkY.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B2FKQ_5-.js → github-repo-picker-DBhdsm3x.js} +1 -1
- package/dist/client/assets/{hooks-5_uPY02P.js → hooks-DnXDFfXX.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CtmOo7gy.js → import-from-deco-dialog-CQrNEd18.js} +1 -1
- package/dist/client/assets/{index-B3Ofs7GR.js → index-1C_mGQYK.js} +1 -1
- package/dist/client/assets/{index-18VPlu9_.js → index-8q5cTvfk.js} +14 -14
- package/dist/client/assets/{index-D0eNritY.js → index-BTv_6po3.js} +1 -1
- package/dist/client/assets/{index-DPOBsX9s.js → index-BZyixu4W.js} +1 -1
- package/dist/client/assets/{index-laMg9IJJ.js → index-CNk0u5Ob.js} +1 -1
- package/dist/client/assets/{index-C74-7rC_.js → index-ChoCV5RI.js} +3 -3
- package/dist/client/assets/{index-BkMvO6br.js → index-Cv5o-Jym.js} +1 -1
- package/dist/client/assets/{index-5GIHeL-g.js → index-D2U9e4pq.js} +1 -1
- package/dist/client/assets/{index-GxYhZPOH.js → index-DFKc4d3N.js} +1 -1
- package/dist/client/assets/{index-BihoOK2W.js → index-DWzP3fZX.js} +1 -1
- package/dist/client/assets/{index-CIxzNHgu.js → index-DjKzm_7S.js} +1 -1
- package/dist/client/assets/{index-BD6No7__.js → index-DweVBJpV.js} +1 -1
- package/dist/client/assets/{index-BP3Art5K.js → index-iKSYi9v5.js} +1 -1
- package/dist/client/assets/{index-redirect-qJTq73AQ.js → index-redirect-C4UtODiM.js} +1 -1
- package/dist/client/assets/{index-Dj_tbWDC.js → index-t5khoU6y.js} +1 -1
- package/dist/client/assets/{input-ClQQvwn8.js → input-BWamIMbN.js} +1 -1
- package/dist/client/assets/{integration-icon-CXTBoi-C.js → integration-icon-EdsPubVt.js} +1 -1
- package/dist/client/assets/{label-DtyPJXbW.js → label-BZcMuJ0q.js} +1 -1
- package/dist/client/assets/{login-DpEp4bzD.js → login-avUjz7eB.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BZR_sfsi.js → mcp-oauth-DCCT0QwD.js} +1 -1
- package/dist/client/assets/{members-Da-N4F4w.js → members-CdekeDqO.js} +1 -1
- package/dist/client/assets/{monaco-editor-C0-ORVvv.js → monaco-editor-B3SQ_IFm.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DaKaZFWH.js → monitoring-stats-row-CZoNTUjo.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1VskdWn.js → oauth-callback-BKoLh3YW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DJ_dLXG7.js → oauth-callback-ai-provider-tPz-_25R.js} +1 -1
- package/dist/client/assets/{onboarding-CUBIxT9d.js → onboarding-DTsyZZax.js} +1 -1
- package/dist/client/assets/{org-install-Badols3M.js → org-install-CCP2NMYy.js} +1 -1
- package/dist/client/assets/{org-layout-UVOciCax.js → org-layout-CSn0d-8X.js} +1 -1
- package/dist/client/assets/{organization-choice-BzwxXw2g.js → organization-choice-CvQmoyRd.js} +1 -1
- package/dist/client/assets/{page-seo-form-C_2RUxxC.js → page-seo-form-f84r-XPs.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BtqV4Z8p.js +1 -0
- package/dist/client/assets/{popover-DESq8MlY.js → popover-CUdzevRE.js} +1 -1
- package/dist/client/assets/{post-editor-C6yPagcF.js → post-editor-MWqisYd8.js} +1 -1
- package/dist/client/assets/{primitives-BDfut_pc.js → primitives-BzNkeic7.js} +1 -1
- package/dist/client/assets/{profile-D5pYQlzN.js → profile-Cvi05jzq.js} +1 -1
- package/dist/client/assets/project-app-view-Cwvch2dA.js +1 -0
- package/dist/client/assets/record-editor-BIJZRDg_.js +1 -0
- package/dist/client/assets/registry-CrX03JF2.js +2 -0
- package/dist/client/assets/{registry-layout-ewdPobS9.js → registry-layout-CZIha2cO.js} +1 -1
- package/dist/client/assets/{require-capability-b5F_i--f.js → require-capability-Dr8mj9VJ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-FfHfv0VI.js → required-auth-layout-CS_iMldS.js} +1 -1
- package/dist/client/assets/{reset-password-_ID0Jmb1.js → reset-password-DxhV1tKz.js} +1 -1
- package/dist/client/assets/{roles-D4aPzPCN.js → roles-BKAYDZzp.js} +1 -1
- package/dist/client/assets/{scroll-area-Dt0A9lzL.js → scroll-area-C-3TY2YE.js} +1 -1
- package/dist/client/assets/{search-input-mkU8caHs.js → search-input-BKD3oaXK.js} +1 -1
- package/dist/client/assets/{secrets-DZHFxUYN.js → secrets-DZxFwhRj.js} +1 -1
- package/dist/client/assets/{sections-editor-BhbIeS6T.js → sections-editor-Hww0_uGb.js} +1 -1
- package/dist/client/assets/{select-CFMmW9o-.js → select-C-6PWfXp.js} +1 -1
- package/dist/client/assets/{select-model-oC-ZbdSY.js → select-model-DGiOgK0q.js} +1 -1
- package/dist/client/assets/{seo-editor-Cu1RCBm-.js → seo-editor-BThpvCjT.js} +1 -1
- package/dist/client/assets/{settings-layout-iHEQZNRo.js → settings-layout-CwGAAGlU.js} +1 -1
- package/dist/client/assets/{settings-section-CCA_rQPu.js → settings-section-CSq9f2ez.js} +1 -1
- package/dist/client/assets/{sheet-DpVVe07a.js → sheet-B7Lez_S9.js} +1 -1
- package/dist/client/assets/{shell-controls-0GymUxsw.js → shell-controls-u_iHFGU5.js} +1 -1
- package/dist/client/assets/{shell-layout-B6CDg-cg.js → shell-layout-DG441JjL.js} +1 -1
- package/dist/client/assets/{shell-route-loading-Dfj-cl4w.js → shell-route-loading-BpdXUJEZ.js} +1 -1
- package/dist/client/assets/{sidebar-DUnL0V4N.js → sidebar-BXZd-GVd.js} +1 -1
- package/dist/client/assets/{skeleton-Biz6Vvdi.js → skeleton-CgP3V6Ja.js} +1 -1
- package/dist/client/assets/{sortable.esm-4-bXuIBY.js → sortable.esm-D9jMeHV1.js} +1 -1
- package/dist/client/assets/{sso-C3HkmRoG.js → sso-Co77Yyyt.js} +1 -1
- package/dist/client/assets/{store-DY5TOVQx.js → store-CmSf-e73.js} +1 -1
- package/dist/client/assets/store-registry-CWYXcSAH.js +2 -0
- package/dist/client/assets/{studio-tools-BnbQl4Xy.js → studio-tools-C9NKrR5C.js} +1 -1
- package/dist/client/assets/{switch-dyBEm-xz.js → switch-Cu2RC5pZ.js} +1 -1
- package/dist/client/assets/{table-DAb40UnL.js → table-DW50z9UL.js} +1 -1
- package/dist/client/assets/{tabs-Y-yEKkZ4.js → tabs-T8F8VZUh.js} +1 -1
- package/dist/client/assets/{task-status-CmHRRegX.js → task-status-DEWrBULH.js} +1 -1
- package/dist/client/assets/{textarea-CZ6lZT55.js → textarea-BK_9gLq0.js} +1 -1
- package/dist/client/assets/{toggle-group-BDe3fVGm.js → toggle-group-e24ylmWs.js} +1 -1
- package/dist/client/assets/{toolbar-DcLfNsL6.js → toolbar-BhxpIEsu.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BK4dVDIq.js → toolbar-icon-button-B27j_4W9.js} +1 -1
- package/dist/client/assets/{tools-list-5V41Fj5o.js → tools-list-DIWh8Oky.js} +1 -1
- package/dist/client/assets/{tooltip-BETVAZty.js → tooltip-D0ODOH5L.js} +1 -1
- package/dist/client/assets/{types-CbtfOW36.js → types-BOo0uLec.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BC-Unv9B.js → use-ai-providers-DjRW0TN5.js} +1 -1
- package/dist/client/assets/{use-automations-DM4xNubt.js → use-automations-CS_Nu0ry.js} +1 -1
- package/dist/client/assets/{use-capability-Buq2jVbm.js → use-capability-DbvoEB-N.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CVyOhRb1.js → use-clock-tick-DicB8A5f.js} +1 -1
- package/dist/client/assets/{use-collections-DJbkAyuY.js → use-collections-CRpuCmSx.js} +1 -1
- package/dist/client/assets/{use-connection-C7H28tUm.js → use-connection-homG8xHs.js} +1 -1
- package/dist/client/assets/{use-copy-DwhmZgzz.js → use-copy-Dq7f5A4R.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DIJXVLDA.js → use-create-virtual-mcp-CMc5HT0P.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-xRcrGDGN.js → use-debounced-autosave-DTd4mDNn.js} +1 -1
- package/dist/client/assets/{use-debounced-value-dGP0T3Z6.js → use-debounced-value-hi69DHr0.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-ZViPJ0gD.js → use-decopilot-events-2XegsErL.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B1HsoB0C.js → use-delete-connection-CP-e1UsZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-BqeK5-ZL.js → use-file-configs-BM_cxwPW.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DKD-IrVC.js → use-infinite-scroll-Cj4qMXbT.js} +1 -1
- package/dist/client/assets/{use-join-requests-D02lKKeN.js → use-join-requests-DGz2R0VR.js} +1 -1
- package/dist/client/assets/{use-mcp-client-A_C0OXe_.js → use-mcp-client-C9rZ5q5t.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BdtnL2tp.js → use-mcp-prompts-Bpm2lRaW.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D5KEYf26.js → use-mcp-tools-BP-8Q6Ct.js} +1 -1
- package/dist/client/assets/{use-members-S8u6cgH3.js → use-members-C6DHv6rG.js} +1 -1
- package/dist/client/assets/{use-mobile-DB_HbZdV.js → use-mobile-BzlsCeN5.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cpj0q3sa.js → use-navigate-to-agent-B4oyUjLa.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-1ug5pqiq.js → use-org-auth-client-BqLuGuER.js} +1 -1
- package/dist/client/assets/{use-org-fs-B8S0kCYo.js → use-org-fs-wGkM6ZHK.js} +1 -1
- package/dist/client/assets/{use-org-sso-CTXVLokg.js → use-org-sso-DNIk-jwi.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BG3L6PMl.js → use-organization-roles-CE_g_E6L.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D13sMxOQ.js → use-organization-settings-DmBEnT-y.js} +1 -1
- package/dist/client/assets/{use-registry-connections-PtpSZeVH.js → use-registry-connections-DLscAznw.js} +1 -1
- package/dist/client/assets/{use-secrets-5DqxCpWf.js → use-secrets-C8LfdaIH.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C-U8Pnl-.js → use-status-sounds-B-cyYEUC.js} +1 -1
- package/dist/client/assets/{use-view-mode-B1BnO7yA.js → use-view-mode-DKBazBz2.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-De67qc1-.js → use-virtual-mcp-E-pwiiFM.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DRJEgKeg.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BYH-CQed.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BrkAIOFb.js → useSuspenseQueries-CV-fvbQG.js} +1 -1
- package/dist/client/assets/{variant-calendar-CGx_HG0U.js → variant-calendar-ByJrzabj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-az73HV8a.js → view-mode-toggle-qIYOoB-v.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/commerce-onboarding-DGsLAJMy.js +0 -1
- package/dist/client/assets/page-seo-sheet-fhZUZgqS.js +0 -1
- package/dist/client/assets/project-app-view-DngS6f9y.js +0 -1
- package/dist/client/assets/record-editor-BkB44FqU.js +0 -1
- package/dist/client/assets/registry-oa3OK8EB.js +0 -2
- package/dist/client/assets/store-registry-o7Mh0_Kv.js +0 -2
- package/dist/client/assets/useInfiniteQuery-WHDQHpmx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CFE7ta84.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as M,c as D,o as wc,n as fh,p as hh,j as p,B as or,s as Dl,bM as Cc,bN as ph,al as mh,af as en,bO as gh,l as X,v as yh,a2 as xh,U as Pt,ai as bh,V as Mt,Y as br,Z as un,bP as Tc,X as Nc,D as Lt,m as kh,d as Sh,K as Wt,t as Hi,k as Mo,b as Pn,E as vh,ac as Mc,bQ as Eo,ah as wh,bR as Ht}from"./index-C74-7rC_.js";import{e as Ch,L as Th,I as Nh,as as Mh,a0 as Eh,a8 as Ah,a7 as Oh,ap as Ec,at as Ih,au as Rh,A as Ac,av as tt,aw as jh,ax as Dh,ay as Ph,h as Lh}from"./agent-icon-aNPmoaPd.js";import{t as Bs}from"./Stars01-BcSQPbwD.js";import{i as Oc,t as _h,d as Ic,b as Mr}from"./XCircle-QoSkb3Jx.js";import{i as Ao}from"./ChevronUp-DWl02poJ.js";import{i as Pl}from"./ChevronRight-DgXTGSyd.js";import{a as Rc,s as $h}from"./Eye-BfxF3_NG.js";import{a as Rt,t as Oo,u as jc,c as Ll}from"./use-clock-tick-CVyOhRb1.js";import{u as Dc}from"./use-copy-DwhmZgzz.js";import{a as tn,b as nn,T as rn}from"./tooltip-BETVAZty.js";import{M as Io,I as Pc,F as zh}from"./file-type-icon-B0qdUvEN.js";import{c as Bh}from"./content-blocks-o63cs2vh.js";import{g as Lc,M as Fh}from"./types-CbtfOW36.js";import{S as Hh,j as Ln,m as Vh,c as Ro,a as Wh,u as Uh}from"./chat-context-B5hrLcwj.js";import{c as qh,r as Kh,R as Jh}from"./hooks-5_uPY02P.js";import{u as Gh}from"./studio-tools-BnbQl4Xy.js";import{f as Xh,l as Yh,m as Qh}from"./tab-id-AX1D_RMI.js";import{e as Zh,u as _c,l as ep}from"./use-mcp-client-A_C0OXe_.js";import{i as $c}from"./AlertCircle-ClgAhfOn.js";import{s as Kr,t as zc}from"./Star01-tqRKmSvv.js";import{s as tp}from"./XClose-CPn-2iye.js";import{n as Vi}from"./ZapSquare-ogfO4bZI.js";import{n as Bc,i as np}from"./Globe01-7w14Dv0L.js";import{c as rp,b as sp,a as Er}from"./Tool01-Cl2bl9JY.js";import{i as _l,a as ip}from"./ZoomOut-5HsDnkoy.js";import{i as Jn}from"./Monitor01-D6j19kcU.js";import{i as op}from"./SearchMd-3hwS3MeL.js";import{i as lp}from"./Upload01-Z-VVijrs.js";import{b as ap,c as cp}from"./shell-layout-B6CDg-cg.js";import{n as Fc}from"./LinkExternal01-DwRUHK9K.js";import{b as up,S as dp,c as fp,d as hp}from"./sheet-DpVVe07a.js";import{I as kr}from"./integration-icon-CXTBoi-C.js";import{a as pp}from"./use-virtual-mcp-De67qc1-.js";import{i as mp}from"./ArrowUpRight-B862Up1l.js";import{a as jo}from"./Users03-DT08k8_1.js";import{a as nt}from"./Palette-DVeyHPSn.js";import{k as Hc}from"./use-navigate-to-agent-Cpj0q3sa.js";import{a as gp}from"./use-connection-C7H28tUm.js";import{a as yp}from"./Stars02-C-4lNJ_k.js";import{g as xp}from"./use-mcp-prompts-BdtnL2tp.js";import{a as bp,c as kp,D as Sp,d as vp,e as wp}from"./dialog-DsOssLqX.js";import{a as Cp,F as Tp,b as Np,c as Mp,d as Ep,e as Ap}from"./form-BHvZi-GZ.js";import{I as Op}from"./input-ClQQvwn8.js";import{t as Ip}from"./ChevronDown-CavzOb2e.js";import{e as Rp}from"./select-CFMmW9o-.js";const jp={openrouter:n=>{const e=n?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Vc(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(jp)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function Wc(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Uc(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+Vc(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function C2(n){return n.reduce((e,t)=>Uc(e,t.metadata?.usage),Wc())}const Dp={damping:.7,stiffness:.05,mass:1.25},Pp=70,Lp=1e3/60,_p=350;let Fs=!1;globalThis.document?.addEventListener("mousedown",()=>{Fs=!0});globalThis.document?.addEventListener("mouseup",()=>{Fs=!1});globalThis.document?.addEventListener("click",()=>{Fs=!1});const $p=(n={})=>{const[e,t]=M.useState(!1),[r,s]=M.useState(n.initial!==!1),[i,o]=M.useState(!1),l=M.useRef(null);l.current=n;const a=M.useCallback(()=>{if(!Fs)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(y.current)||y.current?.contains(k.commonAncestorContainer)},[]),c=M.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=M.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=M.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return y.current?.scrollTop??0},set scrollTop(k){if(y.current){const{scrollBehavior:v}=getComputedStyle(y.current);v!=="auto"&&(y.current.style.scrollBehavior="auto"),y.current.scrollTop=k,d.ignoreScrollToTop=y.current.scrollTop,v!=="auto"&&(y.current.style.scrollBehavior=v)}},get targetScrollTop(){return!y.current||!x.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!x.current)return 0;const{targetScrollTop:k}=this;if(!n.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const v=Math.max(Math.min(n.targetScrollTop(k,{scrollElement:y.current,contentElement:x.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:v},requestAnimationFrame(()=>{b=void 0}),v},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Pp}}},[]),f=M.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const k=Date.now()+(Number(b.wait)||0),v=di(l.current,b.animation),{ignoreEscapes:S=!1}=b;let w,C=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{w=Date.now()}):w=k+(b.duration??0);const T=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:E}=d,j=performance.now(),L=(j-(d.lastTick??j))/Lp;if(d.animation||(d.animation={behavior:v,promise:N,ignoreEscapes:S}),d.animation.behavior===v&&(d.lastTick=j),a()||k>Date.now())return T();if(E<Math.min(C,d.calculatedTargetScrollTop)){if(d.animation?.behavior===v){if(v==="instant")return d.scrollTop=d.calculatedTargetScrollTop,T();d.velocity=(v.damping*d.velocity+v.stiffness*d.scrollDifference)/v.mass,d.accumulated+=d.velocity*L,d.scrollTop+=d.accumulated,d.scrollTop!==E&&(d.accumulated=0)}return T()}return w>Date.now()?(C=d.calculatedTargetScrollTop,T()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:di(l.current,l.current.resize),ignoreEscapes:S,duration:Math.max(0,w-Date.now())||void 0}):d.isAtBottom)});return N.then(E=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),E))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===v?d.animation.promise:T()},[c,a,d]),h=M.useCallback(()=>{u(!0),c(!1)},[u,c]),m=M.useCallback(({target:b})=>{if(b!==y.current)return;const{scrollTop:k,ignoreScrollToTop:v}=d;let{lastScrollTop:S=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,v&&v>k&&(S=v),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===v)return;if(a()){u(!0),c(!1);return}const w=k>S,C=k<S;if(d.animation?.ignoreEscapes){d.scrollTop=S;return}C&&(u(!0),c(!1)),w&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,a,d]),g=M.useCallback(({target:b,deltaY:k})=>{let v=b;for(;!["scroll","auto"].includes(getComputedStyle(v).overflow);){if(!v.parentElement)return;v=v.parentElement}v===y.current&&k<0&&y.current.scrollHeight>y.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),y=$l(b=>{y.current?.removeEventListener("scroll",m),y.current?.removeEventListener("wheel",g),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",g,{passive:!0})},[]),x=$l(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([v])=>{const{height:S}=v.contentRect,w=S-(k??S);if(d.resizeDifference=w,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),w>=0){const C=di(l.current,k?l.current.resize:l.current.initial);f({animation:C,wait:!0,preserveScrollPosition:!0,duration:C==="instant"?void 0:_p})}else d.isNearBottom&&(u(!1),c(!0));k=S,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===w&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:x,scrollRef:y,scrollToBottom:f,stopScroll:h,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:d}};function $l(n,e){const t=M.useCallback(r=>(t.current=r,n(r)),e);return t}const ui=new Map;function di(...n){const e={...Dp};let t=!1;for(const s of n){if(s==="instant"){t=!0;continue}typeof s=="object"&&(t=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return ui.has(r)||ui.set(r,Object.freeze(e)),t?"instant":ui.get(r)}function zp(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Do(n){if(n&&typeof n=="object"&&"gatewayClientId"in n&&typeof n.gatewayClientId=="string")return n.gatewayClientId}function Po(n,e){if(!e)return n;const t=`${zp(e)}_`;return n.startsWith(t)?n.slice(t.length):n}function Bp(n,e){return Po(n,e).replace(/[_-]/g," ").toLowerCase()}function Fp(n){const e={};for(const t of n.arguments??[])e[t.name]=t.required?Dl().min(1,"Required"):Dl();return wc(e)}function Hp(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function Vp(n){const e=D.c(66),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=M.useId();let l;if(e[0]!==t){const $=t?Fp(t):wc({});l=fh($),e[0]=t,e[1]=l}else l=e[1];const c=l;let u;e[2]!==i||e[3]!==t?(u=t?Hp(t,i):{},e[2]=i,e[3]=t,e[4]=u):u=e[4];let d;e[5]!==c||e[6]!==u?(d={resolver:c,defaultValues:u,mode:"onChange"},e[5]=c,e[6]=u,e[7]=d):d=e[7];const f=hh(d);let h;e[8]!==t?.arguments?(h=t?.arguments??[],e[8]=t?.arguments,e[9]=h):h=e[9];const m=h;let g;e[10]!==f||e[11]!==s||e[12]!==r?(g=async $=>{await s($),r(null),f.reset()},e[10]=f,e[11]=s,e[12]=r,e[13]=g):g=e[13];const y=g;let x;e[14]!==f||e[15]!==r?(x=$=>{$||(f.reset(),r(null))},e[14]=f,e[15]=r,e[16]=x):x=e[16];const b=x;if(!t)return null;let k;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(k=t.title||Bp(t.name,Do(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=k):k=e[20];let v;e[21]!==k?(v=p.jsx(bp,{children:p.jsx("span",{className:"capitalize",children:k})}),e[21]=k,e[22]=v):v=e[22];let S;e[23]!==t.description?(S=t.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=S):S=e[24];let w;e[25]!==S||e[26]!==v?(w=p.jsxs(kp,{children:[v,S]}),e[25]=S,e[26]=v,e[27]=w):w=e[27];let C;e[28]!==f||e[29]!==y?(C=$=>{$.stopPropagation(),f.handleSubmit(y)($)},e[28]=f,e[29]=y,e[30]=C):C=e[30];let T;if(e[31]!==m||e[32]!==f.control||e[33]!==f.formState.isSubmitting){let $;e[35]!==f.control||e[36]!==f.formState.isSubmitting?($=F=>p.jsx(Tp,{control:f.control,name:F.name,render:G=>{const{field:Q}=G;return p.jsxs(Np,{children:[p.jsxs(Mp,{className:"text-xs",children:[F.name,F.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),p.jsx(Ep,{children:p.jsx(Op,{...Q,value:Q.value??"",required:F.required,placeholder:F.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(Ap,{})]})}},F.name),e[35]=f.control,e[36]=f.formState.isSubmitting,e[37]=$):$=e[37],T=m.map($),e[31]=m,e[32]=f.control,e[33]=f.formState.isSubmitting,e[34]=T}else T=e[34];let N;e[38]!==b?(N=()=>b(!1),e[38]=b,e[39]=N):N=e[39];let E;e[40]!==f.formState.isSubmitting||e[41]!==N?(E=p.jsx(or,{type:"button",variant:"ghost",onClick:N,disabled:f.formState.isSubmitting,children:"Cancel"}),e[40]=f.formState.isSubmitting,e[41]=N,e[42]=E):E=e[42];let j;e[43]!==f.formState.isSubmitting?(j=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(Hh,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=f.formState.isSubmitting,e[44]=j):j=e[44];let L;e[45]!==f.formState.isSubmitting||e[46]!==o||e[47]!==j?(L=p.jsx(or,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:j}),e[45]=f.formState.isSubmitting,e[46]=o,e[47]=j,e[48]=L):L=e[48];let I;e[49]!==E||e[50]!==L?(I=p.jsxs(Sp,{children:[E,L]}),e[49]=E,e[50]=L,e[51]=I):I=e[51];let P;e[52]!==o||e[53]!==C||e[54]!==T||e[55]!==I?(P=p.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:C,children:[T,I]}),e[52]=o,e[53]=C,e[54]=T,e[55]=I,e[56]=P):P=e[56];let R;e[57]!==f||e[58]!==P?(R=p.jsx(Cp,{...f,children:P}),e[57]=f,e[58]=P,e[59]=R):R=e[59];let z;e[60]!==w||e[61]!==R?(z=p.jsxs(vp,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[w,R]}),e[60]=w,e[61]=R,e[62]=z):z=e[62];let B;return e[63]!==b||e[64]!==z?(B=p.jsx(wp,{open:!0,onOpenChange:b,children:z}),e[63]=b,e[64]=z,e[65]=B):B=e[65],B}function qc(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function Ye(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function _n(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function xe(n){this.content=n}xe.prototype={constructor:xe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new xe(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new xe(t)},addToStart:function(n,e){return new xe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new xe(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new xe(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=xe.from(n),n.size?new xe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=xe.from(n),n.size?new xe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=xe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};xe.from=function(n){if(n instanceof xe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new xe(e)};function Kc(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Kc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Jc(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Jc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class A{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new A(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new A(r,s)}cutByIndex(e,t){return e==t?A.empty:e==0&&t==this.content.length?this:new A(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new A(s,i)}addToStart(e){return new A([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new A(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Kc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Jc(this,e,t,r)}findIndex(e){if(e==0)return Ar(0,e);if(e==this.size)return Ar(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ar(t+1,i):Ar(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return A.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new A(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return A.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new A(t||e,r)}static from(e){if(!e)return A.empty;if(e instanceof A)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new A([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}A.empty=new A([],0);const fi={index:0,offset:0};function Ar(n,e){return fi.index=n,fi.offset=e,fi}function Jr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Jr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Jr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ee=class Wi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Jr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Wi.none;if(e instanceof Wi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};ee.none=[];class Gr extends Error{}class _{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Xc(this.content,e+this.openStart,t);return r&&new _(r,this.openStart,this.openEnd)}removeBetween(e,t){return new _(Gc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return _.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new _(A.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new _(e,r,s)}}_.empty=new _(A.empty,0,0);function Gc(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Gc(i.content,e-s-1,t-s-1)))}function Xc(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Xc(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Wp(n,e,t){if(t.openStart>n.depth)throw new Gr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Gr("Inconsistent open depths");return Yc(n,e,t,0)}function Yc(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Yc(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Xt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Up(t,n);return Xt(i,Zc(n,o,l,e,r))}else return Xt(i,Xr(n,e,r))}function Qc(n,e){if(!e.type.compatibleContent(n.type))throw new Gr("Cannot join "+e.type.name+" onto "+n.type.name)}function Ui(n,e,t){let r=n.node(t);return Qc(r,e.node(t)),r}function Gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Gn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Gt(e.nodeBefore,r)}function Xt(n,e){return n.type.checkContent(e),n.copy(e)}function Zc(n,e,t,r,s){let i=n.depth>s&&Ui(n,e,s+1),o=r.depth>s&&Ui(t,r,s+1),l=[];return Gn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Qc(i,o),Gt(Xt(i,Zc(n,e,t,r,s+1)),l)):(i&&Gt(Xt(i,Xr(n,e,s+1)),l),Gn(e,t,s,l),o&&Gt(Xt(o,Xr(t,r,s+1)),l)),Gn(r,null,s,l),new A(l)}function Xr(n,e,t){let r=[];if(Gn(null,n,t,r),n.depth>t){let s=Ui(n,e,t+1);Gt(Xt(s,Xr(n,e,t+1)),r)}return Gn(e,null,t,r),new A(r)}function Up(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(A.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class lr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ee.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Yr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new lr(t,r,i)}static resolveCached(e,t){let r=zl.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else zl.set(e,r=new qp);let s=r.elts[r.i]=lr.resolve(e,t);return r.i=(r.i+1)%Kp,s}}class qp{constructor(){this.elts=[],this.i=0}}const Kp=12,zl=new WeakMap;class Yr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Jp=Object.create(null);class Xe{constructor(e,t,r,s=ee.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Jr(this.attrs,t||e.defaultAttrs||Jp)&&ee.sameSet(this.marks,r||ee.none)}copy(e=null){return e==this.content?this:new Xe(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xe(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return _.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new _(c,s.depth-o,i.depth-o)}replace(e,t,r){return Wp(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return lr.resolveCached(this,e)}resolveNoCache(e){return lr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),eu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=A.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ee.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ee.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Xe.prototype.text=void 0;class Qr extends Xe{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):eu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Qr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Qr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function eu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class sn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Gp(e,t);if(r.next==null)return sn.empty;let s=tu(r);r.next&&r.err("Unexpected trailing text");let i=nm(tm(s));return rm(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return A.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
1
|
+
import{r as M,c as D,o as wc,n as fh,p as hh,j as p,B as or,s as Dl,bM as Cc,bN as ph,al as mh,af as en,bO as gh,l as X,v as yh,a2 as xh,U as Pt,ai as bh,V as Mt,Y as br,Z as un,bP as Tc,X as Nc,D as Lt,m as kh,d as Sh,K as Wt,t as Hi,k as Mo,b as Pn,E as vh,ac as Mc,bQ as Eo,ah as wh,bR as Ht}from"./index-ChoCV5RI.js";import{e as Ch,L as Th,I as Nh,as as Mh,a0 as Eh,a8 as Ah,a7 as Oh,ap as Ec,at as Ih,au as Rh,A as Ac,av as tt,aw as jh,ax as Dh,ay as Ph,h as Lh}from"./agent-icon-CWPBFzIp.js";import{t as Bs}from"./Stars01-D1UrqdL4.js";import{i as Oc,t as _h,d as Ic,b as Mr}from"./XCircle-IJc8zbrl.js";import{i as Ao}from"./ChevronUp-BoULmO5v.js";import{i as Pl}from"./ChevronRight-CTea8Vrz.js";import{a as Rc,s as $h}from"./Eye-XrixTuLa.js";import{a as Rt,t as Oo,u as jc,c as Ll}from"./use-clock-tick-DicB8A5f.js";import{u as Dc}from"./use-copy-Dq7f5A4R.js";import{a as tn,b as nn,T as rn}from"./tooltip-D0ODOH5L.js";import{M as Io,I as Pc,F as zh}from"./file-type-icon-BoZkRxIi.js";import{c as Bh}from"./content-blocks-o63cs2vh.js";import{g as Lc,M as Fh}from"./types-BOo0uLec.js";import{S as Hh,j as Ln,m as Vh,c as Ro,a as Wh,u as Uh}from"./chat-context-BvVy1XII.js";import{c as qh,r as Kh,R as Jh}from"./hooks-DnXDFfXX.js";import{u as Gh}from"./studio-tools-C9NKrR5C.js";import{f as Xh,l as Yh,m as Qh}from"./tab-id-AX1D_RMI.js";import{e as Zh,u as _c,l as ep}from"./use-mcp-client-C9rZ5q5t.js";import{i as $c}from"./AlertCircle-CoC6NNi4.js";import{s as Kr,t as zc}from"./Star01-BkFl7Mhr.js";import{s as tp}from"./XClose-CtyL8bYf.js";import{n as Vi}from"./ZapSquare-CfbyrH4x.js";import{n as Bc,i as np}from"./Globe01-DA12A_gX.js";import{c as rp,b as sp,a as Er}from"./Tool01-BWmMjNUF.js";import{i as _l,a as ip}from"./ZoomOut-C0N4ehtv.js";import{i as Jn}from"./Monitor01-Cb1N7DaM.js";import{i as op}from"./SearchMd-5ihP7yVQ.js";import{i as lp}from"./Upload01-DZiCAA30.js";import{b as ap,c as cp}from"./shell-layout-DG441JjL.js";import{n as Fc}from"./LinkExternal01-Cwj3iuhi.js";import{b as up,S as dp,c as fp,d as hp}from"./sheet-B7Lez_S9.js";import{I as kr}from"./integration-icon-EdsPubVt.js";import{a as pp}from"./use-virtual-mcp-E-pwiiFM.js";import{i as mp}from"./ArrowUpRight-N57ebzBw.js";import{a as jo}from"./Users03-DvCgevzn.js";import{a as nt}from"./Palette-B_aebYLe.js";import{k as Hc}from"./use-navigate-to-agent-B4oyUjLa.js";import{a as gp}from"./use-connection-homG8xHs.js";import{a as yp}from"./Stars02-COayjfFf.js";import{g as xp}from"./use-mcp-prompts-Bpm2lRaW.js";import{a as bp,c as kp,D as Sp,d as vp,e as wp}from"./dialog-DBpjZOCu.js";import{a as Cp,F as Tp,b as Np,c as Mp,d as Ep,e as Ap}from"./form-x1EJEVpQ.js";import{I as Op}from"./input-BWamIMbN.js";import{t as Ip}from"./ChevronDown-P5eS_rdB.js";import{e as Rp}from"./select-C-6PWfXp.js";const jp={openrouter:n=>{const e=n?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Vc(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(jp)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function Wc(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Uc(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+Vc(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function C2(n){return n.reduce((e,t)=>Uc(e,t.metadata?.usage),Wc())}const Dp={damping:.7,stiffness:.05,mass:1.25},Pp=70,Lp=1e3/60,_p=350;let Fs=!1;globalThis.document?.addEventListener("mousedown",()=>{Fs=!0});globalThis.document?.addEventListener("mouseup",()=>{Fs=!1});globalThis.document?.addEventListener("click",()=>{Fs=!1});const $p=(n={})=>{const[e,t]=M.useState(!1),[r,s]=M.useState(n.initial!==!1),[i,o]=M.useState(!1),l=M.useRef(null);l.current=n;const a=M.useCallback(()=>{if(!Fs)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(y.current)||y.current?.contains(k.commonAncestorContainer)},[]),c=M.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=M.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=M.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return y.current?.scrollTop??0},set scrollTop(k){if(y.current){const{scrollBehavior:v}=getComputedStyle(y.current);v!=="auto"&&(y.current.style.scrollBehavior="auto"),y.current.scrollTop=k,d.ignoreScrollToTop=y.current.scrollTop,v!=="auto"&&(y.current.style.scrollBehavior=v)}},get targetScrollTop(){return!y.current||!x.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!x.current)return 0;const{targetScrollTop:k}=this;if(!n.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const v=Math.max(Math.min(n.targetScrollTop(k,{scrollElement:y.current,contentElement:x.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:v},requestAnimationFrame(()=>{b=void 0}),v},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Pp}}},[]),f=M.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const k=Date.now()+(Number(b.wait)||0),v=di(l.current,b.animation),{ignoreEscapes:S=!1}=b;let w,C=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{w=Date.now()}):w=k+(b.duration??0);const T=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:E}=d,j=performance.now(),L=(j-(d.lastTick??j))/Lp;if(d.animation||(d.animation={behavior:v,promise:N,ignoreEscapes:S}),d.animation.behavior===v&&(d.lastTick=j),a()||k>Date.now())return T();if(E<Math.min(C,d.calculatedTargetScrollTop)){if(d.animation?.behavior===v){if(v==="instant")return d.scrollTop=d.calculatedTargetScrollTop,T();d.velocity=(v.damping*d.velocity+v.stiffness*d.scrollDifference)/v.mass,d.accumulated+=d.velocity*L,d.scrollTop+=d.accumulated,d.scrollTop!==E&&(d.accumulated=0)}return T()}return w>Date.now()?(C=d.calculatedTargetScrollTop,T()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:di(l.current,l.current.resize),ignoreEscapes:S,duration:Math.max(0,w-Date.now())||void 0}):d.isAtBottom)});return N.then(E=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),E))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===v?d.animation.promise:T()},[c,a,d]),h=M.useCallback(()=>{u(!0),c(!1)},[u,c]),m=M.useCallback(({target:b})=>{if(b!==y.current)return;const{scrollTop:k,ignoreScrollToTop:v}=d;let{lastScrollTop:S=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,v&&v>k&&(S=v),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===v)return;if(a()){u(!0),c(!1);return}const w=k>S,C=k<S;if(d.animation?.ignoreEscapes){d.scrollTop=S;return}C&&(u(!0),c(!1)),w&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,a,d]),g=M.useCallback(({target:b,deltaY:k})=>{let v=b;for(;!["scroll","auto"].includes(getComputedStyle(v).overflow);){if(!v.parentElement)return;v=v.parentElement}v===y.current&&k<0&&y.current.scrollHeight>y.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),y=$l(b=>{y.current?.removeEventListener("scroll",m),y.current?.removeEventListener("wheel",g),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",g,{passive:!0})},[]),x=$l(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([v])=>{const{height:S}=v.contentRect,w=S-(k??S);if(d.resizeDifference=w,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),w>=0){const C=di(l.current,k?l.current.resize:l.current.initial);f({animation:C,wait:!0,preserveScrollPosition:!0,duration:C==="instant"?void 0:_p})}else d.isNearBottom&&(u(!1),c(!0));k=S,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===w&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:x,scrollRef:y,scrollToBottom:f,stopScroll:h,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:d}};function $l(n,e){const t=M.useCallback(r=>(t.current=r,n(r)),e);return t}const ui=new Map;function di(...n){const e={...Dp};let t=!1;for(const s of n){if(s==="instant"){t=!0;continue}typeof s=="object"&&(t=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return ui.has(r)||ui.set(r,Object.freeze(e)),t?"instant":ui.get(r)}function zp(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Do(n){if(n&&typeof n=="object"&&"gatewayClientId"in n&&typeof n.gatewayClientId=="string")return n.gatewayClientId}function Po(n,e){if(!e)return n;const t=`${zp(e)}_`;return n.startsWith(t)?n.slice(t.length):n}function Bp(n,e){return Po(n,e).replace(/[_-]/g," ").toLowerCase()}function Fp(n){const e={};for(const t of n.arguments??[])e[t.name]=t.required?Dl().min(1,"Required"):Dl();return wc(e)}function Hp(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function Vp(n){const e=D.c(66),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=M.useId();let l;if(e[0]!==t){const $=t?Fp(t):wc({});l=fh($),e[0]=t,e[1]=l}else l=e[1];const c=l;let u;e[2]!==i||e[3]!==t?(u=t?Hp(t,i):{},e[2]=i,e[3]=t,e[4]=u):u=e[4];let d;e[5]!==c||e[6]!==u?(d={resolver:c,defaultValues:u,mode:"onChange"},e[5]=c,e[6]=u,e[7]=d):d=e[7];const f=hh(d);let h;e[8]!==t?.arguments?(h=t?.arguments??[],e[8]=t?.arguments,e[9]=h):h=e[9];const m=h;let g;e[10]!==f||e[11]!==s||e[12]!==r?(g=async $=>{await s($),r(null),f.reset()},e[10]=f,e[11]=s,e[12]=r,e[13]=g):g=e[13];const y=g;let x;e[14]!==f||e[15]!==r?(x=$=>{$||(f.reset(),r(null))},e[14]=f,e[15]=r,e[16]=x):x=e[16];const b=x;if(!t)return null;let k;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(k=t.title||Bp(t.name,Do(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=k):k=e[20];let v;e[21]!==k?(v=p.jsx(bp,{children:p.jsx("span",{className:"capitalize",children:k})}),e[21]=k,e[22]=v):v=e[22];let S;e[23]!==t.description?(S=t.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=S):S=e[24];let w;e[25]!==S||e[26]!==v?(w=p.jsxs(kp,{children:[v,S]}),e[25]=S,e[26]=v,e[27]=w):w=e[27];let C;e[28]!==f||e[29]!==y?(C=$=>{$.stopPropagation(),f.handleSubmit(y)($)},e[28]=f,e[29]=y,e[30]=C):C=e[30];let T;if(e[31]!==m||e[32]!==f.control||e[33]!==f.formState.isSubmitting){let $;e[35]!==f.control||e[36]!==f.formState.isSubmitting?($=F=>p.jsx(Tp,{control:f.control,name:F.name,render:G=>{const{field:Q}=G;return p.jsxs(Np,{children:[p.jsxs(Mp,{className:"text-xs",children:[F.name,F.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),p.jsx(Ep,{children:p.jsx(Op,{...Q,value:Q.value??"",required:F.required,placeholder:F.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(Ap,{})]})}},F.name),e[35]=f.control,e[36]=f.formState.isSubmitting,e[37]=$):$=e[37],T=m.map($),e[31]=m,e[32]=f.control,e[33]=f.formState.isSubmitting,e[34]=T}else T=e[34];let N;e[38]!==b?(N=()=>b(!1),e[38]=b,e[39]=N):N=e[39];let E;e[40]!==f.formState.isSubmitting||e[41]!==N?(E=p.jsx(or,{type:"button",variant:"ghost",onClick:N,disabled:f.formState.isSubmitting,children:"Cancel"}),e[40]=f.formState.isSubmitting,e[41]=N,e[42]=E):E=e[42];let j;e[43]!==f.formState.isSubmitting?(j=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(Hh,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=f.formState.isSubmitting,e[44]=j):j=e[44];let L;e[45]!==f.formState.isSubmitting||e[46]!==o||e[47]!==j?(L=p.jsx(or,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:j}),e[45]=f.formState.isSubmitting,e[46]=o,e[47]=j,e[48]=L):L=e[48];let I;e[49]!==E||e[50]!==L?(I=p.jsxs(Sp,{children:[E,L]}),e[49]=E,e[50]=L,e[51]=I):I=e[51];let P;e[52]!==o||e[53]!==C||e[54]!==T||e[55]!==I?(P=p.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:C,children:[T,I]}),e[52]=o,e[53]=C,e[54]=T,e[55]=I,e[56]=P):P=e[56];let R;e[57]!==f||e[58]!==P?(R=p.jsx(Cp,{...f,children:P}),e[57]=f,e[58]=P,e[59]=R):R=e[59];let z;e[60]!==w||e[61]!==R?(z=p.jsxs(vp,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[w,R]}),e[60]=w,e[61]=R,e[62]=z):z=e[62];let B;return e[63]!==b||e[64]!==z?(B=p.jsx(wp,{open:!0,onOpenChange:b,children:z}),e[63]=b,e[64]=z,e[65]=B):B=e[65],B}function qc(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function Ye(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function _n(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function xe(n){this.content=n}xe.prototype={constructor:xe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new xe(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new xe(t)},addToStart:function(n,e){return new xe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new xe(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new xe(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=xe.from(n),n.size?new xe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=xe.from(n),n.size?new xe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=xe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};xe.from=function(n){if(n instanceof xe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new xe(e)};function Kc(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Kc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Jc(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Jc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class A{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new A(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new A(r,s)}cutByIndex(e,t){return e==t?A.empty:e==0&&t==this.content.length?this:new A(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new A(s,i)}addToStart(e){return new A([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new A(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Kc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Jc(this,e,t,r)}findIndex(e){if(e==0)return Ar(0,e);if(e==this.size)return Ar(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ar(t+1,i):Ar(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return A.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new A(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return A.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new A(t||e,r)}static from(e){if(!e)return A.empty;if(e instanceof A)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new A([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}A.empty=new A([],0);const fi={index:0,offset:0};function Ar(n,e){return fi.index=n,fi.offset=e,fi}function Jr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Jr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Jr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ee=class Wi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Jr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Wi.none;if(e instanceof Wi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};ee.none=[];class Gr extends Error{}class _{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Xc(this.content,e+this.openStart,t);return r&&new _(r,this.openStart,this.openEnd)}removeBetween(e,t){return new _(Gc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return _.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new _(A.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new _(e,r,s)}}_.empty=new _(A.empty,0,0);function Gc(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Gc(i.content,e-s-1,t-s-1)))}function Xc(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Xc(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Wp(n,e,t){if(t.openStart>n.depth)throw new Gr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Gr("Inconsistent open depths");return Yc(n,e,t,0)}function Yc(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Yc(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Xt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Up(t,n);return Xt(i,Zc(n,o,l,e,r))}else return Xt(i,Xr(n,e,r))}function Qc(n,e){if(!e.type.compatibleContent(n.type))throw new Gr("Cannot join "+e.type.name+" onto "+n.type.name)}function Ui(n,e,t){let r=n.node(t);return Qc(r,e.node(t)),r}function Gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Gn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Gt(e.nodeBefore,r)}function Xt(n,e){return n.type.checkContent(e),n.copy(e)}function Zc(n,e,t,r,s){let i=n.depth>s&&Ui(n,e,s+1),o=r.depth>s&&Ui(t,r,s+1),l=[];return Gn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Qc(i,o),Gt(Xt(i,Zc(n,e,t,r,s+1)),l)):(i&&Gt(Xt(i,Xr(n,e,s+1)),l),Gn(e,t,s,l),o&&Gt(Xt(o,Xr(t,r,s+1)),l)),Gn(r,null,s,l),new A(l)}function Xr(n,e,t){let r=[];if(Gn(null,n,t,r),n.depth>t){let s=Ui(n,e,t+1);Gt(Xt(s,Xr(n,e,t+1)),r)}return Gn(e,null,t,r),new A(r)}function Up(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(A.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class lr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ee.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Yr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new lr(t,r,i)}static resolveCached(e,t){let r=zl.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else zl.set(e,r=new qp);let s=r.elts[r.i]=lr.resolve(e,t);return r.i=(r.i+1)%Kp,s}}class qp{constructor(){this.elts=[],this.i=0}}const Kp=12,zl=new WeakMap;class Yr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Jp=Object.create(null);class Xe{constructor(e,t,r,s=ee.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Jr(this.attrs,t||e.defaultAttrs||Jp)&&ee.sameSet(this.marks,r||ee.none)}copy(e=null){return e==this.content?this:new Xe(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xe(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return _.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new _(c,s.depth-o,i.depth-o)}replace(e,t,r){return Wp(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return lr.resolveCached(this,e)}resolveNoCache(e){return lr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),eu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=A.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ee.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ee.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Xe.prototype.text=void 0;class Qr extends Xe{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):eu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Qr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Qr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function eu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class sn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Gp(e,t);if(r.next==null)return sn.empty;let s=tu(r);r.next&&r.err("Unexpected trailing text");let i=nm(tm(s));return rm(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return A.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
2
2
|
`)}}sn.empty=new sn(!0);class Gp{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function tu(n){let e=[];do e.push(Xp(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Xp(n){let e=[];do e.push(Yp(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Yp(n){let e=em(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Qp(n,e);else break;return e}function Bl(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Qp(n,e){let t=Bl(n),r=t;return n.eat(",")&&(n.next!="}"?r=Bl(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Zp(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function em(n){if(n.eat("(")){let e=tu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Zp(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function tm(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function nu(n,e){return e-n}function Fl(n,e){let t=[];return r(e),t.sort(nu);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function nm(n){let e=Object.create(null);return t(Fl(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Fl(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new sn(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(nu);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function rm(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ru(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function su(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function iu(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function ou(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new im(n,r,e[r]);return t}let Hl=class lu{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ou(e,r.attrs),this.defaultAttrs=ru(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==sn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:su(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xe(this,this.computeAttrs(e),A.from(t),ee.setFrom(r))}createChecked(e=null,t,r){return t=A.from(t),this.checkContent(t),new Xe(this,this.computeAttrs(e),t,ee.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=A.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(A.empty,!0);return i?new Xe(this,e,t.append(i),ee.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){iu(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:ee.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new lu(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function sm(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class im{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?sm(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Hs{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=ou(e,s.attrs),this.excluded=null;let i=ru(this.attrs);this.instance=i?new ee(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ee(this,su(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Hs(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){iu(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class au{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=xe.from(e.nodes),t.marks=xe.from(e.marks||{}),this.nodes=Hl.compile(this.spec.nodes,this),this.marks=Hs.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=sn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Vl(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Vl(this,o.split(" "))}this.nodeFromJSON=s=>Xe.fromJSON(this,s),this.markFromJSON=s=>ee.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Hl){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Qr(r,r.defaultAttrs,e,ee.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Vl(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function om(n){return n.tag!=null}function lm(n){return n.style!=null}class Et{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(om(s))this.tags.push(s);else if(lm(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Ul(this,t,!1);return r.addAll(e,ee.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Ul(this,t,!0);return r.addAll(e,ee.none,t.from,t.to),_.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(um(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=ql(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=ql(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Et(e,Et.schemaRules(e)))}}const cu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},am={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},uu={ol:!0,ul:!0},ar=1,qi=2,Xn=4;function Wl(n,e,t){return e!=null?(e?ar:0)|(e==="full"?qi:0):n&&n.whitespace=="pre"?ar|qi:t&~Xn}class Or{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=ee.none,this.match=i||(o&Xn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ar)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!cu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ul{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=Wl(null,t.preserveWhitespace,0)|(r?Xn:0);s?i=new Or(s.type,s.attrs,ee.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Or(null,null,ee.none,!0,null,o):i=new Or(e.schema.topNodeType,null,ee.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&qi?"full":this.localPreserveWS||(s.options&ar)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;uu.hasOwnProperty(o)&&this.parser.normalizeLists&&cm(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:am.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(cu.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ee.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Kl(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Wl(e,i,o.options);o.options&Xn&&o.content.length==0&&(l|=Xn);let a=ee.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Kl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Or(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ar)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function cm(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&uu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function um(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ql(n){let e={};for(let t in n)e[t]=n[t];return e}function Kl(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class dn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=hi(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Hr(hi(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Hr(hi(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Hr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Jl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Jl(e.marks)}}function Jl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function hi(n){return n.document||window.document}const Gl=new WeakMap;function dm(n){let e=Gl.get(n);return e===void 0&&Gl.set(n,e=fm(n)),e}function fm(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Hr(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=dm(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:m}=Hr(n,f,t,r);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const du=65535,fu=Math.pow(2,16);function hm(n,e){return n+e*fu}function Xl(n){return n&du}function pm(n){return(n-(n&du))/fu}const hu=1,pu=2,Vr=4,mu=8;class Ki{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&mu)>0}get deletedBefore(){return(this.delInfo&(hu|Vr))>0}get deletedAfter(){return(this.delInfo&(pu|Vr))>0}get deletedAcross(){return(this.delInfo&Vr)>0}}class _e{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&_e.empty)return _e.empty}recover(e){let t=0,r=Xl(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+pm(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let m=e==(t<0?a:d)?null:hm(l/3,e-a),g=e==a?pu:e==d?hu:Vr;return(t<0?e!=a:e!=d)&&(g|=mu),new Ki(h,g,m)}s+=u-c}return r?e+s:new Ki(e+s,0,null)}touches(e,t){let r=0,s=Xl(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new _e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?_e.empty:new _e(e<0?[0,-e,0]:[0,0,e])}}_e.empty=new _e([]);class cr{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new cr(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new cr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Ki(e,s,null)}}const pi=Object.create(null);class Me{getMap(){return _e.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=pi[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in pi)throw new RangeError("Duplicate use of step JSON ID "+e);return pi[e]=t,t.prototype.jsonID=e,t}}class ue{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ue(e,null)}static fail(e){return new ue(null,e)}static fromReplace(e,t,r,s){try{return ue.ok(e.replace(t,r,s))}catch(i){if(i instanceof Gr)return ue.fail(i.message);throw i}}}function Lo(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(Lo(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return A.fromArray(r)}class Ct extends Me{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new _(Lo(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return ue.fromReplace(e,this.from,this.to,i)}invert(){return new Ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ct(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ct&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ct(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ct(t.from,t.to,e.markFromJSON(t.mark))}}Me.jsonID("addMark",Ct);class Ge extends Me{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new _(Lo(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return ue.fromReplace(e,this.from,this.to,r)}invert(){return new Ct(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ge(t.from,t.to,e.markFromJSON(t.mark))}}Me.jsonID("removeMark",Ge);class Tt extends Me{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ue.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ue.fromReplace(e,this.pos,this.pos+1,new _(A.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Tt(this.pos,t.marks[s]);return new Tt(this.pos,this.mark)}}return new on(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Tt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Tt(t.pos,e.markFromJSON(t.mark))}}Me.jsonID("addNodeMark",Tt);class on extends Me{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ue.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ue.fromReplace(e,this.pos,this.pos+1,new _(A.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Tt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new on(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new on(t.pos,e.markFromJSON(t.mark))}}Me.jsonID("removeNodeMark",on);class ce extends Me{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Ji(e,this.from,this.to)?ue.fail("Structure replace would overwrite content"):ue.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _e([this.from,this.to-this.from,this.slice.size])}invert(e){return new ce(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&ce.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new ce(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ce)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?_.empty:new _(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ce(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?_.empty:new _(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ce(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ce(t.from,t.to,_.fromJSON(e,t.slice),!!t.structure)}}ce.MAP_BIAS=1;Me.jsonID("replace",ce);class ge extends Me{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ji(e,this.from,this.gapFrom)||Ji(e,this.gapTo,this.to)))return ue.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ue.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?ue.fromReplace(e,this.from,this.to,r):ue.fail("Content does not fit in gap")}getMap(){return new _e([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ge(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new ge(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ge(t.from,t.to,t.gapFrom,t.gapTo,_.fromJSON(e,t.slice),t.insert,!!t.structure)}}Me.jsonID("replaceAround",ge);function Ji(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function mm(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:s.push(o=new Ge(f,h,d[g])));l&&l.to==f?l.to=h:i.push(l=new Ct(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function gm(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Hs){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==i-1&&d.eq(s[h].style)&&(f=m)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Ge(o.from,o.to,o.style)))}function _o(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new ce(l,u,_.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Ge(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new _(A.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new ce(l+f.index,l+f.index+f[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(A.empty,!0);n.replace(l,l,new _(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function ym(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function $n(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!ym(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function xm(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=A.empty,d=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=A.from(r.node(m).copy(u)),d++):a--;let f=A.empty,h=0;for(let m=i,g=!1;m>t;m--)g||s.after(m+1)<s.end(m)?(g=!0,f=A.from(s.node(m).copy(f)),h++):c++;n.step(new ge(a,c,o,l,new _(u.append(f),d,h),u.size-d,!0))}function $o(n,e,t=null,r=n){let s=bm(n,e),i=s&&km(r,e);return i?s.map(Yl).concat({type:e,attrs:t}).concat(i.map(Yl)):null}function Yl(n){return{type:n,attrs:null}}function bm(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function km(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Sm(n,e,t){let r=A.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=A.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new ge(s,i,s,i,new _(r,0,0),t.length,!0))}function vm(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&wm(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&yu(n,o,l,i),_o(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new ge(d,f,d+1,f-1,new _(A.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&gu(n,o,l,i),!1}})}function gu(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function yu(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,i as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,i as j}from"./index-ChoCV5RI.js";import{i as N}from"./SearchMd-5ihP7yVQ.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as t,E as P,r as j,ae as w,B as S,t as y}from"./index-
|
|
1
|
+
import{c as p,j as t,E as P,r as j,ae as w,B as S,t as y}from"./index-ChoCV5RI.js";import{i as k}from"./AlertCircle-CoC6NNi4.js";import{s as z}from"./Plus-CqV2jOMI.js";import{s as E}from"./User01-BU4AVwNl.js";import{t as F}from"./Users01-rcwVvUtr.js";import{e as $,d as I,c as O,a as A,b as R,D as T}from"./dialog-DBpjZOCu.js";import{I as N}from"./input-BWamIMbN.js";import{L as g}from"./label-BZcMuJ0q.js";import{S as B,a as V,b as L,c as q,d as C}from"./select-C-6PWfXp.js";import{S as H}from"./skeleton-CgP3V6Ja.js";import{T as K}from"./textarea-BK_9gLq0.js";import{P as b}from"./index-DweVBJpV.js";import{c as W}from"./settings-section-CSq9f2ez.js";import{u as Y,a as G}from"./use-secrets-C8LfdaIH.js";import{R as J}from"./require-capability-Dr8mj9VJ.js";import"./X-DBy4i4Lp.js";import"./tooltip-D0ODOH5L.js";import"./ChevronUp-BoULmO5v.js";import"./ChevronDown-P5eS_rdB.js";import"./sidebar-BXZd-GVd.js";import"./LayoutLeft-CuSrrdEU.js";import"./use-mobile-BzlsCeN5.js";import"./sheet-B7Lez_S9.js";import"./card-go8Ic7Q5.js";import"./ArrowUpRight-N57ebzBw.js";import"./studio-tools-C9NKrR5C.js";import"./use-capability-DbvoEB-N.js";import"./access-gate-Cp9GeAB2.js";import"./capability-load-error-BehOb5ja.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as He,r as w,l as Be,j as n,B as Ge,i as zn,m as vs,t as W,K as Ss}from"./index-C74-7rC_.js";import{r as xs,a as ys,s as bs,i as Hn,c as _s,b as js,G as ks,V as ws,d as Rs,e as Rt,f as Ds,g as Ns,h as Vs,j as Cs,k as Ps,l as Ts,m as As,n as Ms,o as Es,p as $t,q as Ot,t as Ks,v as ut,w as jt,x as $s,y as Os,z as Ye,A as Vn,S as Bs,M as Cn,B as kt,C as Bt,D as Ls,E as an,P as Fs,F as et,H as xt,I as Is,J as zs,K as Hs,L as Us,N as Ws,O as Gs,Q as dt,R as qs,T as Js,U as Ys,W as Pn,X as wt,Y as Qs,Z as Xs,_ as Zs,$ as er,a0 as tr,a1 as sn,a2 as Tn,a3 as An,a4 as yt,a5 as Lt,a6 as Mn,a7 as nr,a8 as ar,a9 as rn,aa as sr,ab as rr,ac as Un,ad as En,ae as or}from"./index-18VPlu9_.js";import{t as ir}from"./ChevronDown-CavzOb2e.js";import{J as ln,F as Wn,_ as Gn,k as lr,K as cr,L as ur,n as dr}from"./agent-icon-aNPmoaPd.js";import{i as qn}from"./ChevronRight-DgXTGSyd.js";import{n as mr}from"./ChevronUp-DWl02poJ.js";import{i as fr}from"./Globe01-7w14Dv0L.js";import{S as Ft}from"./scroll-area-Dt0A9lzL.js";import{T as mt,a as ft,b as pt}from"./tooltip-BETVAZty.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-DsOssLqX.js";import{I as yr}from"./input-ClQQvwn8.js";import{s as br,a as Jn}from"./Eye-BfxF3_NG.js";import{b as _r}from"./ZoomOut-5HsDnkoy.js";import{i as jr}from"./Settings02-D77UEQ2p.js";import{s as cn}from"./Plus-DE2oM9NP.js";import{s as Yn}from"./Trash01-D75-03uB.js";import{i as kr}from"./Zap-B36bkz1F.js";import{c as it,a as Qn,D as Xn,b as Zn,g as wr}from"./dropdown-menu-wQ-uELKw.js";import{a as ea,b as It,K as ta,P as na,d as aa,C as sa,s as ra,l as Dt,D as oa,c as ia,S as la,v as ca,k as ua}from"./sortable.esm-4-bXuIBY.js";import{r as Kn,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./page-seo-form-C_2RUxxC.js";import{b as Mr}from"./Tool01-Cl2bl9JY.js";import{A as Er}from"./add-section-modal-BOqz-964.js";import"./index-DPOBsX9s.js";import"./SwitchHorizontal01-DcPy-VUg.js";import"./chat-context-B5hrLcwj.js";import"./hooks-5_uPY02P.js";import"./use-mcp-client-A_C0OXe_.js";import"./auth-CiRpWlv5.js";import"./decopilot-sse-pool-Bxsm1x-g.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-De67qc1-.js";import"./use-collections-DJbkAyuY.js";import"./use-ai-providers-BC-Unv9B.js";import"./studio-tools-BnbQl4Xy.js";import"./use-decopilot-events-ZViPJ0gD.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-D13sMxOQ.js";import"./drawer-AyckCMmd.js";import"./collection-search-DwhBerSk.js";import"./SearchMd-3hwS3MeL.js";import"./use-mobile-DB_HbZdV.js";import"./use-mcp-prompts-BdtnL2tp.js";import"./X-BVAUYa_T.js";import"./shell-layout-B6CDg-cg.js";import"./avatar-BjKWRNVB.js";import"./User01-BgkBgTes.js";import"./Users03-DT08k8_1.js";import"./SearchLg-wiFmsHKn.js";import"./Stars02-C-4lNJ_k.js";import"./XClose-CPn-2iye.js";import"./CheckCircle-D6Zd00g5.js";import"./FilterLines-CHINsit0.js";import"./alert-dialog-ac9d9PM5.js";import"./required-auth-layout-FfHfv0VI.js";import"./use-org-sso-CTXVLokg.js";import"./ZapSquare-ogfO4bZI.js";import"./Star01-tqRKmSvv.js";import"./Upload01-Z-VVijrs.js";import"./AlertCircle-ClgAhfOn.js";import"./form-BHvZi-GZ.js";import"./label-DtyPJXbW.js";import"./select-CFMmW9o-.js";import"./XCircle-QoSkb3Jx.js";import"./tabs-Y-yEKkZ4.js";import"./toggle-group-BDe3fVGm.js";import"./Monitor01-D6j19kcU.js";import"./connect-desktop-dialog-DlP4AIXL.js";import"./decopilot-Cj_SKATh.js";import"./checkbox-Kg4LLU9D.js";import"./skeleton-Biz6Vvdi.js";import"./Key01-D84zmw8T.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CCA_rQPu.js";import"./card-BmW79tCv.js";import"./ArrowUpRight-B862Up1l.js";import"./Stars01-BcSQPbwD.js";import"./popover-DESq8MlY.js";import"./command-SyxeX2nl.js";import"./index-CIxzNHgu.js";import"./useInfiniteQuery-WHDQHpmx.js";import"./use-infinite-scroll-DKD-IrVC.js";import"./use-org-fs-B8S0kCYo.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-CXTBoi-C.js";import"./shell-route-loading-Dfj-cl4w.js";import"./task-status-CmHRRegX.js";import"./DotsVertical-BXUN7i-s.js";import"./use-clock-tick-CVyOhRb1.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-status-sounds-C-U8Pnl-.js";import"./empty-state-CNU5O4hk.js";import"./toolbar-DcLfNsL6.js";import"./index-BkMvO6br.js";import"./Palette-DVeyHPSn.js";import"./file-type-icon-B0qdUvEN.js";import"./use-debounced-value-dGP0T3Z6.js";import"./textarea-CZ6lZT55.js";import"./LinkExternal01-DwRUHK9K.js";import"./index-GxYhZPOH.js";import"./LayoutLeft-BzG5LgFk.js";import"./toolbar-icon-button-BK4dVDIq.js";import"./use-connection-C7H28tUm.js";import"./use-mcp-tools-D5KEYf26.js";import"./types-CbtfOW36.js";import"./use-capability-Buq2jVbm.js";import"./extract-connection-data-wL-0uC4r.js";import"./tools-list-5V41Fj5o.js";import"./mcp-oauth-BZR_sfsi.js";import"./badge-BJNy0wyL.js";import"./connection-slug-eyAPH6o3.js";import"./switch-dyBEm-xz.js";import"./Play-DnC6BFen.js";import"./use-debounced-autosave-xRcrGDGN.js";import"./index-BD6No7__.js";import"./sidebar-DUnL0V4N.js";import"./sheet-DpVVe07a.js";import"./search-input-mkU8caHs.js";import"./collection-tabs-BQDCpcYC.js";import"./github-repo-picker-B2FKQ_5-.js";import"./authenticate-and-persist-oauth-C7yk75O_.js";import"./use-navigate-to-agent-Cpj0q3sa.js";import"./github-installations-DzN1UQ4x.js";import"./Users01-Cmsl-eTQ.js";import"./use-secrets-5DqxCpWf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-8_dybPHZ.js";import"./table-DAb40UnL.js";import"./use-members-S8u6cgH3.js";import"./use-org-auth-client-1ug5pqiq.js";import"./use-automations-DM4xNubt.js";import"./useSuspenseInfiniteQuery-CFE7ta84.js";import"./use-file-configs-BqeK5-ZL.js";import"./monaco-editor-C0-ORVvv.js";import"./select-model-oC-ZbdSY.js";import"./automation-list-row-D2B_rh4A.js";import"./Globe04-BmVvGcdk.js";import"./HardDrive-C3esngx2.js";import"./Sun-CWsRADe_.js";import"./Shield01-DGllkrSj.js";import"./use-copy-DwhmZgzz.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-C4oOxnQb.js";import"./use-registry-connections-PtpSZeVH.js";import"./connection-form-helpers-FkUfzqP1.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=ys(c,r.data);if(d)return bs(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function $n(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return da(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function ma(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(_r,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let C;e[6]!==S||e[7]!==h?(C=h?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=C):C=e[8];let R;e[9]!==C?(R=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:C}),e[9]=C,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let D;return e[16]!==b||e[17]!==R||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=D):D=e[19],D}function fa(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:C,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?Hn(c.__resolveType??""):!1;let D;e[0]!==r?(D=_s(r),e[0]=r,e[1]=D):D=e[1];const l=D;let Y;e[2]!==h?(Y={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=Y):Y=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:P,isDragging:se}=aa(Y);let T;e[4]!==P?(T=sa.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let N;e[6]!==T||e[7]!==pe?(N={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=N):N=e[8];const ce=N;let B;e[9]!==r?(B=js(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(ma,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Wr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==C||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),C()},onPointerDown:Ur,children:r.isHidden?n.jsx(jr,{className:"h-3.5 w-3.5"}):n.jsx(br,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=C,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(Wn,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Jn,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==l||e[32]!==_?(G=l&&n.jsxs(it,{className:ws,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(Gn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=G):G=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(Yn,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(Xn,{children:[X,n.jsxs(Zn,{align:"end",className:"w-44",children:[re,G,q,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:C,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:D,canAddSection:l}=m,Y=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>$n(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[P,se]=w.useState(null),[T,pe]=w.useState(r),[N,ce]=w.useState(d.length),B=w.useRef(!1);T!==r?(pe(r),ce(d.length),u($n(d.length))):N!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ra},e[3]=oe):oe=e[3];const Ce=ea(It(na,te),It(ta,oe));let E;e[4]!==K?(E=K.map(Jr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>da(Dt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,$,Z,we,Ee,Ke;if(e[11]!==P||e[12]!==Y||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==C||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==P||e[46]!==Y||e[47]!==K||e[48]!==D||e[49]!==c||e[50]!==d){const ae=P?K.find(Q=>Q.id===P):null;if(q=ae!=null?d[ae.index]:null,G=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!Y;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=P,e[46]=Y,e[47]=K,e[48]=D,e[49]=c,e[50]=d,e[51]=G,e[52]=q,e[53]=we}else G=e[51],q=e[52],we=e[53];re=oa,Se=Ce,de=ia,be=je,$=Ae,Z=Ne,ve=la,le=ue,ke=ca,Ke="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>C(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=Y,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=C,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=Ke}else ve=e[30],re=e[31],G=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ee=e[43],Ke=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Le;e[59]!==ne||e[60]!==Ke?(Le=n.jsx("div",{className:Ke,children:ne}),e[59]=ne,e[60]=Ke,e[61]=Le):Le=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Pe):Pe=e[66];let $e;e[67]!==G||e[68]!==q||e[69]!==h?($e=q?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(q,!1)),children:n.jsx(ma,{section:q,raw:G,meta:h})}):null,e[67]=G,e[68]=q,e[69]=h,e[70]=$e):$e=e[70];let Fe;e[71]!==$e?(Fe=n.jsx(ua,{dropAnimation:null,children:$e}),e[71]=$e,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Pe,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!Y;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(m){return m.id}function On(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[C,R]=w.useState(r);r!==C&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const Y=d||"the rule";let H;e[8]!==Y?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Y}),"."]})]}),e[8]=Y,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let P;e[12]!==d||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let N;e[23]!==v||e[24]!==pe?(N=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=N):N=e[25];let ce;e[26]!==T||e[27]!==N?(ce=n.jsxs(vr,{children:[T,N]}),e[26]=T,e[27]=N,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Yr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",pa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function ha(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Rs(d);h=lr(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Bn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
1
|
+
import{c as He,r as w,l as Be,j as n,B as Ge,i as zn,m as vs,t as W,K as Ss}from"./index-ChoCV5RI.js";import{r as xs,a as ys,s as bs,i as Hn,c as _s,b as js,G as ks,V as ws,d as Rs,e as Rt,f as Ds,g as Ns,h as Vs,j as Cs,k as Ps,l as Ts,m as As,n as Ms,o as Es,p as $t,q as Ot,t as Ks,v as ut,w as jt,x as $s,y as Os,z as Ye,A as Vn,S as Bs,M as Cn,B as kt,C as Bt,D as Ls,E as an,P as Fs,F as et,H as xt,I as Is,J as zs,K as Hs,L as Us,N as Ws,O as Gs,Q as dt,R as qs,T as Js,U as Ys,W as Pn,X as wt,Y as Qs,Z as Xs,_ as Zs,$ as er,a0 as tr,a1 as sn,a2 as Tn,a3 as An,a4 as yt,a5 as Lt,a6 as Mn,a7 as nr,a8 as ar,a9 as rn,aa as sr,ab as rr,ac as Un,ad as En,ae as or}from"./index-8q5cTvfk.js";import{t as ir}from"./ChevronDown-P5eS_rdB.js";import{J as ln,F as Wn,_ as Gn,k as lr,K as cr,L as ur,n as dr}from"./agent-icon-CWPBFzIp.js";import{i as qn}from"./ChevronRight-CTea8Vrz.js";import{n as mr}from"./ChevronUp-BoULmO5v.js";import{i as fr}from"./Globe01-DA12A_gX.js";import{S as Ft}from"./scroll-area-C-3TY2YE.js";import{T as mt,a as ft,b as pt}from"./tooltip-D0ODOH5L.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-DBpjZOCu.js";import{I as yr}from"./input-BWamIMbN.js";import{s as br,a as Jn}from"./Eye-XrixTuLa.js";import{b as _r}from"./ZoomOut-C0N4ehtv.js";import{i as jr}from"./Settings02-iYAu_otv.js";import{s as cn}from"./Plus-CqV2jOMI.js";import{s as Yn}from"./Trash01-66NrnGrm.js";import{i as kr}from"./Zap-fhgO5dDS.js";import{c as it,a as Qn,D as Xn,b as Zn,g as wr}from"./dropdown-menu-EKQ6fenT.js";import{a as ea,b as It,K as ta,P as na,d as aa,C as sa,s as ra,l as Dt,D as oa,c as ia,S as la,v as ca,k as ua}from"./sortable.esm-D9jMeHV1.js";import{r as Kn,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./page-seo-form-f84r-XPs.js";import{b as Mr}from"./Tool01-BWmMjNUF.js";import{A as Er}from"./add-section-modal-L1hZYDnC.js";import"./index-BZyixu4W.js";import"./SwitchHorizontal01-dqeKRNpy.js";import"./chat-context-BvVy1XII.js";import"./hooks-DnXDFfXX.js";import"./use-mcp-client-C9rZ5q5t.js";import"./auth-DnBe9AUC.js";import"./decopilot-sse-pool-DCzhBR7p.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-E-pwiiFM.js";import"./use-collections-CRpuCmSx.js";import"./use-ai-providers-DjRW0TN5.js";import"./studio-tools-C9NKrR5C.js";import"./use-decopilot-events-2XegsErL.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-DmBEnT-y.js";import"./drawer-DPby2hn2.js";import"./collection-search-C001GdqX.js";import"./SearchMd-5ihP7yVQ.js";import"./use-mobile-BzlsCeN5.js";import"./use-mcp-prompts-Bpm2lRaW.js";import"./X-DBy4i4Lp.js";import"./shell-layout-DG441JjL.js";import"./avatar-Dx8vsnte.js";import"./User01-BU4AVwNl.js";import"./Users03-DvCgevzn.js";import"./SearchLg-Dvo924kw.js";import"./Stars02-COayjfFf.js";import"./XClose-CtyL8bYf.js";import"./CheckCircle-kHQ2dQaQ.js";import"./FilterLines-JU5CW8t2.js";import"./alert-dialog-CNwxdflX.js";import"./required-auth-layout-CS_iMldS.js";import"./use-org-sso-DNIk-jwi.js";import"./ZapSquare-CfbyrH4x.js";import"./Star01-BkFl7Mhr.js";import"./Upload01-DZiCAA30.js";import"./AlertCircle-CoC6NNi4.js";import"./form-x1EJEVpQ.js";import"./label-BZcMuJ0q.js";import"./select-C-6PWfXp.js";import"./XCircle-IJc8zbrl.js";import"./tabs-T8F8VZUh.js";import"./toggle-group-e24ylmWs.js";import"./Monitor01-Cb1N7DaM.js";import"./connect-desktop-dialog-DKo4CQJQ.js";import"./decopilot-DdwBW5Gf.js";import"./checkbox-D_sfTX5R.js";import"./skeleton-CgP3V6Ja.js";import"./Key01-C3y_5bqB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CSq9f2ez.js";import"./card-go8Ic7Q5.js";import"./ArrowUpRight-N57ebzBw.js";import"./Stars01-D1UrqdL4.js";import"./popover-CUdzevRE.js";import"./command-B1GcRSWc.js";import"./index-DjKzm_7S.js";import"./useInfiniteQuery-DRJEgKeg.js";import"./use-infinite-scroll-Cj4qMXbT.js";import"./use-org-fs-wGkM6ZHK.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-EdsPubVt.js";import"./shell-route-loading-BpdXUJEZ.js";import"./task-status-DEWrBULH.js";import"./DotsVertical-pUzhcHbw.js";import"./use-clock-tick-DicB8A5f.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-status-sounds-B-cyYEUC.js";import"./empty-state-YIcxVemW.js";import"./toolbar-BhxpIEsu.js";import"./index-Cv5o-Jym.js";import"./Palette-B_aebYLe.js";import"./file-type-icon-BoZkRxIi.js";import"./use-debounced-value-hi69DHr0.js";import"./textarea-BK_9gLq0.js";import"./LinkExternal01-Cwj3iuhi.js";import"./index-DFKc4d3N.js";import"./LayoutLeft-CuSrrdEU.js";import"./toolbar-icon-button-B27j_4W9.js";import"./use-connection-homG8xHs.js";import"./use-mcp-tools-BP-8Q6Ct.js";import"./types-BOo0uLec.js";import"./use-capability-DbvoEB-N.js";import"./extract-connection-data-CPBy2fVV.js";import"./tools-list-DIWh8Oky.js";import"./mcp-oauth-DCCT0QwD.js";import"./badge-BzEWqz_j.js";import"./connection-slug-eyAPH6o3.js";import"./switch-Cu2RC5pZ.js";import"./Play-DDWMuBvQ.js";import"./use-debounced-autosave-DTd4mDNn.js";import"./index-DweVBJpV.js";import"./sidebar-BXZd-GVd.js";import"./sheet-B7Lez_S9.js";import"./search-input-BKD3oaXK.js";import"./collection-tabs-B_vVgFOt.js";import"./github-repo-picker-DBhdsm3x.js";import"./authenticate-and-persist-oauth-u3Bd-L7u.js";import"./use-navigate-to-agent-B4oyUjLa.js";import"./github-installations-DzN1UQ4x.js";import"./Users01-rcwVvUtr.js";import"./use-secrets-C8LfdaIH.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-CqWPoh43.js";import"./table-DW50z9UL.js";import"./use-members-C6DHv6rG.js";import"./use-org-auth-client-BqLuGuER.js";import"./use-automations-CS_Nu0ry.js";import"./useSuspenseInfiniteQuery-BYH-CQed.js";import"./use-file-configs-BM_cxwPW.js";import"./monaco-editor-B3SQ_IFm.js";import"./select-model-DGiOgK0q.js";import"./automation-list-row-B4HURQxP.js";import"./Globe04-DNnzQTTy.js";import"./HardDrive-A9TGjU2B.js";import"./Sun-Brrmn0Wt.js";import"./Shield01-BzDwMZxQ.js";import"./use-copy-Dq7f5A4R.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-Bx0N6sI4.js";import"./use-registry-connections-DLscAznw.js";import"./connection-form-helpers-B8AytMOg.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=ys(c,r.data);if(d)return bs(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function $n(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return da(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function ma(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(_r,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let C;e[6]!==S||e[7]!==h?(C=h?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=C):C=e[8];let R;e[9]!==C?(R=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:C}),e[9]=C,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let D;return e[16]!==b||e[17]!==R||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=D):D=e[19],D}function fa(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:C,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?Hn(c.__resolveType??""):!1;let D;e[0]!==r?(D=_s(r),e[0]=r,e[1]=D):D=e[1];const l=D;let Y;e[2]!==h?(Y={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=Y):Y=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:P,isDragging:se}=aa(Y);let T;e[4]!==P?(T=sa.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let N;e[6]!==T||e[7]!==pe?(N={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=N):N=e[8];const ce=N;let B;e[9]!==r?(B=js(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(ma,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Wr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==C||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),C()},onPointerDown:Ur,children:r.isHidden?n.jsx(jr,{className:"h-3.5 w-3.5"}):n.jsx(br,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=C,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(Wn,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Jn,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==l||e[32]!==_?(G=l&&n.jsxs(it,{className:ws,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(Gn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=G):G=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(Yn,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(Xn,{children:[X,n.jsxs(Zn,{align:"end",className:"w-44",children:[re,G,q,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:C,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:D,canAddSection:l}=m,Y=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>$n(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[P,se]=w.useState(null),[T,pe]=w.useState(r),[N,ce]=w.useState(d.length),B=w.useRef(!1);T!==r?(pe(r),ce(d.length),u($n(d.length))):N!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ra},e[3]=oe):oe=e[3];const Ce=ea(It(na,te),It(ta,oe));let E;e[4]!==K?(E=K.map(Jr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>da(Dt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,$,Z,we,Ee,Ke;if(e[11]!==P||e[12]!==Y||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==C||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==P||e[46]!==Y||e[47]!==K||e[48]!==D||e[49]!==c||e[50]!==d){const ae=P?K.find(Q=>Q.id===P):null;if(q=ae!=null?d[ae.index]:null,G=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!Y;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=P,e[46]=Y,e[47]=K,e[48]=D,e[49]=c,e[50]=d,e[51]=G,e[52]=q,e[53]=we}else G=e[51],q=e[52],we=e[53];re=oa,Se=Ce,de=ia,be=je,$=Ae,Z=Ne,ve=la,le=ue,ke=ca,Ke="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>C(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=Y,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=C,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=Ke}else ve=e[30],re=e[31],G=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ee=e[43],Ke=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Le;e[59]!==ne||e[60]!==Ke?(Le=n.jsx("div",{className:Ke,children:ne}),e[59]=ne,e[60]=Ke,e[61]=Le):Le=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Pe):Pe=e[66];let $e;e[67]!==G||e[68]!==q||e[69]!==h?($e=q?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(q,!1)),children:n.jsx(ma,{section:q,raw:G,meta:h})}):null,e[67]=G,e[68]=q,e[69]=h,e[70]=$e):$e=e[70];let Fe;e[71]!==$e?(Fe=n.jsx(ua,{dropAnimation:null,children:$e}),e[71]=$e,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Pe,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!Y;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(m){return m.id}function On(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[C,R]=w.useState(r);r!==C&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const Y=d||"the rule";let H;e[8]!==Y?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Y}),"."]})]}),e[8]=Y,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let P;e[12]!==d||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let N;e[23]!==v||e[24]!==pe?(N=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=N):N=e[25];let ce;e[26]!==T||e[27]!==N?(ce=n.jsxs(vr,{children:[T,N]}),e[26]=T,e[27]=N,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Yr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",pa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function ha(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Rs(d);h=lr(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Bn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
2
|
`)}function on(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function ga(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(ha,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let C;e[3]!==r?(C=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=C):C=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(Xn,{children:[n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(Wn,{size:14})})}),n.jsxs(Zn,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(Jn,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(Yn,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==C||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,C,R]}),e[12]=b,e[13]=C,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:C,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:D,transform:l,isDragging:Y}=aa(_);let H;e[2]!==l?(H=sa.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=Y?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const P=u,se=p??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Rt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let N;e[11]!==g?(N=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=N):N=e[12];const ce=Y?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?pa:Yr;let te;e[13]!==ce||e[14]!==B?(te=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==C||e[22]!==b?(oe=n.jsx(ga,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:C,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=C,e[22]=b,e[23]=oe):oe=e[23];let Ce;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==N?(Ce=n.jsx("div",{ref:D,style:P,...k,...o,onClick:g,onKeyDown:N,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=N,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Rt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",pa),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(ga,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:C,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>on(c),e[0]=c,e[1]=k):k=e[1];const[o,D]=w.useState(k),[l,Y]=w.useState(null),[H,K]=w.useState(r),[u,P]=w.useState(c.length);let se;e[2]!==c?(se=()=>Bn(c),e[2]=c,e[3]=se):se=e[3];const[T,pe]=w.useState(se),N=w.useRef(!1),ce=Bn(c);H!==r?(K(r),P(c.length),pe(ce),D(on(c))):u!==c.length?(P(c.length),pe(ce),D(on(c))):T!==ce&&(pe(ce),D(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:ra},e[5]=te):te=e[5];const oe=ea(It(na,B),It(ta,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);Y(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{Y(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(L=>Qr(Dt([...L],me,ee))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{Y(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==C||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{N.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=oa,le=oe,ke=ia,Se=je,de=Ae,be=Ne,ve=la,q=E,ne=ca,we="space-y-0.5",G=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>C(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=C,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=G,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],G=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ee;e[49]!==G||e[50]!==we?(Ee=n.jsx("div",{className:we,children:G}),e[49]=G,e[50]=we,e[51]=Ee):Ee=e[51];let Ke;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ee?(Ke=n.jsx(ve,{items:q,strategy:ne,children:Ee}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ee,e[56]=Ke):Ke=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Pe;e[62]!==Le?(Pe=n.jsx(ua,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Pe):Pe=e[63];let $e;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==Ke||e[71]!==Pe?($e=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[Ke,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=Ke,e[71]=Pe,e[72]=$e):$e=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==$e?(Fe=n.jsxs("div",{className:$,children:[Z,$e]}),e[73]=$,e[74]=Z,e[75]=$e,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Ln(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,C]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>C([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(dr,{className:"size-3.5"})}),b.map((o,D)=>{const l=D===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(qn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>C(b.slice(0,D+1)),title:o,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(Un,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:C,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function Fn(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:C,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let D;e[0]!==p?(D=p===void 0?[]:p,e[0]=p,e[1]=D):D=e[1];const l=D;let Y;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==C?(Y=r&&c?b?n.jsx(Ar,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:C}):n.jsx(Un,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=C,e[14]=Y):Y=e[14];const H=Y;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Is(m,e,et)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,C]=w.useState(r);b!==r&&(C(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function In(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Gn,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function Wl({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:C,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:D}=Ds(k),{data:l,isLoading:Y}=Ns(k),H=Vs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,P]=w.useState(null),[se,T]=w.useState(null),[pe,N]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ce,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[Ne,ve]=w.useState(null),[re,G]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ee,Ke]=w.useState(b);b&&!Ee&&(Ke(!0),we(!0),P(null),T(null),N(null),M([])),!b&&Ee&&Ke(!1);const[Le,Pe]=w.useState(null),[$e,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,un]=w.useState(null),va=vs(),Sa=`${m}/${e}/${r}`,zt=Cs({orgSlug:m,virtualMcpId:e,branch:r}),[xa,ya]=w.useState(h),[ba,_a]=w.useState(S),[ja,ka]=w.useState(p);(xa!==h||ba!==S||ja!==p)&&(queueMicrotask(()=>zt.flush()),ya(h),_a(S),ka(p),P(null),T(null),N(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Fe(void 0),xe([]),me(t=>t+1));const ye=Ps({orgSlug:m,virtualMcpId:e,branch:r}),Nt=Qs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>W.error(`Save failed: ${s.message}`)})}),Ht=Ts({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Vt]=w.useState(!1),Ut=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||Y)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const wa=As(o),_e=!!p,ze=_e?null:Ms(wa,h,S),j=_e?p:ze?.key??null,Gt=_e&&p?o[p]:void 0,dn=_e&&p&&Gt?Es(p,Gt):_e&&p?p:"",Ct=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&l&&j&&ze?Kn(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Ra=Z?Ct?.seo:void 0,Jt=$e!==void 0?$e:Ra,Da=Z?Rr(Jt):void 0,Na=qt?.seoTypeOptions??[],Va=Z&&l?Dr(l):"",mn=Le??Da??{},Yt=Z&&qt?Nr(mn,qt):null,Ca=Z&&Yt&&Vr(Jt)?$t(Yt,l):null,Pa=Z?Cr(o,l)?.seoData:void 0,Oe=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Ct?.sections,o??{}),Pt=Oe.length>1,Ve=Math.min(ce,Oe.length-1),tt=Oe[Ve],I=tt?.sections??[],Te=Ot(I,o),fn=!_e&&Ks(Ct?.sections);if(_e&&p&&Qe!==p){un(p);const t=I[0],a=Te[0];if(t&&a){P(0),L(0),M([]);const s=ut(t,a,o);s&&(T(s.data),N(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&un(null),qe.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Oe,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:u};const Ta=()=>({multivariate:fn,index:Ve,variants:Oe.map(t=>({rule:t.rule}))}),pn=(t,a)=>{if(!_)return;if(!j||!fn||t.length<=1){_(null);return}const s=Mn(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ta(),f=Mn(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=nr({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},nt=(t,a,s,i=u??-1,f=!1)=>{const y=Ye(t,a);if(!y){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const V=Vn(y,et)[s];if(!V){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const J=zs(V.value,o);T(J?.data??null),N(J?.resolveType??null);const{resolveType:A,formValue:O}=jt(V.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),L(0),M([]),X(s=>s+1),a.isMultivariate)nt(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),N(s.resolveType)):(T(null),N(null)),he(null),Q(null)}}const Tt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Qt=pe&&l?$t(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Oe);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>W.error(`Save failed: ${i.message}`)})},St=()=>{P(null),T(null),N(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Aa=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Ye(A,O);if(!z||!x)return;const U=sr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Hn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(V.length>1){const z=F.sections,U=[...z?.variants??[]];U[J]&&(U[J]={...U[J],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>W.error(`Save failed: ${z.message}`)})},rn)},Ma=t=>{P(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){nt(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),N(null),he(null),Q(null),vt(null,t,0);return}T(i.data),N(i.resolveType),he(null),Q(null),vt(null,t,0)},hn=t=>{const a=t;T(a),u!==null&&Aa(a,u)},Xt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=Kn(o,a,l);s&&zt.save(j,()=>{const i=va.getQueryData(Ss.decofile(Sa))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Tr(a,s,f,t.inner):f})},Ea=(t,a)=>{j&&(Wt.current[t]=a,Xt())},Ka=(t,a)=>{if(!j)return;const s=Dt([...I],t,a);u!==null&&(u===t?P(a):t<u&&a>=u?P(u-1):t>u&&a<=u&&P(u+1)),Ue(s)},$a=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&P(u-1),Ue(a)},Oa=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,tr(a)),u!==null&&u>t&&P(u+1),Ue(s)},Ba=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?Zs(a):er(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},La=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Xs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ia=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Ot(a,o)[s];if(!i||!f)return;if(f.isMultivariate){nt(i,f,0);return}const y=ut(i,f,o);if(!y){T(null),N(null),he(null),Q(null);return}T(y.data),N(y.resolveType),he(null),Q(null)}})},za=t=>{if(u===null)return;const a=I[u],s=Te[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),nt(a,s,t,u,!0))},Ha=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Ye(a,s);if(!i)return;const f=Js(i,t);if(!f){W.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let V=ee;t===ee?V=Math.min(t,x.length-1):t<ee&&(V=ee-1),L(V),M([]),X(J=>J+1),nt(y[u],s,V),Ue(y)},Ua=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Ye(a,s);if(!i)return;const f=Ys(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(V=>V+1),nt(y[u],s,x),Ue(y)},Wa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Te[u];if(!s||!i?.isMultivariate)return;const f=Ye(s,i);if(!f)return;const y=Gs(f,t,a),x=[...I];x[u]=dt(s,i,y);let V=ee;ee===t?V=a:t<ee&&a>=ee?V=ee-1:t>ee&&a<=ee&&(V=ee+1),L(V),nt(x[u],i,V),Ue(x)},Zt=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const f=Hs(s,i);if(!f){W.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Ot(y,o)[a];if(!x?.isMultivariate){W.error("Could not add variant.");return}P(a),L(f.newVariantIndex),M([]),X(V=>V+1),nt(f.section,x,f.newVariantIndex,a),Ue(y)},Ga=()=>{if(u===null||!j)return;const t=I[u],a=Te[u];if(!t||!a?.isMultivariate)return;const s=Ye(t,a);if(!s)return;const i=qs(t,a,s);if(!i){W.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Ot(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(V=>V+1);const x=ut(i,y,o);x?(T(x.data),N(x.resolveType)):(T(null),N(null)),vt(null,u,0),Ue(f)},qa=async t=>{if(Ne===null||!j)return;const a=sn(t,o);if(a){W.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const f=ut(s,i,o);if(!f){W.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Oe)}),u===Ne&&St(),ve(null),W.success(`Saved global block "${t}"`),g?.()}catch(x){W.error(x instanceof Error?x.message:"Failed to save global block")}},gn=tt?.rule;if(Pt&&u===null&&ue===null&&gn){const{resolveType:t,formValue:a}=jt(gn,o??{},l??void 0);ie(t),E(a)}const At=l?$s(l):[],vn=l&&o?Os(l,o):[],Ja=!_e&&!!(d&&l&&o),Sn=ue&&l?$t(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(ar(a,t,l)>0))try{await Ht.mutateAsync({blockKey:t})}catch(s){W.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],V=x[i],J=V?.rule;if(xt(J,s,l)){const A=J?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}V&&(x[i]={...V,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>W.error(`Save failed: ${A.message}`)})},rn)},Ya=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:En};E({}),xn(a)},Qa=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Xa=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],J=V[i];if(!J)return;const A=kt(J.rule,s,l),O=Lt(t);V[i]={...J,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:V}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){W.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Ye(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",We=y[fe],Xe=typeof We?.name=="string"?We.name:fe,{__resolveType:rt,...Ze}=t;ye.mutate({blockKey:fe,data:yt(rt??"",Ze,Xe)},{onSuccess:()=>g?.(),onError:ot=>W.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),De=[...i];De[a]=dt(A,O,U);const Je=wt(y,x,De,J,V);ye.mutate({blockKey:x,data:Je},{onSuccess:()=>g?.(),onError:fe=>W.error(`Save failed: ${fe.message}`)})},rn))},Za=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:En})},es=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},ts=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Ye(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Lt(t),De=Pn(F,s,U),Je=[...i];Je[a]=dt(A,O,De);const fe=wt(y,x,Je,J,V),We={...y,[x]:fe},{resolveType:Xe,formValue:rt}=jt(U,We,l??void 0);he(Xe),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,We),g?.()}catch(Ze){W.error(Ze instanceof Error?Ze.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Gt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const at=u!==null?Te[u]??null:null,bn=u!==null?I[u]:null,_n=bn&&at?.isMultivariate?Ye(bn,at):null,lt=_n?Vn(_n,et):[],en=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[en]??null,ct=at?.isMultivariate===!0,jn=u!==null&&at!==null,Kt=jn&&(ct||!!(Qt&&se)),ns=Kt&&!_e&&at?.isSavedBlock===!0,st=_e||ns,as=_e?dn:at?.label??"",kn=Ie&&l?$t(Ie,l):null,tn=Kt&&(!_e||je.length>0)?_e?[dn,...je]:[ze.name,at.label,...ct&&Et?[Et.label]:[],...je]:[],ss=Z&&ze?[ze.name,"SEO",...Me]:[],wn=Z?ss:st?tn.length>0?tn:[as]:tn,Rn=()=>{if(!j)return;const t=o[j],a=Us(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),N(null),M([]),E(null),ie(null)},onError:i=>W.error(`Save failed: ${i.message}`)})},nn=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const V=rr(y,x),J={...o,[j]:{...i,sections:V}};ye.mutate({blockKey:j,data:J[j]},{onSuccess:()=>{a?.(),s&&_t(s,J)},onError:A=>W.error(`Save failed: ${A.message}`)})},rs=t=>{G(null),B(t),P(null),T(null),N(null),M([]);const a=Oe[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),pn(Oe.map(f=>({rule:f.rule})),t)},os=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Dt(Oe.map(f=>({rule:f.rule})),t,a);pn(i,s),nn(f=>Dt(f,t,a))},is=t=>{const a=Oe[t]?.rule,s=kt(a,o??{},l??void 0);nn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Oe.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),N(null),M([]),E(null),ie(null)},s)},ls=t=>{nn(a=>or(a,t),()=>{B(t+1),P(null),T(null),N(null),M([]),E(null),ie(null)})},cs=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],J=V[t];if(!J?.rule||typeof J.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const A=J.rule,O=a.trim();Vt(!0);try{if(!O){if(!xt(A,i,l)){G(null);return}const Je=A.__resolveType??"";V[t]={...J,rule:Tn(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:V}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(Je,fe),G(null),g?.();return}const F=An(A,i,l);if(!F){W.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),G(null),g?.();return}const ge=an(O),z=sn(ge,i);if(z){W.error(z);return}const U=yt(F.resolveType,F.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,V[t]={...J,rule:Lt(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:V}}}),De=null}catch(Je){throw De&&await Ht.mutateAsync({blockKey:De}).catch(()=>{}),Je}G(null),W.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){W.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Vt(!1)}},us=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Ye(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const Je=async fe=>{const We={...F,variants:fe},Xe=[...i];Xe[s]=dt(A,O,We);const rt=wt(y,x,Xe,J,V);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!De){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...z,rule:Tn(U,y,l)};const gs=await Je(Nn);await _t(ot,gs),ne(null),g?.();return}const fe=An(U,y,l);if(!fe){W.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const We=an(De),Xe=sn(We,y);if(Xe){W.error(Xe);return}const rt=yt(fe.resolveType,fe.data,De);let Ze=null;try{await ye.mutateAsync({blockKey:We,data:rt}),Ze=We;const ot=[...ge];ot[t]={...z,rule:Lt(We)},await Je(ot),Ze=null}catch(ot){throw Ze&&await Ht.mutateAsync({blockKey:Ze}).catch(()=>{}),ot}ne(null),W.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){W.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{St()},ds=t=>{Pe(t),Xt({inner:t})},ms=t=>{Fe(t),Xt({raw:t})},fs=()=>{Pe(null),xe([])},ps=()=>me(t=>t+1),hs=t=>{if(Z){if(t===0){zt.flush(),we(!1),Pe(null),Fe(void 0),xe([]),me(s=>s+1),C?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||Kt||Z?n.jsxs("div",{className:Be("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&Pt&&tt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${tt.label}`,className:Be("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(ha,{rule:Rt(tt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:tt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:wn.map((t,a)=>{const s=a===wn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(qn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>hs(a),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),st&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!at?.isHidden&&j&&n.jsx(In,{onClick:()=>Zt()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:Ea})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(cr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(ur,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(In,{onClick:Rn})]})}),Z?n.jsx(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:mn,defaultResolveType:Va,seoSchema:Ca,activeResolveType:Yt,seoTypeOptions:Na,formResetKey:Re,siteDefaultSeo:Pa,onBreadcrumbChange:xe,onPersistRaw:ms,onInnerChange:ds,onClearForm:fs,onBumpFormKey:ps}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Bs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:en,onSelect:za,onRename:ne,onDuplicate:Ua,onDelete:Ha,onRemoveAll:Ga,onReorder:Wa,onAdd:()=>Zt()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Cn,{currentRt:Ie??"",currentLabel:Bt(Et?.rule,o??{},et,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:vn,onSelect:Za,onSelectGlobal:ts}),kn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Ln,{schema:kn,value:ae,onChange:es,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${u??"none"}:${en}:${Ie??""}`)})]})]}),n.jsx(Fn,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Oe,activeIndex:Ve,decofile:o??{},meta:l,matchers:At,onSelect:rs,onReorder:os,onRename:G,onDuplicate:ls,onDelete:is,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Be("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(mr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ir,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Be("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Cn,{currentRt:ue,currentLabel:Bt(tt?.rule,o??{},et,l??void 0),currentGlobalKey:kt(tt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:vn,onSelect:Ya,onSelectGlobal:Xa}),Sn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Ln,{schema:Sn,value:Ce,onChange:Qa,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:l,selectedIndex:u,onSelect:Ma,onReorder:Ka,onDelete:$a,onDuplicate:Oa,onMakeReusable:ve,onToggleHidden:Ba,onToggleLazy:La,onAddVariant:Zt,onDetach:Fa,onAddSection:()=>de(!0),canAddSection:Ja})})]}),n.jsx(Ls,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?an(Te[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:qa}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ia}),be&&j&&o&&n.jsx(Fs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(On,{open:!0,initialName:xt(Oe[re]?.rule,o??{},l??void 0)?Bt(Oe[re]?.rule,o??{},et,l??void 0):"",autoLabel:et(Rt(Oe[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await cs(re,t)},onOpenChange:t=>{!t&&!bt&&G(null)}}),q!==null&&n.jsx(On,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Bt(lt[q]?.rule,o??{},et,l??void 0):"",autoLabel:et(Rt(lt[q]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await us(q,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{Wl as SectionsEditor};
|