decocms 4.578.0 → 4.579.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BHOdje2-.js → AlertCircle-GXBIxFcm.js} +1 -1
- package/dist/client/assets/{AreaChart--NTdNKkN.js → AreaChart-BliO7z1O.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DwK9IQqr.js → ArrowLeft-BbqwGy0e.js} +1 -1
- package/dist/client/assets/{ArrowUp-BKp-bI0t.js → ArrowUp-DBkhb8Yz.js} +1 -1
- package/dist/client/assets/{BookOpen01-CCzJ3iHg.js → BookOpen01-1fjc61Mm.js} +1 -1
- package/dist/client/assets/{CartesianChart-DcsXR4up.js → CartesianChart-D_ikhSur.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BH2fCBYy.js → CategoricalChart-DFr--lUX.js} +1 -1
- package/dist/client/assets/{CheckCircle-CpYSXUlJ.js → CheckCircle-B_eEhqJR.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BfPzQt1M.js → ChevronSelectorVertical-D-7E5GYT.js} +1 -1
- package/dist/client/assets/{ChevronUp-yM6kuF7B.js → ChevronUp-FDrusEQ7.js} +1 -1
- package/dist/client/assets/{CreditCard01-ClPhtnpy.js → CreditCard01-KjySk-5G.js} +1 -1
- package/dist/client/assets/{Globe04-CpMO0Sfn.js → Globe04-CYg8V2eL.js} +1 -1
- package/dist/client/assets/{Key01-BUefgO6r.js → Key01-DY2gyLvd.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Beajkv8Y.js → LinkBroken01-CzDrAWsX.js} +1 -1
- package/dist/client/assets/{Minus-CkHBDYFP.js → Minus-CMxaDSgl.js} +1 -1
- package/dist/client/assets/{Monitor01-6Z9BL4ul.js → Monitor01-3IwLMf0Q.js} +1 -1
- package/dist/client/assets/{Play-QQIqJKj8.js → Play-BOARoASB.js} +1 -1
- package/dist/client/assets/{Plus-jqQtsDrV.js → Plus-D452i-ki.js} +1 -1
- package/dist/client/assets/{ReferenceLine-65eMf_HF.js → ReferenceLine-BCPouREj.js} +1 -1
- package/dist/client/assets/{SearchMd--9oaPr0p.js → SearchMd-D9VvymBK.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DWT7jnvZ.js → ShoppingBag01-DrNjYHL1.js} +1 -1
- package/dist/client/assets/{Sun-CBa0lZzX.js → Sun-BvPiksd_.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Be5wnM3M.js → SwitchHorizontal01-BzX5npS9.js} +1 -1
- package/dist/client/assets/{Tool01-C_vFDQiZ.js → Tool01-DoE3EsIZ.js} +1 -1
- package/dist/client/assets/{Tooltip-BxRazsja.js → Tooltip-z7WiBKoc.js} +1 -1
- package/dist/client/assets/{Trash01-D4h16nnS.js → Trash01-_1ewPMOO.js} +1 -1
- package/dist/client/assets/{Upload01-DLWP4rJI.js → Upload01-D11ZXRKj.js} +1 -1
- package/dist/client/assets/{UserSquare-DomA7Npc.js → UserSquare-DHrzs2xN.js} +1 -1
- package/dist/client/assets/{Users01-DQk985Hj.js → Users01-DdipP4E2.js} +1 -1
- package/dist/client/assets/{XClose-DsOcImLD.js → XClose-CR92HpkN.js} +1 -1
- package/dist/client/assets/{Zap-CXSu8byh.js → Zap-D5X_AlHR.js} +1 -1
- package/dist/client/assets/{access-gate-COWmI5bk.js → access-gate-CpF5setC.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BcVopUkx.js → add-connection-dialog-DB2eDzSO.js} +1 -1
- package/dist/client/assets/agent-app-FoPCQlJh.js +1 -0
- package/dist/client/assets/{agent-assets-BiP4eXwk.js → agent-assets-CynthE6_.js} +1 -1
- package/dist/client/assets/{agent-automation-DBUljkhT.js → agent-automation-1MlsXRHC.js} +3 -3
- package/dist/client/assets/{agent-automations-SLj1xajz.js → agent-automations-Dol9sHiV.js} +1 -1
- package/dist/client/assets/{agent-blog-CwfLgnOy.js → agent-blog-Db3MOHTb.js} +2 -2
- package/dist/client/assets/{agent-blog-post-Dv9DOEk2.js → agent-blog-post-BWxagJWC.js} +2 -2
- package/dist/client/assets/{agent-calendar-CjQfj1Sz.js → agent-calendar-DgGhw5pC.js} +1 -1
- package/dist/client/assets/{agent-capabilities-B2YgTs9t.js → agent-capabilities-CtbwhlqH.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-COR6xHVk.js → agent-connect-sources-ByKpOl5Z.js} +1 -1
- package/dist/client/assets/agent-deck-CYqAnEDO.js +1 -0
- package/dist/client/assets/{agent-e2e-CqM9gm_q.js → agent-e2e-CmmnhpPI.js} +1 -1
- package/dist/client/assets/agent-experiments-C0HV4Igp.js +1 -0
- package/dist/client/assets/agent-file-BwXd7p-8.js +1 -0
- package/dist/client/assets/{agent-hosting-D1eqz9SR.js → agent-hosting-FxuGCE-9.js} +1 -1
- package/dist/client/assets/{agent-icon-C-RKmmDR.js → agent-icon-DPgCnEV1.js} +1 -1
- package/dist/client/assets/agent-library-CZViQovH.js +1 -0
- package/dist/client/assets/agent-library-file-DC-34Ulj.js +1 -0
- package/dist/client/assets/agent-overview-DIMIEsnS.js +1 -0
- package/dist/client/assets/{agent-releases-IeUzKjUs.js → agent-releases-CkbrqRyS.js} +1 -1
- package/dist/client/assets/agent-settings-Ct-2qeci.js +1 -0
- package/dist/client/assets/{agent-site-editor-WH6jHL7m.js → agent-site-editor-ClFcVY3S.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B_iiio_B.js +2 -0
- package/dist/client/assets/agent-site-editor-content-XnR2gN3f.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DuB0qtlm.js +1 -0
- package/dist/client/assets/agent-view-B8ACan0R.js +1 -0
- package/dist/client/assets/{agent-view-guard-DL_BQ0ym.js → agent-view-guard-BCiwIORn.js} +1 -1
- package/dist/client/assets/{ai-providers-DQRQioIu.js → ai-providers-bDAV58Mn.js} +1 -1
- package/dist/client/assets/{alert-DejWJPEC.js → alert-DXhGyLVy.js} +1 -1
- package/dist/client/assets/{analytics-sections-aJEg6Lrj.js → analytics-sections-DBGqAepm.js} +1 -1
- package/dist/client/assets/api-keys-BHoBmIeA.js +1 -0
- package/dist/client/assets/{api-keys-CtF2T7md.js → api-keys-BNfyNQ7I.js} +1 -1
- package/dist/client/assets/{app-editor-BbInzuqi.js → app-editor-BiIR6cEw.js} +1 -1
- package/dist/client/assets/{asset-utils-DLSL6NlD.js → asset-utils-C4P9UMw5.js} +1 -1
- package/dist/client/assets/{auth-DQhl82rC.js → auth-DET1t4rk.js} +1 -1
- package/dist/client/assets/{auth-catchall-CKKMb7Qg.js → auth-catchall-Ds0jCVCs.js} +1 -1
- package/dist/client/assets/{auth-entry-GYtwsP_U.js → auth-entry-CcoroHhc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Den49bbd.js → auth-split-layout-DyPur8S6.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BUdNrcOr.js → authenticate-and-persist-oauth-BcQblp8z.js} +1 -1
- package/dist/client/assets/{automation-list-row-BNUSbcf6.js → automation-list-row-CUs_NzLP.js} +1 -1
- package/dist/client/assets/{automation-runs-Pz0rgqnE.js → automation-runs-CwfQCxx5.js} +1 -1
- package/dist/client/assets/{automations-DQjVvCEj.js → automations-aHGSwKcI.js} +1 -1
- package/dist/client/assets/{badge-lysbeP9P.js → badge-CPdAi539.js} +1 -1
- package/dist/client/assets/{block-document-DvtTe-B8.js → block-document-Bbw2FP3P.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-CnaE8A0D.js → blocks-preview-workspace-context-CZpRdqcZ.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DScRj9jB.js → blocks-tab-states-B3rnTo7L.js} +1 -1
- package/dist/client/assets/{blog-preview-url-BaS_j9Mv.js → blog-preview-url-D9nceA8-.js} +1 -1
- package/dist/client/assets/{blog-schema-BZTYj2LA.js → blog-schema-CxC8Q-yf.js} +1 -1
- package/dist/client/assets/{blog-source-gate-D36m3Pml.js → blog-source-gate-SOnwSY-u.js} +1 -1
- package/dist/client/assets/{blog-view-gate-DZU_55_0.js → blog-view-gate-CbpRy_w3.js} +1 -1
- package/dist/client/assets/{buckets-Bbtnc4QE.js → buckets-sxg53sM-.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Ukn_sIrt.js → build-improve-prompt-doc-D_rPYtI9.js} +1 -1
- package/dist/client/assets/{calendar-RFGSgZO6.js → calendar-HFJ5axO1.js} +1 -1
- package/dist/client/assets/{capability-load-error-zDoTf-tr.js → capability-load-error-BCoAaz36.js} +1 -1
- package/dist/client/assets/{category-editor-Dji5QxhQ.js → category-editor-BIsXNtK9.js} +1 -1
- package/dist/client/assets/{category-tree-hquVl_NC.js → category-tree-BwBGBNEZ.js} +1 -1
- package/dist/client/assets/{chart-Y23GGTjZ.js → chart-_XV_ZGbS.js} +1 -1
- package/dist/client/assets/{chat-context-o9Pyy_rd.js → chat-context-DmIaWG0i.js} +1 -1
- package/dist/client/assets/{chat-draft-ZyzRFxm_.js → chat-draft-D5guZJ-Z.js} +1 -1
- package/dist/client/assets/{checkbox-BgJ_rDKP.js → checkbox-C6L9-jtU.js} +1 -1
- package/dist/client/assets/{choose-editor-BE7aIxmQ.js → choose-editor-D-ClYTuz.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BlHmHrJ9.js → cli-auth-success-CMqt_C6d.js} +1 -1
- package/dist/client/assets/{client-icons-ClEjJoc4.js → client-icons-BrNyP8bx.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-DTSvLtYU.js → cms-settings-editor-Cm7lJgYR.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-DChYgVhP.js → cms-store-drafts-CTNFCbln.js} +1 -1
- package/dist/client/assets/{collapsible-Ck6jFTQH.js → collapsible-SBMmc8E3.js} +1 -1
- package/dist/client/assets/{collection-detail-Cu5F_YZk.js → collection-detail-VM7vyobJ.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cc8fDLFX.js → collection-display-button-DNT54OXz.js} +1 -1
- package/dist/client/assets/{collection-search-Cr2_Tgzy.js → collection-search-DXnQxUGL.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-VD4O1Z7Z.js → collection-table-wrapper-BtWWhOUa.js} +1 -1
- package/dist/client/assets/{collection-tabs-BNEX9U1D.js → collection-tabs-BPEGrrum.js} +1 -1
- package/dist/client/assets/{combobox-CqgGSY4o.js → combobox-B8oSfLQg.js} +1 -1
- package/dist/client/assets/{command-CnhVLB17.js → command-ARXYIBtk.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CLNVvG7e.js → companion-mcps-section-CrDXFS6p.js} +1 -1
- package/dist/client/assets/{config-a5cd-EVs.js → config-FNjB2KQg.js} +1 -1
- package/dist/client/assets/{connect-4PrNRBjZ.js → connect-D7SeHA4r.js} +3 -3
- package/dist/client/assets/{connect-layout-CNlF_K4x.js → connect-layout-ByVGILi-.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-UDY4VqBo.js → connect-source-dialog-Di53RqvY.js} +1 -1
- package/dist/client/assets/{connection-CV7VyK2j.js → connection-BTlRsp1B.js} +1 -1
- package/dist/client/assets/{connection-card-DpuIDx02.js → connection-card-DFMJTK3o.js} +1 -1
- package/dist/client/assets/{connection-detail-BTx1Lau8.js → connection-detail-C-BChkKr.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BHr2mHhQ.js → connection-form-helpers-B9Yi82ri.js} +1 -1
- package/dist/client/assets/{connection-slug-D2uNKvQr.js → connection-slug-COimMHkq.js} +1 -1
- package/dist/client/assets/{connections-DyhjRe5H.js → connections-fJDsaPLw.js} +1 -1
- package/dist/client/assets/content-tab-BV39A4DC.js +19 -0
- package/dist/client/assets/{context-Cw8yAq79.js → context-DHTHUOqh.js} +1 -1
- package/dist/client/assets/{context-menu-DIqy9oGB.js → context-menu-B-hlKiE1.js} +1 -1
- package/dist/client/assets/{context-shell-DzGB0CzT.js → context-shell-BGKkeMCB.js} +3 -3
- package/dist/client/assets/{core.esm-AubJLKZ-.js → core.esm-Hiw5xlkT.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D5uXvaYq.js → create-organization-dialog-EtzNyw9E.js} +1 -1
- package/dist/client/assets/{delete-copy-CdfctKz4.js → delete-copy-Bt51Emir.js} +1 -1
- package/dist/client/assets/{device-hint-CFgRDD8m.js → device-hint-DcULIlAN.js} +1 -1
- package/dist/client/assets/{discover-DxhSOuBA.js → discover-B7EzX3Z4.js} +1 -1
- package/dist/client/assets/{domain-settings-C9lZyHfM.js → domain-settings-CYdry1vA.js} +1 -1
- package/dist/client/assets/{drawer-Donq2Zq_.js → drawer-BUu3Urhv.js} +1 -1
- package/dist/client/assets/{editor-BRySXv_B.js → editor-Dc6skLlO.js} +1 -1
- package/dist/client/assets/{editor-classes-8qIA7W4N.js → editor-classes-BRb8pzNp.js} +1 -1
- package/dist/client/assets/{empty-message-BAHk-1bK.js → empty-message-uyJw_GDm.js} +2 -2
- package/dist/client/assets/{empty-state-DDTtYKkY.js → empty-state-CQ-naxDO.js} +1 -1
- package/dist/client/assets/{empty-state-BwFbOlsH.js → empty-state-yinauESn.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BM855EvI.js → experiments-tab-choice-n7UpEKSe.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DsPBwLZT.js → extract-connection-data-UTX_3j8w.js} +1 -1
- package/dist/client/assets/{feature-gate-CEBXLuF8.js → feature-gate-Caiq88-a.js} +1 -1
- package/dist/client/assets/{feature-paywall-DKb-BDqu.js → feature-paywall-CgY8XcJe.js} +1 -1
- package/dist/client/assets/{file-explorer-C_M9KHGa.js → file-explorer-Dt28l_Zt.js} +1 -1
- package/dist/client/assets/{file-preview-ekcEL18H.js → file-preview-B_OweD07.js} +1 -1
- package/dist/client/assets/{file-share-button-ZGH-qkC_.js → file-share-button-GtMerxGo.js} +2 -2
- package/dist/client/assets/{file-type-icon-D4Edy8Bo.js → file-type-icon-5sEsvuio.js} +1 -1
- package/dist/client/assets/{folder-icon-C46Lx0s6.js → folder-icon-BkVkbSXN.js} +1 -1
- package/dist/client/assets/{form-DddGN9Yh.js → form-DQshgY6C.js} +1 -1
- package/dist/client/assets/{frame-navigation-HWq_5QB3.js → frame-navigation-DCO55Sf7.js} +1 -1
- package/dist/client/assets/{general-brvHskhD.js → general-BaBNqFUU.js} +1 -1
- package/dist/client/assets/{github-icon-CBn2nQtJ.js → github-icon-CsOyvsM3.js} +1 -1
- package/dist/client/assets/{held-block-view-BFXBQ9fK.js → held-block-view-CZDHkd7I.js} +1 -1
- package/dist/client/assets/{home-C--lHJVb.js → home-Csg3jJI1.js} +1 -1
- package/dist/client/assets/{home-overview-DaE-41lI.js → home-overview-BWPQ5B3f.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-CrIPblfo.js → hosted-reconcile-BVY_PuHB.js} +1 -1
- package/dist/client/assets/{icon-button-DYLciVFZ.js → icon-button-DTP_l7w5.js} +1 -1
- package/dist/client/assets/{index-W-F8Gjme.js → index--NX8xaba.js} +1 -1
- package/dist/client/assets/{index-Dz6MGtCy.js → index-BUzNTivf.js} +1 -1
- package/dist/client/assets/{index-BJ5UuERb.js → index-B_-7lo18.js} +6 -6
- package/dist/client/assets/{index-CXvGxxAm.js → index-BtBKqC_9.js} +1 -1
- package/dist/client/assets/{index-BmYwClLx.js → index-BxZUC_i-.js} +1 -1
- package/dist/client/assets/{index-BqD88VPt.js → index-COp-j3NW.js} +1 -1
- package/dist/client/assets/{index-BZdAVrUU.js → index-Chdoy1DO.js} +1 -1
- package/dist/client/assets/{index-DChf1qbF.js → index-CoDU2Q4W.js} +1 -1
- package/dist/client/assets/{index-BNwuaZhD.js → index-Cwblfb1K.js} +1 -1
- package/dist/client/assets/{index-Dk-oU4JL.js → index-D8htcGU7.js} +1 -1
- package/dist/client/assets/{index-Ujlc9MWT.js → index-D9OoYQHh.js} +1 -1
- package/dist/client/assets/{index-Cqxphjz0.js → index-DThhcUFE.js} +3 -3
- package/dist/client/assets/{index-jntxieqb.js → index-DpynbW7T.js} +1 -1
- package/dist/client/assets/{index-CHOxYhnv.js → index-PfzOl7J6.js} +37 -37
- package/dist/client/assets/{index-C_bl8gsZ.js → index-TayDSkqp.js} +1 -1
- package/dist/client/assets/{index-redirect-Bw8K1uPG.js → index-redirect-BkFuXXfk.js} +1 -1
- package/dist/client/assets/{index-DnxJcpC4.js → index-xX6vrZ6Z.js} +1 -1
- package/dist/client/assets/{index-Z4MRwIRr.js → index-yk7iwtzd.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Sb4-Zoh0.js → infiniteQueryObserver-BSITs4kU.js} +1 -1
- package/dist/client/assets/{infra-billing-B222FxLt.js → infra-billing-BoDxU99n.js} +1 -1
- package/dist/client/assets/{input-rNhKaUqk.js → input-CHXvb5rt.js} +3 -3
- package/dist/client/assets/{input-CHhCTfcg.js → input-D81euCkI.js} +1 -1
- package/dist/client/assets/{integration-icon-CM5LyK_z.js → integration-icon-Cypf7ART.js} +1 -1
- package/dist/client/assets/item-actions-8EnEtcgh.js +1 -0
- package/dist/client/assets/{jira-icon-CgHUBjzE.js → jira-icon-QIwPAzLK.js} +1 -1
- package/dist/client/assets/{label-B6kbb_qI.js → label-C3bFtEDk.js} +1 -1
- package/dist/client/assets/{layout-8yHvgWm7.js → layout-BQNYAbQM.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-C1EB7MCq.js → legacy-admin-welcome-dialog-BndvejSa.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BQInfINZ.js → legacy-agents-deep-Dl3vADCo.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CJKXe_S6.js → legacy-main-redirect-ChiwiSS2.js} +1 -1
- package/dist/client/assets/library-BRiige9x.js +1 -0
- package/dist/client/assets/{library-tab-CW_E0hfE.js → library-tab-CrYnUaco.js} +1 -1
- package/dist/client/assets/{login-CDwczf6C.js → login-rcDgqa7Z.js} +1 -1
- package/dist/client/assets/{markdown-Deyw3r6u.js → markdown-sfCsYKJ3.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CEhql9SF.js → mcp-app-renderer-D149puyc.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BQtVOszP.js → mcp-oauth-CSBTsyXo.js} +1 -1
- package/dist/client/assets/{mcp-oauth-JUy-C_de.js → mcp-oauth-jwlMSPw2.js} +1 -1
- package/dist/client/assets/{members-DrjrN5qN.js → members-CelJ91W8.js} +1 -1
- package/dist/client/assets/{memory-BITIQ7DP.js → memory-78oDfUbY.js} +1 -1
- package/dist/client/assets/{mock-board-CprpumRW.js → mock-board-1wwE7bgl.js} +3 -3
- package/dist/client/assets/{monaco-editor-CRckTkcR.js → monaco-editor-CdzTj7u7.js} +1 -1
- package/dist/client/assets/{monitoring-GakxK6v8.js → monitoring-CMxjfhWD.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CCOAzga2.js → monitoring-stats-row-DQq79-Av.js} +1 -1
- package/dist/client/assets/{multi-select-B_Fvyk0J.js → multi-select-DuhSvGkq.js} +1 -1
- package/dist/client/assets/{mustache-BGNYir1R.js → mustache-7iPTegv4.js} +1 -1
- package/dist/client/assets/{named-rule-step-WRCKmihp.js → named-rule-step-osjl7ntJ.js} +1 -1
- package/dist/client/assets/{named-rule-view-BGKV11Gn.js → named-rule-view-BLodRfDS.js} +1 -1
- package/dist/client/assets/{new-project-dialog-C9WcHYrC.js → new-project-dialog-ddGWO7oU.js} +1 -1
- package/dist/client/assets/{oauth-callback-DG6fghbH.js → oauth-callback-O0HaoPhW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BjKgNB2f.js → oauth-callback-ai-provider-lqjcXm4x.js} +1 -1
- package/dist/client/assets/{oauth-consent-C8DnEY1C.js → oauth-consent-N41ISlqj.js} +1 -1
- package/dist/client/assets/{onboarding-DWuD3Chf.js → onboarding-5wyvG1ND.js} +1 -1
- package/dist/client/assets/{openai-conversation-BMcQmBgw.js → openai-conversation-CHwDAykX.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-xEm1EFDd.js → optimistic-project-sidebar-views-1aPoGedf.js} +1 -1
- package/dist/client/assets/{order-monitor-day-Cp9FGnxW.js → order-monitor-day-BETRE7hY.js} +1 -1
- package/dist/client/assets/{organization-choice-DC3kAtog.js → organization-choice-xEY1ZwIn.js} +1 -1
- package/dist/client/assets/{orgs-C3ExmEUV.js → orgs-BV4-A9Pr.js} +1 -1
- package/dist/client/assets/{own-accounts-section-D0We85Qt.js → own-accounts-section-DY9RNK5U.js} +1 -1
- package/dist/client/assets/{pair-BoFr4FJb.js → pair-4_jIXzEz.js} +1 -1
- package/dist/client/assets/{parse-sections-D9GxphKG.js → parse-sections-Crm8e-1O.js} +2 -2
- package/dist/client/assets/{plan-Bsk7Zd5h.js → plan-TSt9lDnY.js} +1 -1
- package/dist/client/assets/{plan-ladder-D1iTEGuZ.js → plan-ladder-6lanq0kZ.js} +1 -1
- package/dist/client/assets/{plan-usage-card-BJ5m6iCB.js → plan-usage-card-qPS6Eqeb.js} +1 -1
- package/dist/client/assets/{popover-AfVmBiXN.js → popover-BBhzRgR6.js} +1 -1
- package/dist/client/assets/{post-calendar-CuIdS76v.js → post-calendar-XeIGYeqg.js} +1 -1
- package/dist/client/assets/{post-editor-BnakSlKS.js → post-editor-Cuw86g74.js} +2 -2
- package/dist/client/assets/{preview-content-DjjT4V-O.js → preview-content-CdaarV-M.js} +1 -1
- package/dist/client/assets/{preview-dialog-Ccy0t2uO.js → preview-dialog-eUjd7KAO.js} +1 -1
- package/dist/client/assets/{preview-panel-lxiY3O14.js → preview-panel-DOASEmB8.js} +1 -1
- package/dist/client/assets/{preview-tab-CqLWllse.js → preview-tab-DHUmCnt8.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-D8WcSokk.js → product-picker-dialog-z_7jLJp3.js} +1 -1
- package/dist/client/assets/{profile-Drjsxz7t.js → profile-Q_Uil_2O.js} +1 -1
- package/dist/client/assets/{project-app-view-iFxD19E8.js → project-app-view-B_pnPMK9.js} +1 -1
- package/dist/client/assets/{project-apps-CNXyAUnR.js → project-apps-DOmYqPIW.js} +1 -1
- package/dist/client/assets/{project-icon-D_A1aREs.js → project-icon-DdcX-1Cu.js} +1 -1
- package/dist/client/assets/{project-index-6AmZpE2T.js → project-index-CvnWioTG.js} +1 -1
- package/dist/client/assets/project-reports-CjkBj3OZ.js +1 -0
- package/dist/client/assets/project-tasks-BR7DB76X.js +1 -0
- package/dist/client/assets/{projects-C-jes6vD.js → projects-BnupWVNC.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CzS59zMw.js → projects-empty-state-BBAZx24q.js} +1 -1
- package/dist/client/assets/{prompts-Cdt8Hsyk.js → prompts-CtCcnkuf.js} +1 -1
- package/dist/client/assets/{record-editor-CDn5r9vK.js → record-editor-kAlyd6wn.js} +1 -1
- package/dist/client/assets/{redirect-editor-CjfokzC6.js → redirect-editor-G5HzKFY7.js} +1 -1
- package/dist/client/assets/reports-BZMzVdGj.js +1 -0
- package/dist/client/assets/{reports-W44854hR.js → reports-CCeLAtH1.js} +1 -1
- package/dist/client/assets/{reports-onboarding-B8EBbkkq.js → reports-onboarding-CihuSs_4.js} +1 -1
- package/dist/client/assets/{reports-tab-CAQtX43j.js → reports-tab-CxCo6ljz.js} +2 -2
- package/dist/client/assets/{repositories-DKNamez0.js → repositories-Cr0Vmqsy.js} +1 -1
- package/dist/client/assets/repositories-xVxXVGUl.js +1 -0
- package/dist/client/assets/{repository-binding-zOZEsVNQ.js → repository-binding-BjyWZpYn.js} +1 -1
- package/dist/client/assets/{repository-picker-DQ8Ce_c3.js → repository-picker-BQKFq3La.js} +1 -1
- package/dist/client/assets/{require-capability-DR3oejOb.js → require-capability-Ca04y4iT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D8CrwDut.js → required-auth-layout-rj346c5-.js} +1 -1
- package/dist/client/assets/{reset-password-DMlXhive.js → reset-password-CJ8Ib39J.js} +1 -1
- package/dist/client/assets/{resizable-DOkGVAXY.js → resizable-BWGQtKDK.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-w8xgbNJA.js → resolve-tab-icon--gm9VDQf.js} +1 -1
- package/dist/client/assets/{review-settings-CYZdQlMs.js → review-settings-DKHV4WWw.js} +1 -1
- package/dist/client/assets/{role-color-Dmigi-fS.js → role-color-h7pbmUj8.js} +1 -1
- package/dist/client/assets/{roles-LwSdhOgS.js → roles-33JtztJp.js} +1 -1
- package/dist/client/assets/{route-DoHag-FN.js → route-B2mhSQ66.js} +1 -1
- package/dist/client/assets/route-L9WJSo8Z.js +1 -0
- package/dist/client/assets/{route-CxYCV9F1.js → route-esSEnbHB.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DrAhvgSp.js → sandbox-lifecycle-context-ciVvS_mf.js} +1 -1
- package/dist/client/assets/{save-status-CzYNQ6G2.js → save-status-YxsSW2Rs.js} +1 -1
- package/dist/client/assets/{schema-Cf58u1YZ.js → schema-CWJkmqKK.js} +1 -1
- package/dist/client/assets/{schema-BB8zKrPl.js → schema-MF7uKk3F.js} +1 -1
- package/dist/client/assets/{scroll-area-w2Fr7CkP.js → scroll-area-D0b5TYGa.js} +1 -1
- package/dist/client/assets/{search-input-CxzHzt1i.js → search-input-CfjxHAmm.js} +1 -1
- package/dist/client/assets/{search-toggle-NGBAT2W1.js → search-toggle-CvrrivM1.js} +1 -1
- package/dist/client/assets/{secret-picker-B1Sm2AGS.js → secret-picker-Bh-9Okys.js} +1 -1
- package/dist/client/assets/{secrets-BnQFmasl.js → secrets-BpaSArcv.js} +1 -1
- package/dist/client/assets/{section-array-field-D7aYRyOo.js → section-array-field-YpT7n9vG.js} +1 -1
- package/dist/client/assets/{sections-BB3EA9UD.js → sections-BDOnV4mD.js} +1 -1
- package/dist/client/assets/{sections-editor-CgPW71Cu.js → sections-editor-e-APM9PR.js} +1 -1
- package/dist/client/assets/{select-oOpcW8y8.js → select-DbxUTGle.js} +1 -1
- package/dist/client/assets/{select-model-DRmGTTKK.js → select-model-B_SYZDlx.js} +1 -1
- package/dist/client/assets/{seo-editor-CHYDqTFC.js → seo-editor-BAb4_SVN.js} +1 -1
- package/dist/client/assets/{separator-kcuCI0BI.js → separator-C0AfeS3O.js} +1 -1
- package/dist/client/assets/settings-tab-BdJ07iEH.js +1 -0
- package/dist/client/assets/{sheet-B4sQvcZD.js → sheet-BeOc3FAs.js} +1 -1
- package/dist/client/assets/{shell-layout-C4gugWKg.js → shell-layout-QlUCYlok.js} +1 -1
- package/dist/client/assets/{site-draft-actions-DpgDCYG8.js → site-draft-actions-BsBc3-Kf.js} +1 -1
- package/dist/client/assets/{site-draft-view-BZ84hckI.js → site-draft-view-B2Uxv1of.js} +1 -1
- package/dist/client/assets/site-editor-CkLwv4jN.js +1 -0
- package/dist/client/assets/{site-editor-toast-CPe_RO4U.js → site-editor-toast-Bw0qMl-K.js} +1 -1
- package/dist/client/assets/{skills-CUzlP_yL.js → skills-DK12dTU3.js} +1 -1
- package/dist/client/assets/{slider-DMICv7y9.js → slider-DWOCTsGO.js} +1 -1
- package/dist/client/assets/{sortable.esm-DMidKm69.js → sortable.esm-Bcfqg7Xt.js} +1 -1
- package/dist/client/assets/{sso-rrH5Y6U0.js → sso-BK-CwpIa.js} +1 -1
- package/dist/client/assets/{suggestion-D5SniAVu.js → suggestion-DpDJqics.js} +1 -1
- package/dist/client/assets/{super-agent-icon-CDMKv4pz.js → super-agent-icon-DSWf_C0v.js} +1 -1
- package/dist/client/assets/{switch-DCbfNrSN.js → switch-CdoFqihq.js} +1 -1
- package/dist/client/assets/{synced-repos-_SlW524E.js → synced-repos-BBp6YhqW.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BmobLy_7.js → tab-icon-glyph-BA-Ya2gQ.js} +1 -1
- package/dist/client/assets/{table-BdoV93HO.js → table-DBeLX30i.js} +1 -1
- package/dist/client/assets/{tabs-CGFgLwIj.js → tabs-BwIUi1Ro.js} +1 -1
- package/dist/client/assets/{task-board--eP68xys.js → task-board-Dt94BxWj.js} +1 -1
- package/dist/client/assets/{task-route-Btx_tQTg.js → task-route-BLTj-Kt_.js} +1 -1
- package/dist/client/assets/{task-status-BvghF77r.js → task-status-COZT_U35.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BZAQkd-b.js → taskboard-analytics-DTwKCUBR.js} +1 -1
- package/dist/client/assets/{tasks-C8a0rX7H.js → tasks-BSIA3XNt.js} +1 -1
- package/dist/client/assets/tasks-CbzokKrd.js +1 -0
- package/dist/client/assets/{textarea-DiKdmgZC.js → textarea-0zeG6rdh.js} +1 -1
- package/dist/client/assets/{thread-analytics-D3z89Y54.js → thread-analytics-e-DAlOc7.js} +1 -1
- package/dist/client/assets/{thread-intent-otNmUDpT.js → thread-intent-k_EWWvIp.js} +1 -1
- package/dist/client/assets/{thread-route-CVZs3lS7.js → thread-route-T4ycKium.js} +1 -1
- package/dist/client/assets/{thread-route-CkasfYkE.js → thread-route-bIv-22ov.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DcJJrL4A.js → thread-sheet-body-D5ENmZN2.js} +1 -1
- package/dist/client/assets/{time-range-picker-DBVsSx_d.js → time-range-picker-l-A1yfsB.js} +1 -1
- package/dist/client/assets/{toggle-group-DWJu5FLK.js → toggle-group-BR3YjLpg.js} +1 -1
- package/dist/client/assets/{tool-namespace-BOC8taOg.js → tool-namespace-nlvRAMHv.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BA1yDuio.js → tool-set-selector-iLTKI2dh.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Q9J4as0k.js → toolbar-icon-button-C1sAn-5j.js} +1 -1
- package/dist/client/assets/{tooltip-D2JXB44W.js → tooltip-7oUFzrc9.js} +1 -1
- package/dist/client/assets/{tooltipContext-DFFEsXAa.js → tooltipContext-BnluVbPZ.js} +1 -1
- package/dist/client/assets/{track-BoXXDgSF.js → track-ClTfqB2h.js} +1 -1
- package/dist/client/assets/{types-BQyA3BSs.js → types-CT2b_f_n.js} +1 -1
- package/dist/client/assets/{url-slug-C5-8vP9h.js → url-slug-DlwXWMoY.js} +1 -1
- package/dist/client/assets/{usage-stats-PiJNBrSI.js → usage-stats-DXQh2ym6.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BJRvsFFm.js → use-ai-providers-BV-M-wTR.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-Bx_7T9aq.js → use-apply-named-rule-DVA8503u.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BNelLcsB.js +1 -0
- package/dist/client/assets/{use-automations-D6sbYMe4.js → use-automations-CkOHisGI.js} +1 -1
- package/dist/client/assets/{use-autosave-B4Qmzq9F.js → use-autosave-CMjKQ8gr.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-DwFetary.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-Do_nZB5B.js → use-chat-layout-state-DYxnWGXI.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-xdyGorKy.js → use-cms-publish-actions-BRuQD-xn.js} +1 -1
- package/dist/client/assets/{use-connect-companion-vyHul4nj.js → use-connect-companion-Bz03TbqD.js} +1 -1
- package/dist/client/assets/{use-connection-D0bmffUK.js → use-connection-b1ZFdIKu.js} +1 -1
- package/dist/client/assets/{use-content-sync-lsuVBOfK.js → use-content-sync-J1DOMeIV.js} +1 -1
- package/dist/client/assets/{use-copy-BMjPWKp8.js → use-copy-MGOjhapZ.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BGBBIFpr.js → use-date-fns-locale-Db1-0fqy.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-7L7lz31t.js → use-debounced-autosave-0ckPn95E.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CoBOVCcY.js → use-debounced-value-L8Mvr3Qf.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DVIvAOkL.js → use-deco-credits-CXHEdY4g.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Bvlss2N9.js → use-decopilot-events-CExfz_YN.js} +1 -1
- package/dist/client/assets/{use-delete-block-C97xuHhI.js → use-delete-block-C4Fd-0fO.js} +1 -1
- package/dist/client/assets/{use-delete-connection-tX5LcknK.js → use-delete-connection-CiHyt6_e.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BLMaSYC-.js → use-deployment-admin-D6ysmdql.js} +1 -1
- package/dist/client/assets/{use-entitlements-npCYsfMp.js → use-entitlements-DKzKnO7t.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Dd9sZXW3.js → use-fast-preview-draft-url-Rhzecu_l.js} +1 -1
- package/dist/client/assets/{use-file-configs-H9DeMtGB.js → use-file-configs-FzJwNbFB.js} +1 -1
- package/dist/client/assets/{use-id-selection-DwyVyKTM.js → use-id-selection-DV-7Zfn_.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CrWtaQnK.js → use-inbox-feed-P-dmKrll.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-6BCwcRG9.js → use-infinite-scroll-D4cD1T3_.js} +1 -1
- package/dist/client/assets/{use-join-requests-B4f6m6mx.js → use-join-requests-BZyMQ0xJ.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CRM1n__j.js → use-main-panel-tabs-DTyQot8D.js} +1 -1
- package/dist/client/assets/use-mcp-auth-status-BzTNOh9a.js +1 -0
- package/dist/client/assets/{use-mcp-client-CAI0PiRc.js → use-mcp-client-CVGnTbnR.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DqQEh2Qr.js → use-mcp-prompts-C72FS5ih.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DTs06gsh.js → use-mcp-tools-DQ6qPp-q.js} +1 -1
- package/dist/client/assets/{use-mobile-DlyIeamj.js → use-mobile-Box5tF93.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CfkVWpoJ.js → use-move-blocks-D_Vs6N9H.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-rf_XQPo1.js → use-navigate-to-agent-BFXAaVqR.js} +1 -1
- package/dist/client/assets/{use-never-published-DP-ayb_U.js → use-never-published-D5jr8ByQ.js} +1 -1
- package/dist/client/assets/{use-org-fs-DzWj7Jta.js → use-org-fs-DhEmmAqR.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-0oF8-eI-.js → use-org-repo-syncs-D4_eFcdp.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bz3FXaUK.js → use-org-sso-PK2UdKUD.js} +1 -1
- package/dist/client/assets/{use-organization-settings-04SG-hKv.js → use-organization-settings-1gniuS7P.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-C642E_7q.js → use-project-native-view-presence-CWUPdvlx.js} +1 -1
- package/dist/client/assets/{use-project-scope-BTU4ukSL.js → use-project-scope-RvpHL0s_.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Bh-9Swg8.js → use-recent-apps-B7zKTjxf.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-C6P63hrA.js → use-reports-diagnostic-Df9ZgP2V.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BgsP-jl-.js → use-sandbox-events-BV2Y1Vu8.js} +1 -1
- package/dist/client/assets/{use-secrets-CL1K9zBu.js → use-secrets-DE7J5I_l.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DiLHxC8Z.js → use-section-preview-base-BJE9UobB.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-D-c-hbM9.js → use-sidebar-collapsed-BFQg4qhu.js} +1 -1
- package/dist/client/assets/{use-tags-0c8J6MeW.js → use-tags-CV-rF5OD.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Bp8Wbi_t.js → use-task-board-analytics-BFgtA0eR.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BC3zf7YM.js → use-task-board-events-DMey0obH.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BByRm2Es.js → use-task-board-item-prs-B52UpU_u.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BhZCRvwX.js → use-task-board-items-BxTPwb-L.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-BRt0XfbY.js → use-task-board-prompts-BRQWf9Pf.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DK9jGytt.js → use-task-metadata-CX5mjd3k.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DcXhIS9K.js → use-thread-outputs-NzO2uf9T.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-By-WcYfU.js → use-view-draft-kind-Czb3VJ2z.js} +1 -1
- package/dist/client/assets/{use-voice-input-Bt11fXlC.js → use-voice-input-CJwxrnH4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BVraOGoC.js +1 -0
- package/dist/client/assets/{useQueries-tOLR6QE3.js → useQueries-BTKHF006.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Ta5X_y4e.js +1 -0
- package/dist/client/assets/{users-BW_rkyv3.js → users-C1cmyiHr.js} +1 -1
- package/dist/client/assets/{utils-2an1bWl1.js → utils-dLgjLO-5.js} +2 -2
- package/dist/client/assets/{variant-calendar-7xv9ohqO.js → variant-calendar-BFvdqyOs.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CGi_ZY_N.js → variant-matcher-override-uOKZ9bIk.js} +1 -1
- package/dist/client/assets/{view-header-DkkNDHNd.js → view-header-g_I-xUvY.js} +1 -1
- package/dist/client/assets/{virtual-mcp-D-PJ7-_0.js → virtual-mcp-CIFm7Ktp.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Gp1E8HHl.js → watch-sse-pool-Cs81gduQ.js} +1 -1
- package/dist/client/index.html +11 -3
- package/dist/server/server.js +637 -637
- package/package.json +1 -1
- package/dist/client/assets/agent-app-IytyCAeX.js +0 -1
- package/dist/client/assets/agent-deck-BaQ_Lg8E.js +0 -1
- package/dist/client/assets/agent-experiments-BQTqMeA9.js +0 -1
- package/dist/client/assets/agent-file-aW_ERFnN.js +0 -1
- package/dist/client/assets/agent-library-BMuykAhZ.js +0 -1
- package/dist/client/assets/agent-library-file-DMgZUrW5.js +0 -1
- package/dist/client/assets/agent-overview-BCgVG2tE.js +0 -1
- package/dist/client/assets/agent-settings-DmzwtPvi.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CtuKhycC.js +0 -2
- package/dist/client/assets/agent-site-editor-content-6A0AHGJH.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DiYiv2sS.js +0 -1
- package/dist/client/assets/agent-view-BLZVy10x.js +0 -1
- package/dist/client/assets/api-keys-BVTq6_vY.js +0 -1
- package/dist/client/assets/content-tab-BGklezQM.js +0 -19
- package/dist/client/assets/item-actions-Cdz0dPi_.js +0 -1
- package/dist/client/assets/library-CLMpbtIy.js +0 -1
- package/dist/client/assets/project-reports-Bph27UgY.js +0 -1
- package/dist/client/assets/project-tasks-g0DZAutp.js +0 -1
- package/dist/client/assets/reports-BNOk1CAK.js +0 -1
- package/dist/client/assets/repositories-Bh3IcyhH.js +0 -1
- package/dist/client/assets/route-Bq6SpTLT.js +0 -1
- package/dist/client/assets/settings-tab-vjcKSXb3.js +0 -1
- package/dist/client/assets/site-editor-BJf_n_54.js +0 -1
- package/dist/client/assets/tasks-BNPmBOf9.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BbPdenM-.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-D8GbwCrf.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-C-7pHlxN.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cr6l3hRz.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BEaEPCKW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as H,t as U,a9 as S,C as Z,aa as Q,f as R,ab as X,ac as J,o as z}from"./usage-stats-PiJNBrSI.js";import{gx as M,hj as C,gw as P,hk as x,hl as L,hm as V,hn as K,ho as _,gz as A,eQ as N,r as p,c7 as $}from"./index-CHOxYhnv.js";import{C as k}from"./index-BmYwClLx.js";function tt(t,e){const i=Math.min(t.top,e.top),s=Math.max(t.bottom,e.bottom),l=Math.min(t.left,e.left),r=Math.max(t.right,e.right)-l,n=s-i;return new DOMRect(l,i,r,n)}var et=class{get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(M(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(C(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e;const{selection:i}=this.editor.state,s=(t=this.getReferencedVirtualElement)===null||t===void 0?void 0:t.call(this);if(s)return s;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const l=S(this.view,i.from,i.to);let r={getBoundingClientRect:()=>l,getClientRects:()=>[l]};if(i instanceof Z){let n=this.view.nodeDOM(i.from);const d=n.dataset.nodeViewWrapper?n:n.querySelector("[data-node-view-wrapper]");d&&(n=d),n&&(r={getBoundingClientRect:()=>n.getBoundingClientRect(),getClientRects:()=>[n.getBoundingClientRect()]})}if(i instanceof k){const{$anchorCell:n,$headCell:d}=i,g=n?n.pos:d.pos,f=d?d.pos:n.pos,u=this.view.nodeDOM(g),o=this.view.nodeDOM(f);if(!u||!o)return;const a=u===o?u.getBoundingClientRect():tt(u.getBoundingClientRect(),o.getBoundingClientRect());r={getBoundingClientRect:()=>a,getClientRects:()=>[a]}}return r}constructor({editor:t,element:e,view:i,pluginKey:s="bubbleMenu",updateDelay:l=250,resizeDelay:r=60,shouldShow:n,appendTo:d,getReferencedVirtualElement:g,options:f}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:o,state:a,from:h,to:c})=>{const{doc:m,selection:y}=a,{empty:O}=y,b=!m.textBetween(h,c).length&&Q(a.selection),v=this.element.contains(document.activeElement);return!(!(o.hasFocus()||v)||O||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(o,a)=>{const h=!a?.selection.eq(o.state.selection),c=!a?.doc.eq(o.state.doc);!h&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(o,h,c,a)},this.updateDelay))},this.updateHandler=(o,a,h,c)=>{const{composing:m}=o;if(!(m||!a&&!h)){if(!this.getShouldShow(c)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:o})=>{const a=o.getMeta(this.pluginKey);a==="updatePosition"?this.updatePosition():a&&typeof a=="object"&&a.type==="updateOptions"?this.updateOptions(a.options):a==="hide"?this.hide():a==="show"&&(this.updatePosition(),this.show())},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(u=f?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=g,this.floatingUIOptions={...this.floatingUIOptions,...f},this.element.tabIndex=0,n&&(this.shouldShow=n),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&A(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:i,strategy:s,middlewareData:l})=>{var r,n;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((n=l.hide)===null||n===void 0)&&n.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${e}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:i}=t,s=i.selection.from!==i.selection.to;if(this.updateDelay>0&&s){this.handleDebouncedUpdate(t,e);return}const l=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,l,r,e)}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return((e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:i,oldState:t,from:r,to:n}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const B=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new et({view:e,...t})});R.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[B({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var it=class{getTextContent(t){return X(t,{textSerializers:J(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(M(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(C(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}constructor({editor:t,element:e,view:i,pluginKey:s="floatingMenu",updateDelay:l=250,resizeDelay:r=60,options:n,appendTo:d,shouldShow:g}){var f;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:o})=>{const{selection:a}=o,{$anchor:h,empty:c}=a,m=h.depth===1,y=h.parent.isTextblock&&!h.parent.type.spec.code&&!h.parent.textContent&&h.parent.childCount===0&&!this.getTextContent(h.parent);return!(!u.hasFocus()||!c||!m||!y||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,o,a,h)=>{const{composing:c}=u;if(!(c||!o&&!a)){if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var o;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((o=this.element.parentNode)===null||o===void 0)&&o.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const o=u.getMeta(this.pluginKey);o==="updatePosition"?this.updatePosition():o&&typeof o=="object"&&o.type==="updateOptions"?this.updateOptions(o.options):o==="hide"?this.hide():o==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(f=n?.scrollTarget)!==null&&f!==void 0?f:window,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,g&&(this.shouldShow=g),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return(e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,view:this.view,state:i,oldState:t,from:r,to:n})}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){var t;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const{selection:e}=this.editor.state,i=S(this.view,e.from,e.to);A({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:l,strategy:r,middlewareData:n})=>{var d,g;if(!((d=n.hide)===null||d===void 0)&&d.referenceHidden||!((g=n.hide)===null||g===void 0)&&g.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${s}px`,this.element.style.top=`${l}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const i=!e?.selection.eq(t.state.selection),s=!e?.doc.eq(t.state.doc);this.updateHandler(t,i,s,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const F=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new it({view:e,...t})});R.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[F({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function W(t,e){return t??new U(e)}const st=typeof window<"u"?p.useLayoutEffect:p.useEffect,j=new Set(["left","opacity","position","top","visibility","width"]),nt=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),ot=new Set(["children","className","style"]),rt=new Set(["tabIndex"]),lt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),at={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function T(t,e){return/^on[A-Z]/.test(t)&&typeof e=="function"}function dt(t){return t.startsWith("aria-")||t.startsWith("data-"),t}function ut(t){return t.startsWith("aria-")||t.startsWith("data-")||lt.has(t)}function q(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function ht(t){var e;const i=t.endsWith("Capture"),s=(i?t.slice(0,-7):t).slice(2);return{eventName:(e=at[s])!==null&&e!==void 0?e:s.toLowerCase(),options:i?{capture:!0}:void 0}}function ct(t,e){let i=e.defaultPrevented,s=!1;const l=Object.create(e);return Object.defineProperties(l,{nativeEvent:{value:e},currentTarget:{value:t},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>i},isPropagationStopped:{value:()=>s},preventDefault:{value:()=>{i=!0,e.preventDefault()}},stopPropagation:{value:()=>{s=!0,e.stopPropagation()}}}),l}function E(t){return rt.has(t)}function D(t,e,i){if(e==="tabIndex"){t.tabIndex=Number(i);return}t[e]=i}function ft(t,e){if(e==="tabIndex"){t.removeAttribute("tabindex");return}const i=t[e];if(typeof i=="boolean"){t[e]=!1;return}if(typeof i=="number"){t[e]=0;return}t[e]=""}function pt(t,e){return typeof e!="number"||e===0||t.startsWith("--")||nt.has(t)?String(e):`${e}px`}function gt(t,e){j.has(e)||t.style.removeProperty(q(e))}function mt(t,e,i){j.has(e)||t.style.setProperty(q(e),pt(e,i))}function vt(t,e,i){new Set([...Object.keys(e),...Object.keys(i)]).forEach(s=>{if(ot.has(s)||!ut(s)||T(s,e[s])||T(s,i[s]))return;const l=e[s],r=i[s];if(l===r)return;const n=dt(s);if(r==null||r===!1){E(s)&&ft(t,s),t.removeAttribute(n);return}if(r===!0){E(s)&&D(t,s,!0),t.setAttribute(n,"");return}if(E(s)){D(t,s,r);return}t.setAttribute(n,String(r))})}function yt(t,e,i){if(e!==i){if(i){t.className=i;return}t.removeAttribute("class")}}function bt(t,e,i){const s=e??{},l=i??{};new Set([...Object.keys(s),...Object.keys(l)]).forEach(r=>{const n=s[r],d=l[r];if(n!==d){if(d==null){gt(t,r);return}mt(t,r,d)}})}function wt(t,e,i){e.forEach(({eventName:l,listener:r,options:n})=>{t.removeEventListener(l,r,n)});const s=[];return Object.entries(i).forEach(([l,r])=>{if(!T(l,r))return;const{eventName:n,options:d}=ht(l),g=f=>{r(ct(t,f))};t.addEventListener(n,g,d),s.push({eventName:n,listener:g,options:d})}),s}function Y(t,e){const i=p.useRef({}),s=p.useRef([]);st(()=>{const l=i.current;return yt(t,l.className,e.className),bt(t,l.style,e.style),vt(t,l,e),s.current=wt(t,s.current,e),i.current=e,()=>{s.current.forEach(({eventName:r,listener:n,options:d})=>{t.removeEventListener(r,n,d)}),s.current=[]}},[t,e])}const Tt=N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,getReferencedVirtualElement:n,options:d,children:g,...f},u)=>{const o=p.useRef(document.createElement("div")),a=p.useRef(W(t,"bubbleMenu")).current;Y(o.current,f),typeof u=="function"?u(o.current):u&&(u.current=o.current);const{editor:h}=z(),c=e||h,m={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:a,shouldShow:r,getReferencedVirtualElement:n,options:d},y=p.useRef(m);y.current=m;const[O,b]=p.useState(!1),v=p.useRef(!0);return p.useEffect(()=>{if(c?.isDestroyed)return;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const w=o.current;w.style.visibility="hidden",w.style.position="absolute";const I=B({...y.current,editor:c,element:w});c.registerPlugin(I);const G=y.current.pluginKey;return v.current=!0,b(!0),()=>{b(!1),c.unregisterPlugin(G),window.requestAnimationFrame(()=>{w.parentNode&&w.parentNode.removeChild(w)})}},[c]),p.useEffect(()=>{if(!(!O||!c||c.isDestroyed)){if(v.current){v.current=!1;return}c.view.dispatch(c.state.tr.setMeta(a,{type:"updateOptions",options:y.current}))}},[O,c,i,s,r,d,l,n,a]),$.createPortal(g,o.current)});N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,options:n,children:d,...g},f)=>{const u=p.useRef(document.createElement("div")),o=p.useRef(W(t,"floatingMenu")).current;Y(u.current,g),typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:a}=z(),h=e||a,c={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:o,shouldShow:r,options:n},m=p.useRef(c);m.current=c;const[y,O]=p.useState(!1),b=p.useRef(!0);return p.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const v=u.current;v.style.visibility="hidden",v.style.position="absolute";const w=F({...m.current,editor:h,element:v});h.registerPlugin(w);const I=m.current.pluginKey;return b.current=!0,O(!0),()=>{O(!1),h.unregisterPlugin(I),window.requestAnimationFrame(()=>{v.parentNode&&v.parentNode.removeChild(v)})}},[h]),p.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(b.current){b.current=!1;return}h.view.dispatch(h.state.tr.setMeta(o,{type:"updateOptions",options:m.current}))}},[y,h,i,s,r,n,l,o]),$.createPortal(d,u.current)});export{Tt as B};
|
|
1
|
+
import{A as H,t as U,a9 as S,C as Z,aa as Q,f as R,ab as X,ac as J,o as z}from"./usage-stats-DXQh2ym6.js";import{gx as M,hj as C,gw as P,hk as x,hl as L,hm as V,hn as K,ho as _,gz as A,eQ as N,r as p,c7 as $}from"./index-PfzOl7J6.js";import{C as k}from"./index-BxZUC_i-.js";function tt(t,e){const i=Math.min(t.top,e.top),s=Math.max(t.bottom,e.bottom),l=Math.min(t.left,e.left),r=Math.max(t.right,e.right)-l,n=s-i;return new DOMRect(l,i,r,n)}var et=class{get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(M(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(C(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e;const{selection:i}=this.editor.state,s=(t=this.getReferencedVirtualElement)===null||t===void 0?void 0:t.call(this);if(s)return s;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const l=S(this.view,i.from,i.to);let r={getBoundingClientRect:()=>l,getClientRects:()=>[l]};if(i instanceof Z){let n=this.view.nodeDOM(i.from);const d=n.dataset.nodeViewWrapper?n:n.querySelector("[data-node-view-wrapper]");d&&(n=d),n&&(r={getBoundingClientRect:()=>n.getBoundingClientRect(),getClientRects:()=>[n.getBoundingClientRect()]})}if(i instanceof k){const{$anchorCell:n,$headCell:d}=i,g=n?n.pos:d.pos,f=d?d.pos:n.pos,u=this.view.nodeDOM(g),o=this.view.nodeDOM(f);if(!u||!o)return;const a=u===o?u.getBoundingClientRect():tt(u.getBoundingClientRect(),o.getBoundingClientRect());r={getBoundingClientRect:()=>a,getClientRects:()=>[a]}}return r}constructor({editor:t,element:e,view:i,pluginKey:s="bubbleMenu",updateDelay:l=250,resizeDelay:r=60,shouldShow:n,appendTo:d,getReferencedVirtualElement:g,options:f}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:o,state:a,from:h,to:c})=>{const{doc:m,selection:y}=a,{empty:O}=y,b=!m.textBetween(h,c).length&&Q(a.selection),v=this.element.contains(document.activeElement);return!(!(o.hasFocus()||v)||O||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(o,a)=>{const h=!a?.selection.eq(o.state.selection),c=!a?.doc.eq(o.state.doc);!h&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(o,h,c,a)},this.updateDelay))},this.updateHandler=(o,a,h,c)=>{const{composing:m}=o;if(!(m||!a&&!h)){if(!this.getShouldShow(c)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:o})=>{const a=o.getMeta(this.pluginKey);a==="updatePosition"?this.updatePosition():a&&typeof a=="object"&&a.type==="updateOptions"?this.updateOptions(a.options):a==="hide"?this.hide():a==="show"&&(this.updatePosition(),this.show())},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(u=f?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=g,this.floatingUIOptions={...this.floatingUIOptions,...f},this.element.tabIndex=0,n&&(this.shouldShow=n),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&A(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:i,strategy:s,middlewareData:l})=>{var r,n;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((n=l.hide)===null||n===void 0)&&n.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${e}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:i}=t,s=i.selection.from!==i.selection.to;if(this.updateDelay>0&&s){this.handleDebouncedUpdate(t,e);return}const l=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,l,r,e)}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return((e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:i,oldState:t,from:r,to:n}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const B=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new et({view:e,...t})});R.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[B({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var it=class{getTextContent(t){return X(t,{textSerializers:J(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(M(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(C(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}constructor({editor:t,element:e,view:i,pluginKey:s="floatingMenu",updateDelay:l=250,resizeDelay:r=60,options:n,appendTo:d,shouldShow:g}){var f;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:o})=>{const{selection:a}=o,{$anchor:h,empty:c}=a,m=h.depth===1,y=h.parent.isTextblock&&!h.parent.type.spec.code&&!h.parent.textContent&&h.parent.childCount===0&&!this.getTextContent(h.parent);return!(!u.hasFocus()||!c||!m||!y||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,o,a,h)=>{const{composing:c}=u;if(!(c||!o&&!a)){if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var o;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((o=this.element.parentNode)===null||o===void 0)&&o.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const o=u.getMeta(this.pluginKey);o==="updatePosition"?this.updatePosition():o&&typeof o=="object"&&o.type==="updateOptions"?this.updateOptions(o.options):o==="hide"?this.hide():o==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(f=n?.scrollTarget)!==null&&f!==void 0?f:window,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,g&&(this.shouldShow=g),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return(e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,view:this.view,state:i,oldState:t,from:r,to:n})}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){var t;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const{selection:e}=this.editor.state,i=S(this.view,e.from,e.to);A({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:l,strategy:r,middlewareData:n})=>{var d,g;if(!((d=n.hide)===null||d===void 0)&&d.referenceHidden||!((g=n.hide)===null||g===void 0)&&g.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${s}px`,this.element.style.top=`${l}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const i=!e?.selection.eq(t.state.selection),s=!e?.doc.eq(t.state.doc);this.updateHandler(t,i,s,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const F=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new it({view:e,...t})});R.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[F({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function W(t,e){return t??new U(e)}const st=typeof window<"u"?p.useLayoutEffect:p.useEffect,j=new Set(["left","opacity","position","top","visibility","width"]),nt=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),ot=new Set(["children","className","style"]),rt=new Set(["tabIndex"]),lt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),at={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function T(t,e){return/^on[A-Z]/.test(t)&&typeof e=="function"}function dt(t){return t.startsWith("aria-")||t.startsWith("data-"),t}function ut(t){return t.startsWith("aria-")||t.startsWith("data-")||lt.has(t)}function q(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function ht(t){var e;const i=t.endsWith("Capture"),s=(i?t.slice(0,-7):t).slice(2);return{eventName:(e=at[s])!==null&&e!==void 0?e:s.toLowerCase(),options:i?{capture:!0}:void 0}}function ct(t,e){let i=e.defaultPrevented,s=!1;const l=Object.create(e);return Object.defineProperties(l,{nativeEvent:{value:e},currentTarget:{value:t},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>i},isPropagationStopped:{value:()=>s},preventDefault:{value:()=>{i=!0,e.preventDefault()}},stopPropagation:{value:()=>{s=!0,e.stopPropagation()}}}),l}function E(t){return rt.has(t)}function D(t,e,i){if(e==="tabIndex"){t.tabIndex=Number(i);return}t[e]=i}function ft(t,e){if(e==="tabIndex"){t.removeAttribute("tabindex");return}const i=t[e];if(typeof i=="boolean"){t[e]=!1;return}if(typeof i=="number"){t[e]=0;return}t[e]=""}function pt(t,e){return typeof e!="number"||e===0||t.startsWith("--")||nt.has(t)?String(e):`${e}px`}function gt(t,e){j.has(e)||t.style.removeProperty(q(e))}function mt(t,e,i){j.has(e)||t.style.setProperty(q(e),pt(e,i))}function vt(t,e,i){new Set([...Object.keys(e),...Object.keys(i)]).forEach(s=>{if(ot.has(s)||!ut(s)||T(s,e[s])||T(s,i[s]))return;const l=e[s],r=i[s];if(l===r)return;const n=dt(s);if(r==null||r===!1){E(s)&&ft(t,s),t.removeAttribute(n);return}if(r===!0){E(s)&&D(t,s,!0),t.setAttribute(n,"");return}if(E(s)){D(t,s,r);return}t.setAttribute(n,String(r))})}function yt(t,e,i){if(e!==i){if(i){t.className=i;return}t.removeAttribute("class")}}function bt(t,e,i){const s=e??{},l=i??{};new Set([...Object.keys(s),...Object.keys(l)]).forEach(r=>{const n=s[r],d=l[r];if(n!==d){if(d==null){gt(t,r);return}mt(t,r,d)}})}function wt(t,e,i){e.forEach(({eventName:l,listener:r,options:n})=>{t.removeEventListener(l,r,n)});const s=[];return Object.entries(i).forEach(([l,r])=>{if(!T(l,r))return;const{eventName:n,options:d}=ht(l),g=f=>{r(ct(t,f))};t.addEventListener(n,g,d),s.push({eventName:n,listener:g,options:d})}),s}function Y(t,e){const i=p.useRef({}),s=p.useRef([]);st(()=>{const l=i.current;return yt(t,l.className,e.className),bt(t,l.style,e.style),vt(t,l,e),s.current=wt(t,s.current,e),i.current=e,()=>{s.current.forEach(({eventName:r,listener:n,options:d})=>{t.removeEventListener(r,n,d)}),s.current=[]}},[t,e])}const Tt=N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,getReferencedVirtualElement:n,options:d,children:g,...f},u)=>{const o=p.useRef(document.createElement("div")),a=p.useRef(W(t,"bubbleMenu")).current;Y(o.current,f),typeof u=="function"?u(o.current):u&&(u.current=o.current);const{editor:h}=z(),c=e||h,m={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:a,shouldShow:r,getReferencedVirtualElement:n,options:d},y=p.useRef(m);y.current=m;const[O,b]=p.useState(!1),v=p.useRef(!0);return p.useEffect(()=>{if(c?.isDestroyed)return;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const w=o.current;w.style.visibility="hidden",w.style.position="absolute";const I=B({...y.current,editor:c,element:w});c.registerPlugin(I);const G=y.current.pluginKey;return v.current=!0,b(!0),()=>{b(!1),c.unregisterPlugin(G),window.requestAnimationFrame(()=>{w.parentNode&&w.parentNode.removeChild(w)})}},[c]),p.useEffect(()=>{if(!(!O||!c||c.isDestroyed)){if(v.current){v.current=!1;return}c.view.dispatch(c.state.tr.setMeta(a,{type:"updateOptions",options:y.current}))}},[O,c,i,s,r,d,l,n,a]),$.createPortal(g,o.current)});N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,options:n,children:d,...g},f)=>{const u=p.useRef(document.createElement("div")),o=p.useRef(W(t,"floatingMenu")).current;Y(u.current,g),typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:a}=z(),h=e||a,c={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:o,shouldShow:r,options:n},m=p.useRef(c);m.current=c;const[y,O]=p.useState(!1),b=p.useRef(!0);return p.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const v=u.current;v.style.visibility="hidden",v.style.position="absolute";const w=F({...m.current,editor:h,element:v});h.registerPlugin(w);const I=m.current.pluginKey;return b.current=!0,O(!0),()=>{O(!1),h.unregisterPlugin(I),window.requestAnimationFrame(()=>{v.parentNode&&v.parentNode.removeChild(v)})}},[h]),p.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(b.current){b.current=!1;return}h.view.dispatch(h.state.tr.setMeta(o,{type:"updateOptions",options:m.current}))}},[y,h,i,s,r,n,l,o]),$.createPortal(d,u.current)});export{Tt as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,f as p,av as u,j as s,aZ as x,N as a}from"./index-
|
|
1
|
+
import{c as f,f as p,av as u,j as s,aZ as x,N as a}from"./index-PfzOl7J6.js";import{C as j}from"./capability-load-error-BCoAaz36.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-CHOxYhnv.js";import{n as oe}from"./ArrowUp-BKp-bI0t.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-o9Pyy_rd.js";import{s as ye,g as J,d as ve}from"./tool-namespace-BOC8taOg.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-D2JXB44W.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-Donq2Zq_.js";import{C as Ee}from"./collection-search-Cr2_Tgzy.js";import{u as De}from"./use-mobile-DlyIeamj.js";import{u as Me}from"./use-mcp-client-CAI0PiRc.js";import{u as _e,g as Be}from"./use-mcp-prompts-DqQEh2Qr.js";import{h as Ie,P as Le}from"./usage-stats-PiJNBrSI.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-rNhKaUqk.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-BoFr4FJb.js";import{u as qe,i as Ke}from"./thread-intent-otNmUDpT.js";import{b as Ue}from"./use-view-draft-kind-By-WcYfU.js";import{N as Ve}from"./index-Ujlc9MWT.js";import{i as Qe}from"./LinkBroken01-Beajkv8Y.js";import{f as ee}from"./agent-icon-C-RKmmDR.js";import{d as We}from"./use-entitlements-npCYsfMp.js";import{u as Xe}from"./use-deco-credits-DVIvAOkL.js";import{F as Ye}from"./feature-paywall-DKb-BDqu.js";import{i as Ze}from"./AlertCircle-BHOdje2-.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
|
|
1
|
+
import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-PfzOl7J6.js";import{n as oe}from"./ArrowUp-DBkhb8Yz.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-DmIaWG0i.js";import{s as ye,g as J,d as ve}from"./tool-namespace-nlvRAMHv.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-7oUFzrc9.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-BUu3Urhv.js";import{C as Ee}from"./collection-search-DXnQxUGL.js";import{u as De}from"./use-mobile-Box5tF93.js";import{u as Me}from"./use-mcp-client-CVGnTbnR.js";import{u as _e,g as Be}from"./use-mcp-prompts-C72FS5ih.js";import{h as Ie,P as Le}from"./usage-stats-DXQh2ym6.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-CHXvb5rt.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-4_jIXzEz.js";import{u as qe,i as Ke}from"./thread-intent-k_EWWvIp.js";import{b as Ue}from"./use-view-draft-kind-Czb3VJ2z.js";import{N as Ve}from"./index-D9OoYQHh.js";import{i as Qe}from"./LinkBroken01-CzDrAWsX.js";import{f as ee}from"./agent-icon-DPgCnEV1.js";import{d as We}from"./use-entitlements-DKzKnO7t.js";import{u as Xe}from"./use-deco-credits-CXHEdY4g.js";import{F as Ye}from"./feature-paywall-CgY8XcJe.js";import{i as Ze}from"./AlertCircle-GXBIxFcm.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,b as X,r as $,m as W,j as s,a4 as ze,e as nt,t as je,D as it,v as lt,w as ot,x as at,y as ct,B as Fe,au as dt,Y as ke,a5 as ut,E as H,X as ft,Z as mt,_ as ht,d as pt,aB as gt,l as bt,H as xt,ar as $e,L as Ye,$ as jt,at as Ge,aC as yt,P as vt}from"./index-CHOxYhnv.js";import{u as Ie,c as Ze,i as St,j as wt,k as Ct,l as _t}from"./use-sidebar-collapsed-D-c-hbM9.js";import{S as kt,a as Ot,b as zt}from"./sheet-B4sQvcZD.js";import{u as Rt}from"./use-mobile-DlyIeamj.js";import{u as Et,a as Dt,D as Nt,c as Tt,C as Lt,P as Pt}from"./core.esm-AubJLKZ-.js";import{S as At,v as Mt,u as $t}from"./sortable.esm-DMidKm69.js";import{i as It}from"./Tool01-C_vFDQiZ.js";import{y as Kt,z as Ft,B as Bt,C as Ut,A as Wt,D as Be,l as Ht}from"./agent-icon-C-RKmmDR.js";import{s as Xt}from"./Plus-jqQtsDrV.js";import{i as Yt}from"./UserSquare-DomA7Npc.js";import{s as qe}from"./XClose-DsOcImLD.js";import{T as ge,a as be,c as xe}from"./tooltip-D2JXB44W.js";import{C as Pe,f as Gt,g as Zt,e as qt}from"./context-menu-DIqy9oGB.js";import{a as Vt,O as Ve,w as Jt,b as Qt,c as es,E as ts,r as Oe,d as ss,e as rs,h as ns,t as is,f as Je,m as ls,o as os}from"./shell-layout-C4gugWKg.js";import{C as as}from"./create-organization-dialog-D5uXvaYq.js";import{P as cs}from"./project-apps-CNXyAUnR.js";import{u as ds,a as us}from"./use-recent-apps-Bh-9Swg8.js";import{a as fs}from"./use-navigate-to-agent-rf_XQPo1.js";import{a as ms,u as hs}from"./use-project-scope-BTU4ukSL.js";import{C as Ue,a as ps,b as gs,c as bs,d as xs}from"./command-CnhVLB17.js";import{u as js}from"./use-debounced-value-CoBOVCcY.js";import{n as ys}from"./BookOpen01-CCzJ3iHg.js";import{F as vs,a as Ae,b as Ss,c as Qe}from"./feedback-BqoIMOg7.js";import{T as ws}from"./textarea-DiKdmgZC.js";function Cs(t){const e=I.c(48),{open:n,onOpenChange:r,orgs:i,currentSlug:c,onSelect:l}=t,d=X(),[o,f]=$.useState("");let b;e[0]!==o?(b=o.trim(),e[0]=o,e[1]=b):b=e[1];const h=b,p=js(h,150),m=h.length>0,u=p===h,{hits:y,isSearching:j,isStale:C,isError:w}=Vt(m?p:""),a=m?y:i;let x;e[2]!==r?(x=L=>{r(L),L||f("")},e[2]=r,e[3]=x):x=e[3];const g=x;let v;e[4]!==d?(v=d("sidebar.rail.searchOrganizations"),e[4]=d,e[5]=v):v=e[5];let S;e[6]!==d?(S=d("sidebar.rail.searchPlaceholder"),e[6]=d,e[7]=S):S=e[7];let k;e[8]!==d?(k=d("sidebar.rail.searchPlaceholder"),e[8]=d,e[9]=k):k=e[9];let _;e[10]!==o||e[11]!==k?(_=s.jsx(ps,{value:o,onValueChange:f,placeholder:k}),e[10]=o,e[11]=k,e[12]=_):_=e[12];const T=m&&(C||!u)&&"opacity-50";let R;e[13]!==T?(R=W(T),e[13]=T,e[14]=R):R=e[14];let O;e[15]!==w||e[16]!==m||e[17]!==d?(O=m&&w&&s.jsx(Ue,{children:d("sidebar.rail.searchFailed")}),e[15]=w,e[16]=m,e[17]=d,e[18]=O):O=e[18];let E;e[19]!==w||e[20]!==j||e[21]!==a.length||e[22]!==u||e[23]!==d?(E=!w&&u&&!j&&a.length===0&&s.jsx(Ue,{children:d("sidebar.rail.searchEmpty")}),e[19]=w,e[20]=j,e[21]=a.length,e[22]=u,e[23]=d,e[24]=E):E=e[24];let D;if(e[25]!==c||e[26]!==l||e[27]!==g||e[28]!==a||e[29]!==d){let L;e[31]!==c||e[32]!==l||e[33]!==g||e[34]!==d?(L=P=>s.jsxs(gs,{value:P.slug,onSelect:()=>{g(!1),P.slug!==c&&l(P.slug)},className:"gap-2.5",children:[s.jsx(Ve,{org:P,size:"sm"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),P.slug===c&&s.jsx("span",{className:"text-meta shrink-0",children:d("sidebar.rail.currentOrganization")})]},P.id),e[31]=c,e[32]=l,e[33]=g,e[34]=d,e[35]=L):L=e[35],D=a.map(L),e[25]=c,e[26]=l,e[27]=g,e[28]=a,e[29]=d,e[30]=D}else D=e[30];let z;e[36]!==E||e[37]!==D||e[38]!==R||e[39]!==O?(z=s.jsxs(bs,{className:R,children:[O,E,D]}),e[36]=E,e[37]=D,e[38]=R,e[39]=O,e[40]=z):z=e[40];let A;return e[41]!==n||e[42]!==g||e[43]!==z||e[44]!==v||e[45]!==S||e[46]!==_?(A=s.jsxs(xs,{open:n,onOpenChange:g,title:v,description:S,shouldFilter:!1,children:[_,z]}),e[41]=n,e[42]=g,e[43]=z,e[44]=v,e[45]=S,e[46]=_,e[47]=A):A=e[47],A}function _s(t){const e=I.c(4),{size:n,className:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{d:"M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.028C.533 9.046-.32 13.58.099 18.058a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.042-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.246.198.373.292a.077.077 0 0 1-.007.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.055c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.029ZM8.02 15.331c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.956 2.418-2.157 2.418Zm7.975 0c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.946 2.418-2.157 2.418Z"}),e[0]=i):i=e[0];let c;return e[1]!==r||e[2]!==n?(c=s.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:r,children:i}),e[1]=r,e[2]=n,e[3]=c):c=e[3],c}const ks=250;function Os(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function We(t,e,n){return new Promise(r=>t.toBlob(r,e,n))}async function zs(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(c=>setTimeout(c,ks));const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight,n.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let r=await We(n,"image/png");if((!r||r.size>Qe)&&(r=await We(n,"image/jpeg",.85)),!r)throw new Error("Could not encode the screenshot");const i=r.type==="image/png"?"png":"jpg";return new File([r],`screenshot.${i}`,{type:r.type})}finally{for(const e of t.getTracks())e.stop()}}function He({kind:t,open:e,onOpenChange:n}){const r=X(),i=t==="problem"?{title:r("sidebar.problem.title"),placeholder:r("sidebar.problem.placeholder"),sent:r("sidebar.problem.sent"),failed:r("sidebar.problem.failed")}:{title:r("sidebar.feedback.title"),placeholder:r("sidebar.feedback.placeholder"),sent:r("sidebar.feedback.sent"),failed:r("sidebar.feedback.failed")},{org:c}=ze(),[l,d]=$.useState(""),[o,f]=$.useState([]),[b,h]=$.useState(!1),p=()=>{for(const a of o)URL.revokeObjectURL(a.previewUrl);f([]),d("")},m=a=>{const x=a.filter(S=>Ss.includes(S.type)?S.size>Qe?(je.error(r("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),g=Ae-o.length;x.length>g&&je.error(r("sidebar.feedback.tooManyScreenshots",{max:String(Ae)}));const v=x.slice(0,Math.max(g,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));v.length>0&&f(S=>[...S,...v])},u=a=>{URL.revokeObjectURL(a.previewUrl),f(x=>x.filter(g=>g!==a))},y=async()=>{h(!0);try{m([await zs()])}catch(a){a instanceof DOMException&&a.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",a),je.error(r("sidebar.feedback.screenshotFailed")))}finally{h(!1)}},j=a=>{const x=Array.from(a.clipboardData.files).filter(g=>g.type.startsWith("image/"));x.length!==0&&(a.preventDefault(),m(x))},C=nt({mutationFn:async()=>{const a=new FormData;a.set("kind",t),a.set("message",l.trim()),a.set("pageUrl",window.location.href);for(const g of o)a.append("screenshot",g.file);const x=await fetch(`/api/${encodeURIComponent(c.slug)}/feedback`,{method:"POST",body:a});if(!x.ok)throw new Error(`Feedback failed: ${x.status}`)},onSuccess:()=>{je.success(i.sent),p(),n(!1)},onError:()=>je.error(i.failed)}),w=l.trim().length>0&&!C.isPending;return s.jsx(it,{open:e&&!b,onOpenChange:n,children:s.jsxs(lt,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(ot,{children:s.jsx(at,{children:i.title})}),s.jsx(ws,{autoFocus:!0,value:l,onChange:a=>d(a.target.value),onPaste:j,onKeyDown:a=>{a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),w&&C.mutate())},placeholder:i.placeholder,className:"min-h-32 max-h-80",maxLength:vs}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((a,x)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:a.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:a.previewUrl,alt:r("sidebar.feedback.screenshotAlt",{n:String(x+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>u(a),"aria-label":r("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qe,{size:12})})]},a.previewUrl))}),s.jsxs(ct,{className:"sm:justify-between",children:[Os()?s.jsxs(Fe,{type:"button",variant:"outline",onClick:y,disabled:o.length>=Ae,children:[s.jsx(Kt,{size:14}),r("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx(Fe,{type:"button",onClick:()=>C.mutate(),disabled:!w,children:C.isPending?r("sidebar.feedback.sending"):r("sidebar.feedback.send")})]})]})})}function ye(t){const e=I.c(11),{active:n,label:r,children:i}=t,c=n?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let l;e[0]!==c?(l=W("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=l):l=e[1];let d;e[2]!==l?(d=s.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:s.jsx("span",{className:l})}),e[2]=l,e[3]=d):d=e[3];let o;e[4]!==n||e[5]!==r?(o=r&&s.jsx("span",{"aria-hidden":!0,className:W("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",n?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=n,e[5]=r,e[6]=o):o=e[6];let f;return e[7]!==i||e[8]!==d||e[9]!==o?(f=s.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[d,i,o]}),e[7]=i,e[8]=d,e[9]=o,e[10]=f):f=e[10],f}const Rs="https://docs.decocms.com/",Es="https://discord.gg/EQkX7CymV";function Ds(){const t=I.c(39),e=X(),{org:n}=ze(),[r,i]=$.useState(null),c=!!n.id;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=_=>{H("help_menu_dialog_opened",{kind:_}),i(_)},t[0]=l):l=t[0];const d=l;let o;t[1]!==e?(o=e("sidebar.help.button"),t[1]=e,t[2]=o):o=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:18}),t[3]=f):f=t[3];let b;t[4]!==o?(b=s.jsx(ge,{asChild:!0,children:s.jsx(ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":o,onClick:Ls,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring data-[state=open]:bg-sidebar-accent data-[state=open]:text-foreground",children:f})})}),t[4]=o,t[5]=b):b=t[5];let h;t[6]!==e?(h=e("sidebar.help.button"),t[6]=e,t[7]=h):h=t[7];let p;t[8]!==h?(p=s.jsx(be,{side:"right",children:h}),t[8]=h,t[9]=p):p=t[9];let m;t[10]!==b||t[11]!==p?(m=s.jsxs(xe,{children:[b,p]}),t[10]=b,t[11]=p,t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{}),t[13]=u):u=t[13];let y;t[14]!==e?(y=e("sidebar.help.guides"),t[14]=e,t[15]=y):y=t[15];let j;t[16]!==y?(j=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Rs,target:"_blank",rel:"noopener noreferrer",onClick:Ts,children:[u,y]})}),t[16]=y,t[17]=j):j=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_s,{}),t[18]=C):C=t[18];let w;t[19]!==e?(w=e("sidebar.help.discord"),t[19]=e,t[20]=w):w=t[20];let a;t[21]!==w?(a=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Es,target:"_blank",rel:"noopener noreferrer",onClick:Ns,children:[C,w]})}),t[21]=w,t[22]=a):a=t[22];let x;t[23]!==c||t[24]!==e?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{}),s.jsxs(ke,{onSelect:()=>d("problem"),children:[s.jsx(ut,{}),e("sidebar.help.reportProblem")]}),s.jsxs(ke,{onSelect:()=>d("feedback"),children:[s.jsx(Ft,{}),e("sidebar.feedback.button")]})]}),t[23]=c,t[24]=e,t[25]=x):x=t[25];let g;t[26]!==a||t[27]!==x||t[28]!==j?(g=s.jsxs(mt,{side:"right",align:"end",className:"w-56",children:[j,a,x]}),t[26]=a,t[27]=x,t[28]=j,t[29]=g):g=t[29];let v;t[30]!==g||t[31]!==m?(v=s.jsx(ye,{active:!1,children:s.jsxs(ht,{children:[m,g]})}),t[30]=g,t[31]=m,t[32]=v):v=t[32];let S;t[33]!==c||t[34]!==r?(S=c&&s.jsxs(s.Fragment,{children:[s.jsx(He,{kind:"problem",open:r==="problem",onOpenChange:_=>i(_?"problem":null)}),s.jsx(He,{kind:"feedback",open:r==="feedback",onOpenChange:_=>i(_?"feedback":null)})]}),t[33]=c,t[34]=r,t[35]=S):S=t[35];let k;return t[36]!==v||t[37]!==S?(k=s.jsxs(s.Fragment,{children:[v,S]}),t[36]=v,t[37]=S,t[38]=k):k=t[38],k}function Ns(){return H("help_menu_discord_opened")}function Ts(){return H("help_menu_guides_opened")}function Ls(){return H("help_menu_opened")}function Ps(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const As=()=>Je(globalThis.innerHeight),Ms=()=>Je(0);function $s(t){const e=I.c(59),{org:n,active:r,onSelect:i,pinned:c,onOpenSettings:l,onTogglePin:d,onHide:o}=t,f=X();let b;e[0]!==n.slug?(b={id:n.slug},e[0]=n.slug,e[1]=b):b=e[1];const{setNodeRef:h,listeners:p,transform:m,transition:u,isDragging:y}=$t(b);let j;e[2]!==m?(j=Lt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=j):j=e[3];const C=y?1:void 0,w=`rail-org-${n.slug}`;let a;e[4]!==j||e[5]!==C||e[6]!==w||e[7]!==u?(a={transform:j,transition:u,zIndex:C,viewTransitionName:w},e[4]=j,e[5]=C,e[6]=w,e[7]=u,e[8]=a):a=e[8];const x=n.name,g=r||void 0,v=r?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=i&&"cursor-pointer";let k;e[9]!==v||e[10]!==S?(k=W("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,S),e[9]=v,e[10]=S,e[11]=k):k=e[11];let _;e[12]!==n?(_=s.jsx(Ve,{org:n,size:"lg"}),e[12]=n,e[13]=_):_=e[13];let T;e[14]!==c?(T=c&&s.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:s.jsx(Be,{size:9})}),e[14]=c,e[15]=T):T=e[15];let R;e[16]!==i||e[17]!==n.name||e[18]!==k||e[19]!==_||e[20]!==T||e[21]!==g?(R=s.jsx(ge,{asChild:!0,children:s.jsx(Gt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":x,"aria-current":g,onClick:i,className:k,children:[_,T]})})}),e[16]=i,e[17]=n.name,e[18]=k,e[19]=_,e[20]=T,e[21]=g,e[22]=R):R=e[22];let O;e[23]!==n.name?(O=s.jsx(be,{side:"right",children:n.name}),e[23]=n.name,e[24]=O):O=e[24];let E;e[25]!==R||e[26]!==O?(E=s.jsxs(xe,{children:[R,O]}),e[25]=R,e[26]=O,e[27]=E):E=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ht,{}),e[28]=D):D=e[28];let z;e[29]!==f?(z=f("sidebar.rail.organizationSettings"),e[29]=f,e[30]=z):z=e[30];let A;e[31]!==l||e[32]!==z?(A=s.jsxs(Pe,{onSelect:l,children:[D,z]}),e[31]=l,e[32]=z,e[33]=A):A=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Be,{}),e[34]=L):L=e[34];let P;e[35]!==c||e[36]!==f?(P=f(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=f,e[37]=P):P=e[37];let F;e[38]!==d||e[39]!==P?(F=s.jsxs(Pe,{onSelect:d,children:[L,P]}),e[38]=d,e[39]=P,e[40]=F):F=e[40];let B;e[41]!==o||e[42]!==f?(B=o&&s.jsxs(Pe,{onSelect:o,children:[s.jsx(It,{}),f("sidebar.rail.hideOrganization")]}),e[41]=o,e[42]=f,e[43]=B):B=e[43];let Y;e[44]!==A||e[45]!==F||e[46]!==B?(Y=s.jsxs(Zt,{children:[A,F,B]}),e[44]=A,e[45]=F,e[46]=B,e[47]=Y):Y=e[47];let K;e[48]!==E||e[49]!==Y?(K=s.jsxs(qt,{children:[E,Y]}),e[48]=E,e[49]=Y,e[50]=K):K=e[50];let U;e[51]!==r||e[52]!==K?(U=s.jsx(ye,{active:r,children:K}),e[51]=r,e[52]=K,e[53]=U):U=e[53];let G;return e[54]!==p||e[55]!==h||e[56]!==U||e[57]!==a?(G=s.jsx("div",{ref:h,...p,style:a,className:"w-full shrink-0 touch-none",children:U}),e[54]=p,e[55]=h,e[56]=U,e[57]=a,e[58]=G):G=e[58],G}function Is(t){const e=I.c(64),{project:n,orgSlug:r,active:i,onClose:c,onNavigate:l}=t,d=X();let o,f,b,h,p,m,u,y,j,C,w;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==n.icon||e[4]!==n.id||e[5]!==n.title){const L=Ut(n.icon,n.title);w="group/rail relative flex w-full flex-col items-center gap-1",b=xe,f=ge,C=!0,o=Ye,h=jt.root,e[17]!==r||e[18]!==n.id?(p={org:r,agentId:n.id},e[17]=r,e[18]=n.id,e[19]=p):p=e[19],m=n.title,u=i||void 0,e[20]!==l?(y=()=>{H("org_rail_recent_project_opened"),l?.()},e[20]=l,e[21]=y):y=e[21],j=W("flex shrink-0 rounded-lg focus-ring",L.text,i&&"ring-[1.5px] ring-current"),e[0]=i,e[1]=l,e[2]=r,e[3]=n.icon,e[4]=n.id,e[5]=n.title,e[6]=o,e[7]=f,e[8]=b,e[9]=h,e[10]=p,e[11]=m,e[12]=u,e[13]=y,e[14]=j,e[15]=C,e[16]=w}else o=e[6],f=e[7],b=e[8],h=e[9],p=e[10],m=e[11],u=e[12],y=e[13],j=e[14],C=e[15],w=e[16];let a;e[22]!==n.icon||e[23]!==n.title?(a=s.jsx(Wt,{icon:n.icon,name:n.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=n.icon,e[23]=n.title,e[24]=a):a=e[24];let x;e[25]!==o||e[26]!==h||e[27]!==p||e[28]!==m||e[29]!==u||e[30]!==y||e[31]!==j||e[32]!==a?(x=s.jsx(o,{to:h,params:p,"aria-label":m,"aria-current":u,onClick:y,className:j,children:a}),e[25]=o,e[26]=h,e[27]=p,e[28]=m,e[29]=u,e[30]=y,e[31]=j,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==f||e[35]!==x||e[36]!==C?(g=s.jsx(f,{asChild:C,children:x}),e[34]=f,e[35]=x,e[36]=C,e[37]=g):g=e[37];let v;e[38]!==n.title?(v=s.jsx(be,{side:"right",children:n.title}),e[38]=n.title,e[39]=v):v=e[39];let S;e[40]!==b||e[41]!==g||e[42]!==v?(S=s.jsxs(b,{children:[g,v]}),e[40]=b,e[41]=g,e[42]=v,e[43]=S):S=e[43];const k=i?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let _;e[44]!==k?(_=W("line-clamp-2 w-full text-center text-2xs break-words transition-colors",k),e[44]=k,e[45]=_):_=e[45];let T;e[46]!==n.title||e[47]!==_?(T=s.jsx("span",{"aria-hidden":!0,className:_,children:n.title}),e[46]=n.title,e[47]=_,e[48]=T):T=e[48];let R;e[49]!==n.title||e[50]!==d?(R=d("sidebar.rail.closeApp",{name:n.title}),e[49]=n.title,e[50]=d,e[51]=R):R=e[51];let O;e[52]!==c?(O=()=>{H("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=O):O=e[53];let E,D;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=W("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),D=s.jsx(qe,{size:10}),e[54]=E,e[55]=D):(E=e[54],D=e[55]);let z;e[56]!==R||e[57]!==O?(z=s.jsx("button",{type:"button","aria-label":R,onClick:O,className:E,children:D}),e[56]=R,e[57]=O,e[58]=z):z=e[58];let A;return e[59]!==S||e[60]!==T||e[61]!==z||e[62]!==w?(A=s.jsxs("div",{className:w,children:[S,T,z]}),e[59]=S,e[60]=T,e[61]=z,e[62]=w,e[63]=A):A=e[63],A}const Ks={"site-editor":"/site-editor"};function Fs(t){const e=I.c(26),{app:n}=t,r=X(),i=cs[n],c=Ks[n];if(!i||!c)return null;let l;e[0]!==i.labelKey||e[1]!==r?(l=r(i.labelKey),e[0]=i.labelKey,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==i.labelKey||e[4]!==r?(d=r(i.labelKey),e[3]=i.labelKey,e[4]=r,e[5]=d):d=e[5];let o;e[6]!==i.tone?(o=W("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",i.tone),e[6]=i.tone,e[7]=o):o=e[7];let f;e[8]!==i.Icon?(f=s.jsx(i.Icon,{size:18}),e[8]=i.Icon,e[9]=f):f=e[9];let b;e[10]!==d||e[11]!==o||e[12]!==f||e[13]!==c?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Ye,{to:c,"aria-label":d,"aria-current":"page","data-testid":"org-rail-local-app",className:o,children:f})}),e[10]=d,e[11]=o,e[12]=f,e[13]=c,e[14]=b):b=e[14];let h;e[15]!==i.labelKey||e[16]!==r?(h=r(i.labelKey),e[15]=i.labelKey,e[16]=r,e[17]=h):h=e[17];let p;e[18]!==h?(p=s.jsx(be,{side:"right",children:h}),e[18]=h,e[19]=p):p=e[19];let m;e[20]!==b||e[21]!==p?(m=s.jsxs(xe,{children:[b,p]}),e[20]=b,e[21]=p,e[22]=m):m=e[22];let u;return e[23]!==l||e[24]!==m?(u=s.jsx(ye,{active:!0,label:l,children:m}),e[23]=l,e[24]=m,e[25]=u):u=e[25],u}function Bs(){const{org:t}=ze();return ds(t.slug),null}function et(t){const e=I.c(77),{onNavigate:n}=t===void 0?{}:t,r=X(),i=pt(),{org:c}=ze(),l=gt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={select:Xs},e[0]=d):d=e[0];const o=bt(d);let f;e[1]!==o||e[2]!==l?(f=o?l({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=o,e[2]=l,e[3]=f):f=e[3];const b=f,h=b?b.org:c.slug,{data:p}=xt(),[m,u]=$.useState(!1),[y,j]=$.useState(!1),C=Ie(),{recent:w,forget:a}=fs(c.slug),{projects:x}=ms(),g=hs(),v=us(),S=v&&v.projectId===null?v.app:null,k=S?[]:w.flatMap(N=>x.filter(M=>M.id===N)),_=Jt(p??[],c),{recent:T}=Qt(),R=es();let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O=Ge.railOrgPrefs(),e[4]=O):O=e[4];const[E,D]=$e(O,ts),z=Oe(E),A=$.useSyncExternalStore(Ps,As,Ms),{shown:L}=ss(rs(_,z,c.slug),T,c.slug,A,z.pinned);let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[5]=P):P=e[5];const F=Et(Dt(Pt,P)),B=N=>{const{active:M,over:Ke}=N;Ke&&(H("org_rail_reordered"),D(rt=>ls(Oe(rt),L.map(Hs),String(M.id),String(Ke.id))))},Y=N=>{n?.(),i({to:"/$org/home",params:{org:N},viewTransition:!0})},K=N=>{H("org_rail_travel"),n?.(),R(N,L.map(Ws))},U=()=>{if(H("org_rail_search_opened"),!c.id){j(!0);return}n?.(),os()},G=!C&&"border-r border-sidebar-border";let Z;e[6]!==G?(Z=W("flex w-[68px] shrink-0 flex-col bg-sidebar",G),e[6]=G,e[7]=Z):Z=e[7];const st="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let q;e[8]!==r?(q=r("sidebar.rail.ariaLabel"),e[8]=r,e[9]=q):q=e[9];const Re=Nt,Ee=Tt,De=At,Ne=L.map(Us),Te=Mt,Le=L.map(N=>s.jsxs($.Fragment,{children:[s.jsx($s,{org:N,active:N.slug===h,pinned:z.pinned.includes(N.slug),onSelect:N.slug!==c.slug?()=>K(N.slug):g?()=>Y(N.slug):void 0,onOpenSettings:()=>{n?.(),i({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>D(M=>is(Oe(M),N.slug)),onHide:N.slug===c.slug?void 0:()=>D(M=>ns(Oe(M),N.slug))}),N.slug===c.slug&&k.length>0&&s.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:k.map(M=>s.jsx(Is,{project:M,orgSlug:c.slug,active:g===M.id,onClose:()=>a(M.id),onNavigate:n},M.id))})]},N.id));let V;e[10]!==De||e[11]!==Ne||e[12]!==Te||e[13]!==Le?(V=s.jsx(De,{items:Ne,strategy:Te,children:Le}),e[10]=De,e[11]=Ne,e[12]=Te,e[13]=Le,e[14]=V):V=e[14];let J;e[15]!==Re||e[16]!==B||e[17]!==F||e[18]!==Ee||e[19]!==V?(J=s.jsx(Re,{sensors:F,collisionDetection:Ee,onDragEnd:B,children:V}),e[15]=Re,e[16]=B,e[17]=F,e[18]=Ee,e[19]=V,e[20]=J):J=e[20];let Q;e[21]!==S?(Q=S&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),s.jsx(Fs,{app:S})]}),e[21]=S,e[22]=Q):Q=e[22];let ee;e[23]!==J||e[24]!==Q||e[25]!==q?(ee=s.jsxs("div",{className:st,"aria-label":q,children:[J,Q]}),e[23]=J,e[24]=Q,e[25]=q,e[26]=ee):ee=e[26];let te;e[27]!==r?(te=r("sidebar.rail.search"),e[27]=r,e[28]=te):te=e[28];let ve;e[29]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(Yt,{size:18}),e[29]=ve):ve=e[29];let se;e[30]!==U||e[31]!==te?(se=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":te,"aria-keyshortcuts":"Meta+K Control+K",onClick:U,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:ve})}),e[30]=U,e[31]=te,e[32]=se):se=e[32];let re;e[33]!==r?(re=r("sidebar.rail.search"),e[33]=r,e[34]=re):re=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx("span",{className:"ml-2 text-muted-foreground",children:yt.commandPalette.keys.join("")}),e[35]=Se):Se=e[35];let ne;e[36]!==re?(ne=s.jsxs(be,{side:"right",children:[re,Se]}),e[36]=re,e[37]=ne):ne=e[37];let ie;e[38]!==se||e[39]!==ne?(ie=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[se,ne]})}),e[38]=se,e[39]=ne,e[40]=ie):ie=e[40];let le;e[41]!==r?(le=r("sidebar.picker.newOrganization"),e[41]=r,e[42]=le):le=e[42];let oe;e[43]!==u?(oe=()=>u(!0),e[43]=u,e[44]=oe):oe=e[44];let we;e[45]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Xt,{size:18}),e[45]=we):we=e[45];let ae;e[46]!==le||e[47]!==oe?(ae=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":le,onClick:oe,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:we})}),e[46]=le,e[47]=oe,e[48]=ae):ae=e[48];let ce;e[49]!==r?(ce=r("sidebar.picker.newOrganization"),e[49]=r,e[50]=ce):ce=e[50];let de;e[51]!==ce?(de=s.jsx(be,{side:"right",children:ce}),e[51]=ce,e[52]=de):de=e[52];let ue;e[53]!==ae||e[54]!==de?(ue=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[ae,de]})}),e[53]=ae,e[54]=de,e[55]=ue):ue=e[55];let Ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Ds,{}),e[56]=Ce):Ce=e[56];let fe;e[57]!==ie||e[58]!==ue?(fe=s.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ie,ue,Ce]}),e[57]=ie,e[58]=ue,e[59]=fe):fe=e[59];let me;e[60]!==ee||e[61]!==fe||e[62]!==Z?(me=s.jsxs("div",{className:Z,children:[ee,fe]}),e[60]=ee,e[61]=fe,e[62]=Z,e[63]=me):me=e[63];let he;e[64]!==c.slug||e[65]!==_||e[66]!==y||e[67]!==j||e[68]!==K?(he=s.jsx(Cs,{open:y,onOpenChange:j,orgs:_,currentSlug:c.slug,onSelect:K}),e[64]=c.slug,e[65]=_,e[66]=y,e[67]=j,e[68]=K,e[69]=he):he=e[69];let pe;e[70]!==m||e[71]!==u?(pe=s.jsx(as,{open:m,onOpenChange:u}),e[70]=m,e[71]=u,e[72]=pe):pe=e[72];let _e;return e[73]!==me||e[74]!==he||e[75]!==pe?(_e=s.jsxs(s.Fragment,{children:[me,he,pe]}),e[73]=me,e[74]=he,e[75]=pe,e[76]=_e):_e=e[76],_e}function Us(t){return t.slug}function Ws(t){return t.slug}function Hs(t){return t.slug}function Xs(t){return t.isLoading}function Ys(t){const e=I.c(15),{width:n,minWidth:r,maxWidth:i,onPointerDown:c,onKeyDown:l,onDoubleClick:d}=t,o=X(),{isMobile:f}=Ze(),b=Ie();if(f||b)return null;let h;e[0]!==o?(h=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=h):h=e[1];let p;e[2]!==o?(p=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=p):p=e[3];let m,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},u=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=u):(m=e[4],u=e[5]);let y;return e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==p||e[13]!==n?(y=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,title:p,tabIndex:0,onPointerDown:c,onKeyDown:l,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:u}),e[6]=i,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=h,e[12]=p,e[13]=n,e[14]=y):y=e[14],y}const Me=400,Xe=16,Gs="sidebar.width.v2";function Zs(){const t=I.c(14),e=qs;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u=>typeof u=="number"?e(u):192,t[0]=n):n=t[0];const[r,i]=$e(Gs,n),c=$.useRef(null);let l;t[1]!==i||t[2]!==r?(l=u=>{u.preventDefault();const y=u.clientX,j=e(r),C=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),w=C?Array.from(C.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of w)g.style.transition="none";const a=g=>{const v=e(j+(g.clientX-y));C?.style.setProperty("--sidebar-width",`${v}px`)},x=g=>{const v=e(j+(g.clientX-y));i(v);for(const S of w)S.style.transition="";window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",a),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},t[1]=i,t[2]=r,t[3]=l):l=t[3];const d=l;let o;t[4]!==i?(o=()=>{i(192)},t[4]=i,t[5]=o):o=t[5];const f=o;let b;t[6]!==i||t[7]!==r?(b=u=>{if(u.key==="ArrowLeft")i(e(r-Xe));else if(u.key==="ArrowRight")i(e(r+Xe));else if(u.key==="Home")i(192);else if(u.key==="End")i(Me);else return;u.preventDefault()},t[6]=i,t[7]=r,t[8]=b):b=t[8];const h=b,p=e(r);let m;return t[9]!==h||t[10]!==d||t[11]!==f||t[12]!==p?(m={width:p,minWidth:192,maxWidth:Me,wrapperRef:c,onStartResize:d,onKeyDownResize:h,resetWidth:f},t[9]=h,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function qs(t){return Math.max(192,Math.min(Me,t))}const tt=$.createContext(null);function Vs(){const t=$.use(tt);if(!t)throw new Error("Layout regions require a Layout");return t}function Js({children:t,notice:e,outsideOrg:n}){const r=Rt(),[i,c]=$e(Ge.sidebarOpen(),!0),l=Zs();return s.jsx(tt,{value:{isMobile:r,resize:l},children:s.jsx(St,{open:i,onOpenChange:c,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,s.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!n&&s.jsx(Bs,{}),!r&&(n?.rail??!0)&&s.jsx(et,{}),s.jsx(wt,{ref:l.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${l.width}px`,"--sidebar-width-icon":"0px"},children:s.jsx(Ct,{children:t})})]})]})})})}function Qs(t){const e=I.c(36),{children:n,renderMobile:r}=t,i=X(),{isMobile:c,resize:l}=Vs(),{openMobile:d,setOpenMobile:o}=Ze(),f=Ie();let b;e[0]!==o?(b=()=>o(!1),e[0]=o,e[1]=b):b=e[1];const h=b;if(!c){let x;e[2]!==n||e[3]!==f?(x=s.jsx("div",{className:"contents",inert:f,children:n}),e[2]=n,e[3]=f,e[4]=x):x=e[4];let g;e[5]!==l.maxWidth||e[6]!==l.minWidth||e[7]!==l.onKeyDownResize||e[8]!==l.onStartResize||e[9]!==l.resetWidth||e[10]!==l.width?(g=s.jsx(Ys,{width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,onPointerDown:l.onStartResize,onKeyDown:l.onKeyDownResize,onDoubleClick:l.resetWidth}),e[5]=l.maxWidth,e[6]=l.minWidth,e[7]=l.onKeyDownResize,e[8]=l.onStartResize,e[9]=l.resetWidth,e[10]=l.width,e[11]=g):g=e[11];let v;return e[12]!==x||e[13]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[12]=x,e[13]=g,e[14]=v):v=e[14],v}let p;e[15]!==i?(p=i("layouts.shellControls.navigationTitle"),e[15]=i,e[16]=p):p=e[16];let m;e[17]!==p?(m=s.jsx(kt,{className:"sr-only",children:p}),e[17]=p,e[18]=m):m=e[18];let u;e[19]!==h?(u=s.jsx(et,{onNavigate:h}),e[19]=h,e[20]=u):u=e[20];let y;e[21]!==h||e[22]!==r?(y=r({onClose:h}),e[21]=h,e[22]=r,e[23]=y):y=e[23];let j;e[24]!==y?(j=s.jsx("div",{className:"min-w-0 flex-1",children:y}),e[24]=y,e[25]=j):j=e[25];let C;e[26]!==u||e[27]!==j?(C=s.jsxs("div",{className:"flex h-full min-h-0",children:[u,j]}),e[26]=u,e[27]=j,e[28]=C):C=e[28];let w;e[29]!==m||e[30]!==C?(w=s.jsxs(Ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:er,children:[m,C]}),e[29]=m,e[30]=C,e[31]=w):w=e[31];let a;return e[32]!==d||e[33]!==o||e[34]!==w?(a=s.jsx(zt,{open:d,onOpenChange:o,children:w}),e[32]=d,e[33]=o,e[34]=w,e[35]=a):a=e[35],a}function er(t){return t.preventDefault()}function tr(t){const e=I.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsx(_t,{className:"flex flex-col min-h-0",style:r,children:s.jsx(vt,{variant:"plain",className:"bg-sidebar",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:n})})}),e[1]=n,e[2]=i):i=e[2],i}const kr=Object.assign(Js,{Sidebar:Qs,Content:tr});export{kr as L};
|
|
1
|
+
import{c as I,b as X,r as $,m as W,j as s,a4 as ze,e as nt,t as je,D as it,v as lt,w as ot,x as at,y as ct,B as Fe,au as dt,Y as ke,a5 as ut,E as H,X as ft,Z as mt,_ as ht,d as pt,aB as gt,l as bt,H as xt,ar as $e,L as Ye,$ as jt,at as Ge,aC as yt,P as vt}from"./index-PfzOl7J6.js";import{u as Ie,c as Ze,i as St,j as wt,k as Ct,l as _t}from"./use-sidebar-collapsed-BFQg4qhu.js";import{S as kt,a as Ot,b as zt}from"./sheet-BeOc3FAs.js";import{u as Rt}from"./use-mobile-Box5tF93.js";import{u as Et,a as Dt,D as Nt,c as Tt,C as Lt,P as Pt}from"./core.esm-Hiw5xlkT.js";import{S as At,v as Mt,u as $t}from"./sortable.esm-Bcfqg7Xt.js";import{i as It}from"./Tool01-DoE3EsIZ.js";import{y as Kt,z as Ft,B as Bt,C as Ut,A as Wt,D as Be,l as Ht}from"./agent-icon-DPgCnEV1.js";import{s as Xt}from"./Plus-D452i-ki.js";import{i as Yt}from"./UserSquare-DHrzs2xN.js";import{s as qe}from"./XClose-CR92HpkN.js";import{T as ge,a as be,c as xe}from"./tooltip-7oUFzrc9.js";import{C as Pe,f as Gt,g as Zt,e as qt}from"./context-menu-B-hlKiE1.js";import{a as Vt,O as Ve,w as Jt,b as Qt,c as es,E as ts,r as Oe,d as ss,e as rs,h as ns,t as is,f as Je,m as ls,o as os}from"./shell-layout-QlUCYlok.js";import{C as as}from"./create-organization-dialog-EtzNyw9E.js";import{P as cs}from"./project-apps-DOmYqPIW.js";import{u as ds,a as us}from"./use-recent-apps-B7zKTjxf.js";import{a as fs}from"./use-navigate-to-agent-BFXAaVqR.js";import{a as ms,u as hs}from"./use-project-scope-RvpHL0s_.js";import{C as Ue,a as ps,b as gs,c as bs,d as xs}from"./command-ARXYIBtk.js";import{u as js}from"./use-debounced-value-L8Mvr3Qf.js";import{n as ys}from"./BookOpen01-1fjc61Mm.js";import{F as vs,a as Ae,b as Ss,c as Qe}from"./feedback-BqoIMOg7.js";import{T as ws}from"./textarea-0zeG6rdh.js";function Cs(t){const e=I.c(48),{open:n,onOpenChange:r,orgs:i,currentSlug:c,onSelect:l}=t,d=X(),[o,f]=$.useState("");let b;e[0]!==o?(b=o.trim(),e[0]=o,e[1]=b):b=e[1];const h=b,p=js(h,150),m=h.length>0,u=p===h,{hits:y,isSearching:j,isStale:C,isError:w}=Vt(m?p:""),a=m?y:i;let x;e[2]!==r?(x=L=>{r(L),L||f("")},e[2]=r,e[3]=x):x=e[3];const g=x;let v;e[4]!==d?(v=d("sidebar.rail.searchOrganizations"),e[4]=d,e[5]=v):v=e[5];let S;e[6]!==d?(S=d("sidebar.rail.searchPlaceholder"),e[6]=d,e[7]=S):S=e[7];let k;e[8]!==d?(k=d("sidebar.rail.searchPlaceholder"),e[8]=d,e[9]=k):k=e[9];let _;e[10]!==o||e[11]!==k?(_=s.jsx(ps,{value:o,onValueChange:f,placeholder:k}),e[10]=o,e[11]=k,e[12]=_):_=e[12];const T=m&&(C||!u)&&"opacity-50";let R;e[13]!==T?(R=W(T),e[13]=T,e[14]=R):R=e[14];let O;e[15]!==w||e[16]!==m||e[17]!==d?(O=m&&w&&s.jsx(Ue,{children:d("sidebar.rail.searchFailed")}),e[15]=w,e[16]=m,e[17]=d,e[18]=O):O=e[18];let E;e[19]!==w||e[20]!==j||e[21]!==a.length||e[22]!==u||e[23]!==d?(E=!w&&u&&!j&&a.length===0&&s.jsx(Ue,{children:d("sidebar.rail.searchEmpty")}),e[19]=w,e[20]=j,e[21]=a.length,e[22]=u,e[23]=d,e[24]=E):E=e[24];let D;if(e[25]!==c||e[26]!==l||e[27]!==g||e[28]!==a||e[29]!==d){let L;e[31]!==c||e[32]!==l||e[33]!==g||e[34]!==d?(L=P=>s.jsxs(gs,{value:P.slug,onSelect:()=>{g(!1),P.slug!==c&&l(P.slug)},className:"gap-2.5",children:[s.jsx(Ve,{org:P,size:"sm"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),P.slug===c&&s.jsx("span",{className:"text-meta shrink-0",children:d("sidebar.rail.currentOrganization")})]},P.id),e[31]=c,e[32]=l,e[33]=g,e[34]=d,e[35]=L):L=e[35],D=a.map(L),e[25]=c,e[26]=l,e[27]=g,e[28]=a,e[29]=d,e[30]=D}else D=e[30];let z;e[36]!==E||e[37]!==D||e[38]!==R||e[39]!==O?(z=s.jsxs(bs,{className:R,children:[O,E,D]}),e[36]=E,e[37]=D,e[38]=R,e[39]=O,e[40]=z):z=e[40];let A;return e[41]!==n||e[42]!==g||e[43]!==z||e[44]!==v||e[45]!==S||e[46]!==_?(A=s.jsxs(xs,{open:n,onOpenChange:g,title:v,description:S,shouldFilter:!1,children:[_,z]}),e[41]=n,e[42]=g,e[43]=z,e[44]=v,e[45]=S,e[46]=_,e[47]=A):A=e[47],A}function _s(t){const e=I.c(4),{size:n,className:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{d:"M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.028C.533 9.046-.32 13.58.099 18.058a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.042-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.246.198.373.292a.077.077 0 0 1-.007.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.055c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.029ZM8.02 15.331c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.956 2.418-2.157 2.418Zm7.975 0c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.946 2.418-2.157 2.418Z"}),e[0]=i):i=e[0];let c;return e[1]!==r||e[2]!==n?(c=s.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:r,children:i}),e[1]=r,e[2]=n,e[3]=c):c=e[3],c}const ks=250;function Os(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function We(t,e,n){return new Promise(r=>t.toBlob(r,e,n))}async function zs(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(c=>setTimeout(c,ks));const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight,n.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let r=await We(n,"image/png");if((!r||r.size>Qe)&&(r=await We(n,"image/jpeg",.85)),!r)throw new Error("Could not encode the screenshot");const i=r.type==="image/png"?"png":"jpg";return new File([r],`screenshot.${i}`,{type:r.type})}finally{for(const e of t.getTracks())e.stop()}}function He({kind:t,open:e,onOpenChange:n}){const r=X(),i=t==="problem"?{title:r("sidebar.problem.title"),placeholder:r("sidebar.problem.placeholder"),sent:r("sidebar.problem.sent"),failed:r("sidebar.problem.failed")}:{title:r("sidebar.feedback.title"),placeholder:r("sidebar.feedback.placeholder"),sent:r("sidebar.feedback.sent"),failed:r("sidebar.feedback.failed")},{org:c}=ze(),[l,d]=$.useState(""),[o,f]=$.useState([]),[b,h]=$.useState(!1),p=()=>{for(const a of o)URL.revokeObjectURL(a.previewUrl);f([]),d("")},m=a=>{const x=a.filter(S=>Ss.includes(S.type)?S.size>Qe?(je.error(r("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),g=Ae-o.length;x.length>g&&je.error(r("sidebar.feedback.tooManyScreenshots",{max:String(Ae)}));const v=x.slice(0,Math.max(g,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));v.length>0&&f(S=>[...S,...v])},u=a=>{URL.revokeObjectURL(a.previewUrl),f(x=>x.filter(g=>g!==a))},y=async()=>{h(!0);try{m([await zs()])}catch(a){a instanceof DOMException&&a.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",a),je.error(r("sidebar.feedback.screenshotFailed")))}finally{h(!1)}},j=a=>{const x=Array.from(a.clipboardData.files).filter(g=>g.type.startsWith("image/"));x.length!==0&&(a.preventDefault(),m(x))},C=nt({mutationFn:async()=>{const a=new FormData;a.set("kind",t),a.set("message",l.trim()),a.set("pageUrl",window.location.href);for(const g of o)a.append("screenshot",g.file);const x=await fetch(`/api/${encodeURIComponent(c.slug)}/feedback`,{method:"POST",body:a});if(!x.ok)throw new Error(`Feedback failed: ${x.status}`)},onSuccess:()=>{je.success(i.sent),p(),n(!1)},onError:()=>je.error(i.failed)}),w=l.trim().length>0&&!C.isPending;return s.jsx(it,{open:e&&!b,onOpenChange:n,children:s.jsxs(lt,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(ot,{children:s.jsx(at,{children:i.title})}),s.jsx(ws,{autoFocus:!0,value:l,onChange:a=>d(a.target.value),onPaste:j,onKeyDown:a=>{a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),w&&C.mutate())},placeholder:i.placeholder,className:"min-h-32 max-h-80",maxLength:vs}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((a,x)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:a.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:a.previewUrl,alt:r("sidebar.feedback.screenshotAlt",{n:String(x+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>u(a),"aria-label":r("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qe,{size:12})})]},a.previewUrl))}),s.jsxs(ct,{className:"sm:justify-between",children:[Os()?s.jsxs(Fe,{type:"button",variant:"outline",onClick:y,disabled:o.length>=Ae,children:[s.jsx(Kt,{size:14}),r("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx(Fe,{type:"button",onClick:()=>C.mutate(),disabled:!w,children:C.isPending?r("sidebar.feedback.sending"):r("sidebar.feedback.send")})]})]})})}function ye(t){const e=I.c(11),{active:n,label:r,children:i}=t,c=n?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let l;e[0]!==c?(l=W("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=l):l=e[1];let d;e[2]!==l?(d=s.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:s.jsx("span",{className:l})}),e[2]=l,e[3]=d):d=e[3];let o;e[4]!==n||e[5]!==r?(o=r&&s.jsx("span",{"aria-hidden":!0,className:W("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",n?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=n,e[5]=r,e[6]=o):o=e[6];let f;return e[7]!==i||e[8]!==d||e[9]!==o?(f=s.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[d,i,o]}),e[7]=i,e[8]=d,e[9]=o,e[10]=f):f=e[10],f}const Rs="https://docs.decocms.com/",Es="https://discord.gg/EQkX7CymV";function Ds(){const t=I.c(39),e=X(),{org:n}=ze(),[r,i]=$.useState(null),c=!!n.id;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=_=>{H("help_menu_dialog_opened",{kind:_}),i(_)},t[0]=l):l=t[0];const d=l;let o;t[1]!==e?(o=e("sidebar.help.button"),t[1]=e,t[2]=o):o=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:18}),t[3]=f):f=t[3];let b;t[4]!==o?(b=s.jsx(ge,{asChild:!0,children:s.jsx(ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":o,onClick:Ls,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring data-[state=open]:bg-sidebar-accent data-[state=open]:text-foreground",children:f})})}),t[4]=o,t[5]=b):b=t[5];let h;t[6]!==e?(h=e("sidebar.help.button"),t[6]=e,t[7]=h):h=t[7];let p;t[8]!==h?(p=s.jsx(be,{side:"right",children:h}),t[8]=h,t[9]=p):p=t[9];let m;t[10]!==b||t[11]!==p?(m=s.jsxs(xe,{children:[b,p]}),t[10]=b,t[11]=p,t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{}),t[13]=u):u=t[13];let y;t[14]!==e?(y=e("sidebar.help.guides"),t[14]=e,t[15]=y):y=t[15];let j;t[16]!==y?(j=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Rs,target:"_blank",rel:"noopener noreferrer",onClick:Ts,children:[u,y]})}),t[16]=y,t[17]=j):j=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_s,{}),t[18]=C):C=t[18];let w;t[19]!==e?(w=e("sidebar.help.discord"),t[19]=e,t[20]=w):w=t[20];let a;t[21]!==w?(a=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Es,target:"_blank",rel:"noopener noreferrer",onClick:Ns,children:[C,w]})}),t[21]=w,t[22]=a):a=t[22];let x;t[23]!==c||t[24]!==e?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{}),s.jsxs(ke,{onSelect:()=>d("problem"),children:[s.jsx(ut,{}),e("sidebar.help.reportProblem")]}),s.jsxs(ke,{onSelect:()=>d("feedback"),children:[s.jsx(Ft,{}),e("sidebar.feedback.button")]})]}),t[23]=c,t[24]=e,t[25]=x):x=t[25];let g;t[26]!==a||t[27]!==x||t[28]!==j?(g=s.jsxs(mt,{side:"right",align:"end",className:"w-56",children:[j,a,x]}),t[26]=a,t[27]=x,t[28]=j,t[29]=g):g=t[29];let v;t[30]!==g||t[31]!==m?(v=s.jsx(ye,{active:!1,children:s.jsxs(ht,{children:[m,g]})}),t[30]=g,t[31]=m,t[32]=v):v=t[32];let S;t[33]!==c||t[34]!==r?(S=c&&s.jsxs(s.Fragment,{children:[s.jsx(He,{kind:"problem",open:r==="problem",onOpenChange:_=>i(_?"problem":null)}),s.jsx(He,{kind:"feedback",open:r==="feedback",onOpenChange:_=>i(_?"feedback":null)})]}),t[33]=c,t[34]=r,t[35]=S):S=t[35];let k;return t[36]!==v||t[37]!==S?(k=s.jsxs(s.Fragment,{children:[v,S]}),t[36]=v,t[37]=S,t[38]=k):k=t[38],k}function Ns(){return H("help_menu_discord_opened")}function Ts(){return H("help_menu_guides_opened")}function Ls(){return H("help_menu_opened")}function Ps(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const As=()=>Je(globalThis.innerHeight),Ms=()=>Je(0);function $s(t){const e=I.c(59),{org:n,active:r,onSelect:i,pinned:c,onOpenSettings:l,onTogglePin:d,onHide:o}=t,f=X();let b;e[0]!==n.slug?(b={id:n.slug},e[0]=n.slug,e[1]=b):b=e[1];const{setNodeRef:h,listeners:p,transform:m,transition:u,isDragging:y}=$t(b);let j;e[2]!==m?(j=Lt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=j):j=e[3];const C=y?1:void 0,w=`rail-org-${n.slug}`;let a;e[4]!==j||e[5]!==C||e[6]!==w||e[7]!==u?(a={transform:j,transition:u,zIndex:C,viewTransitionName:w},e[4]=j,e[5]=C,e[6]=w,e[7]=u,e[8]=a):a=e[8];const x=n.name,g=r||void 0,v=r?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=i&&"cursor-pointer";let k;e[9]!==v||e[10]!==S?(k=W("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,S),e[9]=v,e[10]=S,e[11]=k):k=e[11];let _;e[12]!==n?(_=s.jsx(Ve,{org:n,size:"lg"}),e[12]=n,e[13]=_):_=e[13];let T;e[14]!==c?(T=c&&s.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:s.jsx(Be,{size:9})}),e[14]=c,e[15]=T):T=e[15];let R;e[16]!==i||e[17]!==n.name||e[18]!==k||e[19]!==_||e[20]!==T||e[21]!==g?(R=s.jsx(ge,{asChild:!0,children:s.jsx(Gt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":x,"aria-current":g,onClick:i,className:k,children:[_,T]})})}),e[16]=i,e[17]=n.name,e[18]=k,e[19]=_,e[20]=T,e[21]=g,e[22]=R):R=e[22];let O;e[23]!==n.name?(O=s.jsx(be,{side:"right",children:n.name}),e[23]=n.name,e[24]=O):O=e[24];let E;e[25]!==R||e[26]!==O?(E=s.jsxs(xe,{children:[R,O]}),e[25]=R,e[26]=O,e[27]=E):E=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ht,{}),e[28]=D):D=e[28];let z;e[29]!==f?(z=f("sidebar.rail.organizationSettings"),e[29]=f,e[30]=z):z=e[30];let A;e[31]!==l||e[32]!==z?(A=s.jsxs(Pe,{onSelect:l,children:[D,z]}),e[31]=l,e[32]=z,e[33]=A):A=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Be,{}),e[34]=L):L=e[34];let P;e[35]!==c||e[36]!==f?(P=f(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=f,e[37]=P):P=e[37];let F;e[38]!==d||e[39]!==P?(F=s.jsxs(Pe,{onSelect:d,children:[L,P]}),e[38]=d,e[39]=P,e[40]=F):F=e[40];let B;e[41]!==o||e[42]!==f?(B=o&&s.jsxs(Pe,{onSelect:o,children:[s.jsx(It,{}),f("sidebar.rail.hideOrganization")]}),e[41]=o,e[42]=f,e[43]=B):B=e[43];let Y;e[44]!==A||e[45]!==F||e[46]!==B?(Y=s.jsxs(Zt,{children:[A,F,B]}),e[44]=A,e[45]=F,e[46]=B,e[47]=Y):Y=e[47];let K;e[48]!==E||e[49]!==Y?(K=s.jsxs(qt,{children:[E,Y]}),e[48]=E,e[49]=Y,e[50]=K):K=e[50];let U;e[51]!==r||e[52]!==K?(U=s.jsx(ye,{active:r,children:K}),e[51]=r,e[52]=K,e[53]=U):U=e[53];let G;return e[54]!==p||e[55]!==h||e[56]!==U||e[57]!==a?(G=s.jsx("div",{ref:h,...p,style:a,className:"w-full shrink-0 touch-none",children:U}),e[54]=p,e[55]=h,e[56]=U,e[57]=a,e[58]=G):G=e[58],G}function Is(t){const e=I.c(64),{project:n,orgSlug:r,active:i,onClose:c,onNavigate:l}=t,d=X();let o,f,b,h,p,m,u,y,j,C,w;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==n.icon||e[4]!==n.id||e[5]!==n.title){const L=Ut(n.icon,n.title);w="group/rail relative flex w-full flex-col items-center gap-1",b=xe,f=ge,C=!0,o=Ye,h=jt.root,e[17]!==r||e[18]!==n.id?(p={org:r,agentId:n.id},e[17]=r,e[18]=n.id,e[19]=p):p=e[19],m=n.title,u=i||void 0,e[20]!==l?(y=()=>{H("org_rail_recent_project_opened"),l?.()},e[20]=l,e[21]=y):y=e[21],j=W("flex shrink-0 rounded-lg focus-ring",L.text,i&&"ring-[1.5px] ring-current"),e[0]=i,e[1]=l,e[2]=r,e[3]=n.icon,e[4]=n.id,e[5]=n.title,e[6]=o,e[7]=f,e[8]=b,e[9]=h,e[10]=p,e[11]=m,e[12]=u,e[13]=y,e[14]=j,e[15]=C,e[16]=w}else o=e[6],f=e[7],b=e[8],h=e[9],p=e[10],m=e[11],u=e[12],y=e[13],j=e[14],C=e[15],w=e[16];let a;e[22]!==n.icon||e[23]!==n.title?(a=s.jsx(Wt,{icon:n.icon,name:n.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=n.icon,e[23]=n.title,e[24]=a):a=e[24];let x;e[25]!==o||e[26]!==h||e[27]!==p||e[28]!==m||e[29]!==u||e[30]!==y||e[31]!==j||e[32]!==a?(x=s.jsx(o,{to:h,params:p,"aria-label":m,"aria-current":u,onClick:y,className:j,children:a}),e[25]=o,e[26]=h,e[27]=p,e[28]=m,e[29]=u,e[30]=y,e[31]=j,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==f||e[35]!==x||e[36]!==C?(g=s.jsx(f,{asChild:C,children:x}),e[34]=f,e[35]=x,e[36]=C,e[37]=g):g=e[37];let v;e[38]!==n.title?(v=s.jsx(be,{side:"right",children:n.title}),e[38]=n.title,e[39]=v):v=e[39];let S;e[40]!==b||e[41]!==g||e[42]!==v?(S=s.jsxs(b,{children:[g,v]}),e[40]=b,e[41]=g,e[42]=v,e[43]=S):S=e[43];const k=i?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let _;e[44]!==k?(_=W("line-clamp-2 w-full text-center text-2xs break-words transition-colors",k),e[44]=k,e[45]=_):_=e[45];let T;e[46]!==n.title||e[47]!==_?(T=s.jsx("span",{"aria-hidden":!0,className:_,children:n.title}),e[46]=n.title,e[47]=_,e[48]=T):T=e[48];let R;e[49]!==n.title||e[50]!==d?(R=d("sidebar.rail.closeApp",{name:n.title}),e[49]=n.title,e[50]=d,e[51]=R):R=e[51];let O;e[52]!==c?(O=()=>{H("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=O):O=e[53];let E,D;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=W("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),D=s.jsx(qe,{size:10}),e[54]=E,e[55]=D):(E=e[54],D=e[55]);let z;e[56]!==R||e[57]!==O?(z=s.jsx("button",{type:"button","aria-label":R,onClick:O,className:E,children:D}),e[56]=R,e[57]=O,e[58]=z):z=e[58];let A;return e[59]!==S||e[60]!==T||e[61]!==z||e[62]!==w?(A=s.jsxs("div",{className:w,children:[S,T,z]}),e[59]=S,e[60]=T,e[61]=z,e[62]=w,e[63]=A):A=e[63],A}const Ks={"site-editor":"/site-editor"};function Fs(t){const e=I.c(26),{app:n}=t,r=X(),i=cs[n],c=Ks[n];if(!i||!c)return null;let l;e[0]!==i.labelKey||e[1]!==r?(l=r(i.labelKey),e[0]=i.labelKey,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==i.labelKey||e[4]!==r?(d=r(i.labelKey),e[3]=i.labelKey,e[4]=r,e[5]=d):d=e[5];let o;e[6]!==i.tone?(o=W("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",i.tone),e[6]=i.tone,e[7]=o):o=e[7];let f;e[8]!==i.Icon?(f=s.jsx(i.Icon,{size:18}),e[8]=i.Icon,e[9]=f):f=e[9];let b;e[10]!==d||e[11]!==o||e[12]!==f||e[13]!==c?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Ye,{to:c,"aria-label":d,"aria-current":"page","data-testid":"org-rail-local-app",className:o,children:f})}),e[10]=d,e[11]=o,e[12]=f,e[13]=c,e[14]=b):b=e[14];let h;e[15]!==i.labelKey||e[16]!==r?(h=r(i.labelKey),e[15]=i.labelKey,e[16]=r,e[17]=h):h=e[17];let p;e[18]!==h?(p=s.jsx(be,{side:"right",children:h}),e[18]=h,e[19]=p):p=e[19];let m;e[20]!==b||e[21]!==p?(m=s.jsxs(xe,{children:[b,p]}),e[20]=b,e[21]=p,e[22]=m):m=e[22];let u;return e[23]!==l||e[24]!==m?(u=s.jsx(ye,{active:!0,label:l,children:m}),e[23]=l,e[24]=m,e[25]=u):u=e[25],u}function Bs(){const{org:t}=ze();return ds(t.slug),null}function et(t){const e=I.c(77),{onNavigate:n}=t===void 0?{}:t,r=X(),i=pt(),{org:c}=ze(),l=gt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={select:Xs},e[0]=d):d=e[0];const o=bt(d);let f;e[1]!==o||e[2]!==l?(f=o?l({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=o,e[2]=l,e[3]=f):f=e[3];const b=f,h=b?b.org:c.slug,{data:p}=xt(),[m,u]=$.useState(!1),[y,j]=$.useState(!1),C=Ie(),{recent:w,forget:a}=fs(c.slug),{projects:x}=ms(),g=hs(),v=us(),S=v&&v.projectId===null?v.app:null,k=S?[]:w.flatMap(N=>x.filter(M=>M.id===N)),_=Jt(p??[],c),{recent:T}=Qt(),R=es();let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O=Ge.railOrgPrefs(),e[4]=O):O=e[4];const[E,D]=$e(O,ts),z=Oe(E),A=$.useSyncExternalStore(Ps,As,Ms),{shown:L}=ss(rs(_,z,c.slug),T,c.slug,A,z.pinned);let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[5]=P):P=e[5];const F=Et(Dt(Pt,P)),B=N=>{const{active:M,over:Ke}=N;Ke&&(H("org_rail_reordered"),D(rt=>ls(Oe(rt),L.map(Hs),String(M.id),String(Ke.id))))},Y=N=>{n?.(),i({to:"/$org/home",params:{org:N},viewTransition:!0})},K=N=>{H("org_rail_travel"),n?.(),R(N,L.map(Ws))},U=()=>{if(H("org_rail_search_opened"),!c.id){j(!0);return}n?.(),os()},G=!C&&"border-r border-sidebar-border";let Z;e[6]!==G?(Z=W("flex w-[68px] shrink-0 flex-col bg-sidebar",G),e[6]=G,e[7]=Z):Z=e[7];const st="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let q;e[8]!==r?(q=r("sidebar.rail.ariaLabel"),e[8]=r,e[9]=q):q=e[9];const Re=Nt,Ee=Tt,De=At,Ne=L.map(Us),Te=Mt,Le=L.map(N=>s.jsxs($.Fragment,{children:[s.jsx($s,{org:N,active:N.slug===h,pinned:z.pinned.includes(N.slug),onSelect:N.slug!==c.slug?()=>K(N.slug):g?()=>Y(N.slug):void 0,onOpenSettings:()=>{n?.(),i({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>D(M=>is(Oe(M),N.slug)),onHide:N.slug===c.slug?void 0:()=>D(M=>ns(Oe(M),N.slug))}),N.slug===c.slug&&k.length>0&&s.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:k.map(M=>s.jsx(Is,{project:M,orgSlug:c.slug,active:g===M.id,onClose:()=>a(M.id),onNavigate:n},M.id))})]},N.id));let V;e[10]!==De||e[11]!==Ne||e[12]!==Te||e[13]!==Le?(V=s.jsx(De,{items:Ne,strategy:Te,children:Le}),e[10]=De,e[11]=Ne,e[12]=Te,e[13]=Le,e[14]=V):V=e[14];let J;e[15]!==Re||e[16]!==B||e[17]!==F||e[18]!==Ee||e[19]!==V?(J=s.jsx(Re,{sensors:F,collisionDetection:Ee,onDragEnd:B,children:V}),e[15]=Re,e[16]=B,e[17]=F,e[18]=Ee,e[19]=V,e[20]=J):J=e[20];let Q;e[21]!==S?(Q=S&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),s.jsx(Fs,{app:S})]}),e[21]=S,e[22]=Q):Q=e[22];let ee;e[23]!==J||e[24]!==Q||e[25]!==q?(ee=s.jsxs("div",{className:st,"aria-label":q,children:[J,Q]}),e[23]=J,e[24]=Q,e[25]=q,e[26]=ee):ee=e[26];let te;e[27]!==r?(te=r("sidebar.rail.search"),e[27]=r,e[28]=te):te=e[28];let ve;e[29]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(Yt,{size:18}),e[29]=ve):ve=e[29];let se;e[30]!==U||e[31]!==te?(se=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":te,"aria-keyshortcuts":"Meta+K Control+K",onClick:U,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:ve})}),e[30]=U,e[31]=te,e[32]=se):se=e[32];let re;e[33]!==r?(re=r("sidebar.rail.search"),e[33]=r,e[34]=re):re=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx("span",{className:"ml-2 text-muted-foreground",children:yt.commandPalette.keys.join("")}),e[35]=Se):Se=e[35];let ne;e[36]!==re?(ne=s.jsxs(be,{side:"right",children:[re,Se]}),e[36]=re,e[37]=ne):ne=e[37];let ie;e[38]!==se||e[39]!==ne?(ie=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[se,ne]})}),e[38]=se,e[39]=ne,e[40]=ie):ie=e[40];let le;e[41]!==r?(le=r("sidebar.picker.newOrganization"),e[41]=r,e[42]=le):le=e[42];let oe;e[43]!==u?(oe=()=>u(!0),e[43]=u,e[44]=oe):oe=e[44];let we;e[45]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Xt,{size:18}),e[45]=we):we=e[45];let ae;e[46]!==le||e[47]!==oe?(ae=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":le,onClick:oe,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:we})}),e[46]=le,e[47]=oe,e[48]=ae):ae=e[48];let ce;e[49]!==r?(ce=r("sidebar.picker.newOrganization"),e[49]=r,e[50]=ce):ce=e[50];let de;e[51]!==ce?(de=s.jsx(be,{side:"right",children:ce}),e[51]=ce,e[52]=de):de=e[52];let ue;e[53]!==ae||e[54]!==de?(ue=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[ae,de]})}),e[53]=ae,e[54]=de,e[55]=ue):ue=e[55];let Ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Ds,{}),e[56]=Ce):Ce=e[56];let fe;e[57]!==ie||e[58]!==ue?(fe=s.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ie,ue,Ce]}),e[57]=ie,e[58]=ue,e[59]=fe):fe=e[59];let me;e[60]!==ee||e[61]!==fe||e[62]!==Z?(me=s.jsxs("div",{className:Z,children:[ee,fe]}),e[60]=ee,e[61]=fe,e[62]=Z,e[63]=me):me=e[63];let he;e[64]!==c.slug||e[65]!==_||e[66]!==y||e[67]!==j||e[68]!==K?(he=s.jsx(Cs,{open:y,onOpenChange:j,orgs:_,currentSlug:c.slug,onSelect:K}),e[64]=c.slug,e[65]=_,e[66]=y,e[67]=j,e[68]=K,e[69]=he):he=e[69];let pe;e[70]!==m||e[71]!==u?(pe=s.jsx(as,{open:m,onOpenChange:u}),e[70]=m,e[71]=u,e[72]=pe):pe=e[72];let _e;return e[73]!==me||e[74]!==he||e[75]!==pe?(_e=s.jsxs(s.Fragment,{children:[me,he,pe]}),e[73]=me,e[74]=he,e[75]=pe,e[76]=_e):_e=e[76],_e}function Us(t){return t.slug}function Ws(t){return t.slug}function Hs(t){return t.slug}function Xs(t){return t.isLoading}function Ys(t){const e=I.c(15),{width:n,minWidth:r,maxWidth:i,onPointerDown:c,onKeyDown:l,onDoubleClick:d}=t,o=X(),{isMobile:f}=Ze(),b=Ie();if(f||b)return null;let h;e[0]!==o?(h=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=h):h=e[1];let p;e[2]!==o?(p=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=p):p=e[3];let m,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},u=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=u):(m=e[4],u=e[5]);let y;return e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==p||e[13]!==n?(y=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,title:p,tabIndex:0,onPointerDown:c,onKeyDown:l,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:u}),e[6]=i,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=h,e[12]=p,e[13]=n,e[14]=y):y=e[14],y}const Me=400,Xe=16,Gs="sidebar.width.v2";function Zs(){const t=I.c(14),e=qs;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u=>typeof u=="number"?e(u):192,t[0]=n):n=t[0];const[r,i]=$e(Gs,n),c=$.useRef(null);let l;t[1]!==i||t[2]!==r?(l=u=>{u.preventDefault();const y=u.clientX,j=e(r),C=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),w=C?Array.from(C.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of w)g.style.transition="none";const a=g=>{const v=e(j+(g.clientX-y));C?.style.setProperty("--sidebar-width",`${v}px`)},x=g=>{const v=e(j+(g.clientX-y));i(v);for(const S of w)S.style.transition="";window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",a),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},t[1]=i,t[2]=r,t[3]=l):l=t[3];const d=l;let o;t[4]!==i?(o=()=>{i(192)},t[4]=i,t[5]=o):o=t[5];const f=o;let b;t[6]!==i||t[7]!==r?(b=u=>{if(u.key==="ArrowLeft")i(e(r-Xe));else if(u.key==="ArrowRight")i(e(r+Xe));else if(u.key==="Home")i(192);else if(u.key==="End")i(Me);else return;u.preventDefault()},t[6]=i,t[7]=r,t[8]=b):b=t[8];const h=b,p=e(r);let m;return t[9]!==h||t[10]!==d||t[11]!==f||t[12]!==p?(m={width:p,minWidth:192,maxWidth:Me,wrapperRef:c,onStartResize:d,onKeyDownResize:h,resetWidth:f},t[9]=h,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function qs(t){return Math.max(192,Math.min(Me,t))}const tt=$.createContext(null);function Vs(){const t=$.use(tt);if(!t)throw new Error("Layout regions require a Layout");return t}function Js({children:t,notice:e,outsideOrg:n}){const r=Rt(),[i,c]=$e(Ge.sidebarOpen(),!0),l=Zs();return s.jsx(tt,{value:{isMobile:r,resize:l},children:s.jsx(St,{open:i,onOpenChange:c,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,s.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!n&&s.jsx(Bs,{}),!r&&(n?.rail??!0)&&s.jsx(et,{}),s.jsx(wt,{ref:l.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${l.width}px`,"--sidebar-width-icon":"0px"},children:s.jsx(Ct,{children:t})})]})]})})})}function Qs(t){const e=I.c(36),{children:n,renderMobile:r}=t,i=X(),{isMobile:c,resize:l}=Vs(),{openMobile:d,setOpenMobile:o}=Ze(),f=Ie();let b;e[0]!==o?(b=()=>o(!1),e[0]=o,e[1]=b):b=e[1];const h=b;if(!c){let x;e[2]!==n||e[3]!==f?(x=s.jsx("div",{className:"contents",inert:f,children:n}),e[2]=n,e[3]=f,e[4]=x):x=e[4];let g;e[5]!==l.maxWidth||e[6]!==l.minWidth||e[7]!==l.onKeyDownResize||e[8]!==l.onStartResize||e[9]!==l.resetWidth||e[10]!==l.width?(g=s.jsx(Ys,{width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,onPointerDown:l.onStartResize,onKeyDown:l.onKeyDownResize,onDoubleClick:l.resetWidth}),e[5]=l.maxWidth,e[6]=l.minWidth,e[7]=l.onKeyDownResize,e[8]=l.onStartResize,e[9]=l.resetWidth,e[10]=l.width,e[11]=g):g=e[11];let v;return e[12]!==x||e[13]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[12]=x,e[13]=g,e[14]=v):v=e[14],v}let p;e[15]!==i?(p=i("layouts.shellControls.navigationTitle"),e[15]=i,e[16]=p):p=e[16];let m;e[17]!==p?(m=s.jsx(kt,{className:"sr-only",children:p}),e[17]=p,e[18]=m):m=e[18];let u;e[19]!==h?(u=s.jsx(et,{onNavigate:h}),e[19]=h,e[20]=u):u=e[20];let y;e[21]!==h||e[22]!==r?(y=r({onClose:h}),e[21]=h,e[22]=r,e[23]=y):y=e[23];let j;e[24]!==y?(j=s.jsx("div",{className:"min-w-0 flex-1",children:y}),e[24]=y,e[25]=j):j=e[25];let C;e[26]!==u||e[27]!==j?(C=s.jsxs("div",{className:"flex h-full min-h-0",children:[u,j]}),e[26]=u,e[27]=j,e[28]=C):C=e[28];let w;e[29]!==m||e[30]!==C?(w=s.jsxs(Ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:er,children:[m,C]}),e[29]=m,e[30]=C,e[31]=w):w=e[31];let a;return e[32]!==d||e[33]!==o||e[34]!==w?(a=s.jsx(zt,{open:d,onOpenChange:o,children:w}),e[32]=d,e[33]=o,e[34]=w,e[35]=a):a=e[35],a}function er(t){return t.preventDefault()}function tr(t){const e=I.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsx(_t,{className:"flex flex-col min-h-0",style:r,children:s.jsx(vt,{variant:"plain",className:"bg-sidebar",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:n})})}),e[1]=n,e[2]=i):i=e[2],i}const kr=Object.assign(Js,{Sidebar:Qs,Content:tr});export{kr as L};
|
package/dist/client/assets/{infiniteQueryObserver-Sb4-Zoh0.js → infiniteQueryObserver-BSITs4kU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e0 as g,e1 as d,e2 as v}from"./index-
|
|
1
|
+
import{e0 as g,e1 as d,e2 as v}from"./index-PfzOl7J6.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as s,i2 as de,b as Z,i3 as ue,r as le,i4 as xe,i5 as re,gD as T,gT as W,B as J,dY as V,a7 as pe}from"./index-CHOxYhnv.js";import{i as he}from"./CreditCard01-ClPhtnpy.js";import{B as L}from"./badge-lysbeP9P.js";import{M as je}from"./multi-select-B_Fvyk0J.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-oOpcW8y8.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-BdoV93HO.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-DcsXR4up.js";import{T as De}from"./Tooltip-BxRazsja.js";import{a as _e,A as Me}from"./AreaChart--NTdNKkN.js";import{c2 as Re}from"./CategoricalChart-BH2fCBYy.js";import{R as Le}from"./require-capability-DR3oejOb.js";import"./checkbox-BgJ_rDKP.js";import"./Minus-CkHBDYFP.js";import"./ChevronUp-yM6kuF7B.js";import"./command-CnhVLB17.js";import"./index-BNwuaZhD.js";import"./SearchMd--9oaPr0p.js";import"./popover-AfVmBiXN.js";import"./index-BdQq_4o_.js";import"./index-BZdAVrUU.js";import"./index-jntxieqb.js";import"./access-gate-COWmI5bk.js";import"./capability-load-error-zDoTf-tr.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Y(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=Z(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Y(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Y(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ye)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const G=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(G.length>0?1:0)>1,K=Y(u,"pageviews"),se=K>0?Y(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ze,{team:c,showSites:te},c.siteSlugs.join(","))),G.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:G.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ye(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ze(t){const e=k.c(13),{team:n,showSites:l}=t,o=Z(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ge,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ge(t){const e=k.c(40),{invoices:n}=t,l=Z();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=Z(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function vt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{vt as default};
|
|
1
|
+
import{c as k,j as s,i2 as de,b as Z,i3 as ue,r as le,i4 as xe,i5 as re,gD as T,gT as W,B as J,dY as V,a7 as pe}from"./index-PfzOl7J6.js";import{i as he}from"./CreditCard01-KjySk-5G.js";import{B as L}from"./badge-CPdAi539.js";import{M as je}from"./multi-select-DuhSvGkq.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-DbxUTGle.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-DBeLX30i.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-D_ikhSur.js";import{T as De}from"./Tooltip-z7WiBKoc.js";import{a as _e,A as Me}from"./AreaChart-BliO7z1O.js";import{c2 as Re}from"./CategoricalChart-DFr--lUX.js";import{R as Le}from"./require-capability-Ca04y4iT.js";import"./checkbox-C6L9-jtU.js";import"./Minus-CMxaDSgl.js";import"./ChevronUp-FDrusEQ7.js";import"./command-ARXYIBtk.js";import"./index-Cwblfb1K.js";import"./SearchMd-D9VvymBK.js";import"./popover-BBhzRgR6.js";import"./index-BdQq_4o_.js";import"./index-Chdoy1DO.js";import"./index-DpynbW7T.js";import"./access-gate-CpF5setC.js";import"./capability-load-error-BCoAaz36.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Y(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=Z(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Y(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Y(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ye)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const G=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(G.length>0?1:0)>1,K=Y(u,"pageviews"),se=K>0?Y(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ze,{team:c,showSites:te},c.siteSlugs.join(","))),G.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:G.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ye(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ze(t){const e=k.c(13),{team:n,showSites:l}=t,o=Z(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ge,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ge(t){const e=k.c(40),{invoices:n}=t,l=Z();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=Z(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function vt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{vt as default};
|