decocms 4.533.3 → 4.534.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-CdXsV3S7.js → ActiveShapeUtils-OThgbtM7.js} +1 -1
- package/dist/client/assets/{AlertCircle-3zlHk1bR.js → AlertCircle-DU3FjOzc.js} +1 -1
- package/dist/client/assets/{AreaChart-abAlkUS3.js → AreaChart-DGlIn0Ko.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DmLRalOz.js → ArrowLeft-DsuVbScg.js} +1 -1
- package/dist/client/assets/{ArrowUp-DYpVM4EW.js → ArrowUp-B7sqrDYx.js} +1 -1
- package/dist/client/assets/{BarChart-QA5Y4_eS.js → BarChart-B8xXFa6h.js} +1 -1
- package/dist/client/assets/{Building02-BfF63iaY.js → Building02-S_bMa4Om.js} +1 -1
- package/dist/client/assets/{CartesianChart-C7RhMZbm.js → CartesianChart-BoNLutk8.js} +1 -1
- package/dist/client/assets/{CategoricalChart-VnQ3lkHZ.js → CategoricalChart-CAZArx5f.js} +1 -1
- package/dist/client/assets/{CheckCircle-DFCQG4PZ.js → CheckCircle-yGX5jGBH.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BQnuYb4d.js → ChevronSelectorVertical-BnM8vQHm.js} +1 -1
- package/dist/client/assets/{ChevronUp-BADsHIlZ.js → ChevronUp-fCjAl_fm.js} +1 -1
- package/dist/client/assets/{Copy01-BuXPB74z.js → Copy01-D9mDrSvk.js} +1 -1
- package/dist/client/assets/{CreditCard01-3pgS1FBj.js → CreditCard01-Qaes9woG.js} +1 -1
- package/dist/client/assets/{DotsVertical-DGPGhZOp.js → DotsVertical-DholfumB.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DjbsBuIQ.js → ErrorBarContext-D44_lR0v.js} +1 -1
- package/dist/client/assets/{Globe04-h_nDPacm.js → Globe04-4YyuMYqy.js} +1 -1
- package/dist/client/assets/{Image01-C3eHO4JB.js → Image01-BxD5iKMZ.js} +1 -1
- package/dist/client/assets/{Key01-BHDBC0Ty.js → Key01-DiWd4_17.js} +1 -1
- package/dist/client/assets/{Link01-CWRvYa94.js → Link01-BvUGh-xJ.js} +1 -1
- package/dist/client/assets/{LinkBroken01-D8s-Aoli.js → LinkBroken01-Dr4E5MhM.js} +1 -1
- package/dist/client/assets/{Minus-BDVlfQ1F.js → Minus-CXzY2fjB.js} +1 -1
- package/dist/client/assets/{Monitor01-DufxSkfE.js → Monitor01-DZ7IJEbl.js} +1 -1
- package/dist/client/assets/{Play-B4Nce4IV.js → Play-BwYX-89W.js} +1 -1
- package/dist/client/assets/{Plus-DjulKDZN.js → Plus-BjzfR3X1.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BcRJIMrO.js → ReferenceLine-EP99t5eE.js} +1 -1
- package/dist/client/assets/{SearchMd-LiFx-NKw.js → SearchMd-D9nOIU2J.js} +1 -1
- package/dist/client/assets/{Sector-Vy_DZ6Ya.js → Sector-DaS_KQmA.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Diu_6vhS.js → ShoppingBag01-D-6nhQ_W.js} +1 -1
- package/dist/client/assets/{Sun-DwpHFeTI.js → Sun-BNGmGBE4.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DSVF0HAp.js → SwitchHorizontal01-Bx1Hh2TQ.js} +1 -1
- package/dist/client/assets/{Tool01-NhBuMmUV.js → Tool01-DOjTlNii.js} +1 -1
- package/dist/client/assets/{Trash01-6fKruzF0.js → Trash01-BBo1Nb1f.js} +1 -1
- package/dist/client/assets/{Upload01-XEi-StK2.js → Upload01-Ckb3GLnk.js} +1 -1
- package/dist/client/assets/{UserSquare-eFGH-oUL.js → UserSquare-D5QJpydc.js} +1 -1
- package/dist/client/assets/{Users01-BsuShWDn.js → Users01-mS8msQb1.js} +1 -1
- package/dist/client/assets/{XClose-CmswVBOn.js → XClose-BJbQdz2I.js} +1 -1
- package/dist/client/assets/{ZoomOut-DZO-NyFl.js → ZoomOut-ktJ3CkLb.js} +1 -1
- package/dist/client/assets/{access-gate-mZiv8FOt.js → access-gate-d8HEkPLL.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bs11uRPt.js → add-connection-dialog-BbkZiek0.js} +1 -1
- package/dist/client/assets/{agent-analytics-CSaBErHP.js → agent-analytics-DFIJvJD4.js} +1 -1
- package/dist/client/assets/agent-app-DXn15NXm.js +1 -0
- package/dist/client/assets/{agent-assets-DFlbYpaG.js → agent-assets-hfYJh0_A.js} +1 -1
- package/dist/client/assets/{agent-automation-CQUF61n4.js → agent-automation-BZRiWkqh.js} +3 -3
- package/dist/client/assets/{agent-automations-LxAQfaS1.js → agent-automations-BJOpwXL1.js} +1 -1
- package/dist/client/assets/{agent-calendar-BOffXUuz.js → agent-calendar-BAGZ1p7v.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-Bo6TPGly.js → agent-connect-sources-DdipcBCB.js} +1 -1
- package/dist/client/assets/agent-deck-NuWgoB2b.js +1 -0
- package/dist/client/assets/{agent-e2e-Dxeiz6Hg.js → agent-e2e-LjR_AszX.js} +1 -1
- package/dist/client/assets/agent-experiments-Vj5X0t6j.js +1 -0
- package/dist/client/assets/{agent-file-Btt92on1.js → agent-file-8okyQxr6.js} +1 -1
- package/dist/client/assets/agent-hosting-C9iNvWbw.js +1 -0
- package/dist/client/assets/{agent-icon-D2O6Ysxj.js → agent-icon-CkHOSjM9.js} +1 -1
- package/dist/client/assets/agent-library-C3UHx2s8.js +1 -0
- package/dist/client/assets/agent-library-file-COctww9_.js +1 -0
- package/dist/client/assets/agent-monitor-DXFQtlEO.js +1 -0
- package/dist/client/assets/{agent-overview--3R-F01i.js → agent-overview-B-GxdZc_.js} +1 -1
- package/dist/client/assets/{agent-releases-CiTUBkUu.js → agent-releases-C1SwS6iG.js} +1 -1
- package/dist/client/assets/agent-settings-B5i2IDjS.js +1 -0
- package/dist/client/assets/{agent-site-editor-Cyp35eBO.js → agent-site-editor-D9iW-_NS.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Ds8FSXKr.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DMumoGM6.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CTA6NLng.js +1 -0
- package/dist/client/assets/agent-view-BLDpPcVC.js +1 -0
- package/dist/client/assets/{agent-view-guard-DITCswoZ.js → agent-view-guard-DJniAyR6.js} +1 -1
- package/dist/client/assets/{agents-list-vpifaSDW.js → agents-list-xYpqGFZ4.js} +1 -1
- package/dist/client/assets/{ai-providers-Dph9V-S2.js → ai-providers-Cgv75Qyf.js} +1 -1
- package/dist/client/assets/{alert-BIVSlp4X.js → alert-BZ4_krGi.js} +1 -1
- package/dist/client/assets/{analytics-sections-C9r_Id8f.js → analytics-sections-DdkTkULU.js} +1 -1
- package/dist/client/assets/api-keys-3xt_Dt8d.js +1 -0
- package/dist/client/assets/{api-keys-OLI6lFDy.js → api-keys-BrVOkcDU.js} +1 -1
- package/dist/client/assets/{app-editor-BYMnhTet.js → app-editor-BVUf_h-8.js} +1 -1
- package/dist/client/assets/{asset-utils-s-rRWLDR.js → asset-utils-CDK7Qtxq.js} +1 -1
- package/dist/client/assets/{auth-mUy8P9mz.js → auth-D3pCoH2W.js} +1 -1
- package/dist/client/assets/{auth-catchall-C_KiXSY-.js → auth-catchall-lT8YS3M7.js} +1 -1
- package/dist/client/assets/{auth-entry-C1SLfq5y.js → auth-entry-JW9n9dGJ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C_joRAuD.js → auth-split-layout-CzCQMdLI.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Br6pb9qL.js → authenticate-and-persist-oauth-C5L3D5Ca.js} +1 -1
- package/dist/client/assets/{automation-list-row-BG7LwDup.js → automation-list-row-Bab6rpIB.js} +1 -1
- package/dist/client/assets/{automation-runs-D5ib3rJJ.js → automation-runs-DWwJplLm.js} +1 -1
- package/dist/client/assets/{automations-pErLtBmM.js → automations-DkM7elZs.js} +1 -1
- package/dist/client/assets/{autosend-fmyzxlgv.js → autosend-Bqc_eTHm.js} +1 -1
- package/dist/client/assets/{badge-D_XaqFCD.js → badge-BRoRJHXx.js} +1 -1
- package/dist/client/assets/{block-document-BbeKhIjN.js → block-document-BNuYqe1D.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BkWHKGnG.js → blocks-preview-workspace-context-Dl6jUWbf.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-C7qCSetR.js → blocks-tab-states-BVdzRZNO.js} +1 -1
- package/dist/client/assets/{blog-schema-BfUeFqnA.js → blog-schema-BteDgfB1.js} +1 -1
- package/dist/client/assets/{buckets-CvEidzt4.js → buckets-BmAPP4iB.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DWVQcr8S.js → build-improve-prompt-doc-tQKaisud.js} +1 -1
- package/dist/client/assets/{calendar-D5qyPmPe.js → calendar-BO-V-2PJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-Cadq9Tfk.js → capability-load-error-u125FpR3.js} +1 -1
- package/dist/client/assets/{category-editor-Dhi0w6mp.js → category-editor-Dx9msURA.js} +1 -1
- package/dist/client/assets/{cdn-tab-D5vyoNZe.js → cdn-tab-C0oYZyVl.js} +1 -1
- package/dist/client/assets/{chart-BCmVS-sn.js → chart-BY2C1bQi.js} +1 -1
- package/dist/client/assets/{chat-context-DQIwjTah.js → chat-context--E5N-hT7.js} +1 -1
- package/dist/client/assets/{chat-draft-D_5rgFXD.js → chat-draft-BHL2DhpX.js} +1 -1
- package/dist/client/assets/{checkbox-B1LwoLFy.js → checkbox-9OByQcgp.js} +1 -1
- package/dist/client/assets/{choose-editor-B-PLdH8j.js → choose-editor-CDXHgkSU.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CbU133Cr.js → cli-auth-success-CIYu5SNF.js} +1 -1
- package/dist/client/assets/{client-icons-Yic2XONz.js → client-icons-Ce5J9eaq.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-TqgyrL8V.js → cms-settings-editor-CpDEV-_f.js} +1 -1
- package/dist/client/assets/{collapsible-CVxiAnD0.js → collapsible-BlGpPYri.js} +1 -1
- package/dist/client/assets/{collection-detail-DcUQ1g_5.js → collection-detail-B7AdharK.js} +1 -1
- package/dist/client/assets/{collection-display-button-BwvT5j3N.js → collection-display-button-nX7xEjxH.js} +1 -1
- package/dist/client/assets/{collection-search-C7AC5mzN.js → collection-search-BSXlym45.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BkW0lNmQ.js → collection-table-wrapper-BeD_TsfM.js} +1 -1
- package/dist/client/assets/{collection-tabs-DysuRzTT.js → collection-tabs-BM4qUCLn.js} +1 -1
- package/dist/client/assets/{column-rules-DrQ3zKVW.js → column-rules-AdaTBjK3.js} +1 -1
- package/dist/client/assets/{combobox-DIlCtv4m.js → combobox-B60gvVUk.js} +1 -1
- package/dist/client/assets/{command-CmSy_63D.js → command-DM5EhprN.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BJVxRFbR.js → companion-mcps-section-BBRIw4lB.js} +1 -1
- package/dist/client/assets/{config-k6eupn0H.js → config-aAsCELpN.js} +1 -1
- package/dist/client/assets/{connect-1IzEMu95.js → connect-CEbXkIpX.js} +1 -1
- package/dist/client/assets/{connect-layout-B9EK05eh.js → connect-layout-D5ws_ut2.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-B9kwZ1qm.js → connect-source-dialog-B2egdqse.js} +1 -1
- package/dist/client/assets/{connection-8s94grp4.js → connection-CZdSZ7cZ.js} +1 -1
- package/dist/client/assets/{connection-card-6_vGNwe6.js → connection-card-Dm1efAkb.js} +1 -1
- package/dist/client/assets/{connection-detail-06L9lcjS.js → connection-detail-Dn4BBEB7.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B7-YxvfS.js → connection-form-helpers-Dqs2FqS4.js} +1 -1
- package/dist/client/assets/{connections-B67BU6-u.js → connections-C3YlS0Wr.js} +1 -1
- package/dist/client/assets/{content-tab-C8kwNsNv.js → content-tab-BIcFJX6D.js} +3 -3
- package/dist/client/assets/{context-BJ4DUI4o.js → context-MlWWTdkF.js} +1 -1
- package/dist/client/assets/{context-menu-DrJNCXai.js → context-menu-Bwov9uOn.js} +1 -1
- package/dist/client/assets/{context-shell-Cf8JU1_N.js → context-shell-CfvFOsdi.js} +3 -3
- package/dist/client/assets/{core.esm-8ysL4nmy.js → core.esm-B_keGZxr.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CRVy32Y2.js → create-organization-dialog-Cocq6mDk.js} +1 -1
- package/dist/client/assets/{daily-pulse-oZsmQ576.js → daily-pulse-8bE0Iw6L.js} +1 -1
- package/dist/client/assets/{discover-CBj9Ot9k.js → discover-muMw4E4F.js} +1 -1
- package/dist/client/assets/{domain-settings-Cuj3cb68.js → domain-settings-DemA6cL0.js} +1 -1
- package/dist/client/assets/{drawer-DoWw3X-U.js → drawer-CfMdyWdw.js} +1 -1
- package/dist/client/assets/{editor-D54k8w6W.js → editor-DWgFRXKZ.js} +1 -1
- package/dist/client/assets/{editor-classes-DvaDe0n2.js → editor-classes-QN9SL6Dx.js} +1 -1
- package/dist/client/assets/{empty-state-B6ZF6z6U.js → empty-state-DVlVwP7N.js} +1 -1
- package/dist/client/assets/{empty-state-B1U3dIOI.js → empty-state-y1ubQXhw.js} +1 -1
- package/dist/client/assets/{experiments-tab-Bf-4FZ8A.js → experiments-tab-Dg0bDQOw.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CSZHqOVL.js → experiments-tab-choice-DCdgy4TO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-dVntHSWe.js → extract-connection-data-CxPyeLDN.js} +1 -1
- package/dist/client/assets/{feature-gate-CGLZlvT1.js → feature-gate-B0M2_bl9.js} +1 -1
- package/dist/client/assets/{feature-paywall-YRUC3hnv.js → feature-paywall-4HuxS1an.js} +1 -1
- package/dist/client/assets/{file-explorer-CnB8AqiD.js → file-explorer-BS1EH7Er.js} +1 -1
- package/dist/client/assets/{file-preview-B3fPhoS1.js → file-preview-CbtDPWHZ.js} +1 -1
- package/dist/client/assets/{file-share-button--vHcbynF.js → file-share-button-CK1k8aIV.js} +1 -1
- package/dist/client/assets/{file-type-icon-BSvWJ_yJ.js → file-type-icon-CAuyXLhL.js} +1 -1
- package/dist/client/assets/{folder-icon-D9KEEKgD.js → folder-icon-cTmdNovO.js} +2 -2
- package/dist/client/assets/{form-DkJLMDiZ.js → form-D9xHZZfY.js} +1 -1
- package/dist/client/assets/{general-yzYHBZqk.js → general-0ri-rKgE.js} +1 -1
- package/dist/client/assets/{held-block-view-Bcr038cE.js → held-block-view-BrpD5ovO.js} +3 -3
- package/dist/client/assets/home-C2TqmqoZ.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-CpvmWvo8.js → hosted-publish-feedback-CQVL1WKe.js} +1 -1
- package/dist/client/assets/{icon-button-NEW9CrVR.js → icon-button-BQj-MO7v.js} +1 -1
- package/dist/client/assets/{index-DV0IMvuF.js → index-49oCbGKm.js} +1 -1
- package/dist/client/assets/{index-Da57lEgV.js → index-A235sEGg.js} +1 -1
- package/dist/client/assets/{index-DlBqAQ8N.js → index-B8DCfcWN.js} +36 -36
- package/dist/client/assets/{index-C1zQxIQC.js → index-BP9k6J6c.js} +1 -1
- package/dist/client/assets/{index-Dj2q9Kk6.js → index-BQe7wSyL.js} +1 -1
- package/dist/client/assets/index-BojwYFsv.js +4 -0
- package/dist/client/assets/{index-Bk4q9Kta.js → index-Bu8gXULT.js} +1 -1
- package/dist/client/assets/{index-iHeHzM9q.js → index-CExYs_fo.js} +1 -1
- package/dist/client/assets/{index-DHKvbX-F.js → index-CZRRScg8.js} +1 -1
- package/dist/client/assets/{index-C1xdxqY4.js → index-CgRVdVKu.js} +1 -1
- package/dist/client/assets/{index-fPzpoiMb.js → index-D4NFLqDj.js} +1 -1
- package/dist/client/assets/{index-Bah4YwbV.js → index-D8b4uuL_.js} +1 -1
- package/dist/client/assets/{index-y2MV63Fm.js → index-DCiIT3FM.js} +1 -1
- package/dist/client/assets/{index-DCpCimmv.js → index-RZRW1LBs.js} +1 -1
- package/dist/client/assets/index-SXHWoZ_C.css +1 -0
- package/dist/client/assets/{index-hXfcnGlM.js → index-prRf0ZXD.js} +1 -1
- package/dist/client/assets/{index-redirect-BTQYAvyK.js → index-redirect-RWda9D5U.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B1X7cH_h.js → infiniteQueryObserver-nWf_pHR9.js} +1 -1
- package/dist/client/assets/{infra-billing-I23Yzx7q.js → infra-billing-B03vKXLc.js} +1 -1
- package/dist/client/assets/{input-C1vi2y8a.js → input-B9ok0wti.js} +3 -3
- package/dist/client/assets/{input-BM4k5AWI.js → input-CB9WdGBg.js} +1 -1
- package/dist/client/assets/{integration-icon-DffiYnsw.js → integration-icon-BSGvGycd.js} +1 -1
- package/dist/client/assets/{jira-icon-CDq47JPG.js → jira-icon-CcIry80B.js} +1 -1
- package/dist/client/assets/{label-CI9_CFR6.js → label-BQhq9UZg.js} +1 -1
- package/dist/client/assets/{layout-86e7th4n.js → layout-ygwEwZGd.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DrwenQap.js → legacy-agents-deep-DuU4zQfm.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BMDUgvXe.js → legacy-main-redirect-KazKtmFp.js} +1 -1
- package/dist/client/assets/library-CxM_t2Sq.js +1 -0
- package/dist/client/assets/{login-Q6QzHe98.js → login-CwSvRRne.js} +1 -1
- package/dist/client/assets/{markdown-DtVTVyIC.js → markdown-Bz8CEUlh.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-B0DJyUaD.js → mcp-app-renderer-BqjfhS-C.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C2iU61yB.js → mcp-oauth-a_b-JQ66.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BgZxPic2.js → mcp-oauth-mQNJ20n8.js} +1 -1
- package/dist/client/assets/{members-Bk_T8psV.js → members-BzwONXdS.js} +1 -1
- package/dist/client/assets/{memory-BGQEqAyY.js → memory-Bn3BdhY3.js} +1 -1
- package/dist/client/assets/{mini-report-page-CIdyHIZJ.js → mini-report-page-DdUOvKyp.js} +1 -1
- package/dist/client/assets/mock-board-Bi3Dk8KG.js +81 -0
- package/dist/client/assets/{monaco-editor-D_Oeav_Z.js → monaco-editor-aa-CJKVx.js} +1 -1
- package/dist/client/assets/monitoring-Bp77XzYT.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-DdlyqvJE.js → monitoring-stats-row-B69U8Gcv.js} +1 -1
- package/dist/client/assets/{multi-select-DY9yJzQs.js → multi-select-nylLYa08.js} +1 -1
- package/dist/client/assets/{mustache-D61fFDb3.js → mustache-qxFhlusG.js} +1 -1
- package/dist/client/assets/{named-rule-uses-DImccIYP.js → named-rule-uses-C8k1RWls.js} +1 -1
- package/dist/client/assets/{new-project-dialog-kzuu4Dyf.js → new-project-dialog-CSm3PejW.js} +1 -1
- package/dist/client/assets/{oauth-callback-DcDcp9ht.js → oauth-callback-4g3SpGXy.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Bjee7W5B.js → oauth-callback-ai-provider-Cg2m3ViN.js} +1 -1
- package/dist/client/assets/{onboarding-DvIF4FSK.js → onboarding-IoEJWOn9.js} +1 -1
- package/dist/client/assets/{openai-conversation-CjhycVDX.js → openai-conversation-BTjnagC9.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-QrUaUcI4.js → optimistic-project-sidebar-views-Cv_GmItN.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BKjwxjjy.js → order-monitor-day-CKOhRUWT.js} +1 -1
- package/dist/client/assets/{organization-choice-BKIz2sU3.js → organization-choice-DJ_uJMLN.js} +1 -1
- package/dist/client/assets/{orgs-Cm95p7RP.js → orgs-C2JMLbr6.js} +1 -1
- package/dist/client/assets/{page-seo-form-CL0dKYhs.js → page-seo-form-CzO21Nj3.js} +1 -1
- package/dist/client/assets/{pair-BiKkCxaG.js → pair-Dxshgbd0.js} +1 -1
- package/dist/client/assets/{parse-sections-jfUka-ew.js → parse-sections-DWreJJx4.js} +1 -1
- package/dist/client/assets/{plan-Bha3pvLg.js → plan-2BnE6Mz8.js} +1 -1
- package/dist/client/assets/{plan-ladder-BCwguLCI.js → plan-ladder-C5YTaDyF.js} +1 -1
- package/dist/client/assets/{popover-DClIX5lD.js → popover-CeFWN04u.js} +1 -1
- package/dist/client/assets/{post-calendar-kalt2MD0.js → post-calendar-5C02O1u0.js} +1 -1
- package/dist/client/assets/{post-editor-Imtzd9hl.js → post-editor-DgJ_iUnR.js} +1 -1
- package/dist/client/assets/preview-content-DiiSycNp.js +1 -0
- package/dist/client/assets/preview-dialog-Bklxa_ZR.js +1 -0
- package/dist/client/assets/{preview-panel-BbgJC3B_.js → preview-panel-CQW-S9gZ.js} +1 -1
- package/dist/client/assets/{preview-tab-qtdXsUO8.js → preview-tab-BgAcGv6N.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-Dgg0Alt7.js → product-picker-dialog-Bia8NIvi.js} +1 -1
- package/dist/client/assets/{profile-Cmb0Uq9T.js → profile-FE7H1EMG.js} +1 -1
- package/dist/client/assets/{project-app-view-C9SIUrEh.js → project-app-view-BLAq_Iy-.js} +1 -1
- package/dist/client/assets/{project-apps-CWp3jzPS.js → project-apps-D_j6VmNI.js} +1 -1
- package/dist/client/assets/{project-feed-DIYZgm5v.js → project-feed-Dhu9Vg5M.js} +1 -1
- package/dist/client/assets/{project-icon-C5kNnOFq.js → project-icon-CS3H82bh.js} +1 -1
- package/dist/client/assets/project-reports-ZymDh6p5.js +1 -0
- package/dist/client/assets/project-tasks-DxlNQxIY.js +1 -0
- package/dist/client/assets/{projects-D4v4Oq64.js → projects-C7Pcys9n.js} +1 -1
- package/dist/client/assets/{projects-empty-state-D4fHv0Vx.js → projects-empty-state-Bojhg3V0.js} +1 -1
- package/dist/client/assets/{prompts-CYI2Ca4j.js → prompts-WLzLxBR8.js} +1 -1
- package/dist/client/assets/record-editor-CvWK-Gq8.js +1 -0
- package/dist/client/assets/{redirect-editor-CmRN_0xc.js → redirect-editor-BZlRMYi_.js} +1 -1
- package/dist/client/assets/{releases-api-DxEm_izB.js → releases-api-C5UXdeYU.js} +1 -1
- package/dist/client/assets/{reports-CbNZsWyp.js → reports-CZBm6igh.js} +1 -1
- package/dist/client/assets/reports-lWqv1bGh.js +1 -0
- package/dist/client/assets/{reports-onboarding-6K8tJ5J_.js → reports-onboarding-fG3WxoJD.js} +1 -1
- package/dist/client/assets/{reports-tab-DZE0kToJ.js → reports-tab-MG8cmrcU.js} +2 -2
- package/dist/client/assets/repositories-DUEgWQwQ.js +1 -0
- package/dist/client/assets/{repositories-Cv3p6t_W.js → repositories-De4C2A-6.js} +1 -1
- package/dist/client/assets/{repository-binding-CcdmL6ag.js → repository-binding-CA4hZb4c.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DuNS63Y0.js → repository-import-picker-BeNk1ycW.js} +1 -1
- package/dist/client/assets/{repository-picker-D37YtUW-.js → repository-picker-Cf1R7FMh.js} +1 -1
- package/dist/client/assets/{require-capability-wqNUtYQV.js → require-capability-BU8bps4o.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cj_D5aeR.js → required-auth-layout-CRlyc-2h.js} +1 -1
- package/dist/client/assets/{reset-password-qin72Rw_.js → reset-password-ycifmDAy.js} +1 -1
- package/dist/client/assets/{resizable-DkWxmtNv.js → resizable-Cp7httgV.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Bbn4K7a-.js → resolve-tab-icon-Sm0ktfH7.js} +1 -1
- package/dist/client/assets/{review-settings-DvOOayH7.js → review-settings-DChO3Zjf.js} +1 -1
- package/dist/client/assets/{roles-_9O3_in0.js → roles-D46oDwSw.js} +1 -1
- package/dist/client/assets/route-BooEoIma.js +1 -0
- package/dist/client/assets/{route-3yxLu2NB.js → route-C-7lI-Fb.js} +1 -1
- package/dist/client/assets/{route-CgAwr8_y.js → route-Dq__oVWa.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-4NgrDeJq.js → sandbox-lifecycle-context-BAdh5951.js} +1 -1
- package/dist/client/assets/{schema-BI1J5KjU.js → schema-CrCZqXXn.js} +1 -1
- package/dist/client/assets/{schema-XnSsI13A.js → schema-wLkKsLkr.js} +1 -1
- package/dist/client/assets/{scroll-area-DyDtaNCg.js → scroll-area-C8_E-S6T.js} +1 -1
- package/dist/client/assets/{search-input-JrdzMOm_.js → search-input-Dx6e86ww.js} +1 -1
- package/dist/client/assets/{search-toggle-wYGVtvVW.js → search-toggle-B9YJNG3i.js} +1 -1
- package/dist/client/assets/{secret-picker-DWXnDb0U.js → secret-picker-BtSePtvx.js} +1 -1
- package/dist/client/assets/{secrets-Cg7YmK1o.js → secrets-CunET598.js} +1 -1
- package/dist/client/assets/{section-array-field-CfCCudbI.js → section-array-field-CekVmh-r.js} +1 -1
- package/dist/client/assets/{sections-DxQyJ7Yy.js → sections-BeClTgWK.js} +1 -1
- package/dist/client/assets/{sections-editor-2qsFcYQx.js → sections-editor-C89HG7l9.js} +1 -1
- package/dist/client/assets/{select-RAX0QYEC.js → select-CUIweWk_.js} +1 -1
- package/dist/client/assets/{select-model-DpOOiTD1.js → select-model-DyAUq_T6.js} +1 -1
- package/dist/client/assets/{seo-editor-9wU3TQPz.js → seo-editor-C5j2teGj.js} +1 -1
- package/dist/client/assets/{separator-B0GmpR9Y.js → separator-DnSjVw2O.js} +1 -1
- package/dist/client/assets/settings-tab-DMhHTP8z.js +1 -0
- package/dist/client/assets/{sheet-7o24rLAF.js → sheet-D7Cjmd1L.js} +1 -1
- package/dist/client/assets/{shell-layout-Br0nQ-w1.js → shell-layout-B5fwvm5R.js} +1 -1
- package/dist/client/assets/{site-draft-actions-CPsRPxRa.js → site-draft-actions-C3JNXBlQ.js} +1 -1
- package/dist/client/assets/{site-draft-view-BY9yW2Ej.js → site-draft-view-CRGTY3fT.js} +2 -2
- package/dist/client/assets/site-editor-MkHUr8gO.js +1 -0
- package/dist/client/assets/{site-editor-toast-BV71DbMY.js → site-editor-toast-DyhbX0Mw.js} +1 -1
- package/dist/client/assets/{skills-Nw1X0lYG.js → skills-0w9uNtSg.js} +1 -1
- package/dist/client/assets/{slider-C7FCoMPq.js → slider-TYO8jBIT.js} +1 -1
- package/dist/client/assets/{sortable.esm-3LT8rMWS.js → sortable.esm-CJdZ5x-4.js} +1 -1
- package/dist/client/assets/sprints-C1z9xhcL.js +1 -0
- package/dist/client/assets/{sso-CuV4SaSb.js → sso-C8nAwMMn.js} +1 -1
- package/dist/client/assets/{suggestion-B8EqJCT2.js → suggestion-BrKm7YEI.js} +1 -1
- package/dist/client/assets/{switch-DRoHA0RB.js → switch-CFIsLePy.js} +1 -1
- package/dist/client/assets/{symbol-An2Zb2zQ.js → symbol-CI_tPgAs.js} +1 -1
- package/dist/client/assets/{synced-repos-BVfSxB1w.js → synced-repos-DLYz1I5K.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-B34XQCM3.js → tab-icon-glyph-CT6F37P0.js} +1 -1
- package/dist/client/assets/{table-D6WmilUC.js → table-BSN49b35.js} +1 -1
- package/dist/client/assets/{tabs-qk95ql5a.js → tabs-DCwfDaVF.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-8cgor_AG.js → task-assignee-avatar-DgyFcF-g.js} +1 -1
- package/dist/client/assets/{task-board-C3fHBdG2.js → task-board-C6p-KGD0.js} +1 -1
- package/dist/client/assets/{task-route-rNofa-46.js → task-route-XdsLdzBU.js} +1 -1
- package/dist/client/assets/{task-status-B6-9cIIP.js → task-status-BZbt2JR-.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CdD0QR2a.js → taskboard-analytics-BVC0alAo.js} +1 -1
- package/dist/client/assets/{tasks-CdTDj0OK.js → tasks-CPVZ-jRt.js} +1 -1
- package/dist/client/assets/tasks-Dne4DdgF.js +1 -0
- package/dist/client/assets/{textarea-Ibxo_cU5.js → textarea-BwT6ZS7T.js} +1 -1
- package/dist/client/assets/{thread-analytics-CUDgOcLF.js → thread-analytics-BfFOwWyh.js} +1 -1
- package/dist/client/assets/{thread-intent-Bcm8nkb-.js → thread-intent-D-KEwEzf.js} +1 -1
- package/dist/client/assets/{thread-route-Bd56Ws2e.js → thread-route-BsN2LJV1.js} +1 -1
- package/dist/client/assets/{thread-route-DytMtQhr.js → thread-route-DxiNtuGA.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DbsdUgzJ.js → thread-sheet-body-CBWb341N.js} +1 -1
- package/dist/client/assets/{time-range-picker-BjaZu1pB.js → time-range-picker-skZGAHXJ.js} +1 -1
- package/dist/client/assets/{toggle-group--gd2dZNu.js → toggle-group-Cz9DOV3a.js} +1 -1
- package/dist/client/assets/{tool-namespace-Czhk4de_.js → tool-namespace--8cPGMCR.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Doqx7uIl.js → toolbar-icon-button-mD5yQ1bm.js} +1 -1
- package/dist/client/assets/{tooltip-CGDwEKla.js → tooltip-39ugkI0L.js} +1 -1
- package/dist/client/assets/{tooltipContext-BjbnVzdB.js → tooltipContext-DkJYRFMk.js} +1 -1
- package/dist/client/assets/{track-o53s7HUT.js → track-CirEjMry.js} +1 -1
- package/dist/client/assets/{types-BlSD9MKW.js → types-Bl0qOhZH.js} +1 -1
- package/dist/client/assets/{url-slug-BC1hwMbV.js → url-slug-CRfssqK4.js} +1 -1
- package/dist/client/assets/{usage-stats-DFdXpSTz.js → usage-stats-CxhQ4qgm.js} +1 -1
- package/dist/client/assets/{use-ai-providers-YeO0Kt-T.js → use-ai-providers-5x-7PabC.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-B8Wdybx9.js → use-apply-named-rule-DSxEbU5L.js} +1 -1
- package/dist/client/assets/{use-automations-3TnrfuwX.js → use-automations-MORaBKu0.js} +1 -1
- package/dist/client/assets/{use-autosave-DKMWP7df.js → use-autosave-CDkqsUmz.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BYFrwE0Z.js → use-chat-layout-state-C5DfKUVg.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CoJMln1I.js → use-clock-tick-DlyCrQ5n.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BJbCRSe5.js → use-cms-publish-actions-udJEaMAv.js} +1 -1
- package/dist/client/assets/{use-connect-companion-C0IB4u5H.js → use-connect-companion-KQbVQnKu.js} +1 -1
- package/dist/client/assets/{use-connection-CPJ2t_wt.js → use-connection-BzJzZVW-.js} +1 -1
- package/dist/client/assets/{use-copy-pG3Nq4mQ.js → use-copy-CB0L0J8x.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BJ9mL4g_.js → use-create-virtual-mcp-BlrP9zeW.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-aiAkCLG4.js → use-date-fns-locale-S4Zh5od9.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-GnvmIFmT.js → use-debounced-autosave-NTbBlp4_.js} +1 -1
- package/dist/client/assets/{use-debounced-value-HL4NH2l1.js → use-debounced-value-DGARlBw7.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C7mrv7jI.js → use-deco-credits-B1sW1ITA.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Bo1C0-vc.js → use-decopilot-events-CuZxwgAa.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Cbj0xjTC.js → use-delete-connection-CFuK3DED.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DqPz0gQF.js → use-deployment-admin-B2S13nf-.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-HidTF3Ak.js → use-fast-preview-draft-url-B_R5GToU.js} +1 -1
- package/dist/client/assets/{use-file-configs-DjM7limQ.js → use-file-configs-RzjgyVAM.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-BawImjzR.js → use-inbox-feed--WSawVJi.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BWXYJIGE.js → use-infinite-scroll-1G3eM-Rp.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkUHU_ck.js → use-join-requests-B6FHdsSt.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BkwtKsEq.js → use-main-panel-tabs-DxCyHarM.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Diru6v5l.js → use-mcp-auth-status-BcfLKeJh.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BTazWDn_.js → use-mcp-client-CkOyk7WV.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BtAR7liM.js → use-mcp-prompts-BRW3d1m3.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CnDXz04m.js → use-mcp-tools-C7PJtKTN.js} +1 -1
- package/dist/client/assets/{use-mobile-Ba8cwCW_.js → use-mobile-DPbi1clj.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CE7PC8Dn.js → use-move-blocks-CCpu-Xwf.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-ClMAT78e.js → use-navigate-to-agent-CO13gq4R.js} +1 -1
- package/dist/client/assets/{use-org-fs-is3Nb4bW.js → use-org-fs-Cfktb-SK.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-rMxQhmIY.js → use-org-repo-syncs-CwuLQn23.js} +1 -1
- package/dist/client/assets/{use-org-sso-Br-zUY8K.js → use-org-sso-6hyQ_k3q.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CMSlaFcG.js → use-organization-roles-C_hli77o.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CQDxv_1k.js → use-organization-settings-BImwc2PU.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CXnDtexh.js → use-panel-navigate-Cbwq5-nV.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-YGN4D-su.js → use-project-native-view-presence-C4SyLg20.js} +1 -1
- package/dist/client/assets/{use-project-scope-B0GTyJmy.js → use-project-scope-l9xbaEl4.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Dpk0kWXv.js → use-recent-apps-CCPxNoht.js} +1 -1
- package/dist/client/assets/{use-releases-BOl4DpnA.js → use-releases-Bmkjs0qa.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CkiLcbuT.js → use-reports-diagnostic-BM0cNPJI.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-0ezZYS9_.js → use-sandbox-events-yZqbSiZh.js} +1 -1
- package/dist/client/assets/{use-secrets-Df_YMttt.js → use-secrets-CcmUUsNS.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-3xGhEYUn.js → use-section-preview-base-9Uwk-Tbf.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Bpm2BYEZ.js → use-session-runtime-9ouwKPcu.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BnhavbaD.js → use-sidebar-collapsed-Cazuxzc-.js} +1 -1
- package/dist/client/assets/{use-tags-DZKcwnSP.js → use-tags-BjVblitP.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Bv9Zee7f.js → use-task-board-analytics-CUjPXhqt.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Cc9iZtjE.js → use-task-board-events-B5OTWhwn.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BWsy70r-.js → use-task-board-item-prs-DQ5R9f8x.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Zdotw36E.js → use-task-metadata-LGV8Ij9d.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-D2GeKxmA.js → use-thread-analytics-CwHQTHn_.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D4Ri80KS.js → use-thread-outputs-CL8YZNhw.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-8-Bccnnm.js +1 -0
- package/dist/client/assets/{useQueries-MdybfDim.js → useQueries-B2qPgznU.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BlA4IK6h.js +1 -0
- package/dist/client/assets/{users-CLTHtY95.js → users-MAXM_wOJ.js} +1 -1
- package/dist/client/assets/{utils-Cvz7JLdG.js → utils-BW_8cvnQ.js} +1 -1
- package/dist/client/assets/{variant-calendar-D9qfBM7M.js → variant-calendar-CdZp1eCy.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-0q1jVuDF.js → variant-matcher-override-CGM8uMqm.js} +1 -1
- package/dist/client/assets/{view-header-DNRg1UwP.js → view-header-BBFpg8HA.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Bz0i6iLp.js → virtual-mcp-awB3Qm4d.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Vinolgve.js → watch-sse-pool-CoW28DTN.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CpchlFDM.js +0 -1
- package/dist/client/assets/agent-deck-BsttewCw.js +0 -1
- package/dist/client/assets/agent-experiments-DgwnRVuo.js +0 -1
- package/dist/client/assets/agent-hosting-58n6tbGl.js +0 -1
- package/dist/client/assets/agent-library-C6xhflxa.js +0 -1
- package/dist/client/assets/agent-library-file-Lh5pI681.js +0 -1
- package/dist/client/assets/agent-monitor-B7Pvzm4h.js +0 -1
- package/dist/client/assets/agent-settings-DkY2WG9h.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Ck6tXuvy.js +0 -2
- package/dist/client/assets/agent-site-editor-content-TPfojHsu.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Bv1qplXm.js +0 -1
- package/dist/client/assets/agent-view-Dy5CpY1v.js +0 -1
- package/dist/client/assets/api-keys-bAkry4Sk.js +0 -1
- package/dist/client/assets/home-CdpLVlWp.js +0 -1
- package/dist/client/assets/index-69Wn6Yn2.js +0 -4
- package/dist/client/assets/index-CDXVQ_TQ.css +0 -1
- package/dist/client/assets/library-3tOBnuzW.js +0 -1
- package/dist/client/assets/mock-board-Djd1BZ6E.js +0 -81
- package/dist/client/assets/monitoring-D1EdmxtK.js +0 -1
- package/dist/client/assets/preview-content-OZjgSgMZ.js +0 -1
- package/dist/client/assets/preview-dialog-CBkdchfP.js +0 -1
- package/dist/client/assets/project-reports-DJhPJTRc.js +0 -1
- package/dist/client/assets/project-tasks-ItwqddIw.js +0 -1
- package/dist/client/assets/record-editor-B7uavues.js +0 -1
- package/dist/client/assets/reports-CSjngTEz.js +0 -1
- package/dist/client/assets/repositories-CC9x9vTF.js +0 -1
- package/dist/client/assets/route-t6Vm8Ywp.js +0 -1
- package/dist/client/assets/settings-tab-B6r8sKLk.js +0 -1
- package/dist/client/assets/site-editor-CUxt9aeG.js +0 -1
- package/dist/client/assets/tasks-q9Lrl5hM.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ID7ntuLj.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BM00SstB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as $,x as D,_ as We,T as H,$ as je,a0 as A,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-DFdXpSTz.js";import{gh as ye,gY as Ce,gg as Se,gZ as Re,g_ as Ee,g$ as Te,h0 as Oe,h1 as Ie,gj as Ae,fc as Me,r as C,bQ as ze}from"./index-DlBqAQ8N.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){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:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!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:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.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 Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({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 Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!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,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){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 d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.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=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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 Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.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:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({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 Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=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"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
1
|
+
import{n as $,x as D,_ as We,T as H,$ as je,a0 as A,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-CxhQ4qgm.js";import{gh as ye,gY as Ce,gg as Se,gZ as Re,g_ as Ee,g$ as Te,h0 as Oe,h1 as Ie,gj as Ae,fc as Me,r as C,bQ as ze}from"./index-B8DCfcWN.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){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:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!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:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.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 Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({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 Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!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,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){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 d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.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=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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 Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.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:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({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 Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=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"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,f as p,aA as u,j as s,b2 as x,N as a}from"./index-
|
|
1
|
+
import{c as f,f as p,aA as u,j as s,b2 as x,N as a}from"./index-B8DCfcWN.js";import{C as j}from"./capability-load-error-u125FpR3.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};
|
package/dist/client/assets/{infiniteQueryObserver-B1X7cH_h.js → infiniteQueryObserver-nWf_pHR9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{es as g,et as d,eu as v}from"./index-
|
|
1
|
+
import{es as g,et as d,eu as v}from"./index-B8DCfcWN.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:r}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,s=r.fetchMeta?.fetchMore?.direction,h=a&&s==="forward",o=c&&s==="forward",n=a&&s==="backward",f=c&&s==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,r.data),hasPreviousPage:d(t,r.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{g5 as He,dv as Ht,r as S,fu as ie,bQ as $t,c as Z,j as s,hF as Qt,b as de,hH as Jt,hI as Ct,hJ as _t,gn as L,fT as ge,B as Ze,bB as ae,a7 as er}from"./index-DlBqAQ8N.js";import{i as tr}from"./CreditCard01-3pgS1FBj.js";import{B as C}from"./badge-D_XaqFCD.js";import{M as rr}from"./multi-select-DY9yJzQs.js";import{S as nr,d as ir,c as ar,a as sr,b as or}from"./select-RAX0QYEC.js";import{T as ee,a as lr,b as $e,c as te,d as cr,e as ur}from"./table-D6WmilUC.js";import{C as fr,X as dr,Y as gr}from"./CartesianChart-C7RhMZbm.js";import{bN as mr,bO as kt,bP as yr,bQ as pr,bR as br,bS as hr,bT as vr,bU as jr,bc as xr,aB as ue,bV as Sr,N as D,bW as wr,ai as Or,a0 as fe,bX as Ut,F as X,bY as Pr,bZ as Br,bh as Qe,b_ as Tr,aK as Ar,bs as Dr,bE as Nr,a1 as Er,Z as qr,D as se,a2 as Mr,B as Ir,a5 as Rr,b$ as Lr,ax as _r,c0 as kr,c1 as Ur,c2 as Fr,c3 as Wr,c4 as Kr,c5 as zr,c6 as Vr,c7 as Zr,c8 as Gr}from"./CategoricalChart-VnQ3lkHZ.js";import{R as Yr,S as Xr}from"./Sector-Vy_DZ6Ya.js";import{A as Hr,a as $r}from"./AreaChart-abAlkUS3.js";import{R as Qr}from"./require-capability-wqNUtYQV.js";import"./checkbox-B1LwoLFy.js";import"./Minus-BDVlfQ1F.js";import"./ChevronUp-BADsHIlZ.js";import"./command-CmSy_63D.js";import"./index-fPzpoiMb.js";import"./SearchMd-LiFx-NKw.js";import"./popover-DClIX5lD.js";import"./index-BdQq_4o_.js";import"./index-y2MV63Fm.js";import"./index-iHeHzM9q.js";import"./access-gate-mZiv8FOt.js";import"./capability-load-error-Cadq9Tfk.js";var me={},ye={},Je;function Jr(){return Je||(Je=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r,n){const a=new Map;for(let l=0;l<r.length;l++){const o=r[l],u=n(o,l,r);a.has(u)||a.set(u,o)}return Array.from(a.values())}t.uniqBy=e})(ye)),ye}var pe={},Ce;function Cr(){return Ce||(Ce=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r,n){return function(...a){return r.apply(this,a.slice(0,n))}}t.ary=e})(pe)),pe}var be={},et;function Ft(){return et||(et=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return r}t.identity=e})(be)),be}var he={},ve={},tt;function en(){return tt||(tt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return typeof r=="object"&&r!==null}t.isObjectLike=e})(ve)),ve}var rt;function tn(){return rt||(rt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=mr(),r=en();function n(a){return r.isObjectLike(a)&&e.isArrayLike(a)}t.isArrayLikeObject=n})(he)),he}var je={},xe={},nt;function rn(){return nt||(nt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=kt();function r(n){return function(a){return e.get(a,n)}}t.property=r})(xe)),xe}var Se={},we={},Oe={},Pe={},it;function Wt(){return it||(it=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return r==null||typeof r!="object"&&typeof r!="function"}t.isPrimitive=e})(Pe)),Pe}var at;function nn(){return at||(at=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=yr(),r=Wt(),n=pr();function a(f,i,d){return typeof d!="function"?a(f,i,()=>{}):l(f,i,function b(g,p,v,c,h,j){const O=d(g,p,v,c,h,j);return O!==void 0?!!O:l(g,p,b,j)},new Map)}function l(f,i,d,b){if(i===f)return!0;switch(typeof i){case"object":return o(f,i,d,b);case"function":return Object.keys(i).length>0?l(f,{...i},d,b):n.isEqualsSameValueZero(f,i);default:return e.isObject(f)?typeof i=="string"?i==="":!0:n.isEqualsSameValueZero(f,i)}}function o(f,i,d,b){if(i==null)return!0;if(Array.isArray(i))return m(f,i,d,b);if(i instanceof Map)return u(f,i,d,b);if(i instanceof Set)return y(f,i,d,b);const g=Object.keys(i);if(f==null||r.isPrimitive(f))return g.length===0;if(g.length===0)return!0;if(b?.has(i))return b.get(i)===f;b?.set(i,f);try{for(let p=0;p<g.length;p++){const v=g[p];if(!r.isPrimitive(f)&&!(v in f)||i[v]===void 0&&f[v]!==void 0||i[v]===null&&f[v]!==null||!d(f[v],i[v],v,f,i,b))return!1}return!0}finally{b?.delete(i)}}function u(f,i,d,b){if(i.size===0)return!0;if(!(f instanceof Map))return!1;for(const[g,p]of i.entries()){const v=f.get(g);if(d(v,p,g,f,i,b)===!1)return!1}return!0}function m(f,i,d,b){if(i.length===0)return!0;if(!Array.isArray(f))return!1;const g=new Set;for(let p=0;p<i.length;p++){const v=i[p];let c=!1;for(let h=0;h<f.length;h++){if(g.has(h))continue;const j=f[h];let O=!1;if(d(j,v,p,f,i,b)&&(O=!0),O){g.add(h),c=!0;break}}if(!c)return!1}return!0}function y(f,i,d,b){return i.size===0?!0:f instanceof Set?m([...f],[...i],d,b):!1}t.isMatchWith=a,t.isSetMatch=y})(Oe)),Oe}var st;function Kt(){return st||(st=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=nn();function r(n,a){return e.isMatchWith(n,a,()=>{})}t.isMatch=r})(we)),we}var Be={},Te={},Ae={},ot;function an(){return ot||(ot=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}t.getSymbols=e})(Ae)),Ae}var De={},lt;function Ge(){return lt||(lt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}t.getTag=e})(De)),De}var Ne={},ct;function zt(){return ct||(ct=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e="[object RegExp]",r="[object String]",n="[object Number]",a="[object Boolean]",l="[object Arguments]",o="[object Symbol]",u="[object Date]",m="[object Map]",y="[object Set]",f="[object Array]",i="[object Function]",d="[object ArrayBuffer]",b="[object Object]",g="[object Error]",p="[object DataView]",v="[object Uint8Array]",c="[object Uint8ClampedArray]",h="[object Uint16Array]",j="[object Uint32Array]",O="[object BigUint64Array]",x="[object Int8Array]",P="[object Int16Array]",T="[object Int32Array]",B="[object BigInt64Array]",A="[object Float32Array]",E="[object Float64Array]";t.argumentsTag=l,t.arrayBufferTag=d,t.arrayTag=f,t.bigInt64ArrayTag=B,t.bigUint64ArrayTag=O,t.booleanTag=a,t.dataViewTag=p,t.dateTag=u,t.errorTag=g,t.float32ArrayTag=A,t.float64ArrayTag=E,t.functionTag=i,t.int16ArrayTag=P,t.int32ArrayTag=T,t.int8ArrayTag=x,t.mapTag=m,t.numberTag=n,t.objectTag=b,t.regexpTag=e,t.setTag=y,t.stringTag=r,t.symbolTag=o,t.uint16ArrayTag=h,t.uint32ArrayTag=j,t.uint8ArrayTag=v,t.uint8ClampedArrayTag=c})(Ne)),Ne}var Ee={},qe={},ut;function sn(){return ut||(ut=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof He=="object"&&He||(function(){return this})()||Function("return this")();t.globalThis=e})(qe)),qe}var ft;function on(){return ft||(ft=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=sn();function r(n){return typeof e.globalThis.Buffer<"u"&&e.globalThis.Buffer.isBuffer(n)}t.isBuffer=r})(Ee)),Ee}var Me={},dt;function ln(){return dt||(dt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}t.isTypedArray=e})(Me)),Me}var gt;function Vt(){return gt||(gt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=an(),r=Ge(),n=zt(),a=on(),l=Wt(),o=ln();function u(i,d){return m(i,void 0,i,new Map,d)}function m(i,d,b,g=new Map,p=void 0){const v=p?.(i,d,b,g);if(v!==void 0)return v;if(l.isPrimitive(i))return i;if(g.has(i))return g.get(i);if(Array.isArray(i)){const c=new Array(i.length);g.set(i,c);for(let h=0;h<i.length;h++)c[h]=m(i[h],h,b,g,p);return Object.hasOwn(i,"index")&&(c.index=i.index),Object.hasOwn(i,"input")&&(c.input=i.input),c}if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp){const c=new RegExp(i.source,i.flags);return c.lastIndex=i.lastIndex,c}if(i instanceof Map){const c=new Map;g.set(i,c);for(const[h,j]of i)c.set(h,m(j,h,b,g,p));return c}if(i instanceof Set){const c=new Set;g.set(i,c);for(const h of i)c.add(m(h,void 0,b,g,p));return c}if(a.isBuffer(i))return i.subarray();if(o.isTypedArray(i)){const c=new(Object.getPrototypeOf(i)).constructor(i.length);g.set(i,c);for(let h=0;h<i.length;h++)c[h]=m(i[h],h,b,g,p);return c}if(i instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&i instanceof SharedArrayBuffer)return i.slice(0);if(i instanceof DataView){const c=new DataView(i.buffer.slice(0),i.byteOffset,i.byteLength);return g.set(i,c),y(c,i,b,g,p),c}if(typeof File<"u"&&i instanceof File){const c=new File([i],i.name,{type:i.type});return g.set(i,c),y(c,i,b,g,p),c}if(typeof Blob<"u"&&i instanceof Blob){const c=new Blob([i],{type:i.type});return g.set(i,c),y(c,i,b,g,p),c}if(i instanceof Error){const c=structuredClone(i);return g.set(i,c),c.message=i.message,c.name=i.name,c.stack=i.stack,c.cause=i.cause,c.constructor=i.constructor,y(c,i,b,g,p),c}if(i instanceof Boolean){const c=new Boolean(i.valueOf());return g.set(i,c),y(c,i,b,g,p),c}if(i instanceof Number){const c=new Number(i.valueOf());return g.set(i,c),y(c,i,b,g,p),c}if(i instanceof String){const c=new String(i.valueOf());return g.set(i,c),y(c,i,b,g,p),c}if(typeof i=="object"&&f(i)){const c=Object.create(Object.getPrototypeOf(i));return g.set(i,c),y(c,i,b,g,p),c}return i}function y(i,d,b=i,g,p){const v=[...Object.keys(d),...e.getSymbols(d)];for(let c=0;c<v.length;c++){const h=v[c],j=Object.getOwnPropertyDescriptor(i,h);(j==null||j.writable)&&(i[h]=m(d[h],h,b,g,p))}}function f(i){switch(r.getTag(i)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}t.cloneDeepWith=u,t.cloneDeepWithImpl=m,t.copyProperties=y})(Te)),Te}var mt;function cn(){return mt||(mt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Vt();function r(n){return e.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}t.cloneDeep=r})(Be)),Be}var yt;function un(){return yt||(yt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Kt(),r=cn();function n(a){return a=r.cloneDeep(a),l=>e.isMatch(l,a)}t.matches=n})(Se)),Se}var Ie={},Re={},Le={},pt;function fn(){return pt||(pt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Vt(),r=Ge(),n=zt();function a(l,o){return e.cloneDeepWith(l,(u,m,y,f)=>{const i=o?.(u,m,y,f);if(i!==void 0)return i;if(typeof l=="object"){if(r.getTag(l)===n.objectTag&&typeof l.constructor!="function"){const d={};return f.set(l,d),e.copyProperties(d,l,y,f),d}switch(Object.prototype.toString.call(l)){case n.numberTag:case n.stringTag:case n.booleanTag:{const d=new l.constructor(l?.valueOf());return e.copyProperties(d,l),d}case n.argumentsTag:{const d={};return e.copyProperties(d,l),d.length=l.length,d[Symbol.iterator]=l[Symbol.iterator],d}default:return}}})}t.cloneDeepWith=a})(Le)),Le}var bt;function dn(){return bt||(bt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=fn();function r(n){return e.cloneDeepWith(n)}t.cloneDeep=r})(Re)),Re}var _e={},ke={},ht;function gn(){return ht||(ht=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Ge();function r(n){return n!==null&&typeof n=="object"&&e.getTag(n)==="[object Arguments]"}t.isArguments=r})(ke)),ke}var vt;function mn(){return vt||(vt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=br(),r=vr(),n=gn(),a=hr();function l(o,u){let m;if(Array.isArray(u)?m=u:typeof u=="string"&&e.isDeepKey(u)&&o?.[u]==null?m=a.toPath(u):m=[u],m.length===0)return!1;let y=o;for(let f=0;f<m.length;f++){const i=m[f];if((y==null||!Object.hasOwn(y,i))&&!((Array.isArray(y)||n.isArguments(y))&&r.isIndex(i)&&i<y.length))return!1;y=y[i]}return!0}t.has=l})(_e)),_e}var jt;function yn(){return jt||(jt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Kt(),r=jr(),n=dn(),a=kt(),l=mn();function o(u,m){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=r.toKey(u);break}}return m=n.cloneDeep(m),function(y){const f=a.get(y,u);return f===void 0?l.has(y,u):m===void 0?f===void 0:e.isMatch(f,m)}}t.matchesProperty=o})(Ie)),Ie}var xt;function pn(){return xt||(xt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Ft(),r=rn(),n=un(),a=yn();function l(o){if(o==null)return e.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?a.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}t.iteratee=l})(je)),je}var St;function bn(){return St||(St=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Jr(),r=Cr(),n=Ft(),a=tn(),l=pn();function o(u,m=n.identity){return a.isArrayLikeObject(u)?e.uniqBy(Array.from(u),r.ary(l.iteratee(m),1)):[]}t.uniqBy=o})(me)),me}var Ue,wt;function hn(){return wt||(wt=1,Ue=bn().uniqBy),Ue}var vn=hn();const Ot=Ht(vn);function jn(t,e,r){return e===!0?Ot(t,r):typeof e=="function"?Ot(t,e):t}var oe=1;function xn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[e,r]=S.useState({height:0,left:0,top:0,width:0}),n=S.useCallback(a=>{if(a!=null){var l=a.getBoundingClientRect(),o={height:l.height,left:l.left,top:l.top,width:l.width};(Math.abs(o.height-e.height)>oe||Math.abs(o.left-e.left)>oe||Math.abs(o.top-e.top)>oe||Math.abs(o.width-e.width)>oe)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[e.width,e.height,e.top,e.left,...t]);return[e,n]}function Ke(){return Ke=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ke.apply(null,arguments)}function Pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function re(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pt(Object(r),!0).forEach(function(n){Sn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Sn(t,e,r){return(e=wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wn(t){var e=On(t,"string");return typeof e=="symbol"?e:e+""}function On(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pn(t){return Array.isArray(t)&&ue(t[0])&&ue(t[1])?t.join(" ~ "):t}var Q={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function Bn(t,e){return e==null?t:Sr(t,e)}var Tn=t=>{var{separator:e=Q.separator,contentStyle:r,itemStyle:n,labelStyle:a=Q.labelStyle,payload:l,formatter:o,itemSorter:u,wrapperClassName:m,labelClassName:y,label:f,labelFormatter:i,accessibilityLayer:d=Q.accessibilityLayer}=t,b=()=>{if(l&&l.length){var x={padding:0,margin:0},P=Bn(l,u),T=P.map((B,A)=>{if(!B||B.type==="none")return null;var E=B.formatter||o||Pn,{value:N,name:_}=B,F=N,W=_;if(E){var M=E(N,_,B,A,l);if(Array.isArray(M))[F,W]=M;else if(M!=null)F=M;else return null}var K=re(re({},Q.itemStyle),{},{color:B.color||Q.itemStyle.color},n);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(A),style:K},ue(W)?S.createElement("span",{className:"recharts-tooltip-item-name"},W):null,ue(W)?S.createElement("span",{className:"recharts-tooltip-item-separator"},e):null,S.createElement("span",{className:"recharts-tooltip-item-value"},F),S.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:x},T)}return null},g=re(re({},Q.contentStyle),r),p=re({margin:0},a),v=!xr(f),c=v?f:"",h=ie("recharts-default-tooltip",m),j=ie("recharts-tooltip-label",y);v&&i&&l!==void 0&&l!==null&&(c=i(f,l));var O=d?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",Ke({className:h,style:g},O),S.createElement("p",{className:j,style:p},S.isValidElement(c)?c:"".concat(c)),b())},ne="recharts-tooltip-wrapper",An={visibility:"hidden"};function Dn(t){var{coordinate:e,translateX:r,translateY:n}=t;return ie(ne,{["".concat(ne,"-right")]:D(r)&&e&&D(e.x)&&r>=e.x,["".concat(ne,"-left")]:D(r)&&e&&D(e.x)&&r<e.x,["".concat(ne,"-bottom")]:D(n)&&e&&D(e.y)&&n>=e.y,["".concat(ne,"-top")]:D(n)&&e&&D(e.y)&&n<e.y})}function Bt(t){var{allowEscapeViewBox:e,coordinate:r,key:n,offset:a,position:l,reverseDirection:o,tooltipDimension:u,viewBox:m,viewBoxDimension:y}=t;if(l&&D(l[n]))return l[n];var f=r[n]-u-(a>0?a:0),i=r[n]+a;if(e[n])return o[n]?f:i;var d=m[n];if(d==null)return 0;if(o[n]){var b=f,g=d;return b<g?Math.max(i,d):Math.max(f,d)}if(y==null)return 0;var p=i+u,v=d+y;return p>v?Math.max(f,d):Math.max(i,d)}function Nn(t){var{translateX:e,translateY:r,useTranslate3d:n}=t;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function En(t){var{allowEscapeViewBox:e,coordinate:r,offsetTop:n,offsetLeft:a,position:l,reverseDirection:o,tooltipBox:u,useTranslate3d:m,viewBox:y}=t,f,i,d;return u.height>0&&u.width>0&&r?(i=Bt({allowEscapeViewBox:e,coordinate:r,key:"x",offset:a,position:l,reverseDirection:o,tooltipDimension:u.width,viewBox:y,viewBoxDimension:y.width}),d=Bt({allowEscapeViewBox:e,coordinate:r,key:"y",offset:n,position:l,reverseDirection:o,tooltipDimension:u.height,viewBox:y,viewBoxDimension:y.height}),f=Nn({translateX:i,translateY:d,useTranslate3d:m})):f=An,{cssProperties:f,cssClasses:Dn({translateX:i,translateY:d,coordinate:r})}}function Tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(r),!0).forEach(function(n){qn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qn(t,e,r){return(e=Mn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mn(t){var e=In(t,"string");return typeof e=="symbol"?e:e+""}function In(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rn(t){if(!(t.prefersReducedMotion&&t.isAnimationActive==="auto")&&t.isAnimationActive&&t.active)return"transform ".concat(t.animationDuration,"ms ").concat(t.animationEasing)}function Ln(t){var e,r,n,a,l,o,u=wr(),[m,y]=S.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));S.useEffect(()=>{var g=p=>{if(p.key==="Escape"){var v,c,h,j;y({dismissed:!0,dismissedAtCoordinate:{x:(v=(c=t.coordinate)===null||c===void 0?void 0:c.x)!==null&&v!==void 0?v:0,y:(h=(j=t.coordinate)===null||j===void 0?void 0:j.y)!==null&&h!==void 0?h:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(e=t.coordinate)===null||e===void 0?void 0:e.x,(r=t.coordinate)===null||r===void 0?void 0:r.y]),m.dismissed&&(((n=(a=t.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0)!==m.dismissedAtCoordinate.x||((l=(o=t.coordinate)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0)!==m.dismissedAtCoordinate.y)&&y(J(J({},m),{},{dismissed:!1}));var{cssClasses:f,cssProperties:i}=En({allowEscapeViewBox:t.allowEscapeViewBox,coordinate:t.coordinate,offsetLeft:typeof t.offset=="number"?t.offset:t.offset.x,offsetTop:typeof t.offset=="number"?t.offset:t.offset.y,position:t.position,reverseDirection:t.reverseDirection,tooltipBox:{height:t.lastBoundingBox.height,width:t.lastBoundingBox.width},useTranslate3d:t.useTranslate3d,viewBox:t.viewBox}),d=t.hasPortalFromProps?{}:J(J({transition:Rn({prefersReducedMotion:u,isAnimationActive:t.isAnimationActive,active:t.active,animationDuration:t.animationDuration,animationEasing:t.animationEasing})},i),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),b=J(J({},d),{},{visibility:!m.dismissed&&t.active&&t.hasPayload?"visible":"hidden"},t.wrapperStyle);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:f,style:b,ref:t.innerRef},t.children)}var _n=S.memo(Ln),kn=["x","y","top","left","width","height","className"];function ze(){return ze=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ze.apply(null,arguments)}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Un(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(n){Fn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fn(t,e,r){return(e=Wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wn(t){var e=Kn(t,"string");return typeof e=="symbol"?e:e+""}function Kn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zn(t,e){if(t==null)return{};var r,n,a=Vn(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(n=0;n<l.length;n++)r=l[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function Vn(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var Zn=(t,e,r,n,a,l)=>"M".concat(t,",").concat(a,"v").concat(n,"M").concat(l,",").concat(e,"h").concat(r),Gn=t=>{var{x:e=0,y:r=0,top:n=0,left:a=0,width:l=0,height:o=0,className:u}=t,m=zn(t,kn),y=Un({x:e,y:r,top:n,left:a,width:l,height:o},m);return!D(e)||!D(r)||!D(l)||!D(o)||!D(n)||!D(a)?null:S.createElement("path",ze({},Or(y),{className:ie("recharts-cross",u),d:Zn(e,r,l,o,n,a)}))};function Yn(t,e,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-a:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-a,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function Zt(t){var{cx:e,cy:r,radius:n,startAngle:a,endAngle:l}=t,o=fe(e,r,n,a),u=fe(e,r,n,l);return{points:[o,u],cx:e,cy:r,radius:n,startAngle:a,endAngle:l}}function Xn(t,e,r){if(t==="horizontal")return[{x:e.x,y:r.top},{x:e.x,y:r.top+r.height}];if(t==="vertical")return[{x:r.left,y:e.y},{x:r.left+r.width,y:e.y}];if(Ut(e)){if(t==="centric"){var{cx:n,cy:a,innerRadius:l,outerRadius:o,angle:u}=e,m=fe(n,a,l,u),y=fe(n,a,o,u);return[{x:m.x,y:m.y},{x:y.x,y:y.y}]}return Zt(e)}}function Dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dt(Object(r),!0).forEach(function(n){Hn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hn(t,e,r){return(e=$n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $n(t){var e=Qn(t,"string");return typeof e=="symbol"?e:e+""}function Qn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jn=()=>X(Tr),Cn=()=>{var t=Jn(),e=X(Pr),r=X(Br);return!t||!r?Qe(void 0,e):Qe(Nt(Nt({},t),{},{scale:r}),e)};function Ve(){return Ve=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ve.apply(null,arguments)}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function le(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(r),!0).forEach(function(n){ei(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ei(t,e,r){return(e=ti(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ti(t){var e=ri(t,"string");return typeof e=="symbol"?e:e+""}function ri(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ni(t){var{cursor:e,cursorComp:r,cursorProps:n}=t;return S.isValidElement(e)?S.cloneElement(e,n):S.createElement(r,n)}function ii(t){var e,{coordinate:r,payload:n,index:a,offset:l,tooltipAxisBandSize:o,layout:u,cursor:m,tooltipEventType:y,chartName:f}=t,i=r,d=n,b=a;if(!m||!i||f!=="ScatterChart"&&y!=="axis")return null;var g,p,v;if(f==="ScatterChart")g=i,p=Gn,v=se.cursorLine;else if(f==="BarChart")g=Yn(u,i,l,o),p=Yr,v=se.cursorRectangle;else if(u==="radial"&&Ut(i)){var{cx:c,cy:h,radius:j,startAngle:O,endAngle:x}=Zt(i);g={cx:c,cy:h,startAngle:O,endAngle:x,innerRadius:j,outerRadius:j},p=Xr,v=se.cursorLine}else g={points:Xn(u,i,l)},p=Mr,v=se.cursorLine;var P=typeof m=="object"&&"className"in m?m.className:void 0,T=le(le(le(le({stroke:"#ccc",pointerEvents:"none"},l),g),Er(m)),{},{payload:d,payloadIndex:b,className:ie("recharts-tooltip-cursor",P)});return S.createElement(qr,{zIndex:(e=t.zIndex)!==null&&e!==void 0?e:v},S.createElement(ni,{cursor:m,cursorComp:p,cursorProps:T}))}function ai(t){var e=Cn(),r=Ar(),n=Dr(),a=Nr();return e==null||r==null||n==null||a==null?null:S.createElement(ii,Ve({},t,{offset:r,layout:n,tooltipAxisBandSize:e,chartName:a}))}function qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qt(Object(r),!0).forEach(function(n){si(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function si(t,e,r){return(e=oi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oi(t){var e=li(t,"string");return typeof e=="symbol"?e:e+""}function li(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ci(t){return t.dataKey}function ui(t,e){return S.isValidElement(t)?S.cloneElement(t,e):typeof t=="function"?S.createElement(t,e):S.createElement(Tn,e)}var It=[],fi={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function di(t){var e,r,n=Ir(t,fi),{active:a,allowEscapeViewBox:l,animationDuration:o,animationEasing:u,content:m,filterNull:y,isAnimationActive:f,offset:i,payloadUniqBy:d,position:b,reverseDirection:g,useTranslate3d:p,wrapperStyle:v,cursor:c,shared:h,trigger:j,defaultIndex:O,portal:x,axisId:P}=n,T=Rr(),B=typeof O=="number"?String(O):O;S.useEffect(()=>{T(Lr({shared:h,trigger:j,axisId:P,active:a,defaultIndex:B}))},[T,h,j,P,a,B]);var A=_r(),E=kr(),N=Ur(h),{activeIndex:_,isActive:F}=(e=X(U=>Fr(U,N,j,B)))!==null&&e!==void 0?e:{},W=X(U=>Wr(U,N,j,B)),M=X(U=>Kr(U,N,j,B)),K=X(U=>zr(U,N,j,B)),I=W,z=Vr(),R=(r=a??F)!==null&&r!==void 0?r:!1,[V,H]=xn([I,R]),G=N==="axis"?M:void 0;Zr(N,j,K,G,_,R);var Y=x??z;if(Y==null||A==null||N==null)return null;var q=I??It;R||(q=It),y&&q.length&&(q=jn(q.filter(U=>U.value!=null&&(U.hide!==!0||n.includeHidden)),d,ci));var $=q.length>0,w=Mt(Mt({},n),{},{payload:q,label:G,active:R,activeIndex:_,coordinate:K,accessibilityLayer:E}),k=S.createElement(_n,{allowEscapeViewBox:l,animationDuration:o,animationEasing:u,isAnimationActive:f,active:R,coordinate:K,hasPayload:$,offset:i,position:b,reverseDirection:g,useTranslate3d:p,viewBox:A,wrapperStyle:v,lastBoundingBox:V,innerRef:H,hasPortalFromProps:!!x},ui(m,w));return S.createElement(S.Fragment,null,$t.createPortal(k,Y),R&&S.createElement(ai,{cursor:c,tooltipEventType:N,coordinate:K,payload:q,index:_}))}const Ye=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),Rt=["B","KB","MB","GB","TB","PB"];function Gt(t){if(t<=0)return"0 B";const e=Math.min(Rt.length-1,Math.floor(Math.log(t)/Math.log(1024))),r=t/1024**e;return`${r.toFixed(r>=100||e===0?0:1)} ${Rt[e]}`}const Fe=50,gi="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",mi=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function Yt(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function Xe(t){return Yt(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function yi(){const t=new Date;return Array.from({length:12},(e,r)=>{const n=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-r,1));return{value:n.toISOString().slice(0,10),label:n.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function pi(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function Lt(t){const e=Z.c(30),{usage:r,metric:n,colorNum:a,formatValue:l,height:o}=t,u=`var(--chart-${a})`,m=`infra-billing-${n}`;let y;e[0]!==r?(y=r.map(bi),e[0]=r,e[1]=y):y=e[1];const f=y;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:4,top:8,bottom:0},e[2]=i):i=e[2];let d,b;e[3]!==u?(d=s.jsx("stop",{offset:"0%",stopColor:u,stopOpacity:.25}),b=s.jsx("stop",{offset:"100%",stopColor:u,stopOpacity:0}),e[3]=u,e[4]=d,e[5]=b):(d=e[4],b=e[5]);let g;e[6]!==m||e[7]!==d||e[8]!==b?(g=s.jsx("defs",{children:s.jsxs("linearGradient",{id:m,x1:"0",y1:"0",x2:"0",y2:"1",children:[d,b]})}),e[6]=m,e[7]=d,e[8]=b,e[9]=g):g=e[9];let p;e[10]!==l||e[11]!==o?(p=o>100&&s.jsxs(s.Fragment,{children:[s.jsx(fr,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(dr,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(gr,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:l,width:68})]}),e[10]=l,e[11]=o,e[12]=p):p=e[12];let v,c;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={stroke:"var(--border)",strokeDasharray:"4 4"},c={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=v,e[14]=c):(v=e[13],c=e[14]);let h;e[15]!==l?(h=s.jsx(di,{cursor:v,contentStyle:c,formatter:T=>l(Number(T)||0)}),e[15]=l,e[16]=h):h=e[16];const j=`url(#${m})`;let O;e[17]!==u||e[18]!==n||e[19]!==j?(O=s.jsx(Hr,{type:"linear",dataKey:n,stroke:u,strokeWidth:2,fill:j,dot:!1}),e[17]=u,e[18]=n,e[19]=j,e[20]=O):O=e[20];let x;e[21]!==f||e[22]!==O||e[23]!==g||e[24]!==p||e[25]!==h?(x=s.jsxs($r,{data:f,margin:i,children:[g,p,h,O]}),e[21]=f,e[22]=O,e[23]=g,e[24]=p,e[25]=h,e[26]=x):x=e[26];let P;return e[27]!==o||e[28]!==x?(P=s.jsx(Gr,{width:"100%",height:o,children:x}),e[27]=o,e[28]=x,e[29]=P):P=e[29],P}function bi(t){return{...t,label:pi(t.date)}}function ce(t,e){return t.reduce((r,n)=>r+n[e],0)}function hi(){const t=Z.c(39),e=de(),{sites:r,isLoading:n}=Jt(),[a,l]=S.useState(null),o=yi(),[u,m]=S.useState(o[0].value);let y;t[0]!==a||t[1]!==r?(y=a??r.slice(0,Fe),t[0]=a,t[1]=r,t[2]=y):y=t[2];const f=y,i=!a&&r.length>Fe,{data:d,isLoading:b}=Ct(f,u),g=_t();if(n){let w;return t[3]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ae,{className:"h-64 w-full"}),t[3]=w):w=t[3],w}if(r.length===0){let w;t[4]!==e?(w=e("settings.infraBilling.noSites"),t[4]=e,t[5]=w):w=t[5];let k;return t[6]!==w?(k=s.jsx(L,{className:"p-6 text-sm text-muted-foreground",children:w}),t[6]=w,t[7]=k):k=t[7],k}const p=d?.usage??[],v=d?.pageviewsAvailable??!1,c=!!d&&!d.usageUnavailable,h=(w,k)=>c?k(ce(p,w)):"—",j=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:v&&c?Ye.format(ce(p,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:h("requests",wi)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:h("dataTransferBytes",Gt)}],O=xi;let x;t[8]!==d?.teams?(x=d?.teams??[],t[8]=d?.teams,t[9]=x):x=t[9];const P=x;let T;t[10]!==d?.siteSlugsWithoutTeam?(T=d?.siteSlugsWithoutTeam??[],t[10]=d?.siteSlugsWithoutTeam,t[11]=T):T=t[11];const B=T,A=P.length===1?P[0]:void 0,E=A?.billing??null,N=P.length+(B.length>0?1:0)>1,_=ce(p,"pageviews"),F=_>0?ce(p,"requests")/_:0,W=v&&c&&_>0?F.toFixed(F<10?1:0):"—";let M;t[12]!==d?.billingUnavailable||t[13]!==A||t[14]!==e||t[15]!==P.length?(M=d?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):P.length>1?e("settings.infraBilling.multipleTeams",{count:String(P.length)}):A?Xt(A,e):e("settings.infraBilling.noTeam"),t[12]=d?.billingUnavailable,t[13]=A,t[14]=e,t[15]=P.length,t[16]=M):M=t[16];const K=M;let I;t[17]!==r?(I=r.map(ji),t[17]=r,t[18]=I):I=t[18];let z;t[19]!==e?(z=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=z):z=t[20];let R;t[21]!==f||t[22]!==I||t[23]!==z?(R=s.jsx(rr,{className:"w-auto min-w-56 max-w-full",options:I,defaultValue:f,maxCount:2,placeholder:z,onValueChange:l}),t[21]=f,t[22]=I,t[23]=z,t[24]=R):R=t[24];let V;t[25]!==e?(V=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=V):V=t[26];let H;t[27]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(sr,{}),t[27]=H):H=t[27];let G;t[28]!==V?(G=s.jsx(or,{className:"w-48","aria-label":V,children:H}),t[28]=V,t[29]=G):G=t[29];let Y;t[30]!==f.length||t[31]!==e?(Y=f.length===0&&s.jsx(L,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=f.length,t[31]=e,t[32]=Y):Y=t[32];let q;t[33]!==e||t[34]!==i?(q=i&&s.jsx(L,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(Fe)})}),t[33]=e,t[34]=i,t[35]=q):q=t[35];let $;return t[36]!==d?.usageUnavailable||t[37]!==e?($=d?.usageUnavailable&&s.jsx(L,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=d?.usageUnavailable,t[37]=e,t[38]=$):$=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:[R,s.jsxs(nr,{value:u,onValueChange:m,children:[G,s.jsx(ir,{children:o.map(vi)})]})]}),Y,q,$,f.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(ge,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(L,{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(tr,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),A&&E?.canManageSubscription&&s.jsx(Ze,{variant:"outline",size:"sm",disabled:g.isPending,onClick:()=>g.mutate(A.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[E?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")}),b?s.jsx(ae,{className:"h-5 w-16"}):s.jsx(C,{variant:E.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${E.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:E.nextBillingDate?Xe(E.nextBillingDate):"—"})]})]}):!b&&s.jsx("p",{className:"text-xs text-muted-foreground",children:K}),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:W})]})]})]}),j.map(w=>s.jsxs(L,{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:w.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.find(k=>k.value===u)?.label})]}),b?s.jsx(ae,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:w.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(Lt,{usage:p,metric:w.key,colorNum:w.colorNum,formatValue:O(w.key),height:64})})]},w.key))]})}),s.jsx(ge,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:j.map(w=>s.jsxs(L,{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:w.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:w.description})]}),s.jsx(Lt,{usage:p,metric:w.key,colorNum:w.colorNum,formatValue:O(w.key),height:220})]},w.key))})}),s.jsx(ge,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:d?d.billingUnavailable?s.jsx(L,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[P.map(w=>s.jsx(Oi,{team:w,showSites:N},w.siteSlugs.join(","))),B.length>0&&s.jsxs(L,{className:"flex flex-col gap-1 p-4",children:[N&&s.jsx("span",{className:"text-sm font-medium",children:B.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(L,{size:"flush",children:s.jsx(ae,{className:"m-4 h-24"})})})})]})]})}function vi(t){return s.jsx(ar,{value:t.value,children:t.label},t.value)}function ji(t){return{label:t,value:t}}function xi(t){return t==="dataTransferBytes"?Gt:Si}function Si(t){return Ye.format(t)}function wi(t){return Ye.format(t)}function Xt(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Oi(t){const e=Z.c(13),{team:r,showSites:n}=t,a=de(),l=_t(),o=r.billing;let u;e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==a||e[4]!==r.siteSlugs?(u=n&&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:r.siteSlugs.join(", ")}),o&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(C,{variant:o.planType==="free"?"secondary":"success",children:a(`settings.infraBilling.plan.${o.planType}`)}),o.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:a("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:Xe(o.nextBillingDate)})]}),o.canManageSubscription&&s.jsx(Ze,{variant:"outline",size:"sm",disabled:l.isPending,onClick:()=>l.mutate(r.siteSlugs),children:a("settings.infraBilling.manageButton")})]})]}),e[0]=o,e[1]=l,e[2]=n,e[3]=a,e[4]=r.siteSlugs,e[5]=u):u=e[5];let m;e[6]!==o||e[7]!==a||e[8]!==r?(m=o?o.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:a("settings.infraBilling.noInvoices")}):s.jsx(Pi,{invoices:o.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:Xt(r,a)}),e[6]=o,e[7]=a,e[8]=r,e[9]=m):m=e[9];let y;return e[10]!==u||e[11]!==m?(y=s.jsxs(L,{size:"flush",className:"gap-0 overflow-x-auto",children:[u,m]}),e[10]=u,e[11]=m,e[12]=y):y=e[12],y}function Pi(t){const e=Z.c(40),{invoices:r}=t,n=de();let a;e[0]!==r?(a=r.some(Bi),e[0]=r,e[1]=a):a=e[1];const l=a;let o;e[2]!==n?(o=n("settings.infraBilling.invoiceReference"),e[2]=n,e[3]=o):o=e[3];let u;e[4]!==o?(u=s.jsx(ee,{children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==n?(m=n("settings.infraBilling.invoiceDue"),e[6]=n,e[7]=m):m=e[7];let y;e[8]!==m?(y=s.jsx(ee,{children:m}),e[8]=m,e[9]=y):y=e[9];let f;e[10]!==n?(f=n("settings.infraBilling.invoiceAmount"),e[10]=n,e[11]=f):f=e[11];let i;e[12]!==f?(i=s.jsx(ee,{children:f}),e[12]=f,e[13]=i):i=e[13];let d;e[14]!==n?(d=n("settings.infraBilling.invoiceStatus"),e[14]=n,e[15]=d):d=e[15];let b;e[16]!==d?(b=s.jsx(ee,{children:d}),e[16]=d,e[17]=b):b=e[17];let g;e[18]!==n?(g=n("settings.infraBilling.invoiceDocuments"),e[18]=n,e[19]=g):g=e[19];let p;e[20]!==g?(p=s.jsx(ee,{children:g}),e[20]=g,e[21]=p):p=e[21];let v;e[22]!==p||e[23]!==u||e[24]!==y||e[25]!==i||e[26]!==b?(v=s.jsx(lr,{children:s.jsxs($e,{children:[u,y,i,b,p]})}),e[22]=p,e[23]=u,e[24]=y,e[25]=i,e[26]=b,e[27]=v):v=e[27];let c;if(e[28]!==r||e[29]!==n||e[30]!==l){let O;e[32]!==n||e[33]!==l?(O=x=>s.jsxs($e,{children:[s.jsx(te,{children:x.referenceMonth?Yt(x.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(te,{children:x.dueDate?Xe(x.dueDate):"—"}),s.jsx(te,{className:"tabular-nums",children:mi.format(x.value)}),s.jsx(te,{children:s.jsx(Ti,{status:x.status})}),s.jsxs(te,{className:"flex gap-2",children:[x.nfUrl&&s.jsx(We,{href:x.nfUrl,label:n("settings.infraBilling.invoiceNf")}),x.bankSlipUrl&&s.jsx(We,{href:x.bankSlipUrl,label:n("settings.infraBilling.invoiceBankSlip")}),!x.bankSlipUrl&&!l&&x.nfUrl&&s.jsx(We,{href:gi,label:n("settings.infraBilling.invoiceBankTransfer")}),!x.nfUrl&&!x.bankSlipUrl&&"—"]})]},x.id),e[32]=n,e[33]=l,e[34]=O):O=e[34],c=r.map(O),e[28]=r,e[29]=n,e[30]=l,e[31]=c}else c=e[31];let h;e[35]!==c?(h=s.jsx(cr,{children:c}),e[35]=c,e[36]=h):h=e[36];let j;return e[37]!==v||e[38]!==h?(j=s.jsxs(ur,{children:[v,h]}),e[37]=v,e[38]=h,e[39]=j):j=e[39],j}function Bi(t){return!!t.bankSlipUrl}function We(t){const e=Z.c(4),{href:r,label:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(er,{size:14}),e[0]=a):a=e[0];let l;return e[1]!==r||e[2]!==n?(l=s.jsx(Ze,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",children:[a,n]})}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function Ti(t){const e=Z.c(14),{status:r}=t,n=de(),a=r.toLowerCase();if(a==="paid"){let o;e[0]!==n?(o=n("settings.infraBilling.statusPaid"),e[0]=n,e[1]=o):o=e[1];let u;return e[2]!==o?(u=s.jsx(C,{variant:"success",children:o}),e[2]=o,e[3]=u):u=e[3],u}if(a==="overdue"){let o;e[4]!==n?(o=n("settings.infraBilling.statusOverdue"),e[4]=n,e[5]=o):o=e[5];let u;return e[6]!==o?(u=s.jsx(C,{variant:"destructive",children:o}),e[6]=o,e[7]=u):u=e[7],u}if(a==="registered"){let o;e[8]!==n?(o=n("settings.infraBilling.statusPending"),e[8]=n,e[9]=o):o=e[9];let u;return e[10]!==o?(u=s.jsx(C,{variant:"warning",children:o}),e[10]=o,e[11]=u):u=e[11],u}let l;return e[12]!==r?(l=s.jsx(C,{variant:"secondary",children:r}),e[12]=r,e[13]=l):l=e[13],l}function Ai(){const t=Z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Qt,{group:"billing",children:s.jsx(hi,{})}),t[0]=e):e=t[0],e}function Ji(){const t=Z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Qr,{capability:"members:manage",area:"billing",children:s.jsx(Ai,{})}),t[0]=e):e=t[0],e}export{Ji as default};
|
|
1
|
+
import{g5 as He,dv as Ht,r as S,fu as ie,bQ as $t,c as Z,j as s,hF as Qt,b as de,hH as Jt,hI as Ct,hJ as _t,gn as L,fT as ge,B as Ze,bB as ae,a7 as er}from"./index-B8DCfcWN.js";import{i as tr}from"./CreditCard01-Qaes9woG.js";import{B as C}from"./badge-BRoRJHXx.js";import{M as rr}from"./multi-select-nylLYa08.js";import{S as nr,d as ir,c as ar,a as sr,b as or}from"./select-CUIweWk_.js";import{T as ee,a as lr,b as $e,c as te,d as cr,e as ur}from"./table-BSN49b35.js";import{C as fr,X as dr,Y as gr}from"./CartesianChart-BoNLutk8.js";import{bN as mr,bO as kt,bP as yr,bQ as pr,bR as br,bS as hr,bT as vr,bU as jr,bc as xr,aB as ue,bV as Sr,N as D,bW as wr,ai as Or,a0 as fe,bX as Ut,F as X,bY as Pr,bZ as Br,bh as Qe,b_ as Tr,aK as Ar,bs as Dr,bE as Nr,a1 as Er,Z as qr,D as se,a2 as Mr,B as Ir,a5 as Rr,b$ as Lr,ax as _r,c0 as kr,c1 as Ur,c2 as Fr,c3 as Wr,c4 as Kr,c5 as zr,c6 as Vr,c7 as Zr,c8 as Gr}from"./CategoricalChart-CAZArx5f.js";import{R as Yr,S as Xr}from"./Sector-DaS_KQmA.js";import{A as Hr,a as $r}from"./AreaChart-DGlIn0Ko.js";import{R as Qr}from"./require-capability-BU8bps4o.js";import"./checkbox-9OByQcgp.js";import"./Minus-CXzY2fjB.js";import"./ChevronUp-fCjAl_fm.js";import"./command-DM5EhprN.js";import"./index-D4NFLqDj.js";import"./SearchMd-D9nOIU2J.js";import"./popover-CeFWN04u.js";import"./index-BdQq_4o_.js";import"./index-DCiIT3FM.js";import"./index-CExYs_fo.js";import"./access-gate-d8HEkPLL.js";import"./capability-load-error-u125FpR3.js";var me={},ye={},Je;function Jr(){return Je||(Je=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r,n){const a=new Map;for(let l=0;l<r.length;l++){const o=r[l],u=n(o,l,r);a.has(u)||a.set(u,o)}return Array.from(a.values())}t.uniqBy=e})(ye)),ye}var pe={},Ce;function Cr(){return Ce||(Ce=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r,n){return function(...a){return r.apply(this,a.slice(0,n))}}t.ary=e})(pe)),pe}var be={},et;function Ft(){return et||(et=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return r}t.identity=e})(be)),be}var he={},ve={},tt;function en(){return tt||(tt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return typeof r=="object"&&r!==null}t.isObjectLike=e})(ve)),ve}var rt;function tn(){return rt||(rt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=mr(),r=en();function n(a){return r.isObjectLike(a)&&e.isArrayLike(a)}t.isArrayLikeObject=n})(he)),he}var je={},xe={},nt;function rn(){return nt||(nt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=kt();function r(n){return function(a){return e.get(a,n)}}t.property=r})(xe)),xe}var Se={},we={},Oe={},Pe={},it;function Wt(){return it||(it=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return r==null||typeof r!="object"&&typeof r!="function"}t.isPrimitive=e})(Pe)),Pe}var at;function nn(){return at||(at=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=yr(),r=Wt(),n=pr();function a(f,i,d){return typeof d!="function"?a(f,i,()=>{}):l(f,i,function b(g,p,v,c,h,j){const O=d(g,p,v,c,h,j);return O!==void 0?!!O:l(g,p,b,j)},new Map)}function l(f,i,d,b){if(i===f)return!0;switch(typeof i){case"object":return o(f,i,d,b);case"function":return Object.keys(i).length>0?l(f,{...i},d,b):n.isEqualsSameValueZero(f,i);default:return e.isObject(f)?typeof i=="string"?i==="":!0:n.isEqualsSameValueZero(f,i)}}function o(f,i,d,b){if(i==null)return!0;if(Array.isArray(i))return m(f,i,d,b);if(i instanceof Map)return u(f,i,d,b);if(i instanceof Set)return y(f,i,d,b);const g=Object.keys(i);if(f==null||r.isPrimitive(f))return g.length===0;if(g.length===0)return!0;if(b?.has(i))return b.get(i)===f;b?.set(i,f);try{for(let p=0;p<g.length;p++){const v=g[p];if(!r.isPrimitive(f)&&!(v in f)||i[v]===void 0&&f[v]!==void 0||i[v]===null&&f[v]!==null||!d(f[v],i[v],v,f,i,b))return!1}return!0}finally{b?.delete(i)}}function u(f,i,d,b){if(i.size===0)return!0;if(!(f instanceof Map))return!1;for(const[g,p]of i.entries()){const v=f.get(g);if(d(v,p,g,f,i,b)===!1)return!1}return!0}function m(f,i,d,b){if(i.length===0)return!0;if(!Array.isArray(f))return!1;const g=new Set;for(let p=0;p<i.length;p++){const v=i[p];let c=!1;for(let h=0;h<f.length;h++){if(g.has(h))continue;const j=f[h];let O=!1;if(d(j,v,p,f,i,b)&&(O=!0),O){g.add(h),c=!0;break}}if(!c)return!1}return!0}function y(f,i,d,b){return i.size===0?!0:f instanceof Set?m([...f],[...i],d,b):!1}t.isMatchWith=a,t.isSetMatch=y})(Oe)),Oe}var st;function Kt(){return st||(st=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=nn();function r(n,a){return e.isMatchWith(n,a,()=>{})}t.isMatch=r})(we)),we}var Be={},Te={},Ae={},ot;function an(){return ot||(ot=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}t.getSymbols=e})(Ae)),Ae}var De={},lt;function Ge(){return lt||(lt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}t.getTag=e})(De)),De}var Ne={},ct;function zt(){return ct||(ct=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e="[object RegExp]",r="[object String]",n="[object Number]",a="[object Boolean]",l="[object Arguments]",o="[object Symbol]",u="[object Date]",m="[object Map]",y="[object Set]",f="[object Array]",i="[object Function]",d="[object ArrayBuffer]",b="[object Object]",g="[object Error]",p="[object DataView]",v="[object Uint8Array]",c="[object Uint8ClampedArray]",h="[object Uint16Array]",j="[object Uint32Array]",O="[object BigUint64Array]",x="[object Int8Array]",P="[object Int16Array]",T="[object Int32Array]",B="[object BigInt64Array]",A="[object Float32Array]",E="[object Float64Array]";t.argumentsTag=l,t.arrayBufferTag=d,t.arrayTag=f,t.bigInt64ArrayTag=B,t.bigUint64ArrayTag=O,t.booleanTag=a,t.dataViewTag=p,t.dateTag=u,t.errorTag=g,t.float32ArrayTag=A,t.float64ArrayTag=E,t.functionTag=i,t.int16ArrayTag=P,t.int32ArrayTag=T,t.int8ArrayTag=x,t.mapTag=m,t.numberTag=n,t.objectTag=b,t.regexpTag=e,t.setTag=y,t.stringTag=r,t.symbolTag=o,t.uint16ArrayTag=h,t.uint32ArrayTag=j,t.uint8ArrayTag=v,t.uint8ClampedArrayTag=c})(Ne)),Ne}var Ee={},qe={},ut;function sn(){return ut||(ut=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof He=="object"&&He||(function(){return this})()||Function("return this")();t.globalThis=e})(qe)),qe}var ft;function on(){return ft||(ft=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=sn();function r(n){return typeof e.globalThis.Buffer<"u"&&e.globalThis.Buffer.isBuffer(n)}t.isBuffer=r})(Ee)),Ee}var Me={},dt;function ln(){return dt||(dt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}t.isTypedArray=e})(Me)),Me}var gt;function Vt(){return gt||(gt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=an(),r=Ge(),n=zt(),a=on(),l=Wt(),o=ln();function u(i,d){return m(i,void 0,i,new Map,d)}function m(i,d,b,g=new Map,p=void 0){const v=p?.(i,d,b,g);if(v!==void 0)return v;if(l.isPrimitive(i))return i;if(g.has(i))return g.get(i);if(Array.isArray(i)){const c=new Array(i.length);g.set(i,c);for(let h=0;h<i.length;h++)c[h]=m(i[h],h,b,g,p);return Object.hasOwn(i,"index")&&(c.index=i.index),Object.hasOwn(i,"input")&&(c.input=i.input),c}if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp){const c=new RegExp(i.source,i.flags);return c.lastIndex=i.lastIndex,c}if(i instanceof Map){const c=new Map;g.set(i,c);for(const[h,j]of i)c.set(h,m(j,h,b,g,p));return c}if(i instanceof Set){const c=new Set;g.set(i,c);for(const h of i)c.add(m(h,void 0,b,g,p));return c}if(a.isBuffer(i))return i.subarray();if(o.isTypedArray(i)){const c=new(Object.getPrototypeOf(i)).constructor(i.length);g.set(i,c);for(let h=0;h<i.length;h++)c[h]=m(i[h],h,b,g,p);return c}if(i instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&i instanceof SharedArrayBuffer)return i.slice(0);if(i instanceof DataView){const c=new DataView(i.buffer.slice(0),i.byteOffset,i.byteLength);return g.set(i,c),y(c,i,b,g,p),c}if(typeof File<"u"&&i instanceof File){const c=new File([i],i.name,{type:i.type});return g.set(i,c),y(c,i,b,g,p),c}if(typeof Blob<"u"&&i instanceof Blob){const c=new Blob([i],{type:i.type});return g.set(i,c),y(c,i,b,g,p),c}if(i instanceof Error){const c=structuredClone(i);return g.set(i,c),c.message=i.message,c.name=i.name,c.stack=i.stack,c.cause=i.cause,c.constructor=i.constructor,y(c,i,b,g,p),c}if(i instanceof Boolean){const c=new Boolean(i.valueOf());return g.set(i,c),y(c,i,b,g,p),c}if(i instanceof Number){const c=new Number(i.valueOf());return g.set(i,c),y(c,i,b,g,p),c}if(i instanceof String){const c=new String(i.valueOf());return g.set(i,c),y(c,i,b,g,p),c}if(typeof i=="object"&&f(i)){const c=Object.create(Object.getPrototypeOf(i));return g.set(i,c),y(c,i,b,g,p),c}return i}function y(i,d,b=i,g,p){const v=[...Object.keys(d),...e.getSymbols(d)];for(let c=0;c<v.length;c++){const h=v[c],j=Object.getOwnPropertyDescriptor(i,h);(j==null||j.writable)&&(i[h]=m(d[h],h,b,g,p))}}function f(i){switch(r.getTag(i)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}t.cloneDeepWith=u,t.cloneDeepWithImpl=m,t.copyProperties=y})(Te)),Te}var mt;function cn(){return mt||(mt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Vt();function r(n){return e.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}t.cloneDeep=r})(Be)),Be}var yt;function un(){return yt||(yt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Kt(),r=cn();function n(a){return a=r.cloneDeep(a),l=>e.isMatch(l,a)}t.matches=n})(Se)),Se}var Ie={},Re={},Le={},pt;function fn(){return pt||(pt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Vt(),r=Ge(),n=zt();function a(l,o){return e.cloneDeepWith(l,(u,m,y,f)=>{const i=o?.(u,m,y,f);if(i!==void 0)return i;if(typeof l=="object"){if(r.getTag(l)===n.objectTag&&typeof l.constructor!="function"){const d={};return f.set(l,d),e.copyProperties(d,l,y,f),d}switch(Object.prototype.toString.call(l)){case n.numberTag:case n.stringTag:case n.booleanTag:{const d=new l.constructor(l?.valueOf());return e.copyProperties(d,l),d}case n.argumentsTag:{const d={};return e.copyProperties(d,l),d.length=l.length,d[Symbol.iterator]=l[Symbol.iterator],d}default:return}}})}t.cloneDeepWith=a})(Le)),Le}var bt;function dn(){return bt||(bt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=fn();function r(n){return e.cloneDeepWith(n)}t.cloneDeep=r})(Re)),Re}var _e={},ke={},ht;function gn(){return ht||(ht=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Ge();function r(n){return n!==null&&typeof n=="object"&&e.getTag(n)==="[object Arguments]"}t.isArguments=r})(ke)),ke}var vt;function mn(){return vt||(vt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=br(),r=vr(),n=gn(),a=hr();function l(o,u){let m;if(Array.isArray(u)?m=u:typeof u=="string"&&e.isDeepKey(u)&&o?.[u]==null?m=a.toPath(u):m=[u],m.length===0)return!1;let y=o;for(let f=0;f<m.length;f++){const i=m[f];if((y==null||!Object.hasOwn(y,i))&&!((Array.isArray(y)||n.isArguments(y))&&r.isIndex(i)&&i<y.length))return!1;y=y[i]}return!0}t.has=l})(_e)),_e}var jt;function yn(){return jt||(jt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Kt(),r=jr(),n=dn(),a=kt(),l=mn();function o(u,m){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=r.toKey(u);break}}return m=n.cloneDeep(m),function(y){const f=a.get(y,u);return f===void 0?l.has(y,u):m===void 0?f===void 0:e.isMatch(f,m)}}t.matchesProperty=o})(Ie)),Ie}var xt;function pn(){return xt||(xt=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Ft(),r=rn(),n=un(),a=yn();function l(o){if(o==null)return e.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?a.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}t.iteratee=l})(je)),je}var St;function bn(){return St||(St=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Jr(),r=Cr(),n=Ft(),a=tn(),l=pn();function o(u,m=n.identity){return a.isArrayLikeObject(u)?e.uniqBy(Array.from(u),r.ary(l.iteratee(m),1)):[]}t.uniqBy=o})(me)),me}var Ue,wt;function hn(){return wt||(wt=1,Ue=bn().uniqBy),Ue}var vn=hn();const Ot=Ht(vn);function jn(t,e,r){return e===!0?Ot(t,r):typeof e=="function"?Ot(t,e):t}var oe=1;function xn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[e,r]=S.useState({height:0,left:0,top:0,width:0}),n=S.useCallback(a=>{if(a!=null){var l=a.getBoundingClientRect(),o={height:l.height,left:l.left,top:l.top,width:l.width};(Math.abs(o.height-e.height)>oe||Math.abs(o.left-e.left)>oe||Math.abs(o.top-e.top)>oe||Math.abs(o.width-e.width)>oe)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[e.width,e.height,e.top,e.left,...t]);return[e,n]}function Ke(){return Ke=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ke.apply(null,arguments)}function Pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function re(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pt(Object(r),!0).forEach(function(n){Sn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Sn(t,e,r){return(e=wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wn(t){var e=On(t,"string");return typeof e=="symbol"?e:e+""}function On(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pn(t){return Array.isArray(t)&&ue(t[0])&&ue(t[1])?t.join(" ~ "):t}var Q={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function Bn(t,e){return e==null?t:Sr(t,e)}var Tn=t=>{var{separator:e=Q.separator,contentStyle:r,itemStyle:n,labelStyle:a=Q.labelStyle,payload:l,formatter:o,itemSorter:u,wrapperClassName:m,labelClassName:y,label:f,labelFormatter:i,accessibilityLayer:d=Q.accessibilityLayer}=t,b=()=>{if(l&&l.length){var x={padding:0,margin:0},P=Bn(l,u),T=P.map((B,A)=>{if(!B||B.type==="none")return null;var E=B.formatter||o||Pn,{value:N,name:_}=B,F=N,W=_;if(E){var M=E(N,_,B,A,l);if(Array.isArray(M))[F,W]=M;else if(M!=null)F=M;else return null}var K=re(re({},Q.itemStyle),{},{color:B.color||Q.itemStyle.color},n);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(A),style:K},ue(W)?S.createElement("span",{className:"recharts-tooltip-item-name"},W):null,ue(W)?S.createElement("span",{className:"recharts-tooltip-item-separator"},e):null,S.createElement("span",{className:"recharts-tooltip-item-value"},F),S.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:x},T)}return null},g=re(re({},Q.contentStyle),r),p=re({margin:0},a),v=!xr(f),c=v?f:"",h=ie("recharts-default-tooltip",m),j=ie("recharts-tooltip-label",y);v&&i&&l!==void 0&&l!==null&&(c=i(f,l));var O=d?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",Ke({className:h,style:g},O),S.createElement("p",{className:j,style:p},S.isValidElement(c)?c:"".concat(c)),b())},ne="recharts-tooltip-wrapper",An={visibility:"hidden"};function Dn(t){var{coordinate:e,translateX:r,translateY:n}=t;return ie(ne,{["".concat(ne,"-right")]:D(r)&&e&&D(e.x)&&r>=e.x,["".concat(ne,"-left")]:D(r)&&e&&D(e.x)&&r<e.x,["".concat(ne,"-bottom")]:D(n)&&e&&D(e.y)&&n>=e.y,["".concat(ne,"-top")]:D(n)&&e&&D(e.y)&&n<e.y})}function Bt(t){var{allowEscapeViewBox:e,coordinate:r,key:n,offset:a,position:l,reverseDirection:o,tooltipDimension:u,viewBox:m,viewBoxDimension:y}=t;if(l&&D(l[n]))return l[n];var f=r[n]-u-(a>0?a:0),i=r[n]+a;if(e[n])return o[n]?f:i;var d=m[n];if(d==null)return 0;if(o[n]){var b=f,g=d;return b<g?Math.max(i,d):Math.max(f,d)}if(y==null)return 0;var p=i+u,v=d+y;return p>v?Math.max(f,d):Math.max(i,d)}function Nn(t){var{translateX:e,translateY:r,useTranslate3d:n}=t;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function En(t){var{allowEscapeViewBox:e,coordinate:r,offsetTop:n,offsetLeft:a,position:l,reverseDirection:o,tooltipBox:u,useTranslate3d:m,viewBox:y}=t,f,i,d;return u.height>0&&u.width>0&&r?(i=Bt({allowEscapeViewBox:e,coordinate:r,key:"x",offset:a,position:l,reverseDirection:o,tooltipDimension:u.width,viewBox:y,viewBoxDimension:y.width}),d=Bt({allowEscapeViewBox:e,coordinate:r,key:"y",offset:n,position:l,reverseDirection:o,tooltipDimension:u.height,viewBox:y,viewBoxDimension:y.height}),f=Nn({translateX:i,translateY:d,useTranslate3d:m})):f=An,{cssProperties:f,cssClasses:Dn({translateX:i,translateY:d,coordinate:r})}}function Tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(r),!0).forEach(function(n){qn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qn(t,e,r){return(e=Mn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mn(t){var e=In(t,"string");return typeof e=="symbol"?e:e+""}function In(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rn(t){if(!(t.prefersReducedMotion&&t.isAnimationActive==="auto")&&t.isAnimationActive&&t.active)return"transform ".concat(t.animationDuration,"ms ").concat(t.animationEasing)}function Ln(t){var e,r,n,a,l,o,u=wr(),[m,y]=S.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));S.useEffect(()=>{var g=p=>{if(p.key==="Escape"){var v,c,h,j;y({dismissed:!0,dismissedAtCoordinate:{x:(v=(c=t.coordinate)===null||c===void 0?void 0:c.x)!==null&&v!==void 0?v:0,y:(h=(j=t.coordinate)===null||j===void 0?void 0:j.y)!==null&&h!==void 0?h:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(e=t.coordinate)===null||e===void 0?void 0:e.x,(r=t.coordinate)===null||r===void 0?void 0:r.y]),m.dismissed&&(((n=(a=t.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0)!==m.dismissedAtCoordinate.x||((l=(o=t.coordinate)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0)!==m.dismissedAtCoordinate.y)&&y(J(J({},m),{},{dismissed:!1}));var{cssClasses:f,cssProperties:i}=En({allowEscapeViewBox:t.allowEscapeViewBox,coordinate:t.coordinate,offsetLeft:typeof t.offset=="number"?t.offset:t.offset.x,offsetTop:typeof t.offset=="number"?t.offset:t.offset.y,position:t.position,reverseDirection:t.reverseDirection,tooltipBox:{height:t.lastBoundingBox.height,width:t.lastBoundingBox.width},useTranslate3d:t.useTranslate3d,viewBox:t.viewBox}),d=t.hasPortalFromProps?{}:J(J({transition:Rn({prefersReducedMotion:u,isAnimationActive:t.isAnimationActive,active:t.active,animationDuration:t.animationDuration,animationEasing:t.animationEasing})},i),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),b=J(J({},d),{},{visibility:!m.dismissed&&t.active&&t.hasPayload?"visible":"hidden"},t.wrapperStyle);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:f,style:b,ref:t.innerRef},t.children)}var _n=S.memo(Ln),kn=["x","y","top","left","width","height","className"];function ze(){return ze=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ze.apply(null,arguments)}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Un(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(n){Fn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fn(t,e,r){return(e=Wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wn(t){var e=Kn(t,"string");return typeof e=="symbol"?e:e+""}function Kn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zn(t,e){if(t==null)return{};var r,n,a=Vn(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(n=0;n<l.length;n++)r=l[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function Vn(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var Zn=(t,e,r,n,a,l)=>"M".concat(t,",").concat(a,"v").concat(n,"M").concat(l,",").concat(e,"h").concat(r),Gn=t=>{var{x:e=0,y:r=0,top:n=0,left:a=0,width:l=0,height:o=0,className:u}=t,m=zn(t,kn),y=Un({x:e,y:r,top:n,left:a,width:l,height:o},m);return!D(e)||!D(r)||!D(l)||!D(o)||!D(n)||!D(a)?null:S.createElement("path",ze({},Or(y),{className:ie("recharts-cross",u),d:Zn(e,r,l,o,n,a)}))};function Yn(t,e,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-a:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-a,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function Zt(t){var{cx:e,cy:r,radius:n,startAngle:a,endAngle:l}=t,o=fe(e,r,n,a),u=fe(e,r,n,l);return{points:[o,u],cx:e,cy:r,radius:n,startAngle:a,endAngle:l}}function Xn(t,e,r){if(t==="horizontal")return[{x:e.x,y:r.top},{x:e.x,y:r.top+r.height}];if(t==="vertical")return[{x:r.left,y:e.y},{x:r.left+r.width,y:e.y}];if(Ut(e)){if(t==="centric"){var{cx:n,cy:a,innerRadius:l,outerRadius:o,angle:u}=e,m=fe(n,a,l,u),y=fe(n,a,o,u);return[{x:m.x,y:m.y},{x:y.x,y:y.y}]}return Zt(e)}}function Dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dt(Object(r),!0).forEach(function(n){Hn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hn(t,e,r){return(e=$n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $n(t){var e=Qn(t,"string");return typeof e=="symbol"?e:e+""}function Qn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jn=()=>X(Tr),Cn=()=>{var t=Jn(),e=X(Pr),r=X(Br);return!t||!r?Qe(void 0,e):Qe(Nt(Nt({},t),{},{scale:r}),e)};function Ve(){return Ve=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ve.apply(null,arguments)}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function le(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(r),!0).forEach(function(n){ei(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ei(t,e,r){return(e=ti(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ti(t){var e=ri(t,"string");return typeof e=="symbol"?e:e+""}function ri(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ni(t){var{cursor:e,cursorComp:r,cursorProps:n}=t;return S.isValidElement(e)?S.cloneElement(e,n):S.createElement(r,n)}function ii(t){var e,{coordinate:r,payload:n,index:a,offset:l,tooltipAxisBandSize:o,layout:u,cursor:m,tooltipEventType:y,chartName:f}=t,i=r,d=n,b=a;if(!m||!i||f!=="ScatterChart"&&y!=="axis")return null;var g,p,v;if(f==="ScatterChart")g=i,p=Gn,v=se.cursorLine;else if(f==="BarChart")g=Yn(u,i,l,o),p=Yr,v=se.cursorRectangle;else if(u==="radial"&&Ut(i)){var{cx:c,cy:h,radius:j,startAngle:O,endAngle:x}=Zt(i);g={cx:c,cy:h,startAngle:O,endAngle:x,innerRadius:j,outerRadius:j},p=Xr,v=se.cursorLine}else g={points:Xn(u,i,l)},p=Mr,v=se.cursorLine;var P=typeof m=="object"&&"className"in m?m.className:void 0,T=le(le(le(le({stroke:"#ccc",pointerEvents:"none"},l),g),Er(m)),{},{payload:d,payloadIndex:b,className:ie("recharts-tooltip-cursor",P)});return S.createElement(qr,{zIndex:(e=t.zIndex)!==null&&e!==void 0?e:v},S.createElement(ni,{cursor:m,cursorComp:p,cursorProps:T}))}function ai(t){var e=Cn(),r=Ar(),n=Dr(),a=Nr();return e==null||r==null||n==null||a==null?null:S.createElement(ii,Ve({},t,{offset:r,layout:n,tooltipAxisBandSize:e,chartName:a}))}function qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qt(Object(r),!0).forEach(function(n){si(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function si(t,e,r){return(e=oi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oi(t){var e=li(t,"string");return typeof e=="symbol"?e:e+""}function li(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ci(t){return t.dataKey}function ui(t,e){return S.isValidElement(t)?S.cloneElement(t,e):typeof t=="function"?S.createElement(t,e):S.createElement(Tn,e)}var It=[],fi={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function di(t){var e,r,n=Ir(t,fi),{active:a,allowEscapeViewBox:l,animationDuration:o,animationEasing:u,content:m,filterNull:y,isAnimationActive:f,offset:i,payloadUniqBy:d,position:b,reverseDirection:g,useTranslate3d:p,wrapperStyle:v,cursor:c,shared:h,trigger:j,defaultIndex:O,portal:x,axisId:P}=n,T=Rr(),B=typeof O=="number"?String(O):O;S.useEffect(()=>{T(Lr({shared:h,trigger:j,axisId:P,active:a,defaultIndex:B}))},[T,h,j,P,a,B]);var A=_r(),E=kr(),N=Ur(h),{activeIndex:_,isActive:F}=(e=X(U=>Fr(U,N,j,B)))!==null&&e!==void 0?e:{},W=X(U=>Wr(U,N,j,B)),M=X(U=>Kr(U,N,j,B)),K=X(U=>zr(U,N,j,B)),I=W,z=Vr(),R=(r=a??F)!==null&&r!==void 0?r:!1,[V,H]=xn([I,R]),G=N==="axis"?M:void 0;Zr(N,j,K,G,_,R);var Y=x??z;if(Y==null||A==null||N==null)return null;var q=I??It;R||(q=It),y&&q.length&&(q=jn(q.filter(U=>U.value!=null&&(U.hide!==!0||n.includeHidden)),d,ci));var $=q.length>0,w=Mt(Mt({},n),{},{payload:q,label:G,active:R,activeIndex:_,coordinate:K,accessibilityLayer:E}),k=S.createElement(_n,{allowEscapeViewBox:l,animationDuration:o,animationEasing:u,isAnimationActive:f,active:R,coordinate:K,hasPayload:$,offset:i,position:b,reverseDirection:g,useTranslate3d:p,viewBox:A,wrapperStyle:v,lastBoundingBox:V,innerRef:H,hasPortalFromProps:!!x},ui(m,w));return S.createElement(S.Fragment,null,$t.createPortal(k,Y),R&&S.createElement(ai,{cursor:c,tooltipEventType:N,coordinate:K,payload:q,index:_}))}const Ye=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),Rt=["B","KB","MB","GB","TB","PB"];function Gt(t){if(t<=0)return"0 B";const e=Math.min(Rt.length-1,Math.floor(Math.log(t)/Math.log(1024))),r=t/1024**e;return`${r.toFixed(r>=100||e===0?0:1)} ${Rt[e]}`}const Fe=50,gi="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",mi=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function Yt(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function Xe(t){return Yt(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function yi(){const t=new Date;return Array.from({length:12},(e,r)=>{const n=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-r,1));return{value:n.toISOString().slice(0,10),label:n.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function pi(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function Lt(t){const e=Z.c(30),{usage:r,metric:n,colorNum:a,formatValue:l,height:o}=t,u=`var(--chart-${a})`,m=`infra-billing-${n}`;let y;e[0]!==r?(y=r.map(bi),e[0]=r,e[1]=y):y=e[1];const f=y;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:4,top:8,bottom:0},e[2]=i):i=e[2];let d,b;e[3]!==u?(d=s.jsx("stop",{offset:"0%",stopColor:u,stopOpacity:.25}),b=s.jsx("stop",{offset:"100%",stopColor:u,stopOpacity:0}),e[3]=u,e[4]=d,e[5]=b):(d=e[4],b=e[5]);let g;e[6]!==m||e[7]!==d||e[8]!==b?(g=s.jsx("defs",{children:s.jsxs("linearGradient",{id:m,x1:"0",y1:"0",x2:"0",y2:"1",children:[d,b]})}),e[6]=m,e[7]=d,e[8]=b,e[9]=g):g=e[9];let p;e[10]!==l||e[11]!==o?(p=o>100&&s.jsxs(s.Fragment,{children:[s.jsx(fr,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(dr,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(gr,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:l,width:68})]}),e[10]=l,e[11]=o,e[12]=p):p=e[12];let v,c;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={stroke:"var(--border)",strokeDasharray:"4 4"},c={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=v,e[14]=c):(v=e[13],c=e[14]);let h;e[15]!==l?(h=s.jsx(di,{cursor:v,contentStyle:c,formatter:T=>l(Number(T)||0)}),e[15]=l,e[16]=h):h=e[16];const j=`url(#${m})`;let O;e[17]!==u||e[18]!==n||e[19]!==j?(O=s.jsx(Hr,{type:"linear",dataKey:n,stroke:u,strokeWidth:2,fill:j,dot:!1}),e[17]=u,e[18]=n,e[19]=j,e[20]=O):O=e[20];let x;e[21]!==f||e[22]!==O||e[23]!==g||e[24]!==p||e[25]!==h?(x=s.jsxs($r,{data:f,margin:i,children:[g,p,h,O]}),e[21]=f,e[22]=O,e[23]=g,e[24]=p,e[25]=h,e[26]=x):x=e[26];let P;return e[27]!==o||e[28]!==x?(P=s.jsx(Gr,{width:"100%",height:o,children:x}),e[27]=o,e[28]=x,e[29]=P):P=e[29],P}function bi(t){return{...t,label:pi(t.date)}}function ce(t,e){return t.reduce((r,n)=>r+n[e],0)}function hi(){const t=Z.c(39),e=de(),{sites:r,isLoading:n}=Jt(),[a,l]=S.useState(null),o=yi(),[u,m]=S.useState(o[0].value);let y;t[0]!==a||t[1]!==r?(y=a??r.slice(0,Fe),t[0]=a,t[1]=r,t[2]=y):y=t[2];const f=y,i=!a&&r.length>Fe,{data:d,isLoading:b}=Ct(f,u),g=_t();if(n){let w;return t[3]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ae,{className:"h-64 w-full"}),t[3]=w):w=t[3],w}if(r.length===0){let w;t[4]!==e?(w=e("settings.infraBilling.noSites"),t[4]=e,t[5]=w):w=t[5];let k;return t[6]!==w?(k=s.jsx(L,{className:"p-6 text-sm text-muted-foreground",children:w}),t[6]=w,t[7]=k):k=t[7],k}const p=d?.usage??[],v=d?.pageviewsAvailable??!1,c=!!d&&!d.usageUnavailable,h=(w,k)=>c?k(ce(p,w)):"—",j=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:v&&c?Ye.format(ce(p,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:h("requests",wi)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:h("dataTransferBytes",Gt)}],O=xi;let x;t[8]!==d?.teams?(x=d?.teams??[],t[8]=d?.teams,t[9]=x):x=t[9];const P=x;let T;t[10]!==d?.siteSlugsWithoutTeam?(T=d?.siteSlugsWithoutTeam??[],t[10]=d?.siteSlugsWithoutTeam,t[11]=T):T=t[11];const B=T,A=P.length===1?P[0]:void 0,E=A?.billing??null,N=P.length+(B.length>0?1:0)>1,_=ce(p,"pageviews"),F=_>0?ce(p,"requests")/_:0,W=v&&c&&_>0?F.toFixed(F<10?1:0):"—";let M;t[12]!==d?.billingUnavailable||t[13]!==A||t[14]!==e||t[15]!==P.length?(M=d?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):P.length>1?e("settings.infraBilling.multipleTeams",{count:String(P.length)}):A?Xt(A,e):e("settings.infraBilling.noTeam"),t[12]=d?.billingUnavailable,t[13]=A,t[14]=e,t[15]=P.length,t[16]=M):M=t[16];const K=M;let I;t[17]!==r?(I=r.map(ji),t[17]=r,t[18]=I):I=t[18];let z;t[19]!==e?(z=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=z):z=t[20];let R;t[21]!==f||t[22]!==I||t[23]!==z?(R=s.jsx(rr,{className:"w-auto min-w-56 max-w-full",options:I,defaultValue:f,maxCount:2,placeholder:z,onValueChange:l}),t[21]=f,t[22]=I,t[23]=z,t[24]=R):R=t[24];let V;t[25]!==e?(V=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=V):V=t[26];let H;t[27]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(sr,{}),t[27]=H):H=t[27];let G;t[28]!==V?(G=s.jsx(or,{className:"w-48","aria-label":V,children:H}),t[28]=V,t[29]=G):G=t[29];let Y;t[30]!==f.length||t[31]!==e?(Y=f.length===0&&s.jsx(L,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=f.length,t[31]=e,t[32]=Y):Y=t[32];let q;t[33]!==e||t[34]!==i?(q=i&&s.jsx(L,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(Fe)})}),t[33]=e,t[34]=i,t[35]=q):q=t[35];let $;return t[36]!==d?.usageUnavailable||t[37]!==e?($=d?.usageUnavailable&&s.jsx(L,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=d?.usageUnavailable,t[37]=e,t[38]=$):$=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:[R,s.jsxs(nr,{value:u,onValueChange:m,children:[G,s.jsx(ir,{children:o.map(vi)})]})]}),Y,q,$,f.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(ge,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(L,{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(tr,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),A&&E?.canManageSubscription&&s.jsx(Ze,{variant:"outline",size:"sm",disabled:g.isPending,onClick:()=>g.mutate(A.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[E?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")}),b?s.jsx(ae,{className:"h-5 w-16"}):s.jsx(C,{variant:E.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${E.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:E.nextBillingDate?Xe(E.nextBillingDate):"—"})]})]}):!b&&s.jsx("p",{className:"text-xs text-muted-foreground",children:K}),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:W})]})]})]}),j.map(w=>s.jsxs(L,{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:w.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.find(k=>k.value===u)?.label})]}),b?s.jsx(ae,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:w.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(Lt,{usage:p,metric:w.key,colorNum:w.colorNum,formatValue:O(w.key),height:64})})]},w.key))]})}),s.jsx(ge,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:j.map(w=>s.jsxs(L,{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:w.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:w.description})]}),s.jsx(Lt,{usage:p,metric:w.key,colorNum:w.colorNum,formatValue:O(w.key),height:220})]},w.key))})}),s.jsx(ge,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:d?d.billingUnavailable?s.jsx(L,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[P.map(w=>s.jsx(Oi,{team:w,showSites:N},w.siteSlugs.join(","))),B.length>0&&s.jsxs(L,{className:"flex flex-col gap-1 p-4",children:[N&&s.jsx("span",{className:"text-sm font-medium",children:B.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(L,{size:"flush",children:s.jsx(ae,{className:"m-4 h-24"})})})})]})]})}function vi(t){return s.jsx(ar,{value:t.value,children:t.label},t.value)}function ji(t){return{label:t,value:t}}function xi(t){return t==="dataTransferBytes"?Gt:Si}function Si(t){return Ye.format(t)}function wi(t){return Ye.format(t)}function Xt(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Oi(t){const e=Z.c(13),{team:r,showSites:n}=t,a=de(),l=_t(),o=r.billing;let u;e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==a||e[4]!==r.siteSlugs?(u=n&&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:r.siteSlugs.join(", ")}),o&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(C,{variant:o.planType==="free"?"secondary":"success",children:a(`settings.infraBilling.plan.${o.planType}`)}),o.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:a("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:Xe(o.nextBillingDate)})]}),o.canManageSubscription&&s.jsx(Ze,{variant:"outline",size:"sm",disabled:l.isPending,onClick:()=>l.mutate(r.siteSlugs),children:a("settings.infraBilling.manageButton")})]})]}),e[0]=o,e[1]=l,e[2]=n,e[3]=a,e[4]=r.siteSlugs,e[5]=u):u=e[5];let m;e[6]!==o||e[7]!==a||e[8]!==r?(m=o?o.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:a("settings.infraBilling.noInvoices")}):s.jsx(Pi,{invoices:o.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:Xt(r,a)}),e[6]=o,e[7]=a,e[8]=r,e[9]=m):m=e[9];let y;return e[10]!==u||e[11]!==m?(y=s.jsxs(L,{size:"flush",className:"gap-0 overflow-x-auto",children:[u,m]}),e[10]=u,e[11]=m,e[12]=y):y=e[12],y}function Pi(t){const e=Z.c(40),{invoices:r}=t,n=de();let a;e[0]!==r?(a=r.some(Bi),e[0]=r,e[1]=a):a=e[1];const l=a;let o;e[2]!==n?(o=n("settings.infraBilling.invoiceReference"),e[2]=n,e[3]=o):o=e[3];let u;e[4]!==o?(u=s.jsx(ee,{children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==n?(m=n("settings.infraBilling.invoiceDue"),e[6]=n,e[7]=m):m=e[7];let y;e[8]!==m?(y=s.jsx(ee,{children:m}),e[8]=m,e[9]=y):y=e[9];let f;e[10]!==n?(f=n("settings.infraBilling.invoiceAmount"),e[10]=n,e[11]=f):f=e[11];let i;e[12]!==f?(i=s.jsx(ee,{children:f}),e[12]=f,e[13]=i):i=e[13];let d;e[14]!==n?(d=n("settings.infraBilling.invoiceStatus"),e[14]=n,e[15]=d):d=e[15];let b;e[16]!==d?(b=s.jsx(ee,{children:d}),e[16]=d,e[17]=b):b=e[17];let g;e[18]!==n?(g=n("settings.infraBilling.invoiceDocuments"),e[18]=n,e[19]=g):g=e[19];let p;e[20]!==g?(p=s.jsx(ee,{children:g}),e[20]=g,e[21]=p):p=e[21];let v;e[22]!==p||e[23]!==u||e[24]!==y||e[25]!==i||e[26]!==b?(v=s.jsx(lr,{children:s.jsxs($e,{children:[u,y,i,b,p]})}),e[22]=p,e[23]=u,e[24]=y,e[25]=i,e[26]=b,e[27]=v):v=e[27];let c;if(e[28]!==r||e[29]!==n||e[30]!==l){let O;e[32]!==n||e[33]!==l?(O=x=>s.jsxs($e,{children:[s.jsx(te,{children:x.referenceMonth?Yt(x.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(te,{children:x.dueDate?Xe(x.dueDate):"—"}),s.jsx(te,{className:"tabular-nums",children:mi.format(x.value)}),s.jsx(te,{children:s.jsx(Ti,{status:x.status})}),s.jsxs(te,{className:"flex gap-2",children:[x.nfUrl&&s.jsx(We,{href:x.nfUrl,label:n("settings.infraBilling.invoiceNf")}),x.bankSlipUrl&&s.jsx(We,{href:x.bankSlipUrl,label:n("settings.infraBilling.invoiceBankSlip")}),!x.bankSlipUrl&&!l&&x.nfUrl&&s.jsx(We,{href:gi,label:n("settings.infraBilling.invoiceBankTransfer")}),!x.nfUrl&&!x.bankSlipUrl&&"—"]})]},x.id),e[32]=n,e[33]=l,e[34]=O):O=e[34],c=r.map(O),e[28]=r,e[29]=n,e[30]=l,e[31]=c}else c=e[31];let h;e[35]!==c?(h=s.jsx(cr,{children:c}),e[35]=c,e[36]=h):h=e[36];let j;return e[37]!==v||e[38]!==h?(j=s.jsxs(ur,{children:[v,h]}),e[37]=v,e[38]=h,e[39]=j):j=e[39],j}function Bi(t){return!!t.bankSlipUrl}function We(t){const e=Z.c(4),{href:r,label:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(er,{size:14}),e[0]=a):a=e[0];let l;return e[1]!==r||e[2]!==n?(l=s.jsx(Ze,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",children:[a,n]})}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function Ti(t){const e=Z.c(14),{status:r}=t,n=de(),a=r.toLowerCase();if(a==="paid"){let o;e[0]!==n?(o=n("settings.infraBilling.statusPaid"),e[0]=n,e[1]=o):o=e[1];let u;return e[2]!==o?(u=s.jsx(C,{variant:"success",children:o}),e[2]=o,e[3]=u):u=e[3],u}if(a==="overdue"){let o;e[4]!==n?(o=n("settings.infraBilling.statusOverdue"),e[4]=n,e[5]=o):o=e[5];let u;return e[6]!==o?(u=s.jsx(C,{variant:"destructive",children:o}),e[6]=o,e[7]=u):u=e[7],u}if(a==="registered"){let o;e[8]!==n?(o=n("settings.infraBilling.statusPending"),e[8]=n,e[9]=o):o=e[9];let u;return e[10]!==o?(u=s.jsx(C,{variant:"warning",children:o}),e[10]=o,e[11]=u):u=e[11],u}let l;return e[12]!==r?(l=s.jsx(C,{variant:"secondary",children:r}),e[12]=r,e[13]=l):l=e[13],l}function Ai(){const t=Z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Qt,{group:"billing",children:s.jsx(hi,{})}),t[0]=e):e=t[0],e}function Ji(){const t=Z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Qr,{capability:"members:manage",area:"billing",children:s.jsx(Ai,{})}),t[0]=e):e=t[0],e}export{Ji as default};
|